Skip to content
ImagineWorld

SOD: Step-wise On-policy Distillation for Small Language Model Agents

node_idnode-paper_arxiv-2605.07725_sod-step-wise-on-policy-distillation-for-small-language-model-agents
node_typenode-paper
schema_profileworld.node_paper.v1
alternate_namesarxiv-2605.07725
statusactive
orthogonal_scopemanifold, entropy, authority, state
manifoldworld
entropymedium
authorityguides
stateexternal
domainimagineworld.net
node_interiorrosetta_contract
unisonone evidence claim read five ways: seated in the machine-learning field, the work presents SoD — step-wise on-policy distillation for small language model agents — its framework, regime, and stance agreeing on what it is
governed_byWORLD-MANIFOLD, CORPUS
constitutional_citationCONSTITUTION
evidence_bundleworld-bundle-paper
publication_classarxiv_preprint
paper_titleSOD: Step-wise On-policy Distillation for Small Language Model Agents
paper_authorsQiyong Zhong, Mao Zheng, Mingyang Song, Xin Lin, Jie Sun, Houcheng Jiang, Xiang Wang, Junfeng Fang
arxiv_id2605.07725
arxiv_urlhttps://arxiv.org/abs/2605.07725
arxiv_categories{"primary":"cs.CL","secondary":["cs.AI"]}
arxiv_v3
arxiv_submitted_at2026-05-08
arxiv_updated_at2026-08-18
ocr_sourcearxiv_html
ocr_quality_classverbatim_latexml_html
extraction_toolarxiv-nodepaper-transpose
extraction_pipeline_versionworld-ingest-arxiv-html-v1.0
extracted_at2026-10-13T06:51:09Z
math_preserved_as_latextrue
figures_extractedtrue
references_structurally_parsedfalse
created_at2026-10-13T06:51:09Z
updated_at2026-10-14T05:45:17Z
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.


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.

Figure 1: The motivation of SOD . (a) Student-teacher divergence d k d_{k} across reasoning steps, sampled from 800 traj

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.

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 (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.

We consider the post-training of a small language model (SLM) for multi-turn tool-integrated reasoning (TIR). Given an input xx, the model interacts with an external environment over multiple reasoning steps. At each step kk, the model generates a response y_ky\_{k}, which may include natural-language reasoning, a tool invocation, or a final answer. If a tool is invoked, the environment returns an observation o_ko\_{k}, which is appended to the context and conditions subsequent generations.

A trajectory is defined as:

τ=(x,y_1,o_1,…,y_K,o_K,y_K+1),\tau=(x,y\_{1},o\_{1},\ldots,y\_{K},o\_{K},y\_{K+1}),(1)

where y_K+1y\_{K+1} denotes the final response. The policy π_θ\pi\_{\theta} generates only model tokens, while observations {o_k}\{o\_{k}\} are provided by the environment. Let y_ty\_{t} denote a generated token and y_<ty\_{<t} its prefix, which may include both model outputs and tool observations.

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 r(τ)r(\tau) defined on complete trajectories. For each input xx, a group of trajectories {τ_i}_i=1G\{\tau\_{i}\}\_{i=1}^{G} is sampled from the old policy π_θ_old\pi\_{\theta\_{\mathrm{old}}}, each receiving reward r_i=r(τ_i)r\_{i}=r(\tau\_{i}).

The group-relative advantage is computed as:

A^_i=r_i−mean({r_j})std({r_j})+ϵ_A.\hat{A}\_{i}=\frac{r\_{i}-\mathrm{mean}(\{r\_{j}\})}{\mathrm{std}(\{r\_{j}\})+\epsilon\_{A}}.(2)

Let ρ_i,t(θ)=π_θ(y_i,t∣y_i,<t)π_θ_old(y_i,t∣y_i,<t)\rho\_{i,t}(\theta)=\frac{\pi\_{\theta}(y\_{i,t}\mid y\_{i,<t})}{\pi\_{\theta\_{\mathrm{old}}}(y\_{i,t}\mid y\_{i,<t})} 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 T_i\mathcal{T}\_{i} 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.

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 y∼π_θy\sim\pi\_{\theta}, the OPD objective is defined as:

L_OPD=E[∑_t∈T_i(log⁡π_θ(y_t∣y_<t)−log⁡π_teacher(y_t∣y_<t))],\mathcal{L}\_{\mathrm{OPD}}^{\mathrm{}}=\mathbb{E}\left[\sum\_{t\in\mathcal{T}\_{i}}\left(\log\pi\_{\theta}(y\_{t}\mid y\_{<t})-\log\pi\_{\mathrm{teacher}}(y\_{t}\mid y\_{<t})\right)\right],(4)

where π_θ\pi\_{\theta} is the student policy, π_teacher\pi\_{\mathrm{teacher}} is the teacher model, and T_i\mathcal{T}\_{i} 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.

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, Δ_k+1−Δ_k=O(η)\Delta\_{k+1}-\Delta\_{k}=O(\eta) where η\eta is the per-token distributional shift. In TIR, a single erroneous tool observation of length mm causes Δ_k+1−Δ_k=Ω(m⋅η_tool)\Delta\_{k+1}-\Delta\_{k}=\Omega(m\cdot\eta\_{\mathrm{tool}}) with η_tool≫η\eta\_{\mathrm{tool}}\gg\eta. Under jj consecutive tool errors, the divergence compounds super-linearly: Δ_k+j−Δ_k=Ω ⁣(∑_i=0j−1m_i⋅η_tool(i))\Delta\_{k+j}-\Delta\_{k}=\Omega\!\left(\sum\_{i=0}^{j-1}m\_{i}\cdot\eta\_{\mathrm{tool}}^{(i)}\right) with η_tool(i+1)≥η_tool(i)\eta\_{\mathrm{tool}}^{(i+1)}\geq\eta\_{\mathrm{tool}}^{(i)}.

Define the teacher-supported region S_tϵ={v∈V:π_teacher(v∣y_<t)≥ϵ}S\_{t}^{\epsilon}=\{v\in\mathcal{V}:\pi\_{\mathrm{teacher}}(v\mid y\_{<t})\geq\epsilon\} and the overlap ρ_t=∑_v∈S_tϵπ_θ(v∣y_<t)\rho\_{t}=\sum\_{v\in S\_{t}^{\epsilon}}\pi\_{\theta}(v\mid y\_{<t}). When ρ_t≤ρ\rho\_{t}\leq\rho, the second moment of the OPD loss satisfies E[ℓ_t2]≥(1−ρ) log⁡2(1/ϵ)\mathbb{E}[\ell\_{t}^{2}]\geq(1-\rho)\,\log^{2}(1/\epsilon), and the signal-to-noise ratio of the gradient estimator SNR(g_t)→0\mathrm{SNR}(g\_{t})\to 0 as ρ_t→0\rho\_{t}\to 0.

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 O((d_1/d_k)2)O((d\_{1}/d\_{k})^{2}), 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 a

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 K+1K+1 reasoning steps, where each step corresponds to a model response between two tool observations, or the final answer step. Let I_k\mathcal{I}\_{k} denote the set of token positions belonging to the kk-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 kk:

$$d_{k}=\frac{1}{\mathcal{I}_{k}}\sum_{t\in\mathcal{I}_{k}}\left

The score d_kd\_{k} serves as a lightweight indicator of the local reliability of teacher supervision. A small d_kd\_{k} suggests that the student remains well aligned with the teacher distribution, while a large d_kd\_{k} 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., w_1=1w\_{1}=1. For subsequent steps, the weight is:

w_k=min⁡ ⁣(w_1∏_u=1k−1d_u+ϵd_u+1+ϵ,1+δ),k≥2,w\_{k}=\min\!\left(w\_{1}\prod\_{u=1}^{k-1}\frac{d\_{u}+\epsilon}{d\_{u+1}+\epsilon},1+\delta\right),\quad k\geq 2,(7)

where ϵ\epsilon is a small constant for stability and δ\delta 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 Δ_k\Delta\_{k} suffices. We show in Section D.5 that d_kd\_{k} is monotonically consistent with Δ_k\Delta\_{k} and computable at zero marginal cost from the OPD forward pass. We therefore adopt d_kd\_{k} in place of Δ_k\Delta\_{k} in our implementation.

This weighting rule captures the evolution of student-teacher divergence along the trajectory. When the divergence increases, i.e., d_u+1>d_ud\_{u+1}>d\_{u}, 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 d_u+1<d_ud\_{u+1}<d\_{u}, the reweighting mechanism allows the distillation strength to increase accordingly, restoring informative guidance. To ensure stable optimization, the weight is upper-bounded by 1+δ1+\delta.

For a student-generated trajectory, the sampled-token OPD term at token tt is:

ℓ_OPD(y_t)=log⁡π_θ(y_t∣y_<t)−log⁡π_teacher(y_t∣y_<t).\ell\_{\mathrm{OPD}}(y\_{t})=\log\pi\_{\theta}(y\_{t}\mid y\_{<t})-\log\pi\_{\mathrm{teacher}}(y\_{t}\mid y\_{<t}).(8)

Instead of applying this term uniformly at step level, we reweight all tokens in step kk by the corresponding reliability weight w_kw\_{k}, leading to the step-wise OPD objective:

L_OPDstep=E_y∼π_θ[∑_k=1K+1w_k∑_t∈I_k(log⁡π_θ(y_t∣y_<t)−log⁡π_teacher(y_t∣y_<t))].\mathcal{L}\_{\mathrm{OPD}}^{\mathrm{step}}=\mathbb{E}\_{y\sim\pi\_{\theta}}\left[\sum\_{k=1}^{K+1}w\_{k}\sum\_{t\in\mathcal{I}\_{k}}\left(\log\pi\_{\theta}(y\_{t}\mid y\_{<t})-\log\pi\_{\mathrm{teacher}}(y\_{t}\mid y\_{<t})\right)\right].(9)

The final training objective is defined as:

L=L_GRPO+L_OPDstep.\mathcal{L}=\mathcal{L}\_{\mathrm{GRPO}}+\mathcal{L}\_{\mathrm{OPD}}^{\mathrm{step}}.(10)

Here, L_GRPO\mathcal{L}\_{\mathrm{GRPO}} provides sparse outcome-level rewards to drive trajectory exploration, while L_OPDstep\mathcal{L}\_{\mathrm{OPD}}^{\mathrm{step}} supplies dense token-level guidance whose strength is reweighted by the student-teacher divergence, jointly enabling stable learning under tool-induced state drift.

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).

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.

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.

±\pm1.34 60.42.

±\pm1.47 55.19.

±\pm0.81 63.13.

±\pm0.93 61.59

Distilled Student Models from the Qwen3 Series

0.6B Vanilla 7.71.

±\pm0.33 12.81.

±\pm0.38 13.24.

±\pm0.24 14.89.

±\pm0.29 12.16

SFT 5.67.

±\pm0.26 5.42.

±\pm0.22 15.20.

±\pm0.30 9.61.

±\pm0.27 8.97

GRPO 4.06.

±\pm0.37 4.90.

±\pm0.31 20.38.

±\pm0.47 15.95.

±\pm0.51 11.32

OPD 16.82.

±\pm0.81 22.95.

±\pm0.97 17.76.

±\pm0.41 22.65.

±\pm0.75 20.04

OPSDgt 12.63.

±\pm0.58 17.04.

±\pm0.64 17.32.

±\pm0.35 16.73.

±\pm0.44 15.93

OPSDhint 9.77.

±\pm0.43 14.12.

±\pm0.48 15.98.

±\pm0.30 12.65.

±\pm0.37 13.13

SOD 20.84.

±\pm0.90 26.13.

±\pm1.07 22.19.

±\pm0.59 27.72.

±\pm0.83 24.22

1.7B Vanilla 9.90.

±\pm0.38 8.96.

±\pm0.33 26.80.

±\pm0.36 22.73.

±\pm0.41 17.10

SFT 26.77.

±\pm0.66 22.40.

±\pm0.72 29.85.

±\pm0.51 24.63.

±\pm0.57 25.91

GRPO 25.63.

±\pm1.03 21.67.

±\pm1.12 33.55.

±\pm0.76 20.70.

±\pm0.87 25.39

OPD 43.86.

±\pm1.23 37.04.

±\pm1.31 31.73.

±\pm0.55 32.45.

±\pm0.93 36.27

OPSDgt 33.85.

±\pm0.88 24.69.

±\pm0.94 35.02.

±\pm0.67 22.73.

±\pm0.61 29.07

OPSDhint 34.42.

±\pm0.76 21.43.

±\pm0.83 33.46.

±\pm0.59 23.12.

±\pm0.52 28.11

SOD 50.83.

±\pm1.15 41.72.

±\pm1.24 38.72.

±\pm0.73 40.63.

±\pm0.91 42.98

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.

±\pm0.95 35.58.

±\pm1.01 30.12.

±\pm0.59 31.43.

±\pm0.68 34.70

(1.2) w/ Heuristic Weighting 44.96.

±\pm0.98 38.75.

±\pm1.04 31.14.

±\pm0.64 33.71.

±\pm0.72 37.14

(1.3) w/ Mask After Wrong 39.11.

±\pm1.08 31.59.

±\pm1.14 26.56.

±\pm0.67 30.12.

±\pm0.80 31.85

(1.4) w/o Weight Clipping 45.78.

±\pm1.16 37.93.

±\pm1.21 33.57.

±\pm0.74 35.12.

±\pm0.79 38.10

Training Objective

(2.1) w/o GRPO 48.87.

±\pm0.93 39.73.

±\pm1.02 35.89.

±\pm0.62 38.62.

±\pm0.71 40.78

(2.2) w/o Step-wise OPD 25.63.

±\pm1.03 21.67.

±\pm1.12 33.55.

±\pm0.76 20.70.

±\pm0.87 25.39

SOD 50.83.

±\pm1.15 41.72.

±\pm1.24 38.72.

±\pm0.73 40.63.

±\pm0.91 42.98

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 w_k=1w\_{k}=1 for all steps; (1.2) w/ Heuristic Weighting, which applies a fixed exponential decay w_k=γk−k_errw\_{k}=\gamma^{k-k\_{\mathrm{err}}} starting from the first erroneous tool call at step k_errk\_{\mathrm{err}}, with γ\gamma 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 δ\delta in Eq. 7. For Training Objective, we ablate the two terms in Eq. 10: (2.1) w/o GRPO, which removes L_GRPO\mathcal{L}\_{\mathrm{GRPO}}; and (2.2) w/o Step-wise OPD, which removes L_OPDstep\mathcal{L}\_{\mathrm{OPD}}^{\mathrm{step}}. 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.

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 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.

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.

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 d_kd\_{k} 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 .

Figure 5: Three distillation patterns of SOD .

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.

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.

  • [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.

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 π_θ\pi\_{\theta}, teacher policy π_teacher\pi\_{\mathrm{teacher}}, tool environment E\mathcal{E}, prompt set X\mathcal{X}, group size GG, smoothing constant ϵ\epsilon, weight cap δ\delta, clipping range ϵ_clip\epsilon\_{\mathrm{clip}}.

Output: Trained student policy π_θ\pi\_{\theta}.

Stage I: On-Policy Rollout with Tool Interaction

for each prompt x∈Xx\in\mathcal{X} do

  • •

    For i=1,…,Gi=1,\ldots,G: sample trajectory τ_i=(y_1,o_1,…,y_K,o_K,y_K+1)\tau\_{i}=(y\_{1},o\_{1},\ldots,y\_{K},o\_{K},y\_{K+1}) from π_θ_old\pi\_{\theta\_{\mathrm{old}}} by interacting with E\mathcal{E}.

  • •

    Compute outcome reward r_i=r(τ_i)r\_{i}=r(\tau\_{i}) for each trajectory.

  • •

    Compute group-relative advantage A^_i\hat{A}\_{i} via Eq. 2.

Stage II: Student-teacher Divergence and Step-wise Reweighting

for each trajectory τ_i\tau\_{i} do

  • •

    Partition model-generated tokens into reasoning steps {I_k}_k=1K+1\{\mathcal{I}\_{k}\}\_{k=1}^{K+1} (excluding tool observation tokens).

  • •

    For each step k=1,…,K+1k=1,\ldots,K{+}1, compute step-level divergence d_kd\_{k} via Eq. 6.

  • •

    Set w_1←1w\_{1}\leftarrow 1.

  • •

    For k=2,…,K+1k=2,\ldots,K{+}1, compute adaptive weight w_kw\_{k} via Eq. 7.

Stage III: Combined Optimization

  • [nosep,leftmargin=1.5em]

  • •

    Compute GRPO loss L_GRPO\mathcal{L}\_{\mathrm{GRPO}} with clipped surrogate objective ( Eq. 3) using advantages {A^_i}\{\hat{A}\_{i}\}.

  • •

    Compute step-wise OPD loss L_OPDstep\mathcal{L}\_{\mathrm{OPD}}^{\mathrm{step}} via Eq. 9 using weights {w_k}\{w\_{k}\}.

  • •

    Update policy parameters:

[2pt] θ←θ−η∇_θ(L_GRPO+L_OPDstep)\theta\leftarrow\theta-\eta\nabla\_{\theta}\big(\mathcal{L}\_{\mathrm{GRPO}}+\mathcal{L}\_{\mathrm{OPD}}^{\mathrm{step}}\big).- •

Synchronize old policy: θ_old←θ\theta\_{\mathrm{old}}\leftarrow\theta.

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 TypeDomainSource# Samples
SFT DatasetMathematicals1-1k [68]1k
CodingLeetCode [75]1k
Tool-useReTool [47]1k
Total3k
RL DatasetMathematicalDAPO-Math [69]17k
Skywork-or1 (Math) [70]4,902
CodingSkywork-or1 (Code) [70]3,586
ScientificMegaScience [71]3k
Total∼30k\sim\textbf{30k}

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 [0,999][0,999], 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.

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 L=L_GRPO+L_OPD\mathcal{L}=\mathcal{L}\_{\mathrm{GRPO}}+\mathcal{L}\_{\mathrm{OPD}} (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.

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 w_1w\_{1} is fixed as 1, the numerical stability constant ϵ=10−6\epsilon=10^{-6} and the upper-bound offset δ=0.2\delta=0.2 (allowing per-step weights w_k≤1+δw\_{k}\leq 1+\delta). 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.

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 8×\timesH20 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 8×\timesH20 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 d_kd\_{k} (Eq. 6) and adaptive weight w_kw\_{k} (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 O(K)O(K) scalar multiplications (K≈3K{\approx}3–77), requiring no extra forward pass. Peak memory is equivalent (<0.5<0.5 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 +4.9%+4.9\% overhead (1105.4s vs. 1053.6s), which is entirely acceptable given the significant performance gains (+18.50% improvement at average) over OPD.

GRPO exhibits ∼\sim1.4–1.5×\times 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 tt, we record the full sequence of adaptive weights {w_k}_k=1K\{w\_{k}\}\_{k=1}^{K} computed by SOD during that trajectory. We then classify each trajectory into one of three dominant patterns based on the overall shape of the w_kw\_{k} 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.

(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., L=L_GRPO+L_OPD\mathcal{L}=\mathcal{L}\_{\mathrm{GRPO}}+\mathcal{L}\_{\mathrm{OPD}}) 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.

±\pm1.05 35.83.

±\pm1.11 28.96.

±\pm0.58 29.81.

±\pm0.74 33.79

OPD 43.86.

±\pm1.23 37.04.

±\pm1.31 31.73.

±\pm0.55 32.45.

±\pm0.93 36.27

SOD (w/o GRPO) 48.87.

±\pm0.93 39.73.

±\pm1.02 35.89.

±\pm0.62 38.62.

±\pm0.71 40.78

SOD 50.83.

±\pm1.15 41.72.

±\pm1.24 38.72.

±\pm0.73 40.63.

±\pm0.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.

We adopt the notation established in Section 4.1. For notational convenience in the derivations below, we write p_t(⋅)=π_θ(⋅∣y_<t)p\_{t}(\cdot)=\pi\_{\theta}(\cdot\mid y\_{<t}) and q_t(⋅)=π_teacher(⋅∣y_<t)q\_{t}(\cdot)=\pi\_{\mathrm{teacher}}(\cdot\mid y\_{<t}) for the student and teacher next-token distributions conditioned on the student-generated prefix y_<ty\_{<t}. The token-level OPD loss is ℓ_t=log⁡p_t(y_t)−log⁡q_t(y_t)\ell\_{t}=\log p\_{t}(y\_{t})-\log q\_{t}(y\_{t}) with y_t∼p_ty\_{t}\sim p\_{t}. The step-level mismatch Δ_k\Delta\_{k}, the teacher-supported region S_tϵS\_{t}^{\epsilon}, and the overlap ρ_t\rho\_{t} are as defined in the main text.

We analyze how the step-level mismatch Δ_k=1∣I_k∣∑_t∈I_kD_KL(p_t∥q_t)\Delta\_{k}=\frac{1}{|\mathcal{I}\_{k}|}\sum\_{t\in\mathcal{I}\_{k}}D\_{\mathrm{KL}}(p\_{t}\|q\_{t}) evolves between consecutive steps in two settings.

In text-only generation, the prefix at position tt differs from position t−1t-1 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}}\leftp_{t}(v)-p_{t-1}(v)\right,$$

i.e., the maximum total variation (TV) distance between consecutive output distributions. For well-trained transformers, η\eta 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 O(η)O(\eta) per step transition.

In TIR, the transition from step kk to step k+1k+1 involves appending an entire tool observation o_k=(o_k1,…,o_km)o\_{k}=(o\_{k}^{1},\ldots,o\_{k}^{m}) of length m=∣o_k∣m=|o\_{k}| to the prefix:

y_<t_k+1start=y_<t_kend  ⊕  o_k,y\_{<t\_{k+1}^{\mathrm{start}}}=y\_{<t\_{k}^{\mathrm{end}}}\;\oplus\;o\_{k},(12)

where ⊕\oplus denotes concatenation. Crucially, o_ko\_{k} is produced by the external environment, not by either model. Let η_tool\eta\_{\mathrm{tool}} 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.

By the triangle inequality applied to the mm intermediate distributions between p_t_kendp\_{t\_{k}^{\mathrm{end}}} and p_t_k+1startp\_{t\_{k+1}^{\mathrm{start}}}, the total variation shift satisfies:

TV ⁣(p_t_k+1start,  p_t_kend)  ≤  m⋅η_tool.\mathrm{TV}\!\left(p\_{t\_{k+1}^{\mathrm{start}}},\;p\_{t\_{k}^{\mathrm{end}}}\right)\;\leq\;m\cdot\eta\_{\mathrm{tool}}.(13)

A similar bound holds for the teacher distribution. By Pinsker’s inequality (D_KL(P∥Q)≥2 TV(P,Q)2D\_{\mathrm{KL}}(P\|Q)\geq 2\,\mathrm{TV}(P,Q)^{2}), 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 (m≫1m\gg 1) and introduce content not generated by either model, we have η_tool>η\eta\_{\mathrm{tool}}>\eta in general, yielding:

Δ_k+1−Δ_k  =  Ω(m⋅η_tool)  ≥  O(η).\Delta\_{k+1}-\Delta\_{k}\;=\;\Omega(m\cdot\eta\_{\mathrm{tool}})\;\geq\;O(\eta).(14)

Note that even a single erroneous tool call already introduces a substantially larger divergence jump than text-only drift (Ω(m⋅η_tool)\Omega(m\cdot\eta\_{\mathrm{tool}}) vs. O(η)O(\eta)), since the observation length m≫1m\gg 1 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 kk; conditioned on the resulting erroneous observation, its subsequent reasoning is further degraded, increasing the probability of another failure at step k+1k+1. 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 p_errp\_{\mathrm{err}} under the teacher’s training distribution, the joint context of jj consecutive errors has probability at most p_errjp\_{\mathrm{err}}^{j}, an exponential decay in familiarity. It is this accumulated, multi-error prefix that drives the teacher’s conditional distribution far from calibration, making η_tool(i)\eta\_{\mathrm{tool}}^{(i)} grow with ii.

Formally, when the student makes consecutive erroneous tool calls across steps k,k+1,…,k+j−1k,k+1,\ldots,k+j-1, the cumulative divergence satisfies:

Δ_k+j−Δ_k  =  Ω ⁣(∑_i=0j−1m_k+i⋅η_tool(k+i)),\Delta\_{k+j}-\Delta\_{k}\;=\;\Omega\!\left(\sum\_{i=0}^{j-1}m\_{k+i}\cdot\eta\_{\mathrm{tool}}^{(k+i)}\right),(15)

where m_k+im\_{k+i} is the length of the ii-th erroneous observation and η_tool(k+i)\eta\_{\mathrm{tool}}^{(k+i)} is the corresponding per-token shift. Crucially, later errors induce progressively larger per-token shifts (η_tool(k+i+1)≥η_tool(k+i)\eta\_{\mathrm{tool}}^{(k+i+1)}\geq\eta\_{\mathrm{tool}}^{(k+i)}) 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. ∎

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 ℓ_t=log⁡p_t(y_t)−log⁡q_t(y_t)\ell\_{t}=\log p\_{t}(y\_{t})-\log q\_{t}(y\_{t}) under y_t∼p_ty\_{t}\sim p\_{t} decomposes over the vocabulary:

E_y_t∼p_t[ℓ_t2]  =  ∑_v∈Vp_t(v)(log⁡p_t(v)q_t(v))2.\mathbb{E}\_{y\_{t}\sim p\_{t}}[\ell\_{t}^{2}]\;=\;\sum\_{v\in\mathcal{V}}p\_{t}(v)\left(\log\frac{p\_{t}(v)}{q\_{t}(v)}\right)^{2}.(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 S_tϵ={v:q_t(v)≥ϵ}S\_{t}^{\epsilon}=\{v:q\_{t}(v)\geq\epsilon\} and its complement Sˉ_tϵ={v:q_t(v)<ϵ}\bar{S}\_{t}^{\epsilon}=\{v:q\_{t}(v)<\epsilon\}. By the overlap condition ρ_t≤ρ\rho\_{t}\leq\rho, the student places mass at least 1−ρ1-\rho on Sˉ_tϵ\bar{S}\_{t}^{\epsilon}:

∑_v∈Sˉ_tϵp_t(v)  ≥  1−ρ_t  ≥  1−ρ.\sum\_{v\in\bar{S}\_{t}^{\epsilon}}p\_{t}(v)\;\geq\;1-\rho\_{t}\;\geq\;1-\rho.(17)

Restricting the sum to Sˉ_tϵ\bar{S}\_{t}^{\epsilon} gives a lower bound:

E[ℓ_t2]  ≥  ∑_v∈Sˉ_tϵp_t(v)(log⁡p_t(v)q_t(v))2.\mathbb{E}[\ell\_{t}^{2}]\;\geq\;\sum\_{v\in\bar{S}\_{t}^{\epsilon}}p\_{t}(v)\left(\log\frac{p\_{t}(v)}{q\_{t}(v)}\right)^{2}.(18)

For any v∈Sˉ_tϵv\in\bar{S}\_{t}^{\epsilon}, since q_t(v)<ϵq\_{t}(v)<\epsilon, we have:

log⁡p_t(v)q_t(v)  >  log⁡p_t(v)+log⁡1ϵ.\log\frac{p\_{t}(v)}{q\_{t}(v)}\;>\;\log p\_{t}(v)+\log\frac{1}{\epsilon}.(19)

Define the conditional distribution p~(v)=p_t(v)/(1−ρ_t)\tilde{p}(v)=p\_{t}(v)/(1-\rho\_{t}) over Sˉ_tϵ\bar{S}\_{t}^{\epsilon}. By the convexity of x↦x2x\mapsto x^{2} and Jensen’s inequality:

E[ℓ_t2]\displaystyle\mathbb{E}[\ell\_{t}^{2}]  ≥  (1−ρ_t)∑_v∈Sˉ_tϵp~(v)(log⁡p_t(v)q_t(v))2\displaystyle\;\geq\;(1-\rho\_{t})\sum\_{v\in\bar{S}\_{t}^{\epsilon}}\tilde{p}(v)\left(\log\frac{p\_{t}(v)}{q\_{t}(v)}\right)^{2}
------------
  ≥  (1−ρ_t)(∑_v∈Sˉ_tϵp~(v)log⁡p_t(v)q_t(v))2\displaystyle\;\geq\;(1-\rho\_{t})\left(\sum\_{v\in\bar{S}\_{t}^{\epsilon}}\tilde{p}(v)\log\frac{p\_{t}(v)}{q\_{t}(v)}\right)^{2}
------------
  ≥  (1−ρ_t)(log⁡1ϵ+∑_v∈Sˉ_tϵp~(v)log⁡p_t(v))2.\displaystyle\;\geq\;(1-\rho\_{t})\left(\log\frac{1}{\epsilon}+\sum\_{v\in\bar{S}\_{t}^{\epsilon}}\tilde{p}(v)\log p\_{t}(v)\right)^{2}.

The term ∑_v∈Sˉ_tϵp~(v)log⁡p_t(v)=−H_Sˉ\sum\_{v\in\bar{S}\_{t}^{\epsilon}}\tilde{p}(v)\log p\_{t}(v)=-H\_{\bar{S}}, where H_SˉH\_{\bar{S}} is the conditional entropy of the student restricted to Sˉ_tϵ\bar{S}\_{t}^{\epsilon}, satisfying 0≤H_Sˉ≤log⁡∣V∣0\leq H\_{\bar{S}}\leq\log|\mathcal{V}|. For sufficiently small ϵ\epsilon satisfying ϵ<1/∣V∣\epsilon<1/|\mathcal{V}| (a natural condition since the teacher threshold should be below the uniform baseline), we have log⁡(1/ϵ)>log⁡∣V∣≥H_Sˉ\log(1/\epsilon)>\log|\mathcal{V}|\geq H\_{\bar{S}}, so the log⁡(1/ϵ)\log(1/\epsilon) 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 Ω(log⁡2(1/ϵ))\Omega(\log^{2}(1/\epsilon)) when ρ_t→0\rho\_{t}\to 0.

Let g_t=ℓ_t∇_θlog⁡π_θ(y_t∣y_<t)g\_{t}=\ell\_{t}\nabla\_{\theta}\log\pi\_{\theta}(y\_{t}\mid y\_{<t}) be the token-level OPD gradient estimator. The expected gradient is E[g_t]=∇_θD_KL(p_t∥q_t)\mathbb{E}[g\_{t}]=\nabla\_{\theta}D\_{\mathrm{KL}}(p\_{t}\|q\_{t}), which is bounded for any fixed distribution pair with finite KL divergence; let C=∥E[g_t]∥C=\|\mathbb{E}[g\_{t}]\|.

Define c_min⁡≜min⁡_v∥∇_θlog⁡π_θ(v∣y_<t)∥2>0c\_{\min}\triangleq\min\_{v}\|\nabla\_{\theta}\log\pi\_{\theta}(v\mid y\_{<t})\|^{2}>0, which is positive for any non-degenerate parameterization. The variance of the gradient estimator satisfies:

Var[∥g_t∥]  ≥  E[ℓ_t2]⋅c_min⁡−C2.\mathrm{Var}[\|g\_{t}\|]\;\geq\;\mathbb{E}[\ell\_{t}^{2}]\cdot c\_{\min}-C^{2}.(22)

Combining with the second-moment lower bound from Step 4:

SNR(g_t)  =  ∥E[g_t]∥Var[g_t]  ≤  C(1−ρ)log⁡2(1/ϵ)⋅c_min⁡−C2.\mathrm{SNR}(g\_{t})\;=\;\frac{\|\mathbb{E}[g\_{t}]\|}{\sqrt{\mathrm{Var}[g\_{t}]}}\;\leq\;\frac{C}{\sqrt{(1-\rho)\log^{2}(1/\epsilon)\cdot c\_{\min}-C^{2}}}.(23)

As ρ→0\rho\to 0, the denominator grows as O(log⁡(1/ϵ))O(\log(1/\epsilon)) while the numerator CC remains constant, giving SNR(g_t)→0\mathrm{SNR}(g\_{t})\to 0.

When the student drifts far from the teacher-supported region (ρ_t≈0\rho\_{t}\approx 0), most sampled tokens fall in Sˉ_tϵ\bar{S}\_{t}^{\epsilon} where the teacher assigns near-zero probability. The OPD loss for these tokens has large magnitude (due to −log⁡q_t(y_t)>log⁡(1/ϵ)-\log q\_{t}(y\_{t})>\log(1/\epsilon)) 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 S_tϵS\_{t}^{\epsilon} (where teacher guidance is calibrated) are sampled only with probability ρ_t\rho\_{t}, 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 (Ω(m⋅η_tool)\Omega(m\cdot\eta\_{\mathrm{tool}}) vs. O(η)O(\eta)), 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 (∼p_errj\sim p\_{\mathrm{err}}^{j} for jj 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 (ρ_t≈0\rho\_{t}\approx 0) 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 ρ_t\rho\_{t}, reliable teacher guidance) identically to corrupted post-error steps (low ρ_t\rho\_{t}, 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 (d_1≤d_2≤⋯≤d_kd\_{1}\leq d\_{2}\leq\cdots\leq d\_{k}), the weighted gradient contribution from step kk satisfies:

E[w_k2⋅ℓ_t2]  ≤  (d_1+ϵ)2(d_k+ϵ)2⋅E[ℓ_t2],\mathbb{E}[w\_{k}^{2}\cdot\ell\_{t}^{2}]\;\leq\;\frac{(d\_{1}+\epsilon)^{2}}{(d\_{k}+\epsilon)^{2}}\cdot\mathbb{E}[\ell\_{t}^{2}],(24)

where E[ℓ_t2]\mathbb{E}[\ell\_{t}^{2}] is the unweighted second moment from Proposition 2. Consequently, even when ρ_t→0\rho\_{t}\to 0 causes E[ℓ_t2]→∞\mathbb{E}[\ell\_{t}^{2}]\to\infty, the weighted contribution remains bounded whenever d_kd\_{k} grows proportionally to the divergence.

By the definition of w_kw\_{k} in Eq. (7):

w_k=min⁡ ⁣(∏_u=1k−1d_u+ϵd_u+1+ϵ,  1+δ).w\_{k}=\min\!\left(\prod\_{u=1}^{k-1}\frac{d\_{u}+\epsilon}{d\_{u+1}+\epsilon},\;1+\delta\right).(25)

Under monotonically increasing divergence (d_1≤d_2≤⋯≤d_kd\_{1}\leq d\_{2}\leq\cdots\leq d\_{k}), each ratio d_u+ϵd_u+1+ϵ≤1\frac{d\_{u}+\epsilon}{d\_{u+1}+\epsilon}\leq 1, and the product telescopes:

w_k  ≤  ∏_u=1k−1d_u+ϵd_u+1+ϵ  =  d_1+ϵd_k+ϵ.w\_{k}\;\leq\;\prod\_{u=1}^{k-1}\frac{d\_{u}+\epsilon}{d\_{u+1}+\epsilon}\;=\;\frac{d\_{1}+\epsilon}{d\_{k}+\epsilon}.(26)

The weighted second moment of the OPD loss at token t∈I_kt\in\mathcal{I}\_{k} is therefore:

E[w_k2⋅ℓ_t2]  ≤  (d_1+ϵd_k+ϵ)2⋅E[ℓ_t2].\mathbb{E}[w\_{k}^{2}\cdot\ell\_{t}^{2}]\;\leq\;\left(\frac{d\_{1}+\epsilon}{d\_{k}+\epsilon}\right)^{2}\cdot\mathbb{E}[\ell\_{t}^{2}].(27)

From Proposition 2, when the student drifts into low-overlap states, E[ℓ_t2]≥(1−ρ)log⁡2(1/ϵ_teacher)\mathbb{E}[\ell\_{t}^{2}]\geq(1-\rho)\log^{2}(1/\epsilon\_{\mathrm{teacher}}). However, such drift also implies that d_kd\_{k} increases (since d_kd\_{k} is monotonically related to Δ_k\Delta\_{k}, as shown in Appendix D.5). Specifically, when ρ_t→0\rho\_{t}\to 0, the per-token log-probability gaps grow, causing d_k≫d_1d\_{k}\gg d\_{1}. The weighted contribution thus satisfies:

E[w_k2⋅ℓ_t2]  ≤  (d_1+ϵ)2(d_k+ϵ)2⋅(1−ρ)log⁡2(1/ϵ_teacher).\mathbb{E}[w\_{k}^{2}\cdot\ell\_{t}^{2}]\;\leq\;\frac{(d\_{1}+\epsilon)^{2}}{(d\_{k}+\epsilon)^{2}}\cdot(1-\rho)\log^{2}(1/\epsilon\_{\mathrm{teacher}}).(28)

The key insight is that the numerator (d_1+ϵ)2(d\_{1}+\epsilon)^{2} is bounded (determined by the initial step’s divergence), while the denominator (d_k+ϵ)2(d\_{k}+\epsilon)^{2} grows with the accumulated drift. This creates an automatic variance suppression: the more the student diverges (larger d_kd\_{k}, larger E[ℓ_t2]\mathbb{E}[\ell\_{t}^{2}]), the more aggressively the weight w_kw\_{k} attenuates the contribution, preventing the variance explosion that afflicts OPD.

For the weighted gradient estimator g~_t=w_k⋅ℓ_t⋅∇_θlog⁡π_θ(y_t∣y_<t)\tilde{g}\_{t}=w\_{k}\cdot\ell\_{t}\cdot\nabla\_{\theta}\log\pi\_{\theta}(y\_{t}\mid y\_{<t}), the signal (expected gradient from well-aligned early steps where w_k≈1w\_{k}\approx 1) remains intact, while the noise from high-divergence later steps is suppressed by the factor (d_1+ϵ)2/(d_k+ϵ)2(d\_{1}+\epsilon)^{2}/(d\_{k}+\epsilon)^{2}. This restores a positive SNR for the aggregate gradient, in contrast to OPD where the SNR degrades to zero (Proposition 2). ∎

The above analysis addresses the erroneous case where divergence increases monotonically. In the recovery case (d_u+1<d_ud\_{u+1}<d\_{u} for some uu), the weight w_kw\_{k} may exceed 1, potentially amplifying the gradient contribution. However, the hard upper bound w_k≤1+δw\_{k}\leq 1+\delta in Eq. (7) ensures that the weighted second moment is always bounded by (1+δ)2⋅E[ℓ_t2](1+\delta)^{2}\cdot\mathbb{E}[\ell\_{t}^{2}]. Since recovery steps by definition have decreasing d_kd\_{k} (implying the student is returning to the teacher-supported region, i.e., ρ_t\rho\_{t} is increasing), the unweighted E[ℓ_t2]\mathbb{E}[\ell\_{t}^{2}] itself is decreasing in these steps. The combination of bounded amplification and decreasing base variance ensures optimization stability.

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 d_kd\_{k}) and attenuates their influence proportionally, ensuring that the gradient signal remains dominated by informative contributions from well-aligned steps. The upper bound 1+δ1+\delta further ensures that the recovery mechanism does not over-amplify any single step, maintaining optimization stability throughout training.

D.5 Justification of d_kd\_{k} as a Proxy for Δ_k\Delta\_{k}

Section titled “D.5 Justification of d_kd\_{k}d_k as a Proxy for Δ_k\Delta\_{k}Δ_k”

Computing the full KL divergence Δ_k\Delta\_{k} requires evaluating the teacher’s output distribution over the entire vocabulary at each token position, which introduces substantial overhead. In contrast, d_kd\_{k} (Eq. 6) only requires the teacher’s log-probability on the student-sampled token y_ty\_{t}, a quantity already computed in the standard OPD forward pass.

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 Δ_k\Delta\_{k}. When the student drifts further from the teacher (increasing Δ_k\Delta\_{k}), the per-token log-probability gaps increase in expectation, yielding a larger d_kd\_{k}. This monotonic relationship ensures that the ratios d_u/d_u+1d\_{u}/d\_{u+1} used in Eq. (7) correctly reflect the relative trend of divergence across steps.

The weight formula in Eq. (7) is a product of ratios d_u+ϵd_u+1+ϵ\frac{d\_{u}+\epsilon}{d\_{u+1}+\epsilon}, depending only on the relative magnitudes between consecutive steps. Any monotone transformation of Δ_k\Delta\_{k} preserves these ratios’ direction (above or below one), producing equivalent attenuation and recovery behavior. Since d_kd\_{k} maintains the ordering of Δ_k\Delta\_{k}, it is a sufficient statistic for our reweighting mechanism.

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].

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 H(π_teacher(⋅∣y_<t))H(\pi\_{\mathrm{teacher}}(\cdot\mid y\_{<t})) 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 0.850.85 to 2.142.14 across steps, with over 78% of tokens in the final step exceeding H=1.0H{=}1.0. 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.