TPU Builders study

When is on-policy distillation worth it?

We distilled a math teacher and an instruction-following (IF) teacher into one Qwen3.5-2B student with multi-teacher on-policy distillation (MOPD). We compared it against joint RL, offline distillation and weight merging. Everything ran on Google TPU v6e-4 with TorchTPU + vLLM.

Paper: arXiv link comingCode (Apache-2.0) →

TL;DR

  • Routing is the robust effect. Distilling from the math teacher alone on every prompt learns nothing on IF. MOPD, which sends each prompt to its own domain's teacher, is +6.0 pp better on IFEval and +6.1 pp on IFBench (Holm-corrected p < 0.001 for both).
  • MOPD reaches both teachers. It is equivalent (within ±3 pp) to the math teacher on AIME and to the IF teacher on IFEval and IFBench.
  • Two cheaper baselines match MOPD.
    • Offline distillation (SFT on the same teachers' samples) is equivalent to MOPD on all three benchmarks, at matched learner tokens and at matched VM-hours. It needs half the accelerator time per run.
    • A task-arithmetic merge of the two teachers, with no training at all, is equivalent on AIME and IFEval and 2.0 pp higher on IFBench (not significant).
  • MOPD's lead over joint RL (Mix-RL) is smaller than the 2-seed run showed. With 4 seeds, only IFBench survives correction: +3.5 pp. On AIME the gap is +2.4 pp but not significant after Holm, and IFEval is a tie.
  • Why the cheap baselines hold up here: the teachers sit very close to the student. The starting per-token KL is about 0.02 nats, and only about 15% of the teachers' weight updates are nonzero in bf16.
  • Total cost about $596 over 88 VM-hours: the pilot, the main study and the paper extension.

Updated for the paper. An earlier version of this page reported 2 seeds and no offline or merge baselines. Its headline (MOPD clearly beats Mix-RL) did not hold up with 4 seeds and the added baselines.

What is MOPD

Multi-teacher on-policy distillation (MOPD) merges several specialist models into one. The student samples its own answers, and each answer is scored token by token by the teacher for that prompt's domain, here a math teacher or an IF teacher. The student is then pushed toward that teacher's distribution (lower reverse KL), so one model picks up every specialist's skill.

The cheaper alternatives are offline distillation, which trains on the teachers' own samples, and weight merging, which adds the teachers' weight changes together with no training.

Results at a glance

Step-60 scores with 95% CIs:

ModelRunsAIME pass@1IFEval strictIFBench strict
Base Qwen3.5-2B3 / 2 / 2 evals9.42% [6.2, 12.9]68.3% [65.0, 71.6]25.8% [21.5, 30.2]
T-math teacher3 / 1 / 1 evals18.05% [13.2, 23.1]66.4% [62.9, 69.8]24.8% [20.5, 29.2]
T-IF teacher1 / 3 / 3 evals10.57% [7.0, 14.4]74.3% [71.2, 77.3]31.5% [26.9, 36.1]
MOPD4 seeds17.51% [12.8, 22.4]73.0% [70.0, 76.1]31.2% [26.6, 35.9]
MOPD-dist (exact, full vocab)4 seeds17.90% [13.1, 23.0]72.8% [69.6, 76.1]31.9% [27.5, 36.5]
SFT on teacher samples, step 603 seeds17.63% [12.9, 22.6]72.5% [69.4, 75.7]31.1% [26.5, 35.6]
SFT on teacher samples, step 1203 seeds17.65% [12.9, 22.7]72.8% [69.5, 76.1]31.6% [27.1, 36.2]
M2 task-arithmetic merge1 eval18.70% [13.7, 24.0]73.6% [70.3, 76.8]33.3% [28.4, 38.2]
M3 TIES merge, 20% density1 eval17.56% [12.7, 22.7]72.8% [69.5, 76.1]31.9% [27.3, 36.7]
M4 TIES merge, 50% density1 eval17.97% [13.0, 23.1]72.9% [69.5, 76.1]30.8% [26.2, 35.7]
M1 linear average1 eval15.81% [11.2, 20.7]71.0% [67.7, 74.4]29.8% [25.2, 34.5]
Mix-RL (GRPO, math + IF)4 seeds15.14% [10.8, 19.8]72.2% [69.1, 75.4]27.7% [23.4, 32.1]
OPD from T-math only3 seeds17.77% [12.9, 22.8]67.1% [63.7, 70.4]25.2% [20.9, 29.5]
Step-60 AIME pass@1, IFEval and IFBench for every arm, teacher and merge, with 95% CIs
Step-60 scores per arm and benchmark, with 95% CIs. MOPD, SFT and the TIES and task-arithmetic merges land at the same level; Mix-RL trails on AIME and IFBench, and OPD from T-math alone stays at base on IF.

The comparisons that matter

Paired differences at step 60, in pp. The CIs are paired by problem, and Holm correction covers the 7 primary contrasts per benchmark.

ContrastAIMEIFEvalIFBench
MOPD − OPD (T-math only): routing−0.26 {−1.48, +0.97} ≈+5.95 [+3.69, +8.23]+6.06 [+3.04, +9.15]
MOPD − routed teacher−0.54 {−1.69, +0.64} ≈−1.23 {−2.58, +0.09} ≈−0.24 {−2.20, +1.77} ≈
MOPD − SFT@60 (tokens matched)−0.12 {−1.31, +1.15} ≈+0.49 {−0.92, +1.91} ≈+0.15 {−1.80, +2.12} ≈
MOPD − SFT@120 (VM-h matched)−0.14 {−1.29, +1.06} ≈+0.25 {−1.20, +1.68} ≈−0.38 {−1.97, +1.26} ≈
MOPD − M2 task arithmetic−1.19 {−2.65, +0.28} ≈−0.55 {−2.22, +1.10} ≈−2.02 [−4.77, +0.75]
MOPD − M3 TIES 20%−0.05 {−1.46, +1.44} ≈+0.23 {−1.39, +1.93} ≈−0.69 {−3.00, +1.62}
MOPD − Mix-RL+2.37 [+0.29, +4.77]+0.79 {−1.07, +2.74} ≈+3.54 [+0.94, +6.33]
MOPD-dist − MOPD+0.39 {−0.76, +1.55} ≈−0.17 {−1.61, +1.22} ≈+0.69 {−0.77, +2.17} ≈
Forest plot of step-60 paired differences, primary and secondary contrasts, with the ±3 pp equivalence band
Step-60 paired differences with 95% CIs; the green band is the ±3 pp equivalence margin. Most contrasts among MOPD, SFT and the merges sit inside the band; routing on IF and several contrasts against Mix-RL or the base model sit outside it.

Accuracy per unit of compute

At equal accuracy, the merges cost nothing and SFT needs about half of MOPD's VM-hours.

Arm (per seed, to step 60)Chipss/stepLearner tokensVM-h$
Merges M1–M4CPU–0≈ 0 (seconds)≈ 0
Mix-RL211511.0 M1.065.74
SFT on teacher samples, step 60217920.2 M1.598.59
SFT on teacher samples, step 120217940.3 M3.0716.59
MOPD418320.4 M3.3418.03
MOPD-dist419320.5 M3.5018.89
OPD (T-math only)418320.7 M3.3017.84

VM-h is learner wall time times the share of the v6e-4 the run used, and $ is VM-h × $5.40 (the Flex list price). s/step is the median. Teacher training is shared by every arm except Mix-RL and is not included.

Step-60 accuracy against training VM-hours per seed for every arm; merges at about zero
Step-60 accuracy against training VM-hours per seed. The merges sit at about 0 VM-h at MOPD's level; SFT reaches it at about half the VM-hours.
AIME, IFEval and IFBench by training step, seeds pooled with 95% CI bands; SFT runs to step 120
Evals by step, seeds pooled, with 95% CI bands. Every distillation arm reaches about teacher level by step 20 on AIME and then stays flat. Mix-RL is still climbing at step 60 (12.0 → 12.9 → 15.1%). SFT runs to step 120.

Why the cheap baselines work here

When on-policy distillation should win

We expect the ranking to change with:

The paper proposes a test for each. Until those are run, for same-origin, short-horizon specialists: try task arithmetic first (it is free), then offline distillation, and reserve on-policy distillation for when both fall short.

Share of the teacher gap closed

How much of the base-to-teacher gap each arm closes at step 60, with 95% CIs. The teacher is T-math for AIME and T-IF for IFEval and IFBench; 100% means teacher level.

ArmAIME (gap +8.6 pp)IFEval (gap +6.0 pp)IFBench (gap +5.7 pp)
MOPD94% [79, 112]79% [52, 107]96% [58, 155]
MOPD-dist98% [81, 118]76% [44, 108]108% [74, 174]
SFT, step 6095% [79, 114]71% [42, 98]93% [57, 149]
SFT, step 12095% [79, 114]75% [42, 107]102% [68, 167]
M2 task arithmetic108% [87, 131]89% [57, 122]131% [89, 214]
M3 TIES 20%94% [75, 117]75% [43, 108]108% [66, 178]
M4 TIES 50%99% [79, 124]77% [44, 110]89% [48, 149]
M1 linear average74% [55, 95]46% [7, 79]71% [25, 126]
Mix-RL66% [43, 89]66% [33, 105]33% [−11, 73]
OPD (T-math only)97% [79, 116]−21% [−71, 10]−11% [−67, 21]

The gaps are small, so the ratios have wide CIs. The linear average halves each teacher's weight change, which is why it closes less.

Share of the base-to-teacher gap closed at step 60 per arm and benchmark, with 95% CIs
Share of the base-to-teacher gap closed at step 60, per arm and benchmark, with 95% CIs.

MOPD vs MOPD-dist

Equivalent within ±3 pp on all three benchmarks, for about 3.5% more step time. The cheaper sampled-token form is enough at this scale.

Cost

All runs used Flex v6e-4 in europe-west4-a at $5.40/h. Spot was never granted, and on-demand was never requested.

PhaseVM-hoursLedgerOff-ledger (est.)Total
Pilot (30 steps, 1 seed, gates)11.1$60.06≈ $18≈ $78
Main study (2 seeds, teachers)34.2$184.48≈ $33≈ $217
Paper extension (2 more seeds, SFT, merges, re-evals)42.8$231.11≈ $69≈ $301
Total88.1$475.65≈ $120≈ $596

The ledger counts VM time at the Flex list price. Off-ledger cost is cross-region GCS transfer (estimated at $0.08/GB): the bucket is in asia-northeast1 and the VMs ran in europe-west4. Most of it is compile-cache pulls, which grew from 33 GB to 208 GB over the program.

The stored teachers

All four teachers are kept under gs://qrl-bc4a-compile-cache-tpu-builders-509006/teachers/qwen3.5-2b/, with a GCS temporary hold on every object. Each directory holds:

A public Hugging Face release under Apache-2.0 is planned.

TeacherDirectoryAIMEIFEvalIFBench
T-math, 60 steps (used)math-grpo-k1is-60steps-s0-20261124-9dfe9c2/18.05%66.4%24.8%
T-IF, 60 steps (used)if-grpo-k1is-60steps-s0-20261124-9dfe9c2/10.57%74.3%31.5%
T-math, 30 steps (pilot)math-grpo-k1is-30steps-s0-20261124-d909884/15.7%66.7%27.9%
T-IF, 30 steps (pilot)if-grpo-k1is-30steps-s0-20261124-d909884/9.5%71.3%28.1%

The 60-step in-domain scores pool 3 eval repeats (T-math AIME; T-IF IFEval and IFBench); the other cells are single evals.

Caveats

References

MOPD2, the later variant with teacher-prefix and SFT-prefix streams described in the MiMo-V2.6-Flash-MOPD model card, is out of scope here.

Appendix

Per-seed scores and seed spread
Per-seed step-60 scores for every seeded arm
Per-seed step-60 scores for every seeded arm.

Per-seed SD of step-60 scores, in pp (AIME / IFEval / IFBench):

  • Mix-RL: 1.7 / 1.3 / 1.1.
  • MOPD: 0.4 / 0.5 / 1.2.
  • SFT: 0.4 / 0.4 / 0.1.

Both distillation forms are more reproducible than RL, but this does not separate on-policy from offline.

Training dynamics (main study, seeds s0–s1)
Reverse KL to the routed teacher and policy entropy per step
Reverse KL to the routed teacher (all, math and IF prompts) and policy entropy per step, for the distillation and Mix-RL runs of the main study.
  • Reverse KL falls about 30× over 60 steps.
  • Single-teacher OPD carries almost no signal on the other domain: T-math's KL on IF prompts is about 0.002, against 0.022–0.038 for T-IF.
  • Distillation trains every sampled sequence (about 20.5 M tokens per run), so the learner is the bottleneck: about 3% learner idle against about 46% generator idle.
Pilot go/no-go gates

One seed of MOPD, MOPD-dist and Mix-RL plus both teachers, at 30 steps. All seven gates passed.

GateResultNumbers
1. End to end, learner idle < 10%PASS30/30 steps plus final evals; learner idle 6.2% (MOPD), 6.1% (MOPD-dist).
2. s/step inside the modelled P90PASSMOPD 207.9 s (P90 222), MOPD-dist 214.8 s (P90 272).
3. MOPD-dist fits at --mb-tokens 8192; hidden-state loss matches direct logits within 1e-3PASSRan at 8192; difference 0.0 (mean and max) at every step.
4. Reverse KL falls, entropy holdsPASSMOPD KL 0.0088 → 0.0006, MOPD-dist 0.0097 → 0.0010; entropy 0.42 → 0.40.
5. 9B starting KL measuredPASS, switch triggered9B 0.194, 4B 0.178, same-origin 0.0144 (13.4×) → single teacher switched to T-math on every prompt.
6. Teacher export round trip, hold, delete refusalPASSAIME 15.2% vs logged 15.7%, IFEval 71.8% vs 71.3%; 0 missing / 0 mismatched of 320 tensors; 42/42 objects held; deletes of teachers/ refused.
7. Re-price the full planPASSP90 36.7 VM-h = $198 on the ledger, under $255. Actual: $184.48.
Method
  • Student and data. Qwen3.5-2B.
    • Each step samples 8 math prompts (AIME 1983–2023) and 8 IF prompts (RLVR-IFeval).
    • Each prompt gets 8 answers of up to 6,144 tokens, at temperature 1.
    • Every arm sees the same prompt stream per seed.
    • AdamW at a learning rate of 1e-6.
    • All runs are async lag 1 with truncated importance sampling (cap 2), the recipe the async vs sync study recommended.
  • Teachers. Same-origin specialists, trained from the same base with GRPO for 60 steps at 16 prompts per step.
    • T-math: AIME prompts, exact \boxed{} match reward.
    • T-IF: RLVR-IFeval prompts, verifiable instruction-checker reward.
  • Arms.
    • MOPD: each answer goes to its domain's teacher. The per-token advantage is sg[log π_teacher − log π_student], clipped at ±5, in the policy-gradient loss with truncated IS. No outcome reward.
    • MOPD-dist: exact reverse KL to the routed teacher over the full vocabulary.
    • Mix-RL: GRPO on the same mixed batches, outcome reward only.
    • OPD from T-math only: MOPD's loss, with T-math scoring every prompt.
    • SFT on teacher samples: the generator samples from the routed teacher, and the learner minimises cross-entropy on those samples. It is evaluated at step 60 (learner tokens matched) and step 120 (VM-hours matched).
    • Merges, built on CPU in seconds: M1 linear average, M2 task arithmetic (λ = 1), M3 TIES at 20% density (pre-registered primary) and M4 TIES at 50%.
  • Seeds. Four for MOPD, MOPD-dist and Mix-RL; three for OPD and SFT.
  • Eval. AIME pass@1 on the async study's 136-problem set × 16 samples (AIME 2024–2026, BRUMO 2025, HMMT 2025–2026), IFEval strict prompt accuracy (541 × 4) and IFBench strict accuracy (300 × 4). Non-thinking mode.
  • Statistics.
    • Hierarchical bootstrap with 10,000 draws: resample problems, then seeds, then redraw each problem's outcomes from a binomial. Differences are paired by problem.
    • TOST equivalence at ±3 pp, with a 90% CI.
    • Holm correction over 7 primary contrasts per benchmark.
    • A Bayesian mixed GLM as the robustness check.
  • Code. rl/ in this repository, Apache-2.0. The training stack is in rl/qrl/, TPU orchestration in rl/tpu/, and the plans used are rl/tpu/mopd{pilot,full,paper}.json.