WorksComputer Science
Reward-Aligned Distillation
Abstract
Reinforcement learning with verifiable rewards improves the reasoning capabilities of large language models, but remains computationally expensive and sample inefficient. On-policy distillation (OPD) provides dense token-level supervision from a stronger teacher, yet standard OPD distills every token regardless of whether the teacher's preference actually improves task reward. Existing token-selection methods rely on proxies such as uncertainty or teacher–student divergence, which need not identify reward-improving supervision. We introduce Reward-Aligned Distillation (RAD), a bilevel framework that weights distillation signals based on their predicted effect on the student's post-update reward. RAD differentiates through a temporary optimizer step to score each token's supervision, then updates the token weights by projected ascent from the initial token weights. The resulting weights can strengthen, suppress, or reverse individual distillation-gradient contributions. At a matched training-response budget, RAD improves mean accuracy on six competition-math benchmarks over the strongest baselines by 6.5 percentage points for Qwen3-1.7B (non-thinking) and 2.5 points for Qwen3-4B-Instruct-2507. RAD-Simple, a simplified variant, achieves comparable math accuracy at the same training-response budget. On LiveCodeBench-v6, RAD reaches 54.69% and 58.67% pass@1 with Qwen3-1.7B (non-thinking) and OLMo3-7B-Instruct, respectively, exceeding the strongest baselines by 8.7 and 6.4 points. These results support reward-guided weighting of teacher supervision across model families and tasks.
Figure 1. Reward-aligned distillation (RAD) consistently outperforms OPD and other baselines on mathematical reasoning and code generation tasks. The teachers are Qwen3-30B-A3B-Instruct-2507 for the Qwen student and OLMo3.1-32B-Instruct for the OLMo student. (a) Rollout-matched Qwen3-1.7B (non-thinking) results on both math and coding tasks (Table 1 and Table 8). (b) LiveCodeBench-v6 pass@1 for Qwen3-1.7B (non-thinking) and OLMo3-7B-Instruct, comparing RAD at step 100 with baselines at step 200. The grey bars show the strongest baselines, RLAD and GRPO, respectively; each RAD bar gives its gain over that baseline (pp). Dashed lines mark the corresponding teachers.
Introduction
Reinforcement learning with verifiable rewards (RLVR) has been shown effective for improving mathematical reasoning [33] and code generation [21, 11] abilities, but its supervision is sparse: a long response often receives only a single sequence-level reward [39, 13]. On-policy distillation offers a complementary signal by evaluating student-generated responses under a strong teacher and supplying dense token-level guidance [1, 12]. This approach is appealing because the student continues to explore on policy while learning from the teacher at every generated token.
Standard OPD, however, implicitly treats the teacher as the target policy and every teacher preference as worth imitating. This would be justified if the teacher were optimal for the target reward, but a stronger teacher need not be reward-optimal. Teacher–student differences may reflect style, formatting, verbosity, or reasoning choices that do not improve task reward [4]. Consequently, reducing teacher–student divergence does not guarantee reward improvement: uniform distillation can spend capacity matching reward-irrelevant behavior or move the student away from reward-improving solutions [44, 3].
The challenge is therefore to determine which teacher signals will benefit the student’s task performance. Token-selection methods [44, 42] use heuristic criteria such as uncertainty, teacher–student disagreement, and reasoning structure to selectively apply teacher supervision. These criteria identify potentially useful tokens, but do not directly assess whether the corresponding distillation update improves the student policy’s task reward. We therefore seek to choose each token’s distillation weight based on its predicted effect on reward: retain teacher signals that help the student solve the task, and suppress or reverse those that hinder it.
To this end, we introduce reward-aligned distillation (RAD), which weights teacher supervision by its predicted effect on task reward. Token weights affect reward indirectly, by controlling how the student learns from teacher supervision. RAD captures this dependency with a bilevel objective: the inner problem trains the student with weighted distillation, while the outer problem selects weights to maximize the trained student’s reward (Equation (2)). We approximate the inner optimization with one temporary optimizer step using token weights initialized to a tunable value. Differentiating the temporary student’s reward with respect to these weights yields look-ahead scores that guide a projected ascent update. The resulting signed weights can strengthen, suppress, or reverse individual distillation-gradient contributions.
Main Contributions.
We introduce Reward-Aligned Distillation (RAD), a bilevel framework that assigns bounded, signed token weights according to their predicted effect on task reward (§ 4.2). A one-step approximation yields optimizer-aware scores computed jointly through a single Jacobian–vector product (§ 4.3). We also introduce RAD-Simple, which simplifies token scoring by removing the lookahead update and reusing distillation rollouts (§ 4.5).
At matched training-response budgets, RAD and RAD-Simple improve mean accuracy across six math benchmarks over the strongest baselines by up to 6.48 and 3.55 percentage points for Qwen3-1.7B (non-thinking) and Qwen3-4B-Instruct-2507, respectively. On LiveCodeBench-v6, the corresponding pass@1 gains for RAD are 8.7 and 6.4 points for Qwen3-1.7B and OLMo3-7B-Instruct (§ 5).
We demonstrate compatibility with an alternative distillation signal by applying RAD to OPD2. This improves four-benchmark mean math accuracy by 2.66 and 6.51 percentage points for the 1.7B and 4B Qwen students, respectively (Section 6.3).
Related Work
On-policy distillation for LLMs. On-policy distillation queries a teacher on student-generated responses, reducing the training–inference mismatch of offline distillation [1, 12]. Related self-distillation methods obtain teacher signals from the student itself using privileged information such as verified solutions or environment feedback [40, 20, 48].
Unifying distillation and RLVR. KDRL [43] & RLAD [47] combine verifiable rewards with teacher guidance, while RG-OPD [3] uses verifier outcomes and teacher likelihoods to gate trajectory-level distillation. ExOPD [46] scales implicit teacher-derived rewards relative to KL regularization.
Token-selective distillation. TIP [44] selects tokens using uncertainty and teacher–student divergence, while DEAR [42] identifies decision tokens and supporting evidence. REOPOLD [26] combines teacher-derived reward clipping with entropy-guided token sampling. Armandpour et al. (2026) develop an offline diagnostic of reward–distillation alignment, estimating token-level -values by repeatedly sampling continuations after selected next-token choices, which is computationally expensive. They measure cosine similarity between local logit gradients and study oracle filtering of positively aligned tokens. RAD formulates token weighting as a bilevel optimization problem. A one-step approximation yields the sensitivity of post-update reward to each token’s weight, expressed as parameter-space alignment between its distillation gradient and an optimizer-adjusted reward direction. We estimate the reward gradient from minibatch rollouts, avoiding explicit branchwise -value estimation. Both the sign and magnitude of the resulting scores guide projected ascent on bounded, signed weights, which strengthen, suppress, or reverse distillation contributions during training. We compare against representative baselines from both reward-aware and token-selective distillation literature. Extended related work appears in Appendix § 10.
Background
Let denote a prompt sampled from the data distribution . We condition on and omit its outer expectation throughout for simplicity. Let denote the student model, be a response sampled from the student, and be the autoregressive state.
Reinforcement Learning with Verifiable Rewards
Reinforcement learning with verifiable rewards (RLVR) trains a policy to maximize rewards from verifiable outcomes, such as correct answers or passing code tests. Given a reward function , the expected-reward objective is defined as:
Several policy-gradient surrogates can be used to optimize this objective in RLVR, including proximal policy optimization (PPO) [38] and group relative policy optimization (GRPO) [39]. In this work, we use GRPO’s group-relative advantages to estimate the reward gradient. For each prompt, we sample responses from the student and normalize their rewards within the group: , , where is the group reward standard deviation. Every token in receives the same response-level advantage .
On-Policy Distillation
On-policy distillation (OPD) samples responses from the student and evaluates the teacher on the same student-generated states [1, 12]. For a fixed teacher , the reverse-KL objective is defined as:
Unlike GRPO’s sequence-level reward, OPD provides dense supervision at every generated token. Standard OPD, however, weights all token-level teacher signals equally. Moreover, minimizing alone provides no monotonic improvement guarantee for .
Reward-Aligned Distillation
Reward-Aligned Distillation (RAD) selects token-level distillation weights according to their predicted effect on task reward. We introduce the weighted objective (§4.1), then develop a bilevel formulation and its one-step approximation (§ 4.2). We extend the resulting scores to general optimizers and compute them efficiently using Jacobian–vector products (§ 4.3). Algorithm 1 summarizes our training recipe. Finally, we present RAD-Simple, a simplified variant using pre-update reward gradients and shared distillation rollouts (§ 4.5).
Token-Weighted Distillation
Let denote the sampling policy. Holding sampled prefixes fixed, we define the per-token distillation surrogate
Assigning real-valued token weights , with prompt dependence suppressed, gives the weighted objective
The weights can strengthen, suppress, or reverse individual distillation contributions. Uniform weights recover the fixed-prefix OPD surrogate. Appendix F derives the corresponding gradient.
Bilevel Token Weighting
Recall that our goal is to choose token weights in order to maximize the reward after distillation. This naturally leads to a bilevel optimization formulation:
The inner problem trains the student with weighted distillation, and the outer problem chooses weights to maximize the trained student’s reward. Solving the inner problem for each weight update is computationally infeasible. Therefore, we approximate its solution with one SGD ([36]) update from the current student, with learning rate :
At each iteration, we set the initial token weights for every token and denote the temporary student . For the sampled objective, differentiating the post-update reward through Equation (3) with respect to each token’s weight gives the token score, omitting the loss normalization:
Algorithm 1 Reward-aligned distillation (RAD)
Input: Student , teacher , reward , distillation coefficient , optimizer step , initial token weight , weight learning rate .
for each training iteration do
Sample from and score its tokens with the teacher.
Define weighted distillation loss , where is the number of valid response tokens in .
Initialize ; save parameters and optimizer state.
Take the temporary step .
Sample a separate meta batch from the training dataset, generate meta rollouts with , and estimate .
Compute using Equation (6).
Restore the original parameters and optimizer state.
Compute .
Update .
Train the student , with detached .
end for
A positive token score favors increasing the token’s weight, while a negative score favors decreasing it. We update the weights by one projected ascent step:
clips to the weights to be inside to prevent extreme outlier values and is the weight learning rate. We will discuss the choice of initial weight in the next section. We reset the weights to for each new iteration, discard the temporary update, and train the original student with the updated weights. Figure 2 summarizes the iteration.

Figure 2. One iteration of reward-aligned distillation (RAD), illustrated with SGD. (1) Starting from student , assign the initial token weight to every token. (2) Take one temporary step on the weighted distillation objective to obtain , as in Equation (3). (3) Sample separate meta rollouts from to estimate the post-update reward gradient. (4) Differentiate this reward through the temporary step to score each token using Equation (4). Positive scores increase token weights and negative scores decrease them; projected ascent clips the updated weights to , as in Equation (5). (5) Discard the temporary update and take one weighted distillation step from the original . Reset the weights to for the next batch.
Optimizer-Aware Scoring via Jacobian–Vector Product (JVP)
We now extend the SGD derivation to general optimizers, including AdamW (Loshchilov & Hutter [32]), which is widely used in LLM training. This extension accounts for how the student optimizer transforms the weighted distillation gradient. Let denote the parameters returned by one optimizer step with gradient , treating the pre-step optimizer state as fixed. Define . The one-step approximation becomes
We evaluate the token-weight derivatives at , writing and . Similar to Equation (4), differentiating the post-update reward through this optimizer step gives the optimizer-aware token score,
For SGD, , recovering Equation (4). At , the distillation gradient vanishes, so plain SGD without momentum or weight decay gives . AdamW can still move through its existing moments and decoupled weight decay; token-weight derivatives can remain nonzero in either case. For AdamW, we differentiate through the moment updates and gradient clipping; the derivation is in Appendix G. Let collect the per-token surrogates. We compute all scores together using one JVP:
The AdamW-specialized JVP is given in Equation (13). We implement a custom Triton kernel for the flash attention JVP; Appendix H gives the derivation and pseudocode (Algorithm 2).
Choice of initial token weight. The initial token weight determines both the temporary distillation update and the starting point for projected ascent. Under the symmetric constraint , starts from uniform weights and learns a weight perturbation around within , while starts from zero weights and permits signed weights in . We treat as a hyperparameter that may vary between iterations. Appendix A.3 compares these initialization choices. Experiments indicate that learns slower than but can achieve better final performance. Gradually expanding the negative range from to for can help balance learning speed and performance.
RAD Training Algorithm
Distillation rollouts are used to update the student, whereas meta rollouts are used to estimate the reward gradient for token weighting. Both prompt batches are sampled from the same training dataset.
RAD’s bilevel formulation makes token weighting depend on the student’s post-update reward, introducing additional computation before each weighted distillation update. At each step, we take a temporary AdamW step with initial token weights , generate separate meta rollouts, and estimate the reward gradient using GRPO objective. We compute the optimizer-aware token scores via a JVP (Equation (7)), update the weights with Equation (5), and train the original student with the updated weights. The meta batch is only used to learn the token weights; the committed student update uses the distillation rollouts. Algorithm 1 summarizes the procedure of RAD, and Appendix A.2 gives the batch objective and implementation details. RAD can in principle combine any differentiable token-level OPD objective with any RLVR gradient estimator. Section 6.3 demonstrates compatibility with the OPD ([17]) distillation signal.
RAD-Simple: A Simplified Variant of RAD
The bilevel formulation adds a temporary optimizer update, meta rollouts, a reward-gradient computation, and a JVP to standard OPD. To simplify token scoring, RAD-Simple estimates the pre-update reward gradient by reusing the distillation rollouts. Replacing the post-update reward gradient in Equation (4) by the pre-update reward gradient gives
We omit the common factor , which can be absorbed into the weight learning rate , and use the same projected weight update in Equation (5). RAD-Simple also omits the optimizer Jacobian, while the student update still uses AdamW. Reusing the distillation rollouts avoids the temporary student update and separate meta rollout generation, halving the number of training responses per step. The only additional computation compared with OPD are reward-gradient estimation and a JVP. RAD-Simple ignores changes in the reward gradient after distillation and the optimizer’s effect on token scores. Table 1 compares RAD-Simple with RAD at a matched training-response budget.
| Method | AIME24 | AIME25 | AIME26 | HMMT25 Feb | HMMT25 Nov | Olympiad Bench | Mean | Time (h) |
| Teacher | — | |||||||
| Student: Qwen3-1.7B (non-thinking) | ||||||||
| Base | — | |||||||
| GRPO | 5.12 | |||||||
| OPD | 14.28 | |||||||
| TIP | 34.09 | |||||||
| RLAD | 14.11 | |||||||
| ExOPD | 51.02 | |||||||
| RAD | 16.66 | |||||||
| RAD-Simple | 32.48 | |||||||
| vs. best baseline | (+7.50) | (+4.38) | (+7.71) | (+4.79) | (+5.42) | (+4.92) | (+6.48) | — |
| Student: Qwen3-4B-Instruct-2507 | ||||||||
| Base | — | |||||||
| GRPO | 14.77 | |||||||
| OPD | 12.47 | |||||||
| TIP | 24.46 | |||||||
| RLAD | 13.30 | |||||||
| ExOPD | 39.61 | |||||||
| RAD | 26.79 | |||||||
| RAD-Simple | 27.88 | |||||||
| vs. best baseline | (+3.96) | (+6.88) | (+1.67) | (+5.42) | (+3.54) | (+1.71) | (+3.55) | — |
Table 1. Math accuracy (%): RAD at step 100 versus baselines and RAD-Simple at step 200. Values are mean standard deviation over 16 sampled responses; Mean equally weights six benchmarks. Bold/underline mark the best/second-best trained means, with ties sharing a rank. Parentheses give gains of the higher RAD or RAD-Simple score in each column over the best baselines. Time denotes total training time in hours.
Experiments
We describe the experimental setup and evaluation protocol, then present math and coding results. Implementation details, including inference hyperparameters, appear in Appendix A.
Experimental Settings
We evaluate RAD on mathematical reasoning and code generation, and additionally evaluate RAD-Simple on mathematical reasoning.
Models. For mathematical reasoning, we use Qwen3-30B-A3B-Instruct-2507 as the teacher and Qwen3-1.7B (non-thinking) and Qwen3-4B-Instruct-2507 as students ([45]). For code generation, we evaluate Qwen3-1.7B (non-thinking) with the same teacher, and OLMo3-7B-Instruct with OLMo3.1-32B-Instruct as its teacher.
Training protocol. We train with verl ([41]) using 64 prompts and eight responses per prompt. Within each domain and student setting, all methods share the training data, student initialization, rollout group size, sampling configuration, and optimizer settings. RAD additionally samples an equally sized, separate meta batch from the temporary student and updates token weights using exact JVPs. We compare 100 RAD updates with 200 baseline updates, matching the generated training responses, including RAD’s meta rollouts. At this budget, RAD uses 17–18% more training time than OPD and ReLoD on Qwen3-1.7B math, but less than TIP and EXPOPD. On OLMo3-7B coding, RAD uses 18–39% less training time than the reported baselines (Table 11). RAD uses the initial token weight in the main math and coding comparisons, with an additional cosine schedule of negative range for coding. Shared and method-specific settings appear in Appendix § 9.§ 1.
Baselines. We compare RAD and RAD-Simple with GRPO Shao et al., [39], OPD Agarwal et al., [1], TIP Xu et al., [44], RLAD Zhang et al., [47], and ExOPD Yang et al., [46]. Given the higher training cost of the OLMo-3-7B setting (Table 11), we retain GRPO and OPD as reference methods, with TIP and RLAD representing strongest token-selective and reward-aware distillation baselines, respectively. Baseline-specific hyperparameters follow the respective papers.
| Method | Steps | Student GPUs | Qwen3-1.7B (non-thinking), math | OLMo3-7B-Instruct Coding |
| OPD | 200 | 6 | 14.28 | 136.51 |
| TIP | 200 | 6 | 34.09 | 166.79 |
| RLAD | 200 | 6 | 14.11 | 123.81 |
| ExOPD | 200 | 6 | 51.02 | — |
| OPD2 | 200 | 4 | 33.99 | — |
| RAD | 100 | 6 | 16.66 | 101.61 |
| RAD-Simple | 200 | 6 | 32.48 | — |
Table 11.
Mathematical reasoning. Following ExOPD Yang et al., [46], we train on 57,046 problems from DeepMath-103K He et al., [15] with difficulty ratings of at least 6. We evaluate on AIME24 (AoPS, 2024), AIME25 [34], AIME26, HMMT2025-Feb, HMMT2025-Nov Balunovic et al., [5], and OlympiadBench He et al., [14]. We sample 16 responses per problem at temperature 1.0 and top- 1.0, with a 32,768-token generation limit. Responses are graded with Math-Verify 3, and pass @1 is estimated as the fraction of sampled responses that are correct. The overall score is the unweighted mean across the six benchmarks.
Code generation. We train on the Eurus code split Cui et al., [9], assigning reward 1 when all tests pass and 0 otherwise. We evaluate on all 1,055 LiveCodeBench-v6 tasks Jain et al., [22]. Following ExOPD Yang et al., [46], we sample four responses per task at temperature 1.0 and top- 1.0, with a 32,768-token generation limit. Dataset statistics appear in Table 5.
| Domain | Use | Dataset | # Problems | Responses / prompt | Metric |
| Math | Train | DeepMath-103K, level | 57,046 | 8 | Binary correctness reward |
| Math | Eval | AIME24 | 30 | 16 | pass@1 accuracy (Math-Verify) |
| Math | Eval | AIME25 | 30 | 16 | pass@1 accuracy (Math-Verify) |
| Math | Eval | AIME26 | 30 | 16 | pass@1 accuracy (Math-Verify) |
| Math | Eval | HMMT2025-Feb | 30 | 16 | pass@1 accuracy (Math-Verify) |
| Math | Eval | HMMT2025-Nov | 30 | 16 | pass@1 accuracy (Math-Verify) |
| Math | Eval | OlympiadBench | 675 | 16 | pass@1 accuracy (Math-Verify) |
| Code | Train | Eurus code split (APPS, CodeContests, Codeforces, and TACO) | 25,276 | 8 | Binary all-tests-pass reward |
| Code | Val | APPS | 142 | 1 | pass@1 functional correctness |
| Code | Val | CodeContests | 377 | 1 | pass@1 functional correctness |
| Code | Val | Codeforces | 123 | 1 | pass@1 functional correctness |
| Code | Val | TACO | 382 | 1 | pass@1 functional correctness |
| Code | Eval | LiveCodeBench-v6 | 1,055 | 4 | pass@1 functional correctness (native execution) |
Table 5. Dataset statistics and evaluation metrics. Counts denote dataset examples or tasks; responses per prompt are sampled whenever a prompt is selected. RAD additionally samples an independent outer batch of 64 meta prompts with eight responses each (512 responses). Coding training and validation counts refer to the Eurus split before model-specific prompt-length filtering.
Mathematical Reasoning Results
At the matched training-response budget (Table 1), RAD reaches 39.07% mean accuracy with Qwen3-1.7B (non-thinking), exceeding the strongest baseline, ExOPD at 32.59%, by 6.48 points. With Qwen3-4B-Instruct-2507, RAD reaches 59.80%, exceeding the strongest baseline, GRPO at 57.29%, by 2.51 points. The corresponding gains over OPD are 8.01 and 6.71 points. Figure 3 tracks both students on four benchmarks (AIME24/25 and HMMT2025-Feb/Nov). For the 1.7B student, RAD improves more slowly early in training but continues to improve as the distillation baselines plateau or decline. For the 4B student, RAD exceeds all baselines from step 30 onward. RAD-Simple trails RAD at 100 updates for both students but continues to improve, reaching comparable accuracy at 200 updates.
Figure 3. Math evaluation dynamics for Qwen3-1.7B (non-thinking) in the left panel and Qwen3-4B-Instruct-2507 in the right panel, averaged equally over AIME24/25 and HMMT2025-Feb/Nov. Distillation baselines tend to plateau or decline early, while GRPO improves slowly. RAD reaches a higher peak within 100 updates than these baselines achieve over 200 updates.
At the same training-response budget, RAD-Simple reaches and mean accuracy after 200 updates for the 1.7B and 4B students, respectively (Table 1). These results are 0.65 points below and 1.04 points above RAD at step 100, respectively, and exceed the strongest baselines by 5.83 and 3.55 points. This shows that the simpler pre-update scores can also support effective token weighting. However, within the same 100 training steps, RAD-Simple learns slower than RAD as shown in Figure 3. RAD-Simple removes the temporary optimizer update and separate meta rollouts, and computes token scores using the current-policy reward gradient without the optimizer Jacobian. It achieves similar math accuracy at a matched generated-response budget, but requires more training time for Qwen3-1.7B. This trade-off supports the practical value of RAD’s full scoring procedure: additional computation for estimating token weights can improve overall training efficiency.
For Qwen3-4B-Instruct-2507, OPD reaches 53.09% at step 200, slightly above the base student’s 52.38%, while TIP, RLAD, and ExOPD perform below the base student. Similar degradation of OPD and ExOPD is observed in Heo et al. [17] (Table 4 and Table 5). RAD’s gain in this setting supports using post-update reward to guide the contribution of each teacher signal even when the initial teacher–student gap is small.
| Method | Qwen3-1.7B (non-thinking) | Qwen3-4B-Instruct-2507 |
| Teacher | 59.79 | 59.79 |
| Base | 8.23 | 47.34 |
| Uniform OPD | 25.42 | 47.81 |
| OPD | 28.33 | 53.13 |
| OPD + RAD | 30.99 | 59.64 |
| vs. OPD | +2.66 | +6.51 |
Table 4. RAD compatibility with OPD: RAD at step 100 versus baselines at step 200. Values are mean math accuracy over AIME24/25 and HMMT2025-Feb/Nov.
Appendix § 13.§ 3 additionally compares RAD with baselines with a matched training time. Figure 10 in Appendix § 13.§ 4 compares RAD at step 90 with GRPO at step 450 on math and coding, with GRPO using as many generated training responses. Appendix § 13 compares total training times for Qwen3-1.7B (non-thinking) on math and OLMo3-7B-Instruct on coding, and reports a RAD training-time breakdown for Qwen3-1.7B (non-thinking).
Figure 10. Evaluation during extended training for Qwen3-1.7B (non-thinking). Left: math; right: coding. Math averages AIME24/25 and HMMT2025-Feb/Nov with 16 responses per problem. Coding reports pass@1 on all 1,024 Eurus validation problems. RAD is shown through step 90; GRPO is shown through step 450 in both math and coding. The vertical line marks step 90.
Code Generation Results
Figure 4 compares both students across varying difficulty tiers on full LiveCodeBench-v6. Appendix § 11.§ 1 reports the full numerical results (Table 8). RAD with Qwen3-1.7B (non-thinking) reaches pass@1 at step 100, compared with for RLAD, the strongest step-200 baseline. RAD also leads the five evaluated baselines on Easy, Medium, and Hard. Appendix § 11.§ 2 reports Qwen3-1.7B (non-thinking) coding-validation dynamics and checkpoint results.
Figure 4. LiveCodeBench-v6 pass@1 (%) by difficulty, comparing RAD at step 100 with baselines at step 200. RAD outperforms the baselines across all difficulty levels for both student models. Numbers above RAD’s bars give its improvement over the best baseline in that tier (percentage points). Error bars show ±1 standard deviation over four sampled responses; black lines mark available teacher means. Table 8 reports the full means and standard deviations.
| Method | Easy (322) | Medium (383) | Hard (350) | Overall (1,055) |
| Student: Qwen3-1.7B (non-thinking) | ||||
| Teacher | ||||
| Base (student) | ||||
| GRPO | ||||
| OPD | ||||
| TIP | ||||
| RLAD | ||||
| ExOPD | ||||
| RAD (ours) | ||||
| vs. best baseline | (+3.34) | (+12.53) | (+9.50) | (+8.72) |
| Student: OLMo3-7B-Instruct | ||||
| Teacher | ||||
| Base (student) | ||||
| GRPO | ||||
| OPD | ||||
| TIP | ||||
| RLAD | ||||
| RAD (ours) | ||||
| vs. best baseline | (+4.97) | (+9.40) | (+4.29) | (+6.40) |
Table 8. Full LiveCodeBench-v6 pass@1 (%; mean ± standard deviation over four sample positions), comparing RAD at step 100 with baselines at step 200. Bold/underline: best/second-best trained means; parentheses: gains of RAD in each column over the best evaluated baseline (pp, before rounding).
With OLMo3-7B-Instruct, RAD reaches 58.67 ± 0.52% on full LiveCodeBench-v6 at step 100, exceeding GRPO at 52.27 ± 0.26%, the strongest completed step-200 baseline, by 6.40 points. These results extend the coding comparison to a different model family and a larger student. Appendix § 11.§ 3 reports OLMo3-7B-Instruct coding-validation dynamics and checkpoint results.
Preliminary experiments also extend RAD to agentic software engineering. On SWE-bench Verified, RAD achieves 50.5% pass@1, outperforming the strongest baseline by 3.7 percentage points while training for half as many epochs (Appendix § 12).
Analysis and Extensions
In this section, we examine which components drive RAD’s performance, how token reweighting affects gradient alignment, and whether RAD extends to other distillation signals.
RQ1: Which components contribute to RAD’s performance?
We ablate RAD using Qwen3-1.7B (non-thinking) with after 100 updates on AIME24/25 and HMMT2025-Feb/Nov (Table 2). Reversing scores or shuffling weights reduces accuracy from 32.71% to 0.36% and 6.35%, respectively, supporting token-specific alignment. Restricting weights to yields 25.00%, while gradually introducing negative weights achieves 31.20%. Replacing AdamW lookahead with SGD yields 16.88%. These comparisons support signed weights and optimizer-aware scoring in this setting.
| Variant | Change from RAD | Acc. (%) | Δ (pp) |
| RAD | AdamW lookahead; separate meta rollouts | 32.71 | — |
| Negative score | Reverse the score: | 0.36 | (−32.34) |
| Shuffled weights | Permute weights within each response | 6.35 | (−26.35) |
| Positive only | Restrict weights to | 25.00 | (−7.71) |
| Negative-bound warmup | Cosine lower bound: over 50 steps | 31.20 | (−1.51) |
| Pre-update gradient | Reward gradient before the temporary update | 34.32 | (+1.61) |
| + rollout reuse | Pre-update reward grad; reuse distillation rollouts | 18.54 | (−14.17) |
| SGD lookahead | SGD lookahead update | 16.88 | (−15.83) |
Table 2. Qwen3-1.7B (non-thinking) math ablations at step 100 (): mean accuracy over the four benchmarks (AIME24/25 and HMMT2025-Feb/Nov). Reversing scores or shuffling weights sharply reduces accuracy. Variants use separate meta rollouts unless rollout reuse is specified. Δ (pp) denotes difference from RAD. Bold/underline: best/second-best displayed means.
Evaluating the reward gradient before the temporary update achieves 34.32%, comparable to RAD. However, it achieves 47.19% compared with 55.26% of RAD for Qwen3-4B-Instruct-2507, showing the benefit depends on the student setting. Reusing distillation rollouts further reduces accuracy to 18.54%, but also halves the generated responses per update. We next examine how token reweighting changes gradient alignment in RAD and RAD-Simple.
RQ2: Does token reweighting improve gradient alignment?
We compare uniform weights and learned token weights at fixed Qwen3-1.7B (non-thinking) math checkpoints at steps 0 and 100. We measure cosine alignment between distillation descent direction (negative distillation gradient), , and RAD’s optimizer-aware reward direction (Equation (6)), and current student’s reward direction .
Table 3 shows that reweighting increases cosine with for RAD and for RAD-Simple at both checkpoints. RAD’s cosine with decreases: RAD’s token weights target the optimizer-aware reward direction , which accounts for how changes in the distillation gradient affect post-update reward, rather than the immediate reward gradient.
| Method | Step | Uniform | Reweighted |
| Cosine with | |||
| RAD | 0 | ||
| RAD | 100 | ||
| Cosine with | |||
| RAD | 0 | ||
| RAD | 100 | ||
| RAD-Simple | 0 | ||
| RAD-Simple | 100 |
Table 3. Cosine between distillation descent direction and the reward direction. Uniform uses ; reweighted uses the learned token weights.
RQ3: Is RAD compatible with other distillation signals?
We apply RAD’s token weighting to OPD ([17]), which derives supervision from an instruction-tuned teacher and its paired base model. We evaluate on the same four math benchmarks; implementation details appear in Appendix A.1.
Table 4 compares OPD + RAD after 100 updates with uniform OPD and OPD after 200 updates, matching the number of generated training responses. Adding RAD improves OPD, supporting its compatibility with an alternative distillation signal. For Qwen3-4B-Instruct-2507, the combined method also approaches teacher accuracy (Figure 5).

Figure 5. OPD evaluation dynamics for Qwen3-4B-Instruct-2507, using Table 4’s benchmarks. Horizontal lines mark the initial student and teacher. OPD + RAD approaches teacher accuracy at step 100.
Conclusion and Future Work
RAD uses optimizer-aware lookahead scores and projected ascent to align token-level distillation with reward. It improves math and coding accuracy at a matched training-response budget. Results with OLMo3-7B-Instruct extend the evidence to a different model family and a larger student, while OPD{sup}2` results support compatibility with other distillation signals. RAD-Simple reuses distillation rollouts and removes the temporary update; it improves over the strongest math baselines for both Qwen students at the same training-response budget, demonstrating the effectiveness of simpler token scoring in these settings.
Limitations and future work. RAD requires a temporary student update, fresh outer rollouts, and an exact JVP, increasing its per-step cost relative to standard OPD. RAD-Simple removes the temporary update and fresh outer rollouts but still requires reward-gradient estimation and a JVP. Further reducing these costs and understanding when optimizer-aware lookahead is beneficial remain important directions. Future work should explore longer training horizons, and learned or non-verifiable rewards.
Experimental Details and Additional Math Results
Training Settings
Shared training setup. The reported main math and coding experiments use eight NVIDIA H100 GPUs. Each update uses 64 actor prompts with eight responses per prompt; RAD additionally samples 64 separate meta prompts with eight responses each. Table 6 and Table 7 summarize the shared and method-specific math hyperparameters. We describe the datasets first, followed by the baseline implementations and RAD weight settings.
| Hyperparameter | Value |
| Training prompts per step | 64 |
| Rollouts per prompt | 8 |
| Actor epochs | 1 |
| Maximum prompt length | 2,048 |
| Maximum response length | 32,768 |
| Training temperature | 1.0 |
| Training top- | 1.0 |
| Optimizer | AdamW |
| Learning rate | |
| Weight decay | 0.01 |
| Global gradient clipping | 1.0 |
| Random seed | 42 |
| RAD / baseline steps | 100 / 200 |
| Evaluation interval | 10 steps |
| Responses per eval problem | 16 |
Table 6. Shared math training hyperparameters.
| Hyperparameter | Value |
| Distillation coefficient (RAD / baselines) | 0.1 |
| RAD: meta prompts | 64 |
| RAD: initial token weight | 0 |
| RAD: weight learning rate | |
| TIP retention ratio | 0.5 |
| RLAD | 0.5 |
| RLAD teacher log-ratio clamp | 1.0 |
| RLAD clipping thresholds | 0.20 / 0.28 |
| ExOPD | 1.25 |
Table 7. Method-specific math hyperparameters. and count valid response tokens in the first and current actor batches.
Math datasets and evaluation. Dataset sizes and evaluation metrics are listed in Table 5. For AIME26, we use the 30-problem MathArena snapshot with two upstream-confirmed transcription corrections. For OlympiadBench, we use the 675-problem Qwen2.5-Math evaluation snapshot.
Coding data. The Eurus code split is assembled from APPS ([16]), CodeContests ([30]), Codeforces (Codeforces), and TACO ([29]). The coding results in Table 8 to Table 10 use 25,276 training examples and 1,024 validation examples (Table 5).
Table 10: OLMo3-7B-Instruct coding-validation pass@1 (%) over 1,024 Eurus problems, with one response per problem and one training run per method. Bold/underline: best/second-best reported value per column, with ties sharing a rank; dashes: unavailable. Parentheses give RAD’s step-100 gain over the best available baseline at the indicated step (percentage points, before rounding).
| Method | Step 100 | Step 200 |
| GRPO | 34.28 | 35.84 |
| OPD | 33.20 | 33.01 |
| TIP | 27.44 | 25.68 |
| RLAD | 34.28 | 33.98 |
| RAD (ours) | 40.23 | — |
| Δ vs. best baseline | (+5.96) | (+4.39) |
Table 10.
Coding evaluation. LiveCodeBench-v6 contains 322 easy, 383 medium, and 350 hard tasks. Evaluation uses a 40,960-token context limit for the combined prompt and response, with at most 32,768 generated tokens per response. The main coding comparison reports RAD at step 100 and baselines at step 200.
Baseline implementations. GRPO optimizes task reward without teacher guidance, while OPD applies reverse-KL distillation uniformly to all response tokens. TIP uses Soft-OR selection with 50% token retention. RLAD modifies the clipped GRPO update with a teacher-aware policy ratio. ExOPD constructs a reward-extrapolated reverse-KL advantage using frozen student and teacher base policies. OPD, RLAD, ExOPD, and RAD use sampled-action estimates of reverse KL, while TIP uses full-vocabulary reverse KL as in their paper.
RAD weight settings. For the math and coding experiments, RAD uses distillation coefficient to prevent excessively frequent gradient clipping, and weight learning rate in Equation (5). Here and are the numbers of valid response tokens in the first and current actor batches, respectively. The unprojected weight change is : the score already includes the optimizer learning rate through the optimizer Jacobian and the scaling of the estimated outer reward gradient. The weight learning rate should therefore be interpreted together with this score scale; the resulting weights are clipped to the specified interval. We apply no further weight normalization. Both math runs use the fixed initial token weight and clipping interval . These are experimental settings, while Equation (5) keeps configurable. For RAD-Simple on math, we use and for both Qwen3-1.7B (non-thinking) and Qwen3-4B-Instruct-2507. Both use and clipping interval throughout 200 updates.
The Qwen3-1.7B (non-thinking) coding RAD run uses the same weight learning rate with distillation coefficient , without further weight normalization. It keeps the teacher’s thinking prefix, uses the initial token weight , and clips weights to an upper bound of 1 and a lower bound that follows a cosine schedule from 0 to over the first 50 steps. The initial token weight stays fixed throughout this clipping-bound schedule, which gradually permits negative weights. The OLMo coding run uses the same initial token weight and clipping schedule (Appendix § 11.§ 3).
OPD2 compatibility settings. For the OPD2 compatibility experiment, the teacher pair is Qwen3-30B-A3B-Instruct-2507 and Qwen3-30B-A3B-Base. Our local implementation uses frozen-student TopK64 support and global token-mean reduction, with distillation coefficient for both OPD2 and OPD2 + RAD. The RAD variant uses a cosine schedule for the initial token weight from 1 to 0, a clipping radius of 1 around , and weight learning rate . This schedule changes both the initial token weight and the clipping interval, moving the latter from to . Each step uses 64 actor prompts with eight responses each; RAD additionally uses 64 meta prompts with eight responses each. We compare OPD2 + RAD at step 100 with uniform OPD and OPD2 at step 200.
Implementation Details
Batch objective. Let be the current student rollout batch, with prefixes , and let be its number of valid response tokens. The temporary and committed updates use the normalized batch objective
where is the distillation coefficient. We keep the loss normalization fixed when differentiating with respect to the weights. The exact weight derivative is , (Equation (11)). We update the weights using the scores directly with the separately specified weight learning rate in Equation (5). We also apply a detached token-level rollout/training importance correction clipped at 5, omitted from the notation. The weights are detached for the committed student update.
JVP backends. The flash_triton attention implementation combines a FlashAttention forward pass with a custom Triton kernel for the attention JVP (Algorithm 2). The Qwen3-1.7B (non-thinking) and Qwen3-4B-Instruct-2507 RAD experiments use this implementation to compute the model JVP on a temporary full student replica with its parameter direction. The olmo3_layer_streamed backend, used for OLMo3-7B-Instruct RAD coding, computes the model JVP one layer at a time: it gathers each parameter group and its direction, propagates activations and their tangents, and releases the gathered tensors after use. This execution strategy reduces parameter and direction storage while reusing the same flash_triton attention rule; Appendix § 16.§ 1 gives the details.
Initial Token Weight Ablation
How does the initial token weight affect learning dynamics and final accuracy? In a four-run comparison, we study fixed , fixed , a cosine schedule from to over 100 updates, and fixed with negative-weight warmup (Figure 6). The warmup keeps the upper clipping bound at 1 and lowers the lower bound from 0 to with a cosine schedule through step 50, gradually permitting negative weights. All four runs use weight learning rate without further weight normalization. At step 100, fixed reaches 32.71% mean accuracy without warmup and 31.20% with warmup, compared with 26.30% for fixed and 27.45% for the cosine initialization schedule. Both zero-initialized variants outperform the other initialization choices at
Figure 6. Initial token weight and negative-weight warmup comparison for Qwen3-1.7B (non-thinking). Each curve shows one run with seed 42 over the shared step-10–100 window. Accuracy equally averages AIME24/25 and HMMT2025-Feb/Nov, with 16 responses per problem. Fixed without warmup uses the same run as Table 1, restricted to these four benchmarks. All runs use AdamW lookahead, separate meta rollouts, weight learning rate , and no further weight normalization. The initialization variants clip to ; cosine initialization reaches at step 100. Negative-weight warmup keeps and the upper bound at 1 while lowering the lower bound from 0 to by step 50 using a cosine schedule. Dots are observed evaluations; labels show step-100 accuracy.
this checkpoint; fixed without warmup leads the warmup variant by 1.51 percentage points in this single-seed comparison. The first three variants use , varying initialization and clipping bounds together; warmup changes only the lower bound while keeping .
Extended Related Work
On-policy distillation for LLMs. Knowledge distillation transfers capabilities from a larger teacher to a smaller student [6, 18]. For LLMs, teacher supervision can take the form of token-level probability distributions or generated text [25, 37]. Off-policy distillation trains on fixed sequences, often generated by the teacher [19, 28]. On-policy distillation instead queries the teacher on student-generated responses, exposing the student to supervision along its own trajectories and reducing the mismatch between training and inference [1, 12]. Self-distillation paradigm obtains supervision from the student itself, with privileged information such as verified solutions or environment feedback providing a stronger teacher context [40, 20, 48].
Unifying distillation and RLVR. Several methods combine dense teacher supervision with verifiable task rewards. KDRL [43] jointly optimizes a GRPO reward objective and reverse-KL distillation, while RLAD [47] incorporates teacher guidance into policy optimization through a likelihood ratio anchored to a mixture of the teacher and the previous student policy. RG-OPD [3] uses agreement between verifier outcomes and teacher likelihoods to gate trajectory-level distillation. A related perspective connects OPD to KL-regularized reinforcement learning: Yang et al. [46] introduce a flexible reference model and scales the implicit reward derived from teacher probabilities, yielding the reward-extrapolation variant ExOPD. Our proposed method, RAD, uses task reward to determine how individual token-level distillation contributions should enter the student update.
Token-selective distillation. TIP [44] and DEAR [42] select teacher supervision using uncertainty, teacher–student divergence, and reasoning structure. REOPOLD [26] combines token log-ratio rewards with clipping and entropy-guided sampling. Armandpour et al. (2026) diagnose token-level alignment between distillation and reward-improving directions in logit space and study oracle filtering of positively aligned tokens. RAD operationalizes reward-guided weighting during training: it differentiates a reward surrogate through the student optimizer and shared parameters to assign bounded, signed token weights. These weights can also reverse teacher contributions; our positive-only ablation supports the benefit of this additional flexibility. We compare RAD with representative reward-aware and token-selective baselines.
Bilevel reweighting. Learning example weights from a held-out objective is a standard use of bilevel optimization [35]. Gradient similarity has also been used to adapt auxiliary losses toward a primary objective [10]. We apply this principle at token granularity in on-policy language-model distillation. The one-step approximation avoids solving the full inner problem or an implicit linear system [31, 27].
Additional Coding Results
Detailed LiveCodeBench Results
Table 8 gives the full results underlying Figure 4, including standard deviations and gains for Qwen3-1.7B (non-thinking) and OLMo3-7B-Instruct.
Qwen Coding Validation
We evaluate Qwen3-1.7B (non-thinking), trained with Qwen3-30B-A3B-Instruct-2507 as teacher, on the full 1,024-problem Eurus validation split (Table 5). We sample one response per problem and report problem-weighted pass@1. Baselines generate 512 training responses per step; RAD generates 1,024 including meta rollouts. Training and weight settings appear in Appendix § 9.§ 1.
At the matched training-response budget, RAD at step 100 reaches 29.69%, exceeding RLAD at step 200 (23.34%) by 6.35 points (Figure 7 and Table 9). Extended RAD training reaches 30.66% at step 200.
Figure 7. Coding-validation dynamics for Qwen3-1.7B (non-thinking). Each point reports pass@1 over all 1,024 validation problems for one training run per method. Curves stop at the last available evaluation. We compare RAD at step 100 with baselines at step 200; the RAD curve is dotted beyond step 100 and extends to step 200.
Table 9: Qwen3-1.7B (non-thinking) coding-validation pass@1 (%). Step-100 scores are shown by dataset; available step-200 scores are shown overall. Overall weights all 1,024 problems equally. Bold/underline: best/second-best reported value per column, with ties sharing a rank; dashes: unavailable. Parentheses give RAD’s gain over the best baseline at the same step (pp, before rounding). RAD at step 100 matches baselines at step 200 in training responses.
| Method | Step 100 | Step 200 | ||||
| APPS | CodeContests | Codeforces | TACO | Overall | Overall | |
| GRPO | 17.61 | 17.51 | 15.45 | 7.85 | 13.67 | 18.16 |
| OPD | 28.87 | 25.99 | 21.95 | 11.52 | 20.51 | 21.97 |
| TIP | 27.46 | 23.08 | 26.83 | 12.57 | 20.21 | 22.27 |
| RLAD | 37.32 | 26.79 | 31.71 | 15.18 | 24.51 | 23.34 |
| ExOPD | 19.01 | 20.16 | 16.26 | 10.21 | 15.82 | 19.73 |
| RAD (ours) | 45.07 | 32.89 | 31.71 | 20.16 | 29.69 | 30.66 |
| Δ vs. best baseline | (+7.75) | (+6.10) | (+0.00) | (+4.97) | (+5.18) | (+7.32) |
Table 9.
OLMo3-7B Settings and Validation
We train OLMo3-7B-Instruct with OLMo3.1-32B-Instruct as the teacher4 on the Eurus coding split and evaluate on the same 1,024-problem validation split described in Appendix § 11.§ 2. We sample one response per problem with temperature 1, top- 1, and a 32,768-token limit, and report problem-weighted pass@1. Each method uses one training seed, 64 actor prompts with eight responses each, and AdamW with learning rate . RAD additionally uses 64 meta prompts with eight responses each. We allocate six GPUs to student training and, for distillation methods, two additional GPUs to teacher inference.
RAD uses the same weight settings as the Qwen coding experiment: fixed initial token weight , upper bound 1, a cosine lower-bound schedule from 0 to through step 50, and weight learning rate without further normalization. OPD, TIP, and RAD use distillation coefficient ; TIP uses full-vocabulary reverse KL, and RLAD uses .
RAD solves 412 of 1,024 validation problems at step 100, compared with 351 for both GRPO and RLAD at step 100 and 367 for GRPO at step 200 (Table 10 and Figure 8). At step 200, OPD, TIP, and RLAD reach 33.01%, 25.68%, and 33.98%, respectively. These single-run results support applying RAD beyond the Qwen student–teacher pairs; they do not isolate the effects of model family and student size.
Figure 8. Coding-validation dynamics for OLMo3-7B-Instruct. Each point reports pass@1 over all 1,024 Eurus validation problems. Curves stop at the last available evaluation. We compare RAD at step 100 with all four baselines at step 200.
We also evaluate these checkpoints on all 1,055 LiveCodeBench-v6 tasks using the sampling and native grading protocol of the main coding experiments, with each OLMo checkpoint’s native tokenizer and chat template. Table 8 reports the full results, including the base student and teacher references.
Preliminary Experiments on Agentic RL Settings
We apply RAD to an agentic software-engineering task. A Qwen3.5-4B5 policy is trained on R2E-Gym (Jain et al., [23]) with the OpenHands agent harness provided by R2E-Gym. Each episode presents a repository at a failing commit and lets the policy read, edit, and run code for up to 75 tool turns within a 65,536-token context, generating at most 8,192 tokens per turn with temperature 1, top- 1, and no top- truncation; the reward is the hidden test suite’s verdict on the final patch. Each update samples 32 tasks with eight attempts each and uses a constant learning rate of . The teacher is Qwen3.6-27B.6 The baselines train for one epoch on R2E-Gym, and RAD for half an epoch.
We evaluate on SWE-bench Verified (Jimenez et al., [24]; Chowdhury et al., [7]) with three rollouts for each of its 500 tasks under the training scaffold, sampling parameters, and context budget. Its repositories are disjoint from the training corpus. pass@1 is the mean resolved rate over all 1,500 attempts, and pass@3 is the fraction of tasks resolved by at least one of the three attempts.
RAD with negative-weight warmup reaches 50.5% pass@1 and 63.6% pass@3, the best of the five methods (Figure 9). It improves on GRPO by 5.9 points and on the strongest non-RAD baseline, RLAD, by 3.7 points, while training for half as many epochs.

Figure 9. SWE-bench Verified at a 65,536-token context and 75 tool turns. Solid bars show pass@1 with ±1 standard deviation across the three rollouts; hatched bars show pass@3. Horizontal lines mark the pass@1 of the base student and the teacher.
Computational Cost and Efficiency
Comparison with Baselines
Table 11 compares total training time for Qwen3-1.7B (non-thinking) on math and OLMo3-7B-Instruct on coding. RAD uses 100 updates and the baselines use 200, matching 102,400 generated training responses. The math comparison also includes RAD-Simple at 200 updates. We include checkpoint saves and exclude periodic validation, process startup, and time between training attempts. Each retained update is counted once. For Qwen3-1.7B (non-thinking) on math, RAD-Simple records 32.48 training hours over 200 updates, compared with 16.66 hours for RAD over 100 updates. The main runs use six H100 GPUs for the student, whereas OPD2 uses four student GPUs alongside its two-teacher setup. These are measured costs of the experimental configurations: generated response lengths, teacher execution, and GPU allocations also affect step time.
Table 11: Total training time (hours) for RAD at step 100 versus baselines at step 200, matching generated training responses. RAD-Simple is included only for math, at step 200. Checkpoint saves are included; periodic validation, startup, and restart downtime are excluded.
RAD Stage Breakdown
We profile the first 100 RAD updates for Qwen3-1.7B (non-thinking) on math, which uses eight NVIDIA H100 80GB GPUs: six for the student and its rollouts, and two for teacher inference. Each step generates 512 actor responses and 512 meta responses, with a maximum generation length of 32,768 tokens. Table 12 averages the recorded trainer timers over all 100 steps, including checkpoint saves but excluding periodic validation, job startup, and I/O outside the training-step timer.
| Stage | Seconds | Share |
| Distillation rollout pipeline | 211.1 | 35.2% |
| Student log-probabilities and advantages | 11.9 | 2.0% |
| Lookahead stage | 283.2 | 47.2% |
| Weight computation and student update | 87.5 | 14.6% |
| Rollout weight synchronization | 5.3 | 0.9% |
| Checkpoint saves | 0.6 | 0.1% |
| Other in-step overhead | 0.3 | 0.1% |
| Total training step | 599.9 | 100% |
Table 12. RAD math training-time breakdown for Qwen3-1.7B (non-thinking), averaged over the same 100 updates as Table 11. Entries give seconds per training step and each stage’s share of recorded training-step time. Checkpoint saves are amortized over all steps; validation is excluded and reported separately in the text.
The distillation rollout pipeline includes generation and overlapping teacher scoring and reward evaluation. The lookahead stage includes the temporary optimizer update, transfer of temporary weights, meta rollouts, reward-gradient computation, and restoration of the student. Weight computation and the committed student update include the exact JVP and projected weight update. These are sequential trainer stages; nested teacher-request and JVP timers are not added again. The recorded timers do not separately resolve the components within the lookahead stage.
Mean training-step time is 10.0 minutes for Qwen3-1.7B (non-thinking), corresponding to 16.66 recorded training hours over 100 steps. Periodic validation adds 5.78 hours outside this total. The lookahead stage accounts for 47.2% of training-step time; weight computation and the student update account for 14.6%. These averages include changing response lengths.
Math Comparison at Comparable Training Times
We use the cumulative recorded training time of RAD at step 90 for Qwen3-1.7B (non-thinking) as a 12.09-hour reference budget. We use TIP at step 70 and ExOPD at step 50, the first evaluated checkpoints above this budget, for a closer time match. They use 100.9% and 102.6% of the reference budget, respectively. The other baselines use their latest available evaluated checkpoint within the budget. Selection uses time rather than accuracy; we do not interpolate accuracy between checkpoints. Evaluations occur every ten steps and cover the original four benchmarks, so AIME26 and OlympiadBench are excluded from this comparison.
Training time sums the logged durations of completed updates along the retained training trajectory, including checkpoint saves. We count each retained update once and exclude periodic validation, process startup, restart downtime, and discarded attempts. ExOPD logs checkpoint saves outside its step timer, so their durations are added separately. All runs use six H100 GPUs for the student; teacher execution follows each method’s implementation. This compares logged training times, which also depend on generated response lengths and implementation details.
| Method | Step | Training (h) | Budget used | Accuracy (%) |
| Student: Qwen3-1.7B (non-thinking); budget 12.09 h | ||||
| GRPO | 290 | 11.98 | 99.1% | |
| OPD | 160 | 11.72 | 96.9% | |
| TIP | 70 | 12.19 | 100.9% | |
| RLAD | 170 | 12.08 | 99.9% | |
| ExOPD | 50 | 12.40 | 102.6% | |
| RAD (ours) | 90 | 12.09 | 100.0% | |
| RAD-Simple | 140 | 8.97 | 74.2% | |
| RAD vs. best | — | — | — |
Table 13. Math accuracy for Qwen3-1.7B (non-thinking) at comparable training times, relative to RAD at step 90. RAD-Simple uses its latest evaluated checkpoint within this budget. Accuracy is the mean over AIME24/25 and HMMT2025-Feb/Nov, with standard deviation across 16 sample-position accuracies. Budget used is the fraction of RAD’s cumulative training time. Bold/underline mark the best/second-best means; parentheses give RAD’s gain over the strongest displayed baseline (pp).
For Qwen3-1.7B (non-thinking), RAD exceeds the strongest selected baseline, ExOPD, by 5.47 percentage points, despite ExOPD using 2.6% more training time. GRPO’s step 290 uses 99.1% of the reference budget.
Extended GRPO Training
Figure 10 compares Qwen3-1.7B (non-thinking) RAD runs through step 90 with GRPO over a 450-step window. RAD reaches 32.81% on the four math benchmarks and 30.86% on Eurus coding validation at step 90. At step 450, GRPO reaches 33.28% on math and 31.54% on coding. GRPO generates 512 training responses per step, while RAD generates 512 actor and 512 meta responses. Both GRPO endpoints use 2.50 times as many training responses as RAD at step 90.
Gradient of Weighted On-Policy Distillation
Per-token surrogate. For a response sampled from the frozen policy , the surrogate used in Equations (1) and (8) is
The sampling policy and prefixes are held fixed. For batch notation, write .
Derivation of the per-token gradient. At a fixed prefix , consider the expected weighted reverse KL
Holding fixed when differentiating with respect to gives
This is the per-token, frozen-prefix gradient used in § 4. The surrogate in Equation (9) realizes the same gradient. At the update point , the ratio in value but remains differentiable, giving
Since the sampling distribution in Equation (1) is fixed, its gradient is simply
Student rollouts provide a sampled estimate of this expected gradient.
Action-independent weights and OPD. If does not depend on , the second expectation in Equation (10) vanishes by the zero-mean score identity. The result is times the OPD gradient, with OPD recovered at . For an action- or response-dependent weight, this term generally does not vanish. If the weight had explicit differentiable dependence on , an additional term
would appear; the updated weights in Equation (8) are instead detached during student training, and its normalization is fixed.
Full sequence-level gradient. Equation (10) conditions on a fixed prefix and is therefore a per-token gradient. For comparison, define the full sequence-level objective
Unlike Equation (1), its sampling distribution depends on . Differentiating the complete trajectory expectation gives
The first term supplies the contribution because the teacher is fixed and
Combining this with the diagonal contribution after expanding the second term gives
which is the frozen-prefix contribution used by the main derivation. The remaining off-diagonal terms are the cross-token trajectory-distribution gradients omitted by the fixed-prefix estimator. Our implementation uses this fixed-prefix estimator and refreshes the state distribution with new on-policy rollouts at every iteration.
Hypergradient through One Optimizer Step
For the fixed batch in Equation (8), let . One optimizer step and its evaluation at initial token weight are
The batch, original parameters, and current optimizer state are fixed. Using the reward direction from Equation (6), the weight derivative is
The JVP computes the scores together. We apply the weight learning rate directly to these scores in Equation (5).
SGD.
For an unclipped SGD step without momentum,
This gives the SGD score in Equation (4), with the learning rate already included. Momentum or gradient clipping is handled by including that operation in .
AdamW.
Our experiments use AdamW with global gradient clipping. Let , where is the clipping operator; we suppress the dependence on below. Given the current moments and update index , AdamW computes
Here is the learning rate, is weight decay, are the moment coefficients, and is the Adam numerical-stability constant. All vector operations are elementwise; and denote multiplication and division.
Let be the Jacobian of with respect to . Specializing the optimizer-aware reward direction to AdamW gives
Substituting Equation (12) gives the AdamW-specialized JVP used in training:
Custom Triton Kernel for Attention JVPs
In the flash_triton attention implementation, FlashAttention computes the attention output and row log-sum-exp during the model JVP in Equation (7), and a custom Triton rule propagates their directional derivatives. We describe scaled dot-product self-attention with zero dropout and no score softcapping. For one sequence and head,
where , , are the queries, keys, and values, and is the head dimension. Softmax and log-sum-exp include only allowed keys in each row; masked probabilities are zero. Structural masks are fixed during differentiation. Dots denote directional derivatives induced by the parameter direction , with , , supplied by forward-mode differentiation through the preceding operations. The attention JVP is
Here is elementwise multiplication, with broadcast across each output row. The term accounts for differentiating the softmax normalizer. Reusing the saved , , the kernel reconstructs probabilities one tile at a time and accumulates Equation (14).
Algorithm 2 Tiled attention JVP using the FlashAttention output and log-sum-exp
Input: , , , tangents , , , saved , , sequence boundaries, and attention masks.
Output: Attention-output tangent and log-sum-exp tangent .
Initialize , to zero, including padded positions.
for each sequence, query head, and valid query block in parallel do
Select the corresponding key/value head for grouped-query attention.
Load , , , ; initialize FP32 accumulators , .
for each key block in the same sequence allowed by the block’s masks do
Load , , , .
.
.
, broadcasting over keys.
Set masked entries of to zero.
.
.
end for
Store and for valid queries.
end for
Query blocks stay within sequence boundaries, so packed sequences cannot attend to one another. Causal, padding, and sliding-window masks use the same valid query–key pairs as the primal; grouped-query heads share their key/value tensors without explicitly repeating them. Our training launchers use 16-query blocks, with Triton autotuning key-block sizes of 16 or 32. Probability factors and tangent accumulators remain in FP32; the products with and use tf32x3 tensor-core precision. The kernel stores in the primal output’s dtype and in FP32. It avoids storing full attention or attention-tangent matrices, while full-attention arithmetic remains quadratic in sequence length. The rule analytically differentiates the attention equations up to floating-point error.
Layer-Streamed JVP Execution
The olmo3_layer_streamed backend evaluates the embedding, decoder layers, final normalization, and output projection in sequence. For each parameter group, the FSDP executor gathers its parameters and the corresponding components of , propagates both activations and activation tangents, and releases the gathered tensors after use. It can prefetch the next group, so gathered parameter and direction storage is bounded by the current and prefetched groups. Activation states are retained for a bounded set of microbatches at a time, with microbatch grouping synchronized across ranks to preserve the order of collective operations.
Within each OLMo decoder layer, the backend uses the same FlashAttention primal and Triton attention tangent as flash_triton (Algorithm 2), including the masks for full and sliding-window attention. Forward-mode differentiation propagates the chain-rule JVP through successive layers, reducing the memory needed for gathered parameters and their direction while retaining the token-score computation in Equation (7).
References
- [1]Rishabh Agarwal, Nino Vieillard, Yongchao Zhou, Piotr Stanczyk, Sabela Ramos Garea, Matthieu Geist, and Olivier Bachem. On-policy distillation of language models: Learning from self-generated mistakes. In International Conference on Learning Representations, volume 2024, pp. 21246–21263, 2024.arxiv.org/abs/2306.13649
- [3]Mohammad Sadegh Akhondzadeh, Vijay Lingam, Atula Tejaswi, Chanakya Ekbote, Sujay Sanghavi, and Aleksandar Bojchevski. Reward-gated on-policy distillation, 2026. URL https://arxiv.org/abs/2607.04037.
- [4]Mohammadreza Armandpour, Fatih Ilhan, David Harrison, Ajay Jaiswal, Duc NM Hoang, Fartash Faghri, Yizhe Zhang, Minsik Cho, and Mehrdad Farajtabar. Unmasking on-policy distillation: Where it helps, where it hurts, and why. arXiv preprint arXiv:2605.10889, 2026.arxiv.org/abs/2605.10889
- [5]Mislav Balunovic, Jasper Dekoninck, Ivo Petrov, Nikola Jovanović, and Martin Vechev. Math Arena: Evaluating LLMs on uncontaminated math competitions. Advances in Neural Information Processing Systems, 38, 2025.
- [6]Cristian Bucilă, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 535–541, 2006.DOI
- [7]Neil Chowdhury et al. Introducing SWE-bench verified. https://openai.com/index/introducing-swe-bench-verified/, 2024.
- [9]Ganqiu Cui, Lifan Yuan, Zefan Wang, Hanbin Wang, Yuchen Zhang, Jiacheng Chen, Wendi Li, Bingxiang He, Yuchen Fan, Tianyu Yu, Qixin Xu, Weize Chen, Jiarui Yuan, Huayu Chen, Kaiyan Zhang, Xingtai Lv, Shuo Wang, Yuan Yao, Xu Han, Hao Peng, Yu Cheng, Zhiyuan Liu, Maosong Sun, Bowen Zhou, and Ning Ding. Process reinforcement through implicit rewards. arXiv preprint arXiv:2502.01456, 2025.arxiv.org/abs/2502.01456
- [10]Yunshu Du, Wojciech M Czarnecki, Siddhant M Jayakumar, Mehrdad Farajtabar, Razvan Pascanu, and Balaji Lakshminarayanan. Adapting auxiliary losses using gradient similarity. arXiv preprint arXiv:1812.02224, 2018.arxiv.org/abs/1812.02224
- [11]Chanakya Ekbote, Vijay Lingam, Behrooz Omidvar Tehrani, Jun Huan, Sujay Sanghavi, Anoop Deoras, and Stefano Soatto. Murphy: Reflective multi-turn reinforcement learning for self-correcting code generation in large language models. In First Workshop on Foundations of Reasoning in Language Models, 2025. URL https://openreview.net/forum?id=x0Ir7cWEiA.
- [12]Yuxian Gu, Li Dong, Furu Wei, and Minlie Huang. Minillm: Knowledge distillation of large language models. In International Conference on Learning Representations, volume 2024, pp. 32694–32717, 2024.
- [13]Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Peiyi Wang, Qihao Zhu, Runxin Xu, Ruoyu Zhang, Shirong Ma, Xiao Bi, et al. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning. arXiv preprint arXiv:2501.12948, 2025.DOI
- [14]Chaoqun He, Renjie Luo, Yuzhuo Bai, Shengding Hu, Zhen Thai, Junhao Shen, Jinyi Hu, Xu Han, Yujie Huang, Yuxiang Zhang, et al. Olympiadbench: A challenging benchmark for promoting agi with olympiad-level bilingual multimodal scientific problems. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3828–3850, 2024.
- [15]Zhiwei He, Tian Liang, Jiahao Xu, Qiuzhi Liu, Xingyu Chen, Yue Wang, Linfeng Song, Dian Yu, Zhenwen Liang, Wenxuan Wang, Zhuosheng Zhang, Rui Wang, Zhaopeng Tu, Haitao Mi, and Dong Yu. DeepMath-103K: A large-scale, challenging, decontaminated, and verifiable mathematical dataset for advancing reasoning. arXiv preprint arXiv:2504.11456, 2025.arxiv.org/abs/2504.11456
- [16]Dan Hendrycks, Steven Basart, Saurav Kadavath, Mantas Mazeika, Akul Arora, Ethan Guo, Collin Burns, Samir Puranik, Horace He, Dawn Song, et al. Measuring coding challenge competence with apps. arXiv preprint arXiv:2105.09938, 2021.
- [17]Byeongho Heo, Jaehui Hwang, Sangdoo Yun, and Dongyoon Han. On-policy delta distillation. arXiv preprint arXiv:2607.15161, 2026.arxiv.org/abs/2607.15161
- [18]Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.arxiv.org/abs/1503.02531
- [19]Cheng-Yu Hsieh, Chun-Liang Li, Chih-kuan Yeh, Hootan Nakhost, Yasuhisa Fujii, Alex Ratner, Ranjay Krishna, Chen-Yu Lee, and Tomas Pfister. Distilling step-by-step! outperforming larger language models with less training data and smaller model sizes. In Anna Rogers, Jordan Boyd-Graber, and Naokazu Okazaki (eds.), Findings of the Association for Computational Linguistics: ACL 2023, pp. 8003–8017, Toronto, Canada, July 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.findings-acl.507. URL https://aclanthology.org/2023.findings-acl.507/.DOI
- [20]Jonas Hübotter, Frederike Lübeck, Lejs Behric, Anton Baumann, Marco Bagatella, Daniel Marta, Ido Hakimi, Idan Shenfeld, Thomas Kleine Buening, Carlos Guestrin, et al. Reinforcement learning via self-distillation. arXiv preprint arXiv:2601.20802, 2026.arxiv.org/abs/2601.20802
- [21]Aaron Jaech, Adam Kalai, Adam Lehrer, Adam Richardson, Ahmed El-Kishky, Aiden Low, Alec Helyar, Aleksander Madry, Alex Beutel, Alex Carney, et al. Openai o1 system card. arXiv preprint arXiv:2412.16720, 2024.arxiv.org/abs/2412.16720
- [22]Naman Jain, Alex Gu, Wen-Ding Li, Fanjia Yan, Tianjun Zhang, Sida Wang, Armando Solar-Lezama, Koushik Sen, and Ion Stoica. Livecodebench: Holistic and contamination free evaluation of large language models for code. In International Conference on Learning Representations, volume 2025, pp. 58791–58831, 2025a.arxiv.org/abs/2403.07974
- [23]Naman Jain, Jaskirat Singh, Manish Shetty, Liang Zheng, Koushik Sen, and Ion Stoica. R2E-Gym: Procedural environments and hybrid verifiers for scaling open-weights SWE agents. arXiv preprint arXiv:2504.07164, 2025b.arxiv.org/abs/2504.07164
- [24]Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. SWE-bench: Can language models resolve real-world GitHub issues? In International Conference on Learning Representations, 2024.arxiv.org/abs/2310.06770
- [25]Yoon Kim and Alexander M Rush. Sequence-level knowledge distillation. In Proceedings of the 2016 conference on empirical methods in natural language processing, pp. 1317–1327, 2016.arxiv.org/abs/1606.07947
- [26]Jongwoo Ko, Sara Abdali, Young Jin Kim, Tianyi Chen, and Pashmina Cameron. Scaling reasoning efficiently via relaxed on-policy distillation, 2026. URL https://arxiv.org/abs/2603.11137.
- [27]Jeongyeol Kwon, Dohyun Kwon, Stephen Wright, and Robert D Nowak. A fully first-order method for stochastic bilevel optimization. In International Conference on Machine Learning, pp. 18083–18113. PMLR, 2023.arxiv.org/abs/2301.10945
- [28]Minchong Li, Feng Zhou, and Xiaohui Song. BiLD: Bi-directional logits difference loss for large language model distillation. In Owen Rambow, Leo Wanner, Marianna Apidianaki, Hend Al-Khalifa, Barbara Di Eugenio, and Steven Schockaert (eds.), Proceedings of the 31st International Conference on Computational Linguistics, pp. 1168–1182, Abu Dhabi, UAE, January 2025. Association for Computational Linguistics. URL https://aclanthology.org/2025.coling-main.78/.arxiv.org/abs/2406.13555
- [29]Rongao Li, Jie Fu, Bo-Wen Zhang, Tao Huang, Zhihong Sun, Chen Lyu, Guang Liu, Zhi Jin, and Ge Li. Taco: Topics in algorithmic code generation dataset. arXiv preprint arXiv:2312.14852, 2023.arxiv.org/abs/2312.14852
- [30]Yujia Li, David Choi, Junyoung Chung, Nate Kushman, Julian Schrittwieser, Rémi Leblond, Tom Eccles, James Keeling, Felix Gimeno, Agustin Dal Lago, et al. Competition-level code generation with alphacode. Science, 378(6624):1092–1097, 2022.DOI
- [31]Bo Liu, Mao Ye, Stephen Wright, Peter Stone, and Qiang Liu. Bome! bilevel optimization made easy: A simple first-order approach. Advances in neural information processing systems, 35: 17248–17262, 2022.arxiv.org/abs/2209.08709
- [32]Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=Bkg6RiCqY7.
- [33]Thang Luong and Edward Lockhart. Advanced version of gemini with deep think officially achieves gold-medal standard at the international mathematical olympiad, 2025. URL https://deepmind.google/blog/advanced-version-of-gemini-with-deep-think-officially-achieves-gold-medal-standard-at-the-international-mathematical-olympiad/.
- [34]OpenCompass. Aime 2025, 2025. URL https://huggingface.co/datasets/opencompass/AIME2025.
- [35]Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. International conference on machine learning, pp. 4334–4343. PMLR, 2018.arxiv.org/abs/1803.09050
- [36]Herbert Robbins and Sutton Monro. A stochastic approximation method. The annals of mathematical statistics, pp. 400–407, 1951.
- [37]Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter, 2020. URL https://arxiv.org/abs/1910.01108.
- [38]John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.arxiv.org/abs/1707.06347
- [39]Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, YK Li, Yang Wu, et al. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300, 2024.arxiv.org/abs/2402.03300
- [40]Idan Shenfeld, Mehul Damani, Jonas Hübotter, and Pulkit Agrawal. Self-distillation enables continual learning. arXiv preprint arXiv:2601.19897, 2026.arxiv.org/abs/2601.19897
- [41]Guangming Sheng, Chi Zhang, Zilingfeng Ye, Xibin Wu, Wang Zhang, Ru Zhang, Yanghua Peng, Haibin Lin, and Chuan Wu. Hybridflow: A flexible and efficient rlhf framework. In Proceedings of the Twentieth European Conference on Computer Systems, pp. 1279–1297, 2025.DOI
- [42]Jinwei Xiao, Zhuowen Han, Yueqing Sun, Zhengxi Lu, Yuxin Liu, Zhiyuan Yao, Wentao Chen, Qi Gu, and Xunliang Cai. Finding the evidence: Discovering decision-supporting tokens for on-policy reasoning distillation. arXiv preprint arXiv:2606.22830, 2026.arxiv.org/abs/2606.22830
- [43]Hongling Xu, Qi Zhu, Heyuan Deng, Jinpeng Li, Lu Hou, Yasheng Wang, Lifeng Shang, Ruifeng Xu, and Fei Mi. Kdrl: Post-training reasoning llms via unified knowledge distillation and reinforcement learning. arXiv preprint arXiv:2506.02208, 2025.arxiv.org/abs/2506.02208
- [44]Yuanda Xu, Hejian Sang, Zhengze Zhou, Ran He, Zhipeng Wang, and Alborz Geramifard. Tip: Token importance in on-policy distillation. arXiv preprint arXiv:2604.14084, 2026.arxiv.org/abs/2604.14084
- [45]An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Cheng'en Huang, Chenxu Lv, et al. Qwen3 technical report. arXiv preprint arXiv:2505.09388, 2025.arxiv.org/abs/2505.09388
- [46]Wenkai Yang, Weijie Liu, Ruobing Xie, Kai Yang, Saiyong Yang, and Yankai Lin. Learning beyond teacher: Generalized on-policy distillation with reward extrapolation. arXiv preprint arXiv:2602.12125, 2026.arxiv.org/abs/2602.12125
- [47]Zhaoyang Zhang, Shuli Jiang, Yantao Shen, Yuting Zhang, Dhananjay Ram, Shuo Yang, Zhuowen Tu, Wei Xia, and Stefano Soatto. Reinforcement-aware knowledge distillation for llm reasoning. arXiv preprint arXiv:2602.22495, 2026.arxiv.org/abs/2602.22495
- [48]Siyan Zhao, Zhihui Xie, Mengchen Liu, Jing Huang, Guan Pang, Feiyu Chen, and Aditya Grover. Self-distilled reasoner: On-policy self-distillation for large language models. arXiv preprint arXiv:2601.18734, 2026.arxiv.org/abs/2601.18734






