Manuscript Offprint

arXiv:2610.03515

Learning from Repaired Reasoning: Root-Cause-Guided On-Policy Distillation

Chenglei Shen, Haoyang Yao, Weijie Yu, Song Jin, Xiao Zhang, Jun Xu

ABSTRACT

On-policy self-distillation (OPSD) uses reference solutions as privileged hindsight to supervise student-generated reasoning trajectories. However, reference-based guidance may explain a correct solution without addressing why the student's own reasoning fails. This reasoning mismatch between the guidance provided and the correction needed can encourage the student to borrow correct conclusions while leaving its reasoning errors unresolved. Moreover, applying the same hindsight throughout the trajectory risks a distillation trap, where unnecessary constraints on valid reasoning compete with correction of substantive errors. To address these issues, we propose Root-Cause-Guided On-Policy Distillation (RC-OPD), which uses repairs of the student's own reasoning to provide guidance that addresses its specific errors while building on valid progress. For each failed attempt, RC-OPD locates the earliest substantive error, develops a local correction, and uses the corrected intermediate result as an anchor for the valid prefix. An iterative diagnosis–repair–continuation process tests the repairs through student continuation, identifying further errors within a fixed repair budget. For repair chains that reach a correct answer, root–cause–guided distillation uses failure diagnoses and corrective goals to supervise the erroneous segments, while anchor-guided distillation supports the corresponding valid prefixes with reasoning chains leading to the repaired intermediate results. We evaluate RC-OPD across multiple datasets and model scales. Extensive experiments and analyses show that it mitigates reasoning mismatch and the distillation trap, yielding substantial performance gains. Code is available at https://github.com/Starrylay/RC-OPD.git.

1 INTRODUCTION

Large language models have made substantial progress in mathematical reasoning by generating intermediate steps and learning from demonstrations and feedback (Wei et al., 2022; Shao et al., 2024). A central concern in this development is how to provide useful supervision over a long reasoning process. Outcome supervision evaluates completed answers, while process supervision offers feedback on intermediate decisions (Lightman et al., 2023). On-policy distillation provides dense teacher distributions at the prefixes generated by the student, reducing the mismatch between training on demonstrations and reasoning at inference time (Agarwal et al., 2024). On-policy self-distillation (OPSD) extends this approach by using the student itself, conditioned on a reference solution as privileged hindsight, as the teacher (Zhao et al., 2026a). The student can thus learn on its own trajectories with guidance informed by a correct solution, making OPSD an appealing approach to reasoning post-training.

However, reference-based guidance may explain a correct solution without addressing the specific errors in the student's own reasoning. The teacher may supply an intermediate conclusion without explaining how to correct the student's derivation to reach it. We call this reasoning mismatch: a misalignment between the guidance provided and the correction needed in the student's own attempt. The student may then accept a supplied intermediate conclusion without establishing the steps that justify it. As shown in the top panel of Figure 1, a Borrowed Reference Segment skips over the missing reasoning step labeled Unreachable. The response reaches the correct answer.

without establishing the required inferential connection. Our analysis in Section 4 exposes this distinction empirically. With complete reference solutions, the model achieves near-perfect answer accuracy, yet excluding responses with unresolved reference borrowing substantially lowers the scores. Reference access can therefore mask a reasoning gap behind answer-level success. Applying the same reference-conditioned guidance throughout the trajectory introduces a further risk, the distillation trap: unnecessary constraints on already-sound steps can compete with correction of substantive errors, as illustrated in Figure 1 (bottom).

The underlying challenge is to turn knowledge of a successful solution into a correction that the student can use from its own reasoning state. A failed attempt can contain a valid prefix, an initiating error, and a suffix affected by that error. Providing a conclusion from another route can bridge these segments in the output without explaining the missing inference. Querying the teacher at student-generated prefixes does not automatically resolve this problem, since the teacher still has access to the reference conclusions. Useful hindsight must instead explain the local fault and establish a corrected intermediate result supported by the retained prefix. Its value should also be tested through the student's continuation: can the student proceed from this repair, rather than merely accept a supplied endpoint? This calls for trajectory-grounded hindsight, distinct supervision for the erroneous segment and valid prefix, and renewed diagnosis when the continuation exposes another error.

Our central insight is to use local repairs of the student’s own reasoning to construct guidance for correcting its errors and supporting its valid progress. Based on this insight, we propose Root-Cause-Guided On-Policy Distillation (RC-OPD) with three components. First, Diagnose locates the stage containing the earliest substantive error, termed the Error Stage, and repairs it into an Anchor Stage: a corrected reasoning step that builds on the retained prefix and provides a valid starting point for continuation. Diagnosis also produces Failure Reason & Goal, explaining the local fault and the intermediate result needed to correct it, and COT to Anchor, a concise chain of thought connecting the problem conditions to the Anchor Stage along the student’s viable route. Second, Iterative Counterfactual Validation tests the repair by letting the same student policy continue from the repaired prefix. If the answer remains incorrect, diagnosis proceeds in the new continuation, retaining earlier Anchor Stages while correcting successive Error Stages. Successful completion selects the associated diagnosed prefixes and Error Stages for supervision. Third, Differentiated Distillation conditions the teacher on Failure Reason & Goal for each Error Stage and on COT to Anchor for the corresponding diagnosed valid prefix. When validation does not reach a correct answer within the repair budget, supervision falls back to reference-conditioned distillation on the original trajectory. Together, these components ground hindsight in local diagnosis, test it through student continuation, and assign it according to each reasoning segment’s role.

Figure

Figure 1: Reasoning mismatch (top): a Borrowed Reference Segment bypasses the Unreachable transition, creating apparent reachability. Distillation trap (bottom): Reference-conditioned KL on every step also constrains already-sound steps.

Our contributions are threefold: 1) We formulate reasoning mismatch and the distillation trap as two connected challenges in using reference-based hindsight for on-policy supervision. 2) We propose RC-OPD, which uses local repairs to construct root-cause-guided supervision for erroneous segments and anchor-guided supervision for valid prefixes. 3) We introduce iterative counterfactual validation to address successive errors and select local supervision based on successful student continuation.

References (28)