SOD: Step-wise On-policy Distillation for Small Language Model Agents
{"primary":"cs.CL","secondary":["cs.AI"]}local graph
SOD: Step-wise On-policy Distillation for Small Language Model Agents
Section titled “SOD: Step-wise On-policy Distillation for Small Language Model Agents”Authors: Qiyong Zhong, Mao Zheng, Mingyang Song, Xin Lin, Jie Sun, Houcheng Jiang, Xiang Wang, Junfeng Fang
arxiv: 2605.07725
Converted to markdown on 2026-10-13 from the arXiv HTML (LaTeXML) rendering; figures embedded from the same source.
Abstract
Section titled “Abstract”Tool-integrated reasoning (TIR) is difficult to scale to small language models due to instability in long-horizon tool interactions and limited model capacity. While reinforcement learning methods like group relative policy optimization provide only sparse outcome-level rewards. Recently, on-policy distillation (OPD) has gained popularity by supplying dense token-level supervision from a teacher on student-generated trajectories. However, our experiments indicate that applying OPD to TIR leads to a critical failure mode: erroneous tool calls tend to cascade across subsequent reasoning steps, progressively amplifying student-teacher divergence and rendering the teacher’s token-level supervision increasingly unreliable. To address this, we propose SOD, a step-wise on-policy distillation framework for small language model agents, which adaptively reweights distillation strength at each step based on step-level divergence. Therefore, SOD can attenuate potentially misleading teacher signals in high-divergence regions while preserving dense guidance in well-aligned states. Experiments on challenging math, science, and code benchmarks show that SOD achieves up to 20.86% improvement over the second-best baseline. Notably, our 0.6B student achieves 26.13% on average@32 at AIME 2025, demonstrating effective transfer of agentic reasoning to small models.
1 Introduction
Section titled “1 Introduction”
Figure 1: The motivation of SOD . (a) Student-teacher divergence d k d_{k} across reasoning steps, sampled from 800 trajectories: in TIR, erroneous tool calls cause divergence to accelerate sharply, unlike the gradual drift in text-only reasoning. (b) Teacher entropy statistics over 800 sampled trajectories: on erroneous trajectories, both the mean entropy change (bars) and the standard deviation (dashed lines) grow rapidly at later steps, indicating increasingly unreliable teacher supervision. Please refer to Appendix F for detailed cases. (c) Radar chart comparing methods on four benchmarks.
Agentic capabilities have substantially expanded the applicability of large language models (LLMs) [1, 2], enabling them to solve complex real-world tasks [3, 4, 5]. However, such capabilities are typically realized by large-scale models, which incurs substantial inference cost, deployment overhead, and system complexity [5, 6, 7]. In latency-, resource-, and privacy-sensitive scenarios, transferring agentic capabilities to small language models (SLMs) that can be deployed on-device is therefore of significant practical importance [8, 9, 10, 11, 12]. Despite this motivation, enabling SLMs to acquire stable and effective tool-integrated reasoning (TIR) abilities remains a major challenge [13, 14, 15, 16].
Existing post-training methods for enhancing TIR abilities are largely based on reinforcement learning (RL) [17, 18, 19], particularly policy optimization algorithms such as group relative policy optimization (GRPO) [20]. However, in SLM-based TIR settings, RL often suffers from unstable optimization [13, 14]. TIR tasks typically involve long-horizon trajectories [17], multi-step decision making [18], and interactions with external tools [5], whereas RL commonly provides only sparse outcome-level rewards [21]. For small models with limited capacity and weaker exploration ability, such sparse supervision can further exacerbate exploration failure, leaving the policy in a cold-start regime with few informative reasoning signals [22].
Recently, on-policy distillation (OPD) has emerged as a promising paradigm for post-training [23, 24, 25, 26, 27]. Unlike RL methods that rely on sparse, trajectory-level rewards [21], OPD provides dense token-level supervision [24] on trajectories sampled from the student’s own policy [23], thereby alleviating the credit assignment difficulty inherent in sparse reward signals [28, 29] while substantially improving sample efficiency [30] and training stability [28].
However, our experiments show that directly transferring OPD to SLM-based TIR can lead to severe training instability [31, 32, 33, 34]. We attribute this failure to a fundamental difference between how student trajectories deviate from the teacher distribution in TIR and in standard text-based reasoning [29, 35, 36, 33]. As illustrated in Figure 1(a), in text-only reasoning, even when the student gradually departs from the teacher, subsequent states still evolve continuously along the generated context, and the resulting distribution shift is typically progressive [37, 23]. In contrast, TIR introduces discontinuous state transitions through tool interactions [17]. A single erroneous tool call can inject an incorrect observation into the context, causing subsequent reasoning steps to unfold from a corrupted state [13]. This issue is further amplified because teacher models are often highly accurate in tool use, whereas small models have limited capacity and weaker exploration ability [38, 14]. During early training, small models may accumulate multiple erroneous tool calls, causing their state distribution to rapidly drift away from the teacher distribution [29, 39]. In such out-of-distribution states, teacher-provided token-level supervision may become unreliable or even misleading [40, 33, 22, 41, 31] as illustrated in Figure 1(b), and the enlarged student-teacher discrepancy can induce unstable gradients and even training collapse [29, 28].
Based on this observation, we propose SOD, a Step-wise On-policy Distillation framework for small language model agents. The core idea is to adaptively adjust the distillation strength at each reasoning step according to the divergence between the student and teacher. Specifically, when the student remains well aligned with the teacher, SOD preserves dense supervision to fully exploit teacher guidance; when the deviation becomes large, it progressively attenuates the distillation signal for the corresponding step, thereby reducing the influence of potentially misleading supervision under out-of-distribution states. Experimental results (as displayed in Figure 1(c)) demonstrate that this simple yet effective step-wise reweighting mechanism enables lightweight agents to acquire agentic TIR capabilities more efficiently. Extensive experiments on challenging math, science, and code benchmarks show that SOD outperforms the second-best baseline by up to 20.86%. Notably, our 0.6B-scale student achieves 26.13% accuracy on AIME 2025. To our best knowledge, this is the first sub-billion-parameter model to reach this level on such a challenging reasoning benchmark.
2 Related Work
Section titled “2 Related Work”Reinforcement Learning for Agents.
Section titled “Reinforcement Learning for Agents.”RL-based post-training has evolved from reinforcement learning from human feedback (RLHF) [42, 43] with PPO [44] to more scalable methods like GRPO [20]. For language agents, structured reasoning paradigms such as ReAct [3], Toolformer [4], and FireAct [45] enable tool use but rely on demonstrations rather than online optimization. Recent work extends RL to agent interaction trajectories across code generation [46], tool use [47], GUI interaction [48], and web navigation [49]. A central challenge is credit assignment under sparse, delayed feedback, addressed via trajectory-level updates and value-free formulations [50, 51]. KL-regularized policy optimization further introduces bias and instability concerns [44], amplified in agentic settings by distribution shift and compounding errors. Broader frameworks scaling agentic RL across environments [52, 53, 54] still rely on trajectory-level rewards without dense supervision.
On-policy Distillation.
Section titled “On-policy Distillation.”On-Policy Distillation (OPD) [36, 55, 56, 57, 58, 41, 59] introduces token-level supervision on student-generated trajectories to mitigate the distribution mismatch of offline distillation. Gu et al. [24] formulates OPD as reverse KL minimization under the student distribution, while Agarwal et al. [23] unifies on-policy and off-policy distillation across divergence objectives. Yang et al. [60] further interprets OPD as KL-regularized reinforcement learning with implicit per-token rewards, and Li et al. [29] shows that OPD primarily aligns local support on student-visited states, depending on teacher–student compatibility in reasoning patterns. OPD has also been extended to self-distillation settings without external teachers [61, 62, 63, 64, 65]. Recently, more works [31, 32, 33, 34, 66] have explored introducing OPD to mitigate the limitations of RL.
3 Preliminaries
Section titled “3 Preliminaries”3.1 Multi-turn Tool-Integrated Reasoning
Section titled “3.1 Multi-turn Tool-Integrated Reasoning”We consider the post-training of a small language model (SLM) for multi-turn tool-integrated reasoning (TIR). Given an input , the model interacts with an external environment over multiple reasoning steps. At each step , the model generates a response , which may include natural-language reasoning, a tool invocation, or a final answer. If a tool is invoked, the environment returns an observation , which is appended to the context and conditions subsequent generations.
A trajectory is defined as:
| (1) |
where denotes the final response. The policy generates only model tokens, while observations are provided by the environment. Let denote a generated token and its prefix, which may include both model outputs and tool observations.
3.2 Group Relative Policy Optimization
Section titled “3.2 Group Relative Policy Optimization”Group Relative Policy Optimization (GRPO) [20] is a reinforcement learning algorithm that updates the policy using relative rewards within a group of sampled trajectories. We assume access to an outcome-level reward function defined on complete trajectories. For each input , a group of trajectories is sampled from the old policy , each receiving reward .
The group-relative advantage is computed as:
| (2) |
Let denote the token-level importance ratio. The objective is defined as:
| $$\mathcal{L}_{\mathrm{GRPO}}=-\mathbb{E}\left[\frac{1}{G}\sum_{i=1}^{G}\frac{1}{ | \mathcal{T}_{i} | }\sum_{t\in\mathcal{T}_{i}}\min\left(\rho_{i,t}(\theta)\hat{A}_{i},\mathrm{clip}(\rho_{i,t}(\theta),1-\epsilon,1+\epsilon)\hat{A}_{i}\right)\right],$$ |
where denotes model-generated token positions. This objective provides an on-policy learning signal based on relative trajectory performance, but supplies only sparse outcome-level rewards.
3.3 On-policy Distillation
Section titled “3.3 On-policy Distillation”On-policy distillation (OPD) [23, 67] is a post-training paradigm that provides dense token-level supervision on student-generated trajectories by aligning the student policy with a teacher distribution. Given a trajectory , the OPD objective is defined as:
| (4) |
where is the student policy, is the teacher model, and denotes the set of model-generated token positions in the sampled trajectory. This objective corresponds to a sampled estimator of the reverse KL divergence between the student and teacher policies on student-visited states.
4 Methodology
Section titled “4 Methodology”In this section, we introduce SOD. The framework of SOD is displayed in Figure 2. We first analyze why on-policy distillation (OPD) can become unreliable under tool-induced state drift. We then introduce a step-level divergence score as an observable proxy for the reliability of teacher supervision, and finally formulate a step-wise reweighted OPD objective.
4.1 Failure of On-policy Distillation under Tool-Induced State Drift
Section titled “4.1 Failure of On-policy Distillation under Tool-Induced State Drift”The OPD objective assumes that teacher supervision remains reliable across all student-visited states [35, 29, 33]. This assumption holds when distribution drift is gradual, but is severely violated in TIR due to discontinuous state transitions introduced by tool observations. We formalize this failure through two propositions (proofs in Appendix D).
We define the step-level mismatch as:
| $$\Delta_{k}=\frac{1}{ | \mathcal{I}_{k} | }\sum_{t\in\mathcal{I}_{k}}D_{\mathrm{KL}}\bigl(\pi_{\theta}(\cdot\mid y_{<t}),\big|,\pi_{\mathrm{teacher}}(\cdot\mid y_{<t})\bigr).$$ |
Proposition 1 (Discontinuous divergence amplification).
Section titled “Proposition 1 (Discontinuous divergence amplification).”In text-only reasoning, where is the per-token distributional shift. In TIR, a single erroneous tool observation of length causes with . Under consecutive tool errors, the divergence compounds super-linearly: with .
Proposition 2 (Gradient SNR degradation).
Section titled “Proposition 2 (Gradient SNR degradation).”Define the teacher-supported region and the overlap . When , the second moment of the OPD loss satisfies , and the signal-to-noise ratio of the gradient estimator as .
Together, these results characterize a failure cascade specific to TIR: consecutive erroneous tool calls trigger compounding divergence amplification (Prop. 1), progressively pushing the student away from the teacher distribution into low-overlap states where the OPD gradient becomes dominated by high-variance, uninformative contributions (Prop. 2). This is empirically confirmed in Figure 1: divergence accelerates sharply as tool errors accumulate (a), and teacher entropy becomes elevated and unstable in subsequent steps (b). Since OPD aggregates losses uniformly across steps, it systematically overweights these corrupted signals, motivating our step-wise reweighting mechanism. We formally show in Appendix D.4 that under monotonically increasing divergence, our reweighting suppresses the weighted second moment by a factor of , restoring bounded gradient SNR even in low-overlap states where OPD suffers SNR collapse.

Figure 2: The overview of SOD . (a) The student generates multi-step trajectories where erroneous tool calls propagate across steps, degrading teacher supervision reliability. (b) Student-teacher distributions drift apart as errors accumulate. (c) Step-level divergence d k d_{k} quantifies this drift. (d) SOD adaptively attenuates distillation weights in high-divergence steps, unlike vanilla OPD which applies uniform weights. Please refer to Section 5.6 for more characteristics of SOD.
4.2 Student-teacher Divergence and Step-wise Reweighting
Section titled “4.2 Student-teacher Divergence and Step-wise Reweighting”We partition a generated trajectory into reasoning steps, where each step corresponds to a model response between two tool observations, or the final answer step. Let denote the set of token positions belonging to the -th model-generated step. Tool observation tokens are excluded because they are produced by the external environment rather than by the policy.
We define a step-level divergence score to quantify student–teacher divergence at step :
| $$d_{k}=\frac{1}{ | \mathcal{I}_{k} | }\sum_{t\in\mathcal{I}_{k}}\left |
The score serves as a lightweight indicator of the local reliability of teacher supervision. A small suggests that the student remains well aligned with the teacher distribution, while a large indicates substantial mismatch, often caused by tool-induced state drift or corrupted observations.
Based on these divergence scores, we adaptively reweight the strength of distillation across steps. We initialize the first step with full distillation strength, i.e., . For subsequent steps, the weight is:
| (7) |
where is a small constant for stability and controls the maximum amplification of the distillation. Since the reweighting in Eq. 7 depends only on the ratios between consecutive divergence scores rather than their absolute values, any monotone proxy of suffices. We show in Section D.5 that is monotonically consistent with and computable at zero marginal cost from the OPD forward pass. We therefore adopt in place of in our implementation.
This weighting rule captures the evolution of student-teacher divergence along the trajectory. When the divergence increases, i.e., , indicating that the student is drifting away from the teacher distribution (often due to tool-induced state shift), the corresponding ratio becomes smaller than one, leading to attenuation of the distillation signal in high-mismatch regions. Conversely, the student may partially move back toward the teacher-supported region in later steps, effectively correcting earlier deviations. We refer to this phenomenon as recovery from earlier errors. In such cases, when , the reweighting mechanism allows the distillation strength to increase accordingly, restoring informative guidance. To ensure stable optimization, the weight is upper-bounded by .
4.3 Training Objective
Section titled “4.3 Training Objective”For a student-generated trajectory, the sampled-token OPD term at token is:
| (8) |
Instead of applying this term uniformly at step level, we reweight all tokens in step by the corresponding reliability weight , leading to the step-wise OPD objective:
| (9) |
The final training objective is defined as:
| (10) |
Here, provides sparse outcome-level rewards to drive trajectory exploration, while supplies dense token-level guidance whose strength is reweighted by the student-teacher divergence, jointly enabling stable learning under tool-induced state drift.
5 Experiment
Section titled “5 Experiment”5.1 Experimental Setup
Section titled “5.1 Experimental Setup”Datasets & Benchmarks.
Section titled “Datasets & Benchmarks.”Following Yu et al. [52], our training data comprises a 3k high-quality SFT corpus of multi-turn reasoning trajectories curated from s1-1k [68], LeetCode, and ReTool [47], along with a 30k diverse RL dataset covering mathematical reasoning from DAPO-Math [69], math and coding tasks from Skywork-or1 [70], and scientific problem solving from MegaScience [71]. Please refer to Section B.1 for more details. We evaluate on 4 challenging benchmarks: AIME 2024/2025, GPQA-Diamond [72], and LiveCodeBench [73] (See Section B.2 for details).
Evaluation Setups.
Section titled “Evaluation Setups.”The temperature is fixed at 1.0 with nucleus sampling parameter top_p=0.6. For each problem, 32 independent samples are generated to enable a more thorough evaluation, from which average@32 are computed and finally reported (percentage). The teacher model is a Qwen3-4B model [28] further optimized with GRPO on the RL datasets. If not otherwise specified, the teacher of subsequent experiments is the 4B model. We use Qwen3-0.6B and Qwen3-1.7B as student models.
Baselines & Implementation Details.
Section titled “Baselines & Implementation Details.”For the baselines, we evaluate SOD against a set of supervised, RL, and distillation baselines. For each student, we compare SOD with the following baselines: (1) Vanilla. (2) SFT. (3) GRPO [20]. (4) OPD [23]. (5) OPSDgt [61] (On-policy self-distillation with groundtruth). (6) OPSDhint [61] (On-policy self-distillation with hints). For more details about the baselines, please refer to Section B.3. For implementation details, please refer to Section B.4.
Table 1: Performance comparison of Qwen3 teacher and student across 4 benchmarks. The best results are in bold, and the second-best results are underlined. We report average@32 over 5 runs.
Params Method Math Science Code Average
AIME 2024 AIME 2025 GPQA LiveCodeBench
Teacher Models from the Qwen3 Series
4B GRPO 67.60.
1.34 60.42.
1.47 55.19.
0.81 63.13.
0.93 61.59
Distilled Student Models from the Qwen3 Series
0.6B Vanilla 7.71.
0.33 12.81.
0.38 13.24.
0.24 14.89.
0.29 12.16
SFT 5.67.
0.26 5.42.
0.22 15.20.
0.30 9.61.
0.27 8.97
GRPO 4.06.
0.37 4.90.
0.31 20.38.
0.47 15.95.
0.51 11.32
OPD 16.82.
0.81 22.95.
0.97 17.76.
0.41 22.65.
0.75 20.04
OPSDgt 12.63.
0.58 17.04.
0.64 17.32.
0.35 16.73.
0.44 15.93
OPSDhint 9.77.
0.43 14.12.
0.48 15.98.
0.30 12.65.
0.37 13.13
SOD 20.84.
0.90 26.13.
1.07 22.19.
0.59 27.72.
0.83 24.22
1.7B Vanilla 9.90.
0.38 8.96.
0.33 26.80.
0.36 22.73.
0.41 17.10
SFT 26.77.
0.66 22.40.
0.72 29.85.
0.51 24.63.
0.57 25.91
GRPO 25.63.
1.03 21.67.
1.12 33.55.
0.76 20.70.
0.87 25.39
OPD 43.86.
1.23 37.04.
1.31 31.73.
0.55 32.45.
0.93 36.27
OPSDgt 33.85.
0.88 24.69.
0.94 35.02.
0.67 22.73.
0.61 29.07
OPSDhint 34.42.
0.76 21.43.
0.83 33.46.
0.59 23.12.
0.52 28.11
SOD 50.83.
1.15 41.72.
1.24 38.72.
0.73 40.63.
0.91 42.98
5.2 Overall Performance
Section titled “5.2 Overall Performance”We compare SOD against six baselines on both 0.6B and 1.7B student models. The results are summarized in Table 1, from which we draw the following key observations. Note that we also provide training cost analysis in Section C.1.
-
•
Obs 1: SOD consistently outperforms all baselines across every benchmark. On both model scales, SOD achieves the highest scores on all four tasks, surpassing the strongest baseline OPD by 20.86% (0.6B) and 18.50% (1.7B) in relative average improvement. Notably, SFT and GRPO both fail to outperform the Vanilla baseline at the 0.6B scale, indicating that sparse outcome-level rewards and static demonstrations are insufficient for guiding small models in TIR. In contrast, our step-wise reweighting mechanism provides dense yet reliability-modulated supervision, effectively preventing misleading gradients from corrupted tool-call states while preserving informative teacher guidance in well-aligned regions.
-
•
Obs 2: The improvements generalize across different model scales, demonstrating the scalability of SOD. Our 1.7B student recovers 69.8% of the 4B teacher’s performance, compared to only 58.9% for OPD, showing that SOD substantially improves distillation efficiency. Furthermore, even our 0.6B model surpasses several 1.7B baselines, suggesting that step-wise reweighting can partially compensate for the capacity gap between model scales.
Table 2: Ablation study on key components of SOD. Results are evaluated on 1.7B student model.
Variants Math Science Code Average
AIME 2024 AIME 2025 GPQA LiveCodeBench
Step-wise Reweighting
(1.1) w/ Uniform Weighting 41.68.
0.95 35.58.
1.01 30.12.
0.59 31.43.
0.68 34.70
(1.2) w/ Heuristic Weighting 44.96.
0.98 38.75.
1.04 31.14.
0.64 33.71.
0.72 37.14
(1.3) w/ Mask After Wrong 39.11.
1.08 31.59.
1.14 26.56.
0.67 30.12.
0.80 31.85
(1.4) w/o Weight Clipping 45.78.
1.16 37.93.
1.21 33.57.
0.74 35.12.
0.79 38.10
Training Objective
(2.1) w/o GRPO 48.87.
0.93 39.73.
1.02 35.89.
0.62 38.62.
0.71 40.78
(2.2) w/o Step-wise OPD 25.63.
1.03 21.67.
1.12 33.55.
0.76 20.70.
0.87 25.39
SOD 50.83.
1.15 41.72.
1.24 38.72.
0.73 40.63.
0.91 42.98
5.3 Ablation Study
Section titled “5.3 Ablation Study”To evaluate each component in SOD, we develop six variants from two perspectives on the Qwen3-1.7B student. For Step-wise Reweighting, we consider: (1.1) w/ Uniform Weighting, which fixes for all steps; (1.2) w/ Heuristic Weighting, which applies a fixed exponential decay starting from the first erroneous tool call at step , with fixed as 0.9; (1.3) w/ Mask After Wrong, which zeros out the OPD signal for all steps after the first tool-call error; and (1.4) w/o Weight Clipping, which removes the upper-bound clipping in Eq. 7. For Training Objective, we ablate the two terms in Eq. 10: (2.1) w/o GRPO, which removes ; and (2.2) w/o Step-wise OPD, which removes . The results are reported in Table 2, from which we observe:
-
•
Obs 3: The adaptive step-wise reweighting is critical, and neither static nor heuristic alternatives can substitute it. Replacing our adaptive reweighting mechanism with uniform weighting (variant 1.1) causes a notable drop to 34.70% average, confirming that treating all steps equally exposes training to misleading supervision from corrupted states. Heuristic decay (variant 1.2) partially mitigates this issue (37.14%) by down-weighting later steps, yet still falls behind because a fixed schedule cannot capture non-monotonic divergence patterns where the student recovers alignment after earlier errors. Hard masking (variant 1.3) performs worst (31.85%), as it discards all subsequent supervision after a single error, wasting informative signals from partially correct trajectories and preventing the student from recovering. Removing weight clipping (variant 1.4) yields 38.10%, indicating that unbounded amplification introduces training instability.
-
•
Obs 4: Both the GRPO and step-wise OPD components are indispensable, serving complementary roles. Removing GRPO (variant 2.1) reduces the average to 40.78%, showing that outcome-level rewards remain valuable for steering exploration with dense distillation. Removing step-wise OPD (variant 2.2) causes a far more severe drop to 25.39%, which confirms that sparse rewards alone are insufficient for stable TIR learning in small models. The pronounced asymmetry reveals their complementary nature: step-wise OPD provides the primary fine-grained guidance, while GRPO broadens trajectory-level exploration beyond the teacher distribution.
5.4 Scalability and Generalization
Section titled “5.4 Scalability and Generalization”To evaluate the generalization of SOD to different teacher models, we conduct experiments using an additional Qwen3 teacher (14B) to distill students at both the 0.6B and 1.7B scales. The results are visualized in Figure 3, from which we draw the following observation:
-
•
Obs 5: SOD consistently benefits from stronger teachers, whereas OPD suffers from the increased capacity gap. An interesting finding emerges when comparing teacher choices under OPD: on the 0.6B student, switching from the 4B to the 14B teacher actually degrades average accuracy by a notable margin. This reveals that a larger student-teacher capacity gap amplifies distribution mismatch, causing uniform distillation to propagate increasingly unreliable supervision. In contrast, SOD with the 14B teacher consistently outperforms its 4B counterpart on both student scales, confirming that our step-wise reweighting effectively harnesses the richer knowledge from teachers while suppressing the harmful signals introduced by the wider gap.

Figure 3: Scalability of SOD across different student-teacher configurations.
Figure 4: Training dynamics across methods on 0.6B and 1.7B student models . We track accuracy on AIME2025 (left), policy entropy (middle), and mean tool-calling turns (right) throughout training.
5.5 Dynamic training analysis
Section titled “5.5 Dynamic training analysis”To understand how SOD shapes the learning dynamics of agentic reasoning, we monitor three key metrics throughout training: task accuracy, policy entropy, and mean tool-calling turns. As shown in Figure 4, we highlight the following observations:
-
•
Obs 6: SOD consistently outperforms GRPO by a large margin. As shown in Figure 4(a)(d), SOD achieves significantly higher accuracy than GRPO across both model scales. This gap is driven by GRPO’s severe entropy collapse (Figure 4(b)(e)), where the policy loses exploration ability and degenerates into repetitive outputs, ultimately abandoning multi-step tool interactions entirely (Figure 4(c)(f)), a fatal failure mode for TIR tasks.
-
•
Obs 7: SOD achieves more stable training than OPD. While OPD maintains comparable entropy levels, its accuracy exhibits notable instability, particularly on 1.7B where performance peaks early then degrades significantly (Figure 4(d)), suggesting that uniform distillation can destabilize later training. In contrast, SOD sustains steady improvement without degradation. Additionally, SOD uses fewer tool-calling turns than OPD (Figure 4(c)(f)), indicating more efficient reasoning with fewer erroneous intermediate steps.
5.6 Three Distillation Patterns of SOD
Section titled “5.6 Three Distillation Patterns of SOD”During training, SOD exhibits three characteristic distillation patterns, as illustrated in Figure 5:
(1) Stable Pattern. The student remains closely aligned with the teacher, i.e., the step-level divergence is low. Therefore, adaptive weights stay high, allowing full utilization of teacher supervision along the trajectory. In this regime, the optimization closely resembles sufficient distillation. (2) Erroneous Pattern. Persistent deviations increase step-level divergence, often caused by incorrect intermediate reasoning or tool usage. Adaptive weights are progressively reduced, which suppresses potentially misleading supervision and stabilizes training under such corrupted states. (3) Recovery Pattern. The student initially deviates but then recovers. Weights are attenuated during high-divergence steps and restored later, enabling effective guidance on corrected steps and preserving useful supervision after recovery. This behavior allows the model to avoid over-penalizing temporary errors while still benefiting from supervision once alignment is re-established.
We also provide further analysis, i.e., the quantitative analysis of distillation pattern distribution according training steps in Section C.2. Detailed examples are provided in Appendix G.

Figure 5: Three distillation patterns of SOD .
6 Limitations
Section titled “6 Limitations”Our work has two main limitations. (1) We focus on agentic TIR tasks with a python code interpreter, which provides a clean and reproducible execution environment that isolates tool-induced state drift without confounding factors from complex API configurations. Other agentic settings (e.g., web browsing, API calls) may exhibit different drift patterns and are worth exploring. (2) All experiments use the Qwen3 [28] model family, chosen for its strong and stable performance across scales, open availability at multiple sizes, and wide adoption in recent OPD studies [61, 41, 25, 29] that facilitates fair comparison. Validating on other model families remains valuable. Due to resource constraints, we leave these explorations to future work.
7 Conclusion
Section titled “7 Conclusion”In this work, we study on-policy distillation for small language model agents under tool-integrated reasoning. We identify that tool-induced state transitions can rapidly push the student into out-of-distribution regions where teacher supervision becomes unreliable. To address this, we propose SOD, a step-wise on-policy distillation framework that adaptively reweights distillation strength based on student–teacher divergence, preserving informative signals in aligned regions while attenuating misleading guidance under large drift. Extensive experiments across math, science, and code benchmarks demonstrate consistent improvements in both training stability and final performance. Our findings suggest that effective agent distillation requires supervision mechanisms that adapt to evolving state distributions, offering a general principle for robust training in agentic systems.
References
Section titled “References”- [1] Z. Xi, W. Chen, X. Guo, W. He, Y. Ding, B. Hong, M. Zhang, J. Wang, S. Jin, E. Zhou, et al. (2023) The rise and potential of large language model based agents: a survey. arXiv preprint arXiv:2309.07864. Cited by: §1.
- [2] M. Kang, J. Jeong, S. Lee, J. Cho, and S. J. Hwang (2025) Distilling llm agent into small models with retrieval and code tools. arXiv preprint arXiv:2505.17612. Cited by: §1.
- [3] S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. R. Narasimhan, and Y. Cao (2023) ReAct: synergizing reasoning and acting in language models. In ICLR, Cited by: §1, §2.
- [4] T. Schick, J. Dwivedi-Yu, R. Dessì, R. Raileanu, M. Lomeli, E. Hambro, L. Zettlemoyer, N. Cancedda, and T. Scialom (2023) Toolformer: language models can teach themselves to use tools. In NeurIPS, Cited by: §1, §2.
- [5] J. Singh, R. Magazine, Y. Pandya, and A. Nambi (2025) Agentic reasoning and tool integration for llms via reinforcement learning. arXiv preprint arXiv:2505.01441. Cited by: §1, §1.
- [6] L. Chenglin, Q. Chen, L. Li, C. Wang, F. Tao, Y. Li, Z. Chen, and Y. Zhang (2024) Mixed distillation helps smaller language models reason better. In Findings of the Association for Computational Linguistics: EMNLP 2024, pp. 1673–1690. Cited by: §1.
- [7] S. Fan, X. Ye, Y. Huo, Z. Chen, Y. Guo, S. Yang, W. Yang, S. Ye, J. Chen, H. Chen, et al. (2026) AgentProcessBench: diagnosing step-level process quality in tool-using agents. arXiv preprint arXiv:2603.14465. Cited by: §1.
- [8] J. Xu, Z. Li, W. Chen, Q. Wang, X. Gao, Q. Cai, and Z. Ling (2024) On-device language models: a comprehensive review. arXiv preprint arXiv:2409.00088. Cited by: §1.
- [9] X. Xu, M. Li, C. Tao, T. Shen, R. Cheng, J. Li, C. Xu, D. Tao, and T. Zhou (2024) A survey on knowledge distillation of large language models. arXiv preprint arXiv:2402.13116. Cited by: §1.
- [10] J. Qiu, X. Juan, Y. Wang, L. Yang, X. Qi, T. Zhang, J. Guo, Y. Lu, Z. Yao, H. Wang, et al. (2025) Agentdistill: training-free agent distillation with generalizable mcp boxes. arXiv preprint arXiv:2506.14728. Cited by: §1.
- [11] Y. Yao, H. Zhu, P. Wang, J. Ren, X. Yang, Q. Chen, X. Li, D. Shi, J. Li, Q. Wang, et al. (2026) O-researcher: an open ended deep research model via multi-agent distillation and agentic rl. arXiv preprint arXiv:2601.03743. Cited by: §1.
- [12] W. Li, J. Lin, Z. Jiang, J. Cao, X. Liu, J. Zhang, Z. Huang, Q. Chen, W. Sun, Q. Wang, et al. (2025) Chain-of-agents: end-to-end agent foundation models via multi-agent distillation and agentic rl. arXiv preprint arXiv:2508.13167. Cited by: §1.
- [13] C. Qian, E. C. Acikgoz, Q. He, H. Wang, X. Chen, D. Hakkani-Tür, G. Tur, and H. Ji (2025) ToolRL: reward is all tool learning needs. arXiv preprint arXiv:2504.13958. Cited by: §1, §1, §1.
- [14] C. Rainone, T. Bakker, and R. Memisevic (2025) Replacing thinking with tool usage enables reasoning in small language models. arXiv preprint arXiv:2507.05065. Cited by: §1, §1, §1.
- [15] Z. Xue, L. Zheng, Q. Liu, Y. Li, X. Zheng, Z. Ma, and B. An (2025) Simpletir: end-to-end reinforcement learning for multi-turn tool-integrated reasoning. arXiv preprint arXiv:2509.02479. Cited by: §1.
- [16] J. Liu, Z. Kong, P. Dong, C. Yang, T. Li, H. Tang, G. Yuan, W. Niu, W. Zhang, P. Zhao, et al. (2025) Structured agent distillation for large language model. arXiv preprint arXiv:2505.13820. Cited by: §1.
- [17] X. Li, H. Zou, and P. Liu (2025) ToRL: scaling tool-integrated rl. arXiv preprint arXiv:2503.23383. Cited by: §1, §1.
- [18] B. Jin, H. Zeng, Z. Yue, D. Wang, H. Zamani, and J. Han (2025) Search-r1: training llms to reason and leverage search engines with reinforcement learning. arXiv preprint arXiv:2503.09516. Cited by: §1.
- [19] H. Song, J. Jiang, Y. Min, J. Chen, Z. Chen, W. X. Zhao, L. Fang, and J. Wen (2025) R1-searcher: incentivizing the search capability in llms via reinforcement learning. arXiv preprint arXiv:2503.05592. Cited by: §1.
- [20] Z. Shao, P. Wang, Q. Zhu, R. Xu, J. Song, X. Bi, H. Zhang, M. Zhang, Y. Li, Y. Wu, et al. (2024) Deepseekmath: pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300. Cited by: 3rd item, §1, §2, §3.2, §5.1.
- [21] DeepSeek-AI (2025) DeepSeek-r1: incentivizing reasoning capability in llms via reinforcement learning. arXiv preprint arXiv:2501.12948. Cited by: §1, §1.
- [22] F. Yang, R. Meng, T. Di Qi, A. Ezzati, and Y. Wen (2026) KEPO: knowledge-enhanced preference optimization for reinforcement learning with reasoning. arXiv preprint arXiv:2602.00400. Cited by: §1, §1.
- [23] R. Agarwal, N. Vieillard, Y. Zhou, P. Stanczyk, S. R. Garea, M. Geist, and O. Bachem (2024) On-policy distillation of language models: learning from self-generated mistakes. In The twelfth international conference on learning representations, Cited by: 4th item, §1, §1, §2, §3.3, §5.1.
- [24] Y. Gu, L. Dong, F. Wei, and M. Huang (2024) Minillm: knowledge distillation of large language models. In The twelfth international conference on learning representations, Cited by: §1, §2.
- [25] W. Jin, T. Min, Y. Yang, S. R. Kadhe, Y. Zhou, D. Wei, N. Baracaldo, and K. Lee (2026) Entropy-aware on-policy distillation of language models. arXiv preprint arXiv:2603.07079. Cited by: §1, §6.
- [26] J. Ko, S. Abdali, Y. J. Kim, T. Chen, and P. Cameron (2026) Scaling reasoning efficiently via relaxed on-policy distillation. arXiv preprint arXiv:2603.11137. Cited by: §1.
- [27] Y. Wu, S. Han, and H. Cai (2026) Lightning opd: efficient post-training for large reasoning models with offline on-policy distillation. arXiv preprint arXiv:2604.13010. Cited by: §1.
- [28] Q. Team (2025) Qwen3 technical report. arXiv preprint arXiv:2505.09388. Cited by: §1, §1, §5.1, §6.
- [29] Y. Li, Y. Zuo, B. He, J. Zhang, C. Xiao, C. Qian, T. Yu, H. Gao, W. Yang, Z. Liu, et al. (2026) Rethinking on-policy distillation of large language models: phenomenology, mechanism, and recipe. arXiv preprint arXiv:2604.13016. Cited by: §1, §1, §2, §4.1, §6.
- [30] S. Xu, L. Pang, Y. Zhu, J. Gu, Z. Wei, J. Deng, F. Pan, H. Shen, and X. Cheng (2026) RLKD: distilling llms’ reasoning via reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 40, pp. 34151–34159. Cited by: §1.
- [31] G. Li, T. Yang, J. Fang, M. Song, M. Zheng, H. Guo, D. Zhang, J. Wang, and T. Chua (2026) Unifying group-relative and self-distillation policy optimization via sample routing. arXiv preprint arXiv:2604.02288. Cited by: 4th item, §1, §2.
- [32] C. Yang, C. Qin, Q. Si, M. Chen, N. Gu, D. Yao, Z. Lin, W. Wang, J. Wang, and N. Duan (2026) Self-distilled rlvr. arXiv preprint arXiv:2604.03128. Cited by: 4th item, §1, §2.
- [33] W. Bousselham, H. Kuehne, and C. Schmid (2025) VOLD: reasoning transfer from llms to vision-language models via on-policy distillation. arXiv preprint arXiv:2510.23497. Cited by: 4th item, §1, §2, §4.1.
- [34] Y. Wang, X. Chen, X. Jin, M. Wang, and L. Yang (2026) Openclaw-rl: train any agent simply by talking. arXiv preprint arXiv:2603.10165. Cited by: 4th item, §1, §2.
- [35] Y. Fu, H. Huang, K. Jiang, Y. Zhu, and D. Zhao (2026) Revisiting on-policy distillation: empirical failure modes and simple fixes. arXiv preprint arXiv:2603.25562. Cited by: §1, §4.1.
- [36] M. Song and M. Zheng (2026) A survey of on-policy distillation for large language models. arXiv preprint arXiv:2604.00626. Cited by: §1, §2.
- [37] S. Ross, G. J. Gordon, and D. Bagnell (2011) A reduction of imitation learning and structured prediction to no-regret online learning. In AISTATS, Cited by: §1.
- [38] A. Gudibande, E. Wallace, C. Snell, X. Geng, H. Liu, P. Abbeel, S. Levine, and D. Song (2023) The false promise of imitating proprietary llms. arXiv preprint arXiv:2305.15717. Cited by: §1.
- [39] J. Wang, W. Zhang, W. Shi, Y. Li, and J. Cheng (2026) TCOD: exploring temporal curriculum in on-policy distillation for multi-turn autonomous agents. arXiv preprint arXiv:2604.24005. Cited by: §1.
- [40] I. Jang, J. Yeom, J. Yeo, H. Lim, and T. Kim (2026) Stable on-policy distillation through adaptive target reformulation. arXiv preprint arXiv:2601.07155. Cited by: §1.
- [41] Y. Xu, H. Sang, Z. Zhou, R. He, Z. Wang, and A. Geramifard (2026) TIP: token importance in on-policy distillation. arXiv preprint arXiv:2604.14084. Cited by: §1, §2, §6.
- [42] P. F. Christiano, J. Leike, T. Brown, M. Martic, S. Legg, and D. Amodei (2017) Deep reinforcement learning from human preferences. Advances in neural information processing systems 30. Cited by: §2.
- [43] D. M. Ziegler, N. Stiennon, J. Wu, T. B. Brown, A. Radford, D. Amodei, P. Christiano, and G. Irving (2019) Fine-tuning language models from human preferences. arXiv preprint arXiv:1909.08593. Cited by: §2.
- [44] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov (2017) Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347. Cited by: §2.
- [45] B. Chen, C. Shu, E. Shareghi, N. Collier, K. Narasimhan, and S. Yao (2023) Fireact: toward language agent fine-tuning. arXiv preprint arXiv:2310.05915. Cited by: §2.
- [46] J. Yang, C. E. Jimenez, A. Wettig, K. Lieret, S. Yao, K. Narasimhan, and O. Press (2024) Swe-agent: agent-computer interfaces enable automated software engineering. Advances in Neural Information Processing Systems 37, pp. 50528–50652. Cited by: §2.
- [47] J. Feng, S. Huang, X. Qu, G. Zhang, Y. Qin, B. Zhong, C. Jiang, J. Chi, and W. Zhong (2025) Retool: reinforcement learning for strategic tool use in llms. arXiv preprint arXiv:2504.11536. Cited by: 1st item, Table 3, §2, §5.1.
- [48] H. Bai, Y. Zhou, M. Cemri, J. Pan, A. Suhr, S. Levine, and A. Kumar (2024) Digirl: training in-the-wild device-control agents with autonomous reinforcement learning. Advances in Neural Information Processing Systems 37, pp. 12461–12495. Cited by: §2.
- [49] Z. Qi, X. Liu, I. L. Iong, H. Lai, X. Sun, W. Zhao, Y. Yang, X. Yang, J. Sun, S. Yao, et al. (2024) Webrl: training llm web agents via self-evolving online curriculum reinforcement learning. arXiv preprint arXiv:2411.02337. Cited by: §2.
- [50] Y. Zhou, A. Zanette, J. Pan, S. Levine, and A. Kumar (2024) Archer: training language model agents via hierarchical multi-turn rl, 2024. URL https://arxiv. org/abs/2402.19446. Cited by: §2.
- [51] K. Chen, M. Cusumano-Towner, B. Huval, A. Petrenko, J. Hamburger, V. Koltun, and P. Krähenbühl (2025) Reinforcement learning for long-horizon interactive llm agents. arXiv preprint arXiv:2502.01600. Cited by: §2.
- [52] Z. Yu, L. Yang, J. Zou, S. Yan, and M. Wang (2025) Demystifying reinforcement learning in agentic reasoning. arXiv preprint arXiv:2510.11701. Cited by: §B.1, §B.4, §E.1, §2, §5.1.
- [53] Y. Wang, T. Xie, K. Shen, M. Wang, and L. Yang (2026) RLAnything: forge environment, policy, and reward model in completely dynamic rl system. arXiv preprint arXiv:2602.02488. Cited by: §2.
- [54] Y. Wang, L. Yang, Y. Tian, K. Shen, and M. Wang (2025) Co-evolving llm coder and unit tester via reinforcement learning. arXiv preprint arXiv:2506.03136. Cited by: §2.
- [55] T. Ye, L. Dong, X. Wu, S. Huang, and F. Wei (2026) On-policy context distillation for language models. arXiv preprint arXiv:2602.12275. Cited by: §2.
- [56] T. Ye, L. Dong, Z. Chi, X. Wu, S. Huang, and F. Wei (2025) Black-box on-policy distillation of large language models. arXiv preprint arXiv:2511.10643. Cited by: §2.
- [57] W. Zhu, R. Xie, R. Wang, and P. Liu (2026) Hybrid policy distillation for llms. arXiv preprint arXiv:2604.20244. Cited by: §2.
- [58] B. Zheng, X. Ma, Y. Liang, J. Ruan, X. Fu, K. Lin, B. Zhu, K. Zeng, and X. Cai (2026) SCOPE: signal-calibrated on-policy distillation enhancement with dual-path adaptive weighting. arXiv preprint arXiv:2604.10688. Cited by: §2.
- [59] X. Chen, J. Wang, W. Zhu, P. Qiu, X. Dong, H. Sang, Z. Wang, A. Geramifard, and F. Luo (2026) SODA: semi on-policy black-box distillation for large language models. arXiv preprint arXiv:2604.03873. Cited by: §2.
- [60] W. Yang, W. Liu, R. Xie, K. Yang, S. Yang, and Y. Lin (2026) Learning beyond teacher: generalized on-policy distillation with reward extrapolation. arXiv preprint arXiv:2602.12125. Cited by: §2.
- [61] S. Zhao, Z. Xie, M. Liu, J. Huang, G. Pang, F. Chen, and A. Grover (2026) Self-distilled reasoner: on-policy self-distillation for large language models. arXiv preprint arXiv:2601.18734. Cited by: 5th item, 6th item, §2, §5.1, §6.
- [62] E. Penaloza, D. Vattikonda, N. Gontier, A. Lacoste, L. Charlin, and M. Caccia (2026) Privileged information distillation for language models. arXiv preprint arXiv:2602.04942. Cited by: §2.
- [63] J. Hübotter, F. Lübeck, L. Behric, A. Baumann, M. Bagatella, D. Marta, I. Hakimi, I. Shenfeld, T. K. Buening, C. Guestrin, et al. (2026) Reinforcement learning via self-distillation. arXiv preprint arXiv:2601.20802. Cited by: §2.
- [64] I. Shenfeld, M. Damani, J. Hübotter, and P. Agrawal (2026) Self-distillation enables continual learning. arXiv preprint arXiv:2601.19897. Cited by: §2.
- [65] Y. He, S. Kaur, A. Bhaskar, Y. Yang, J. Liu, N. Ri, L. Fowl, A. Panigrahi, D. Chen, and S. Arora (2026) Self-distillation zero: self-revision turns binary rewards into dense supervision. arXiv preprint arXiv:2604.12002. Cited by: §2.
- [66] H. Wang, G. Wang, H. Xiao, Y. Zhou, Y. Pan, J. Wang, K. Xu, Y. Wen, X. Ruan, X. Chen, et al. (2026) Skill-sd: skill-conditioned self-distillation for multi-turn llm agents. arXiv preprint arXiv:2604.10674. Cited by: 4th item, §2.
- [67] K. Lu and T. M. Lab (2025) On-policy distillation. Thinking Machines Lab: Connectionism. Note: https://thinkingmachines.ai/blog/on-policy-distillation External Links: Document Cited by: §3.3.
- [68] N. Muennighoff, Z. Yang, W. Shi, X. L. Li, L. Fei-Fei, H. Hajishirzi, L. Zettlemoyer, P. Liang, E. Candès, and T. B. Hashimoto (2025) S1: simple test-time scaling. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pp. 20286–20332. Cited by: 1st item, Table 3, §5.1.
- [69] Q. Yu, Z. Zhang, R. Zhu, Y. Yuan, X. Zuo, Y. Yue, W. Dai, T. Fan, G. Liu, L. Liu, et al. (2025) Dapo: an open-source llm reinforcement learning system at scale. arXiv preprint arXiv:2503.14476. Cited by: 2nd item, Table 3, §5.1.
- [70] J. He, J. Liu, C. Y. Liu, R. Yan, C. Wang, P. Cheng, X. Zhang, F. Zhang, J. Xu, W. Shen, S. Li, L. Zeng, T. Wei, C. Cheng, B. An, Y. Liu, and Y. Zhou (2025) Skywork open reasoner 1 technical report. arXiv preprint arXiv:2505.22312. Cited by: 2nd item, Table 3, Table 3, §5.1.
- [71] R. Fan, Z. Wang, and P. Liu (2025) MegaScience: pushing the frontiers of post-training datasets for science reasoning. arXiv preprint arXiv:2507.16812. Cited by: 2nd item, Table 3, §5.1.
- [72] D. Rein, B. L. Hou, A. C. Stickland, J. Petty, R. Y. Pang, J. Dirani, J. Michael, and S. R. Bowman (2024) Gpqa: a graduate-level google-proof q&a benchmark. In First Conference on Language Modeling, Cited by: 2nd item, §5.1.
- [73] N. Jain, K. Han, A. Gu, W. Li, F. Yan, T. Zhang, S. Wang, A. Solar-Lezama, K. Sen, and I. Stoica LiveCodeBench: holistic and contamination free evaluation of large language models for code. In The Thirteenth International Conference on Learning Representations, Cited by: 3rd item, §5.1.
- [74] J. Zou, L. Yang, J. Gu, J. Qiu, K. Shen, J. He, and M. Wang (2025) ReasonFlux-prm: trajectory-aware prms for long chain-of-thought reasoning in llms. The Thirty-ninth Annual Conference on Neural Information Processing Systems. Cited by: 1st item.
- [75] Y. Xia, W. Shen, Y. Wang, J. K. Liu, H. Sun, S. Wu, J. Hu, and X. Xu (2025) Leetcodedataset: a temporal dataset for robust evaluation and efficient training of code llms. arXiv preprint arXiv:2504.14655. Cited by: Table 3.
- [76] G. Sheng, C. Zhang, Z. Ye, X. Wu, W. Zhang, R. Zhang, Y. Peng, H. Lin, and C. Wu (2025) Hybridflow: a flexible and efficient rlhf framework. In Proceedings of the Twentieth European Conference on Computer Systems, pp. 1279–1297. Cited by: §B.4.
Appendix
Section titled “Appendix”Appendix A Algorithmic Details of SOD
Section titled “Appendix A Algorithmic Details of SOD”We present the complete training procedure of SOD in Algorithm 1. At each iteration, the student generates on-policy trajectories with tool interactions, computes step-level divergence against the teacher, derives adaptive distillation weights, and updates the policy with a combined GRPO and step-wise OPD objective.
Algorithm 1 SOD: Step-wise On-policy Distillation for Small Language Model Agents
Input: Student policy , teacher policy , tool environment , prompt set , group size , smoothing constant , weight cap , clipping range .
Output: Trained student policy .
Stage I: On-Policy Rollout with Tool Interaction
for each prompt do
-
•
For : sample trajectory from by interacting with .
-
•
Compute outcome reward for each trajectory.
-
•
Compute group-relative advantage via Eq. 2.
Stage II: Student-teacher Divergence and Step-wise Reweighting
for each trajectory do
-
•
Partition model-generated tokens into reasoning steps (excluding tool observation tokens).
-
•
For each step , compute step-level divergence via Eq. 6.
-
•
Set .
-
•
For , compute adaptive weight via Eq. 7.
Stage III: Combined Optimization
-
[nosep,leftmargin=1.5em]
-
•
Compute GRPO loss with clipped surrogate objective ( Eq. 3) using advantages .
-
•
Compute step-wise OPD loss via Eq. 9 using weights .
-
•
Update policy parameters:
[2pt] .- •
Synchronize old policy: .
Appendix B Experimental Setup
Section titled “Appendix B Experimental Setup”B.1 Training Datasets.
Section titled “B.1 Training Datasets.”We provide information in detail of our training datasets including SFT dataset and RL dataset, which is following Yu et al. [52]. For the prompts template for different benchmarks, please refer to Section E.1. We also provide statistical information of our training data in Table 3.
-
•
SFT dataset. The SFT dataset is constructed from a mixture of curated and synthetic multi-turn problem-solving trajectories. Specifically, a teacher model (Qwen3-Coder-30B-A3B) is employed within an agent-based framework where the SandBoxFusion is used as the code interpreter to generate end-to-end interaction traces, where problems are drawn from three complementary sources: the s1-1k set [68], a curated collection of 3k LeetCode problems, and a 2k multi-turn ReTool [47] dataset. To ensure data quality, the generated trajectories for the latter two subsets are scored using ReasonFlux-PRM [74], and only the top-ranked subsets (1k each) are retained, together with the full s1-1k set, resulting in a final 3k high-quality SFT corpus.
-
•
RL dataset. The RL dataset is designed to emphasize diversity across domains in order to study its impact on training dynamics. It comprises 30k samples aggregated from multiple sources, including 17k mathematical reasoning problems from DAPO-Math [69], a mixture of 4,902 math and 3,586 code tasks from Skywork-or1 [70], and an additional 3k science problems from MegaScience [71].
Table 3: Summary of the training datasets used in our experiments.
| Dataset Type | Domain | Source | # Samples |
| SFT Dataset | Mathematical | s1-1k [68] | 1k |
| Coding | LeetCode [75] | 1k | |
| Tool-use | ReTool [47] | 1k | |
| Total | 3k | ||
| RL Dataset | Mathematical | DAPO-Math [69] | 17k |
| Skywork-or1 (Math) [70] | 4,902 | ||
| Coding | Skywork-or1 (Code) [70] | 3,586 | |
| Scientific | MegaScience [71] | 3k | |
| Total |
B.2 Benchmarks
Section titled “B.2 Benchmarks”We provide detailed descriptions of the four benchmarks used in our evaluation.
-
•
AIME 2024/2025. The American Invitational Mathematics Examination (AIME) is a prestigious mathematics competition administered by the Mathematical Association of America (MAA). Each year’s examination consists of two sessions (AIME I and AIME II), each containing 15 problems, for a total of 30 problems per year. All answers are integers in the range , which enables unambiguous automatic evaluation via exact match. The problems span advanced topics including algebra, number theory, combinatorics, and geometry, requiring multi-step reasoning chains and creative problem-solving strategies that go well beyond pattern matching. We use the 2024 and 2025 editions as benchmarks: AIME 2024 was administered in February 2024, and AIME 2025 in February 2025. The use of recent competition problems mitigates the risk of data contamination, as these problems are unlikely to appear in pre-training corpora of models with earlier knowledge cutoffs.
-
•
GPQA-Diamond [72]. GPQA (Graduate-Level Google-Proof Q&A) is a challenging multiple-choice question-answering benchmark consisting of questions authored by domain experts holding PhDs in biology, physics, and chemistry. The questions are deliberately designed to be “Google-proof”, they cannot be answered through simple web searches, requiring instead genuine domain expertise and multi-step scientific reasoning. The dataset comprises three nested subsets: GPQA Extended (546 questions), GPQA Main (448 questions), and GPQA Diamond (198 questions). We adopt the Diamond subset, which is the highest-quality partition: it contains only questions where both independent domain expert validators answered correctly, while skilled non-expert validators (holding PhDs in other scientific fields, with unrestricted internet access) failed. Human performance baselines on the Diamond subset are approximately 65% for domain experts and 34% for non-experts, compared to a random baseline of 25%.
-
•
LiveCodeBench [73]. LiveCodeBench is a continuously updated benchmark for evaluating the coding capabilities of large language models. Unlike static benchmarks such as HumanEval, LiveCodeBench mitigates data contamination by continuously collecting new problems from competitive programming platforms (LeetCode, AtCoder, and Codeforces) and annotating each problem with its release date. This temporal annotation enables contamination-aware evaluation by restricting the test set to problems released after a model’s training data cutoff. We use the v6 release, which contains 1,055 problems spanning May 2023 to April 2025. Following common practice, we evaluate on problems within a recent time window to ensure minimal overlap with training data. The benchmark assesses multiple code-related capabilities including code generation, self-repair (debugging given execution feedback), code execution prediction, and test output prediction.
B.3 Baselines
Section titled “B.3 Baselines”We compare SOD with a diverse set of baselines spanning supervised learning, reinforcement learning, and distillation-based approaches. These baselines are chosen to reflect different sources of supervision (offline vs. on-policy), as well as different granularities of learning signals (sequence-level vs. token-level).
-
•
Vanilla. The base model without any additional task-specific training. This baseline reflects the zero-shot or instruction-tuned capability of the model.
-
•
SFT (Supervised Fine-Tuning). A standard supervised learning baseline where the model is trained to maximize the likelihood of reference solutions. This approach corresponds to off-policy imitation learning, where the model learns from fixed expert trajectories. While simple and effective, SFT suffers from exposure bias due to the mismatch between training (on ground-truth prefixes) and inference (on model-generated prefixes).
-
•
GRPO (Group Relative Policy Optimization) [20]. A reinforcement learning approach that optimizes the model using relative performance within a group of sampled responses. For each input, multiple candidate outputs are generated, and each is assigned a scalar reward based on task-specific correctness. Instead of learning a separate value function, GRPO computes advantages by normalizing rewards within the group, effectively measuring how much better or worse a response is compared to its peers. The model is then updated using a policy optimization objective with clipping to ensure stable training. While GRPO avoids the need for a learned critic and is relatively efficient, it relies on sparse, sequence-level rewards, assigning the same advantage to all tokens in a response and thus lacking fine-grained token-level supervision.
-
•
OPD (On-Policy Distillation) [23]. An on-policy distillation method where the model learns from its own generated trajectories while receiving dense token-level supervision from a teacher distribution. At each decoding step, the objective minimizes the divergence between the student and teacher token distributions along the student’s rollout. This approach mitigates exposure bias and provides richer supervision compared to RL, but relies on an external teacher policy. Following recent findings that combining OPD with GRPO stabilizes training and improves performance [31, 32, 33, 34, 23, 66], our OPD baseline adopts the joint objective (see Eq. 10 for the objective of SOD). We additionally report results for naive OPD (without GRPO) in Section C.3.
-
•
OPSDgt (On-Policy Self-Distillation with Ground Truth) [61]. A self-distillation variant where the same model plays both teacher and student roles. The student generates responses conditioned only on the input, while the teacher is additionally conditioned on the full ground-truth solution, which is treated as privileged information. The training objective minimizes the token-level divergence between the teacher and student distributions along the student’s trajectory. This setting provides strong supervision but assumes access to complete reference solutions.
-
•
OPSDhint (On-Policy Self-Distillation with Hints) [61]. A more practical variant of OPSD where the privileged information is replaced with a hint derived from the ground-truth solution. Instead of directly exposing the full solution, the teacher conditions on a compressed or partial guidance signal (i.e., a hint), which provides weaker but more realistic supervision. This setup evaluates whether partial information can effectively guide self-distillation. Please refer to Section E.2 for the specific prompt in generating hints.
B.4 Implementation Details.
Section titled “B.4 Implementation Details.”All experiments are conducted using the VeRL framework [76] and Open-AgentRL framework [52]. To ensure a fair comparison, all methods share the same base training infrastructure, optimizer, and core hyperparameters unless otherwise noted. To promote reproducibility and better understanding the details of our implementation, we provide an anonymous code link at the end of the abstract.
-
•
Compute Resources. All experiments are conducted on a single node with 8 NVIDIA H20 GPUs (96GB memory each). For RL and distillation-based methods, training runs for 1 epoch and typically takes 2-3 days for 0.6B and 1.7B student models (see Table 4), while training with larger 4B and 14B teacher models requires approximately 5-6 days. In contrast, supervised fine-tuning (SFT) is significantly more efficient, with 5 training epochs typically completed within a few hours under the same hardware setup. To ensure robustness and statistical reliability, all experiments are repeated over 5 independent runs with different random seeds. These details provide sufficient information about hardware configuration, execution time, and experimental protocol for reproducibility.
-
•
Supervised Fine-Tuning (SFT). We fine-tune the base Qwen3-0.6B and Qwen3-1.7B models on the 3K SFT corpus for 5 epochs with a global batch size of 128. We use the AdamW optimizer with a learning rate of 5e-5. The maximum sequence length is set to 32,768 tokens with right truncation.
-
•
Baselines & Teacher Models(RL & Distillation). For all RL and distillation-based methods (GRPO, OPD, OPSDgt, OPSDhint) including the teacher models, we adopt a unified training configuration to isolate the effect of each algorithm. Specifically, we use the AdamW optimizer with a learning rate of 1e-6, a training batch size of 64, and a mini-batch size of 16. All RL & Distillation baselines including SOD are trained based on the SFT checkpoint. The maximum prompt length is set to 2,560 tokens and the maximum response length to 20,480 tokens. We sample 16 responses per prompt during training and 32 during validation. All methods are trained for at most 1 epoch (For the teacher models, we train for at most 2 epochs). The multi-turn agent interaction supports up to 16 tool-call turns. Rollout is performed asynchronously via vLLM with tensor parallelism of 4. For distillation-based methods (OPD and its variants), the teacher model (Qwen3-4B, further optimized with GRPO) provides token-level supervision along the student’s on-policy rollouts.
-
•
SOD. SOD adopts the same training configuration as the baselines described above. The only additional hyperparameters are those governing the step-wise adaptive weighting mechanism: the initial weight is fixed as 1, the numerical stability constant and the upper-bound offset (allowing per-step weights ). These parameters control the adaptive distillation strength based on the per-step student–teacher divergence, enabling the model to automatically modulate learning intensity across reasoning steps.
Appendix C Additional Experiments
Section titled “Appendix C Additional Experiments”C.1 Training Cost and Practicality Analysis
Section titled “C.1 Training Cost and Practicality Analysis”A natural concern is whether the step-wise divergence computation in SOD introduces substantial overhead relative to standard OPD. We address this by reporting wall-clock training metrics for all methods. All experiments are conducted on 8H20 GPUs with identical batch sizes and rollout configurations, trained for 120 steps (0.6B) or 150 steps (1.7B). Key observations are summarized as:
Table 4: Training cost comparison. All runs use 8H20 96GB GPUs with identical configurations.
Params Method Avg Time/Step Peak Memory Total Time
(s) (GB) (h)
0.6B GRPO 680.6 78.5 22.7
OPD 1090.5 87.7 36.4
SOD 1052.3 87.6 35.1
1.7B GRPO 784.6 81.7 32.7
OPD 1053.6 88.2 43.9
SOD 1105.4 88.7 46.1
SOD vs. OPD: negligible algorithmic overhead.
Section titled “SOD vs. OPD: negligible algorithmic overhead.”The step-wise divergence (Eq. 6) and adaptive weight (Eq. 7) are computed from the student and teacher log-probabilities already available during the OPD forward pass. The additional computation is merely per-step averaging and scalar multiplications (–), requiring no extra forward pass. Peak memory is equivalent ( GB difference). Notably, for the 0.6B model, SOD is actually 3.5% faster per step than OPD (1052.3s vs. 1090.5s), because the adaptive reweighting suppresses learning from erroneous tool-call patterns, resulting in more efficient rollouts with fewer failed retries and shorter responses. For the 1.7B model, SOD shows a modest overhead (1105.4s vs. 1053.6s), which is entirely acceptable given the significant performance gains (+18.50% improvement at average) over OPD.
Why GRPO has lower per-step time.
Section titled “Why GRPO has lower per-step time.”GRPO exhibits 1.4–1.5 lower per-step time than OPD-based methods. However, this is largely because GRPO’s training collapses in later stages: as shown in Figure 4, the GRPO-trained student progressively loses the ability to perform effective tool calls, resulting in drastically shorter responses and fewer sandbox interactions in later training steps. This artificially deflates the average per-step time. In contrast, OPD and SOD maintain long, structured reasoning trajectories with active tool usage throughout training, which naturally requires more generation time per step.
C.2 Quantitative Analysis of Distillation Pattern Distribution
Section titled “C.2 Quantitative Analysis of Distillation Pattern Distribution”Figure 6: Distribution of three distillation patterns over training steps. At each step, all rollout trajectories are classified into Stable, Recovery, or Erroneous based on their adaptive weight dynamics, and the proportion of each pattern is reported (smoothed with a 9-step moving average).
To move beyond qualitative illustration and quantify how the three distillation patterns evolve during training, we conduct a systematic classification of all multi-step trajectories at each training step. Specifically, for every rollout sample at global step , we record the full sequence of adaptive weights computed by SOD during that trajectory. We then classify each trajectory into one of three dominant patterns based on the overall shape of the sequence:
-
•
Stable: Adaptive weights remain consistently high throughout the trajectory, indicating that the student stays well-aligned with the teacher across all reasoning steps.
-
•
Erroneous: Weights are progressively suppressed and remain low by the final step, indicating persistent divergence that the student fails to correct.
-
•
Recovery: Weights drop during intermediate steps (reflecting temporary divergence) but recover by the final step, indicating that the student successfully re-aligns after an initial deviation.
We note that a fourth logical category exists, i.e., trajectories that begin aligned but degrade toward the end (i.e., early weights are high but the final weight is low). In practice, we find this pattern accounts for a negligible fraction (1%) of all trajectories, as persistent degradation without any preceding divergence signal is rare under SOD’s cumulative reweighting mechanism. We therefore merge these cases into the erroneous category for simplicity. At each training step, we classify all rollout samples and compute the proportion of each pattern. Results are smoothed with a 9-step moving average for visualization clarity. Figure 6 reports the distribution over the training trajectory for both model scales.
Key observations.
Section titled “Key observations.”(1) Stable proportion increases over training. For both 0.6B and 1.7B, the fraction of stable trajectories grows steadily, confirming that SOD progressively improves student-teacher alignment as training proceeds. (2) Erroneous proportion decreases consistently. The proportion of erroneous trajectories declines substantially over training. This indicates that, as training progresses under SOD, the student model becomes increasingly capable: when encountering difficult reasoning steps, it no longer falls into consecutive errors but instead recovers or avoids mistakes altogether. (3) Recovery grows and becomes a persistent component. Notably, the recovery proportion is initially low (especially for the 0.6B model) and increases over training before stabilizing at a substantial level. This reveals a meaningful progression: early in training, the student lacks the capacity to recover from divergence; once it deviates, it tends to remain erroneous. As training proceeds, the student develops the ability to self-correct after intermediate missteps, converting what would have been erroneous trajectories into recovery ones. Even at the end of training, recovery trajectories account for a significant proportion of all samples, indicating that SOD’s adaptive reweighting mechanism remains continuously active. (4) Model capacity affects convergence speed and pattern composition. The 1.7B model reaches a higher stable proportion faster and drives erroneous to a lower level by the end of training, while maintaining a moderate recovery proportion throughout. In contrast, the 0.6B model starts with a much higher erroneous fraction and lower recovery fraction, reflecting its initially limited ability to self-correct. As training progresses, the 0.6B model gradually develops recovery capability, but converges more slowly overall. This suggests that SOD’s protective suppression of erroneous signals is particularly critical for smaller models during early training.
C.3 The Performance of Naive On-policy Distillation
Section titled “C.3 The Performance of Naive On-policy Distillation”In the main experiments, our OPD baseline combines the OPD loss with GRPO (i.e., ) as illustrated in Section B.3. Here we report results for naive OPD, which uses only the token-level distillation loss without any RL reward signal.
Table 5: Comparison of naive OPD vs. OPD on the 1.7B student model.
Method Math Science Code Average
AIME 2024 AIME 2025 GPQA LiveCodeBench
naive OPD 40.54.
1.05 35.83.
1.11 28.96.
0.58 29.81.
0.74 33.79
OPD 43.86.
1.23 37.04.
1.31 31.73.
0.55 32.45.
0.93 36.27
SOD (w/o GRPO) 48.87.
0.93 39.73.
1.02 35.89.
0.62 38.62.
0.71 40.78
SOD 50.83.
1.15 41.72.
1.24 38.72.
0.73 40.63.
0.91 42.98
As shown in Table 5, naive OPD underperforms the OPD baseline by 2.48 points on average (33.79 vs. 36.27). Without the outcome-level reward signal from GRPO, the student relies entirely on dense teacher supervision for learning. However, as analyzed in Section 4.1, OPD applies uniform distillation across all steps including those corrupted by tool-induced state drift. In the absence of GRPO’s reward-driven exploration, the model lacks an independent signal to distinguish successful from failed trajectories, making it more susceptible to the compounding error problem.
More notably, comparing the two pure distillation variants, naive OPD (33.79) vs. SOD w/o GRPO (40.78), reveals that our step-wise reweighting alone accounts for a +6.99 (+20.69%) improvement without any RL reward signal. This confirms that the core benefit of SOD stems from the adaptive step-wise reweighting mechanism rather than from the RL component. GRPO provides complementary gains (+2.20 on top of step-wise OPD), but the reweighting mechanism remains the primary driver of performance improvement. These results also suggest that step-wise reweighting and GRPO address orthogonal aspects of the training challenge: the former stabilizes dense supervision under state drift, while the latter provides sparse outcome-level exploration signals.
Appendix D Proofs for Section 4.1
Section titled “Appendix D Proofs for Section 4.1”We adopt the notation established in Section 4.1. For notational convenience in the derivations below, we write and for the student and teacher next-token distributions conditioned on the student-generated prefix . The token-level OPD loss is with . The step-level mismatch , the teacher-supported region , and the overlap are as defined in the main text.
D.1 Proof of Proposition 1
Section titled “D.1 Proof of Proposition 1”Proof.
Section titled “Proof.”We analyze how the step-level mismatch evolves between consecutive steps in two settings.
Text-only case (gradual drift).
Section titled “Text-only case (gradual drift).”In text-only generation, the prefix at position differs from position by exactly one student-sampled token. Define the per-token distributional shift as:
| $$\eta\triangleq\max_{t};\mathrm{TV}(p_{t},p_{t-1})=\max_{t};\frac{1}{2}\sum_{v\in\mathcal{V}}\left | p_{t}(v)-p_{t-1}(v)\right | ,$$ |
i.e., the maximum total variation (TV) distance between consecutive output distributions. For well-trained transformers, is small because the self-attention mechanism distributes influence across many context positions, so appending a single token has limited impact on the output distribution. Since consecutive steps share a boundary of one token, the step-level mismatch changes by at most per step transition.
TIR case (discontinuous drift).
Section titled “TIR case (discontinuous drift).”In TIR, the transition from step to step involves appending an entire tool observation of length to the prefix:
| (12) |
where denotes concatenation. Crucially, is produced by the external environment, not by either model. Let denote the average per-token distributional shift induced by observation tokens, measured by the TV distance between the model’s output distribution before and after conditioning on each successive observation token.
Single-step bound.
Section titled “Single-step bound.”By the triangle inequality applied to the intermediate distributions between and , the total variation shift satisfies:
| (13) |
A similar bound holds for the teacher distribution. By Pinsker’s inequality (), the change in step-level KL divergence is lower-bounded by the squared TV shift. Since tool observations typically span tens to hundreds of tokens () and introduce content not generated by either model, we have in general, yielding:
| (14) |
Note that even a single erroneous tool call already introduces a substantially larger divergence jump than text-only drift ( vs. ), since the observation length and the out-of-distribution content shifts conditioning more aggressively. Nevertheless, the teacher, having encountered some error patterns during training, can still provide partially useful supervision after an isolated failure. The critical issue arises from the cascading nature of errors in weaker student models, as we analyze next.
Cascading errors and super-linear compounding.
Section titled “Cascading errors and super-linear compounding.”Weaker student models, precisely the targets of OPD, are prone to producing consecutive erroneous tool calls. A weaker student is more likely to generate an incorrect tool invocation at step ; conditioned on the resulting erroneous observation, its subsequent reasoning is further degraded, increasing the probability of another failure at step . This creates a cascading failure pattern where each error compounds upon the previous ones.
The key insight is that while the teacher may reasonably handle a single isolated error in the context (having potentially seen similar error messages during training), the joint occurrence of multiple consecutive failures creates a conditioning context that is combinatorially unlikely under the teacher’s training distribution. If each individual error context has marginal probability under the teacher’s training distribution, the joint context of consecutive errors has probability at most , an exponential decay in familiarity. It is this accumulated, multi-error prefix that drives the teacher’s conditional distribution far from calibration, making grow with .
Formally, when the student makes consecutive erroneous tool calls across steps , the cumulative divergence satisfies:
| (15) |
where is the length of the -th erroneous observation and is the corresponding per-token shift. Crucially, later errors induce progressively larger per-token shifts () because the prefix is already corrupted by prior errors, where the teacher has never been calibrated on such multi-error contexts, making its predictions increasingly unreliable. This yields super-linear growth of divergence with the number of consecutive tool failures, which is empirically confirmed in Figure 1(a) where the student-teacher divergence accelerates as errors accumulate. ∎
D.2 Proof of Proposition 2
Section titled “D.2 Proof of Proposition 2”Proof.
Section titled “Proof.”We prove the second-moment lower bound and then derive the SNR degradation.
Step 1: Decomposition of the second moment.
Section titled “Step 1: Decomposition of the second moment.”The second moment of the OPD loss under decomposes over the vocabulary:
| (16) |
Step 2: Restricting to the low-overlap region.
Section titled “Step 2: Restricting to the low-overlap region.”We partition the vocabulary into the teacher-supported region and its complement . By the overlap condition , the student places mass at least on :
| (17) |
Restricting the sum to gives a lower bound:
| (18) |
Step 3: Applying Jensen’s inequality.
Section titled “Step 3: Applying Jensen’s inequality.”For any , since , we have:
| (19) |
Define the conditional distribution over . By the convexity of and Jensen’s inequality:
| --- | --- | --- | --- |
| --- | --- | --- | --- |
Step 4: Bounding the entropy term.
Section titled “Step 4: Bounding the entropy term.”The term , where is the conditional entropy of the student restricted to , satisfying . For sufficiently small satisfying (a natural condition since the teacher threshold should be below the uniform baseline), we have , so the term dominates:
| $$\mathbb{E}[\ell_{t}^{2}];\geq;(1-\rho)\left(\log\frac{1}{\epsilon}-H_{\bar{S}}\right)^{2};\geq;(1-\rho),\log^{2}!\frac{1}{\epsilon}\cdot\left(1-\frac{\log | \mathcal{V} | }{\log(1/\epsilon)}\right)^{2},$$ |
which grows as when .
Step 5: SNR degradation.
Section titled “Step 5: SNR degradation.”Let be the token-level OPD gradient estimator. The expected gradient is , which is bounded for any fixed distribution pair with finite KL divergence; let .
Define , which is positive for any non-degenerate parameterization. The variance of the gradient estimator satisfies:
| (22) |
Combining with the second-moment lower bound from Step 4:
| (23) |
As , the denominator grows as while the numerator remains constant, giving .
Interpretation.
Section titled “Interpretation.”When the student drifts far from the teacher-supported region (), most sampled tokens fall in where the teacher assigns near-zero probability. The OPD loss for these tokens has large magnitude (due to ) but is uninformative. It reflects the teacher’s inability to model these out-of-distribution states rather than a meaningful learning signal. Meanwhile, informative signals from (where teacher guidance is calibrated) are sampled only with probability , making them increasingly rare. The gradient is thus dominated by high-variance, low-information contributions, rendering optimization unstable. ∎
D.3 Discussion: Failure Cascade and Design Implications
Section titled “D.3 Discussion: Failure Cascade and Design Implications”The two propositions together characterize a failure cascade specific to TIR:
-
Initial perturbation: An erroneous tool call returns a corrupted observation (e.g., a runtime error, incorrect output, or timeout message). This already introduces a divergence jump substantially larger than text-only drift ( vs. ), though the teacher, having encountered some error patterns during pretraining, can still provide partially useful supervision after an isolated failure.
-
Cascading accumulation: Weaker student models, precisely the targets of OPD, are prone to making consecutive errors. Each subsequent erroneous tool call further corrupts the prefix, and the joint pattern of multiple consecutive failures becomes exponentially unlikely under the teacher’s training distribution ( for consecutive errors). It is this accumulated multi-error context, rather than any single error, that drives the teacher’s conditional distribution far from calibration. The divergence thus compounds super-linearly (Proposition 1), as empirically demonstrated by the accelerating divergence curve in Figure 1(a).
-
Supervision breakdown: In the resulting low-overlap states () caused by accumulated consecutive errors, the OPD gradient estimator suffers variance explosion and SNR degradation (Proposition 2). Updates become dominated by uninformative, high-magnitude contributions from tokens where the teacher provides no meaningful guidance. Figure 1(b) confirms this empirically: the teacher’s conditional entropy becomes both elevated and highly variable in steps following accumulated tool errors.
-
Amplification by uniform aggregation: OPD sums token-level losses across all steps with equal weight, treating well-aligned early steps (high , reliable teacher guidance) identically to corrupted post-error steps (low , unreliable guidance). When cumulative tool errors cause a substantial portion of later steps to have low overlap, the aggregate gradient is systematically biased by these high-variance contributions.
This analysis implies that a stabilizing objective should modulate distillation strength at the step level: preserving full-strength dense supervision in well-aligned steps while attenuating the signal when the estimated student-teacher divergence indicates teacher miscalibration. This is the design principle underlying our adaptive step-wise reweighting mechanism.
D.4 Variance Reduction under Step-wise Reweighting
Section titled “D.4 Variance Reduction under Step-wise Reweighting”We now show that the step-wise reweighting mechanism in Eq. (7) provably addresses the gradient SNR degradation identified in Proposition 2.
Proposition 3 (Bounded variance under adaptive reweighting).
Section titled “Proposition 3 (Bounded variance under adaptive reweighting).”Under the step-wise weighted OPD objective (Eq. 9), when the divergence increases monotonically across steps (), the weighted gradient contribution from step satisfies:
| (24) |
where is the unweighted second moment from Proposition 2. Consequently, even when causes , the weighted contribution remains bounded whenever grows proportionally to the divergence.
Proof.
Section titled “Proof.”By the definition of in Eq. (7):
| (25) |
Under monotonically increasing divergence (), each ratio , and the product telescopes:
| (26) |
The weighted second moment of the OPD loss at token is therefore:
| (27) |
From Proposition 2, when the student drifts into low-overlap states, . However, such drift also implies that increases (since is monotonically related to , as shown in Appendix D.5). Specifically, when , the per-token log-probability gaps grow, causing . The weighted contribution thus satisfies:
| (28) |
The key insight is that the numerator is bounded (determined by the initial step’s divergence), while the denominator grows with the accumulated drift. This creates an automatic variance suppression: the more the student diverges (larger , larger ), the more aggressively the weight attenuates the contribution, preventing the variance explosion that afflicts OPD.
SNR recovery.
Section titled “SNR recovery.”For the weighted gradient estimator , the signal (expected gradient from well-aligned early steps where ) remains intact, while the noise from high-divergence later steps is suppressed by the factor . This restores a positive SNR for the aggregate gradient, in contrast to OPD where the SNR degrades to zero (Proposition 2). ∎
Stability under recovery.
Section titled “Stability under recovery.”The above analysis addresses the erroneous case where divergence increases monotonically. In the recovery case ( for some ), the weight may exceed 1, potentially amplifying the gradient contribution. However, the hard upper bound in Eq. (7) ensures that the weighted second moment is always bounded by . Since recovery steps by definition have decreasing (implying the student is returning to the teacher-supported region, i.e., is increasing), the unweighted itself is decreasing in these steps. The combination of bounded amplification and decreasing base variance ensures optimization stability.
Interpretation.
Section titled “Interpretation.”This result formalizes the intuition behind our method: OPD fails because it applies uniform weight to all steps, allowing high-variance contributions from corrupted post-error steps to dominate the gradient. Our step-wise reweighting automatically detects these corrupted steps (via increasing ) and attenuates their influence proportionally, ensuring that the gradient signal remains dominated by informative contributions from well-aligned steps. The upper bound further ensures that the recovery mechanism does not over-amplify any single step, maintaining optimization stability throughout training.
D.5 Justification of as a Proxy for
Section titled “D.5 Justification of d_kd\_{k}d_k as a Proxy for Δ_k\Delta\_{k}Δ_k”Computing the full KL divergence requires evaluating the teacher’s output distribution over the entire vocabulary at each token position, which introduces substantial overhead. In contrast, (Eq. 6) only requires the teacher’s log-probability on the student-sampled token , a quantity already computed in the standard OPD forward pass.
Monotonic consistency.
Section titled “Monotonic consistency.”By Jensen’s inequality:
| $$d_{k}=\frac{1}{ | \mathcal{I}_{k} | }\sum_{t\in\mathcal{I}_{k}}\left |
where the right-hand side is the absolute value of a single-sample Monte Carlo estimate of . When the student drifts further from the teacher (increasing ), the per-token log-probability gaps increase in expectation, yielding a larger . This monotonic relationship ensures that the ratios used in Eq. (7) correctly reflect the relative trend of divergence across steps.
Sufficiency of ordering.
Section titled “Sufficiency of ordering.”The weight formula in Eq. (7) is a product of ratios , depending only on the relative magnitudes between consecutive steps. Any monotone transformation of preserves these ratios’ direction (above or below one), producing equivalent attenuation and recovery behavior. Since maintains the ordering of , it is a sufficient statistic for our reweighting mechanism.
Appendix E Prompt Template
Section titled “Appendix E Prompt Template”E.1 Datasets Prompt Template
Section titled “E.1 Datasets Prompt Template”Our dataset contains various question types, including mathematics, programming, and scientific problems, each with different answer formats. To ensure consistent model output and facilitate simultaneous reasoning and tool usage, we have developed specialized prompts for each task type. Below, we present these prompts following Yu et al. [52].
E.2 Baseline Prompt Template
Section titled “E.2 Baseline Prompt Template”For the OPSDhint baseline, we construct partial guidance signals by prompting a language model to distill the ground-truth solution into a concise hint. Given a problem and its full solution, the model is instructed to extract the key insight or critical intermediate step (e.g.,, a useful substitution, a relevant theorem, or a strategic decomposition) without revealing the final answer or complete derivation. The resulting hint is then injected into the teacher’s input as a conditioning signal during on-policy self-distillation. The prompt template used for hint generation is shown below:
Appendix F Visualization and Analysis of Token Entropy from The Teacher
Section titled “Appendix F Visualization and Analysis of Token Entropy from The Teacher”To provide intuitive evidence for the motivation behind SOD’s divergence-aware reweighting, we visualize the token-level conditional entropy of the teacher distribution along student-generated trajectories. This entropy directly reflects the teacher’s confidence when providing supervision at each token position: low entropy indicates that the teacher assigns high probability mass to a single continuation (i.e., confident and reliable guidance), while high entropy signals that the teacher is uncertain about the correct next token given the student’s context, i.e., a hallmark of out-of-distribution states where distillation becomes unreliable.
We present two representative cases below. Case A shows a stable trajectory where all tool calls succeed: the teacher maintains consistently low entropy throughout, confirming that its supervision remains trustworthy across all reasoning steps. Case B illustrates an erroneous trajectory where repeated tool failures corrupt the student’s context: the teacher’s mean entropy escalates sharply from to across steps, with over 78% of tokens in the final step exceeding . This progressive degradation of teacher confidence validates our core design principle, i.e., uniformly distilling from such corrupted states would propagate fundamentally unreliable supervision, whereas SOD’s adaptive weights automatically attenuate the distillation signal in these high-entropy regions.