Organizations: Beijing University of Posts and Telecommunications · University of Hong Kong · Nanyang Technological University · China Aerospace Science and Industry Corporation
Large language models (LLMs) exhibit strong general capabilities that mechanistic interpretability has attributed to sparse computational circuits. However, existing circuit studies emphasize preserving functionality or explaining safety, leaving the mechanisms underlying failures across a broader range of tasks largely unexplored. Extending circuit analysis from abilities to errors, we explore the perspective that such failures may likewise arise from erroneous internal computations and that targeted tuning of the corresponding parameters can correct such errors while largely preserving other capabilities. Motivated by this insight, we introduce RESCUE (Reasoning-Error Sparse-Circuit Uncovering and Editing), a framework that localizes error-associated circuits and surgically repairs them for performance enhancement. General tasks typically involve multi-step reasoning and long-form generation, where early deviations can cause prefixes to drift from supervised references, leading SFT-based mask optimization to overlook circuits involved in generation-time errors. RESCUE therefore refines these masks through reinforcement learning with multiple masked-model rollouts, improving their relevance to observed task failures. Finally, RESCUE introduces a pruning technique and precisely fine-tunes error circuits to correct task failures, thereby translating error localization into a sparse and targeted model update. We validate RESCUE on heterogeneous repair sets across two domains: (1) mathematical reasoning, identifying a math error circuit of 1.40% density whose repair raises accuracy from 6.0% to 75.5%; and (2) medical QA, where a similarly compact 1.44% circuit improves repair-set accuracy from 0% to 81%. Our code is available at: https://github.com/chuanpupig/RESCUE.
Figures & tables
Figure 1: Overview of RESCUE , with complementary repair and preservation signals ( Left ), the sparse-circuit localization and tuning framework ( Middle ), and targeted repair generations ( Right ).
Figure 2: Post-tuning accuracy after heterogeneous GSM8K repair; Aggregate Evaluation is the macro-average over the eight non-target benchmarks in Section 5.1 . The panels use different truncated y-axis ranges for readability, with exact percentages shown above each bar.
Model
Error Pattern
Base (Acc.)
RESCUE Abl. (Acc.)
Δ (pp)
Circuit
Qwen3-8B
Misleading Premise Back-solving
2%
93%
+91
0.32%
Dynamic State Tracking
1%
91%
+90
0.31%
Dropped-lowest Average
4%
94%
+90
0.26%
Declining Group Accumulation
2%
76%
+74
0.44%
Multiplicative Increment Back-solving
0%
91%
+91
0.39%
Llama-3.1-8B- Instruct
Cumulative Target Gap
1%
95%
+94
0.62%
Table 1: Pattern-specific circuit ablation. Circuit denotes the proportion of selected MLP rows.
Model
Error Pattern
Rephrased(Acc.)
Ablation (Acc.)
Δ (pp)
Qwen3-8B
Misleading Premise Back-solving
28%
42%
+14
Dynamic State Tracking
17%
25%
+8
Dropped-lowest Average
3%
16%
+13
Declining Group Accumulation
1%
18%
+17
Multiplicative Increment Back-solving
0%
23%
+23
Llama-3.1-8B- Instruct
Cumulative Target Gap
25%
60%
+35
Table 2: Cross-rephrase transfer of pattern-specific error circuits. Accuracy is measured over 100 rephrased examples before and after ablating the circuit localized from the original formulation.
Figure 3: Density-matched random-circuit controls. Pale-blue lines denote their means, while orange dashed and red solid lines denote Base and RESCUE, respectively.
Figure 4: Full-set ablation accuracy (%) during sequential repair for (a) Qwen3-8B and (b) Llama-3.1-8B-Instruct. AR1–AR5 denote repair stages; pattern order follows Table 1.
Targeted Repair
Post-tuning Evaluation
Model
Method
Repair-set (Acc.)
Circuit
MedMCQA
Aggregate Eval.
Qwen3-8B
Base
3.0%
–
59%
66.63%
LoRA
65.0%
–
60%
64.75%
RESCUE
78.5%
1.47%
60%
66.75%
Llama-3.1-8B-Instruct
Base
0.0%
–
59%
62.38%
LoRA
65.5%
–
57%
58.88%
Table 3: Cross-domain repair results on MedMCQA. Repair-set accuracy is measured after RESCUE and after LoRA. Aggregate Eval. is the mean accuracy over the eight benchmarks.
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 5: English translation of the prompt for generating pattern-specific GSM8K problems.
Figure 6: English translation of the prompt for rephrasing pattern-specific problems.
Figure 7: English translation of the prompt for minimally correcting erroneous reasoning.
Figure 8: Illustrative minimum-intervention correction. Colored text marks the erroneous and revised quantities; unchanged reasoning is omitted for brevity.
Model
Benchmark
Base
LoRA
Supervised-only
RESCUE
Qwen3-8B
ARC-C
56
57
57
57
HellaSwag
75
76
75
76
WinoGrande
68
67
68
67
PIQA
78
77
78
77
TruthfulQA
36
36
36
36
MMLU-Math
50
53
55
50
Appendix
Table 4: Detailed post-tuning accuracy (%) after heterogeneous GSM8K repair; Aggregate Eval. is the macro-average over the eight non-target benchmarks.
Model
Benchmark
Base
Misleading Premise Back-solving
Dynamic State Tracking
Dropped-lowest Average
Declining Group Accumulation
Multiplicative Increment Back-solving
Qwen3-8B
GSM8K
80
80
81
80
86
82
MATH-500
75
76
75
77
74
75
ARC-C
56
56
56
57
55
58
HellaSwag
75
75
75
75
75
75
WinoGrande
68
69
68
68
67
68
PIQA
78
77
78
77
77
77
Appendix
Table 5: Post-tuning accuracy (%) after independently repairing each pattern-specific GSM8K dataset; Aggregate Eval. is the macro-average over the eight non-target benchmarks.
Figure 9: Layer-wise enrichment of localized error-circuit rows, normalized by each circuit’s overall selection density. Curves and shading show the mean and min–max range across five pattern-specific circuits; E=1 denotes no enrichment.
Model
Misleading Premise Back-solving
Dynamic State Tracking
Qwen3-8B
Rephrased Base
28%
17%
Transferred Abl.
42%
25%
Re-localized Abl.
95%
95%
Δ vs. Base (pp)
+67
+78
Circuit
0.68%
0.69%
Model
Cumulative Target Gap
Percentage Risk
Appendix
Table 6: Re-localization on rephrased pattern-specific datasets. Transferred Abl. applies the original circuit, whereas Re-localized Abl. uses a circuit localized on the rephrased data; the bottom panel reports post-tuning accuracy.
Figure 10: Benchmark accuracy for the base models and their final states after five sequential repairs (AR5).
Model
Benchmark
Base
LoRA
RESCUE
Qwen3-8B
MedMCQA
59
60
60
GSM8K
80
85
86
ARC-C
56
57
58
HellaSwag
75
76
76
WinoGrande
68
68
69
PIQA
78
76
79
Appendix
Table 7: Detailed post-tuning accuracy (%) for MedMCQA repair. Aggregate Eval. averages the eight benchmarks from ARC-C through BBH and excludes GSM8K.