RESCUE: Repairing Language Model Errors to Sparse Circuits via Reinforcement Learning

Chuanpu Liu, Miao Yu, Yikai Cai, Yuanhe Zhang, Zhenhong Zhou +3 more
9/29/2026
cs.LG

Official code: chuanpupig/RESCUE (0 stars, last commit 2026-09-26).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

chuanpupig/RESCUEOfficial100%

Official implementation and reproduction code.

00PythonSep 9, 20263 weeks ago

Similar Papers

Cite this paper

@article{liu2026rescue,
  title  = {RESCUE: Repairing Language Model Errors to Sparse Circuits via Reinforcement Learning},
  author = {Chuanpu Liu and Miao Yu and Yikai Cai and Yuanhe Zhang and Zhenhong Zhou and Li Sun and Zuming Jiang and Yufei Guo},
  year   = {2026},
  eprint = {2609.36813},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.36813v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.36813.svg)](https://codeofpaper.com/paper/2609.36813)

Discussion