Skip to content

On-policy distillation: a map

Skip →MOPD (multi-teacher OPD)
main track #15corefrontierblogrubric 11/122026 · ~25 min

Learning Stack (synthesis)

Read first: REINFORCE and the Policy-Gradient Theorem (Williams 1992; Sutton et al. 1999) · Distilling the Knowledge in a Neural Network

Status

TL;DR. On-policy distillation (OPD) trains a student on text it samples itself, using teacher feedback at every prefix the student visited. The most common implementation scores each token with the teacher’s log-probability and minimises the reverse KL from student to teacher; other methods use forward KL, JSD or selective token masks. With the reverse-KL choice, OPD is RL with a dense per-token reward. The family differs mainly in who the teacher is (a bigger model, several RL specialists, the model itself with extra context, or a black-box API) and how each token is graded (one sampled-token log-ratio, top-k logits, or the full vocabulary).

Why it matters now. OPD moved from a 2023 research idea to the last stage of frontier post-training in 2025–2026. Qwen3 uses it to make its small models. Xiaomi’s MiMo-V2-Flash names its multi-teacher version MOPD and calls it a new post-training paradigm. DeepSeek-V4 says it entirely replaced the mixed-RL stage of V3.2 with multi-teacher OPD. For search and deep-research agents, OPD is how a specialised search teacher’s behaviour is merged into one deployable model without running RL on every skill again. The same exposure-bias logic also shows up in retrieval itself: see on-policy chain retrieval.

What makes it OPD. Four choices are separate: whose samples the training visits (the student’s, for OPD), which divergence is used, which tokens are scored, and who the teacher is. The common white-box recipe fixes the second choice to reverse KL. Write πθ\pi_\theta for the student and πT\pi_T for the teacher. Sample y∼πθ(⋅∣x)y \sim \pi_\theta(\cdot\mid x). Let the teacher prefill yy in one forward pass, which gives log⁡πT(yt∣x,y<t)\log \pi_T(y_t \mid x, y_{\lt t}) at every position. Minimise the per-token reverse KL on the student’s own prefixes:

LOPD(θ)=Ey∼πθ[∑tKL(πθ(⋅∣x,y<t) ∥ πT(⋅∣x,y<t))].\mathcal{L}_\text{OPD}(\theta) = \mathbb{E}_{y\sim\pi_\theta}\Big[\sum_t \mathrm{KL}\big(\pi_\theta(\cdot\mid x,y_{\lt t})\,\big\|\,\pi_T(\cdot\mid x,y_{\lt t})\big)\Big].

The RL view. Grade only the sampled token and you get a per-token advantage

At=log⁡πT(yt∣x,y<t)−log⁡πθ(yt∣x,y<t),A_t = \log \pi_T(y_t\mid x,y_{\lt t}) - \log \pi_\theta(y_t\mid x,y_{\lt t}),

whose expectation over yt∼πθy_t \sim \pi_\theta is exactly −KL(πθ ∥ πT)-\mathrm{KL}(\pi_\theta\,\|\,\pi_T) at that prefix.

A two-token example. Suppose the student gives the token it sampled probability 0.3. If the teacher gives that token 0.6, then At=log⁡(0.6/0.3)=log⁡2≈+0.69A_t = \log(0.6/0.3) = \log 2 \approx +0.69, and the update raises the token’s probability. If the teacher gives it 0.1, then At=log⁡(0.1/0.3)≈−1.10A_t = \log(0.1/0.3) \approx -1.10, and the update lowers it. The sign measures relative probability (does the teacher like this token more or less than the student does?), not whether the token is factually correct.

Fixed prefix versus whole sequence. At a fixed prefix, the sampled log-ratio gives an unbiased gradient of the negative reverse KL. With the rollout prefixes treated as fixed data, a policy-gradient update with discount 0 averages these local gradients; that is the Thinking Machines recipe. The full sequence-KL gradient additionally credits each token for its effect on which future prefixes get visited. MiniLLM keeps that future-return term (a cumulative return, discount 1) and adds variance-reduction tricks. MOPD drops AtA_t into GRPO/PPO code as if it were a reward, with a stop-gradient (written sg\mathrm{sg}: the teacher-minus-student value is treated as a constant number, so no gradient flows through the student’s own log-probability inside it) and clipping. Three properties follow:

  • Dense. RLVR gives one scalar per answer. OPD gives one per token, so credit assignment is direct.
  • Non-stationary, with a known optimum. The reward depends on the current student; exact KL is minimised when the student matches the teacher, unlike an unconstrained learned reward. That does not guarantee safe optimisation with sampled, clipped or length-normalised surrogates: MiniLLM observes short or repetitive outputs and adds stabilising remedies.
  • Teacher-targeted, not reward-targeted. Pure distillation aims at the teacher distribution rather than directly optimising task reward. This limits the available supervision, so OPD mostly transfers skill rather than discovering it, but it does not impose a strict ceiling on benchmark accuracy: GKD’s self-distilled students, some MiniLLM students and MOPD’s AIME26 result all outscore their teachers.

Why reverse KL. Reverse KL is mode-seeking: the student pays a lot for putting mass where the teacher puts almost none, and little for ignoring some teacher modes. A small student cannot cover everything a big teacher can do, so it concentrates on what it can do well. MiniLLM argues forward KL makes the student overestimate the teacher’s low-probability (“void”) regions. GKD shows the best divergence depends on task and sampling temperature, and some self-distillation methods (OPSD, SDFT) find forward KL works best in their setting.

Why on-policy reduces exposure bias. SFT and classic knowledge distillation train on teacher or dataset prefixes. At inference the student conditions on its own prefixes, which drift after its first mistake, and it never saw those states in training. OPD samples the prefixes from the student, so the teacher’s grades arrive exactly on the states the student will visit, including states after its own errors. This reduces the train–test mismatch; it does not guarantee that the student learns to recover from every bad prefix. This is the DAgger argument from imitation learning, which GKD makes explicitly.

On-policy distillation family: the common white-box recipe, two design axes, and related methods Left: the common white-box reverse-KL recipe for on-policy distillation; other OPD methods swap in forward KL, JSD or token masks. The student samples a response on its own states; the teacher prefills that response and gives a log-probability at every position; the per-token advantage is the teacher log-probability minus the student log-probability, whose expectation over the student's next-token distribution is the negative reverse KL. Right: a two by two grid of who the teacher is. A bigger model (GKD, MiniLLM, the Thinking Machines recipe, Qwen3 strong-to-weak). Many RL-trained domain specialists, with each prompt routed to one teacher (MOPD in MiMo-V2-Flash, DeepSeek-V4 and V4.1-Flash). The model itself given privileged context (OPSD, SDFT, SD-Search; pi-Distill is marked as related because its main method trains on teacher-generated rollouts). A dashed box for a black-box teacher that only returns text: GAD, a related method in which a discriminator gives a sequence-level reward and no teacher log-probabilities are used. Bottom: an axis for how the teacher's grade is computed, from a single sampled-token log-ratio (cheap, RL-ready, high variance) through top-k logits (corrected so the retained-token divergence is minimised at the teacher's probabilities; the tail is still omitted) to the full vocabulary (exact per-position KL, heavy teacher input and output). Shared white-box recipe 1. Student samples y ~ π_θ on its own prefixes (states) 2. Teacher prefills y log π_T at every position 3. Dense per-token grade A_t = log π_T − log π_θ mean over π_θ = −reverse KL SFT: dense, teacher's states. RLVR: own states, 1 grade/answer. Dashed / * = related, not this recipe. Axis 1: who is the teacher? A bigger model GKD · MiniLLM Thinking Machines OPD Qwen3 strong-to-weak shared tokenizer needed Many RL specialists MOPD (MiMo-V2-Flash) DeepSeek-V4, V4.1-Flash route prompt → teacher merges skills in policy Itself + extra context OPSD (sees solution) SDFT (sees a demo) SD-Search · π-Distill* no bigger model needed Black-box (related) GAD: discriminator gives 1 sequence-level reward text-only API teacher no logits, any tokenizer Axis 2: how is each token graded? Sampled-token log-ratio 1 number per token, RL-ready TM blog, MOPD (PG form) Top-k logits optimum-corrected (MOPD, k=64) tail omitted, small payload Full vocabulary exact KL per position GKD, OPSD, DeepSeek-V4 ← cheaper, noisier lower variance, more teacher I/O →
Original sketch. The common white-box reverse-KL recipe is on the left; variants differ in who the teacher is (right) and how each token is graded (bottom). Related methods that drop teacher log-probabilities or student rollouts (GAD, π-Distill) are set apart.
Method (year)TeacherWhose samplesPer-token signalDistinctive ideaPage
GKD (2023, ICLR 2024)Bigger modelMix: fraction λ of student samplesFull distribution: forward KL, reverse KL or JSD(β)Data source and divergence are knobs; can add an RL rewardGKD
MiniLLM (2023, ICLR 2024)Bigger modelStudent, mixed with teacher (α = 0.2)Sequence-level reverse KL via policy gradientSingle-step decomposition, length normalisation, teacher-mixed samplingMiniLLM
Thinking Machines OPD (2025, blog)Bigger model or earlier checkpointStudentSampled-token log-ratio, discount 0One teacher forward pass inside a normal RL loop; continual-learning useOPD blog
Qwen3 strong-to-weak (2025)Qwen3-32B or 235B-A22BOff-policy phase, then studentLogit KLProduction recipe for the small Qwen3 models; compared head-to-head with RLQwen3
MOPD (Xiaomi, 2026)Several RL specialists from one SFT checkpointStudent; each prompt routed to its domain teacherSampled-token reverse KL (or top-k, k = 64), optional outcome rewardMerge specialists in policy space; teachers run as prefill servicesMOPD
DeepSeek-V4 / V4.1-Flash (2026)More than 10 (V4) and more than 40 (V4.1-Flash) specialistsStudentFull-vocabulary reverse KL, weighted per teacherReplaces mixed RL; teacher weights and logits offloadedDeepSeek-V4, V4.1-Flash
Open-MOPD (2026)Three specialists on a 3B baseStudentAs MOPDFixes token-budget imbalance across domainsMOPD § Open-MOPD
OPSD (2026)The model itself, shown the reference solutionStudentFull-vocabulary clipped divergence (forward KL best)No bigger teacher; fixed initial policy as teacherOPSD
SDFT (2026)The model itself, shown a demonstrationStudentDivergence to the in-context teacher (forward KL in practice)Learning new skills from demos with less forgettingSDFT
SD-Search (2026)The model itself, given a hindsight summary of a group of rolloutsStudentToken-level JSD at search-query positions, on top of GRPOSelf-distillation aimed at search queriesarXiv 2605.18299

Related methods outside the white-box recipe. Two methods often listed beside OPD differ in a way that matters:

  • π-Distill (2026) — privileged-information teacher rollouts. Its main method trains on traces generated by the PI-conditioned teacher, with teacher and student jointly updated in one parameter-shared model; the authors note it “can be viewed as off-policy learning”. Its separate OPSD alternative uses student rollouts. See π-Distill.
  • GAD (2025) — related black-box distillation. Student-generated responses receive a sequence-level scalar reward from a learned discriminator trained to tell them apart from the API teacher’s (GPT-5-Chat in the paper); no teacher-token log-probabilities are required, so it works with text-only teachers and any tokenizer. See arXiv 2511.10643.

Naming. “MOPD” is Xiaomi’s name, introduced in the MiMo-V2-Flash report and expanded in a standalone paper. DeepSeek-V4 describes the same multi-teacher idea without that name. Note also that “OPSD” means two different things on this site: Zhao et al.’s self-distillation and a π-Distill variant.

Further reading. A broad survey (Song & Zheng, arXiv 2604.00626) covers teacher supervision, self-distillation, OPD + RL, multi-teacher OPD, agentic OPD and open problems such as cross-tokenizer distillation. Its multi-teacher section lists further MOPD variants (TrustMOPD, Δ-MOPD, CaMOPD, D³-MOPD) that this site does not cover.

  • MiniLLM (Table 1): a GPT-2 120M student distilled from GPT-2 1.5B scores 44.7 GPT-4 feedback on DollyEval, versus 38.6 SFT, 40.3 KD and 41.2 SeqKD. A LLaMA-7B student from LLaMA-13B reaches 76.4, versus 73.0 SFT (teacher 79.0).
  • Qwen3 (Table 21, 8B student, same starting checkpoint): AIME’24 55.0 → 67.6 with RL (17,920 GPU hours) and → 74.4 with OPD (1,800 GPU hours). OPD also raises pass@64 (90.0 → 93.3); RL leaves it at 90.0.
  • Thinking Machines: from a 60% SFT checkpoint, about 150 OPD steps reach 70% on AIME’24, an estimated 9–30× less compute than extrapolated SFT. Distilling an RL-trained policy takes 7–10× fewer gradient steps than RL.
  • MOPD paper (Qwen3-30B-A3B, three domains): MOPD recovers 0.937 of the teacher–SFT gap on average, versus 0.882 for mixed-domain RL and 0.775 for cascaded RL, with every domain between 0.91 and 0.95.
  • Open-MOPD: on SmolLM3-3B, a standard multi-teacher OPD baseline recovers 35.6% of the improvement from mixed-domain SFT to the routed RL experts (RouteRL); Open-MOPD’s combined token-share balancing, gap-aware allocation and student reward refresh raise recovery to 83.4%.

All of these are author-reported; most report no uncertainty estimates, and the Qwen3, MiMo and DeepSeek numbers come from vendor reports.

SituationUseWhy
Cold start: the student’s samples are poor or the format is newSFT or off-policy KD firstOPD grades are only informative if the student already lands near the teacher’s support
A stronger teacher with the same tokenizer existsOPDDense signal on the student’s own states; Qwen3 reports about one-tenth of RL’s GPU hours for a better result
You need to exceed every available model, or no teacher existsRLVR (GRPO and relatives)OPD targets the teacher’s distribution; an outcome reward optimises the task directly
Several specialists must become one modelMOPD / multi-teacher OPDAvoids the see-saw of mixed RL and the forgetting of cascaded RL; check each domain’s effective gradient weight
No bigger teacher, but you have solutions, demos or hindsightSelf-distillation (OPSD, SDFT, SD-Search)The model conditioned on extra context is the teacher
The teacher is an API returning text onlySFT on its outputs, or GADLogit OPD needs log-probabilities on the student’s tokens
Continual learning or personalisation after domain mid-trainingOPD from the model’s pre-update versionThinking Machines uses this to restore instruction following lost during mid-training

These modes compose. The production recipes all chain them: SFT → RL (to make teachers) → OPD (to merge them), sometimes with an outcome reward added to the OPD advantage.

  • Teacher-bound supervision and cost accounting. OPD mostly transfers skill; the teacher’s own RL is the expensive part and is rarely counted in “OPD is cheaper” claims.
  • Compatibility. Logit OPD needs a shared vocabulary. Even then, the MOPD paper finds that a stronger external teacher can hurt: same-origin teachers mattered more than raw strength.
  • Variance versus I/O. Sampled-token grades are cheap but noisy; full-vocabulary grades are exact but require moving teacher logits at scale (DeepSeek-V4 rebuilds them from cached last-layer hidden states).
  • Domain imbalance. With long math or code trajectories and short instruction-following answers, a prompt-balanced mix under a global token-mean loss starves the short domain of gradient weight. Inspect the loss reduction first: a global token mean ∑i∑tℓit/∑iLi\sum_i\sum_t \ell_{it} / \sum_i L_i weights responses by length, while a sequence mean 1N∑i1Li∑tℓit\frac1N\sum_i \frac1{L_i}\sum_t \ell_{it} does not, so token-share balancing on top of sequence normalisation can over-correct.
  • Regressions hide in averages. After MOPD, MiMo-V2-Flash matches or beats its best teacher on most benchmarks, but ends 6.3 points below the teacher on BrowseComp and drops 3.9 points on Arena-Hard creative writing.
  • Cross-tokenizer and black-box teachers remain open; GAD is one answer, and the survey lists others.

This is the technical path. For an intuition-first route, read this map, then On-Policy Distillation (Thinking Machines), then MOPD, and come back to GKD and MiniLLM for the derivations.

  1. GKD for the on-policy argument and the divergence choice.
  2. MiniLLM for the policy-gradient form of reverse KL and its pitfalls.
  3. On-Policy Distillation (Thinking Machines) for the simple modern recipe.
  4. Qwen3 §4.5 and Table 21 for a production comparison with RL.
  5. MOPD for multi-teacher merging, then the DeepSeek-V4 post-training section for the full-vocabulary variant.
  6. OPSD and SDFT for self-distillation.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    At one prefix the student's next-token distribution over three tokens is p_S = (A 0.5, B 0.3, C 0.2) and the teacher's is p_T = (A 0.7, B 0.2, C 0.1). Compute the sampled-token OPD advantage A_t = log p_T − log p_S for each token the student could sample, its expectation under p_S, the reverse KL(p_S‖p_T) and the forward KL(p_T‖p_S). Then explain what the spread of the three advantages implies for choosing between the sampled-token, top-k and full-vocabulary forms of the loss.

    What a strong answer covers
    • Advantages: A ≈ +0.34 (log 1.4), B ≈ −0.41 (log 0.667), C ≈ −0.69 (log 0.5). Sampling A pushes A up; sampling B or C pushes those tokens down.
    • Expectation under p_S: 0.5·0.34 + 0.3·(−0.41) + 0.2·(−0.69) ≈ −0.092, which is exactly −KL(p_S‖p_T). The reverse KL is ≈ 0.092 and the forward KL(p_T‖p_S) ≈ 0.085; the two differ because KL is asymmetric.
    • The per-sample advantage has variance ≈ 0.19 around a mean of only −0.09, so one sampled token per position is a noisy estimate of the per-position KL. Every individual sign can disagree with the average.
    • The full-vocabulary form sums over all three tokens at this prefix and removes that sampling noise, at the cost of the teacher shipping a whole distribution per position. Top-k keeps most of the mass with a small payload; MOPD's k = 64 form adds terms so that the retained-token generalised KL is minimised at the teacher's probabilities, but the omitted vocabulary tail is still omitted. DeepSeek-V4 cites the variance of the sampled-token form as its reason for full-vocabulary distillation.
  2. Mechanism

    Place SFT on teacher outputs, off-policy logit KD, RLVR and on-policy distillation in a 2 × 2 grid of "whose states does training visit?" × "how dense is the signal?". Use the grid to explain why OPD reduces exposure bias and why it needs far fewer samples than RLVR, and say what OPD gives up relative to each neighbour.

    What a strong answer covers
    • SFT and off-policy KD train on teacher (or dataset) prefixes with a dense per-token target. At inference the student conditions on its own prefixes, which drift after its first mistake; it never saw those states in training (exposure bias, the DAgger argument).
    • RLVR trains on the student's own prefixes but gets one scalar per answer, so credit assignment over thousands of tokens is weak and many rollouts are needed.
    • OPD trains on the student's own prefixes and gets a grade for every token from the teacher, including on prefixes that already contain a student error. This is the on-policy, dense cell.
    • Versus SFT/KD it costs student sampling and a teacher forward pass per step, and it needs a shared tokenizer for logit access. Versus RLVR it targets the teacher's distribution rather than task reward: its supervision comes only from the teacher, so it is a poor tool for discovering behaviour the teacher would not produce (although students can still outscore teachers on particular benchmarks).
  3. Critique

    Qwen3's Table 21 starts from the same off-policy-distilled 8B checkpoint and reports that on-policy distillation reaches 74.4 on AIME'24 with 1,800 GPU hours, while RL reaches 67.6 with 17,920 GPU hours. List the threats to reading this as "OPD is 10× cheaper than RL", and design the experiment that would settle it.

    What a strong answer covers
    • The teacher (Qwen3-32B or Qwen3-235B-A22B) was itself trained with large-scale reasoning RL. Its cost is amortised and excluded; OPD is cheap because someone already paid for RL on a bigger model.
    • OPD's supervision comes from the teacher, so the comparison says nothing about a setting with no stronger teacher, or about the frontier model that has to be trained first.
    • The table is vendor-reported from one starting checkpoint with no uncertainty estimates, and training used math and code queries only (six benchmarks are reported). GPU-hour accounting (teacher prefill hardware, rollout engine) is not broken down.
    • Settling experiment: fix total compute including teacher training, compare OPD against RL from a matched student across several student sizes and seeds, and include a domain where the teacher is weak. If OPD's advantage disappears there, the gain is transfer from the teacher, not a better optimiser.
  4. Connect

    MiniLLM optimises sequence-level reverse KL with a policy-gradient return R_t = Σ over t' ≥ t of log p(y_t')/q_θ(y_t'), a cumulative return with discount 1. The Thinking Machines recipe uses the per-token log-ratio with discount 0. What does each estimator optimise, what does discount 0 throw away, and which extra machinery does each need?

    What a strong answer covers
    • Sequence-level reverse KL equals the sum over positions of the per-position KL, taken under the student's own state distribution. Its gradient has two parts: change the next-token distribution at a visited state, and change which future states get visited.
    • Discount 0 keeps only the first part. Each token is graded only by its own log-ratio and ignores how it changes later grades. That is lower variance and simple, but myopic.
    • MiniLLM keeps the future term (the "Long" part of its gradient using R_(t+1)). Because that return is noisy and favours short outputs, it adds the single-step decomposition (exact per-step expectation over the vocabulary), length normalisation, and teacher-mixed sampling against reward hacking.
    • Both are RL with a dense, non-stationary reward that depends on the current student. Exact KL has a known optimum (the student matching the teacher), unlike an unconstrained learned reward, but that does not make sampled, clipped or length-normalised surrogates safe to optimise: MiniLLM observes degenerate short or repetitive outputs without its remedies.
  5. Design

    You lead post-training for a 9B deep-research search agent. You have three RL-trained specialists from the same SFT checkpoint (a 30B search agent, a math reasoner and an instruction follower), plus GPT-class API access for writing quality. Search trajectories average 6,000 tokens and instruction-following responses 400. Design the pipeline (SFT, OPD, MOPD, RLVR or GAD, in which order and for which skill), the per-token signal you would use, and how you would detect regressions.

    What a strong answer covers
    • Start with SFT or off-policy distillation for support: OPD needs a student whose own samples are reasonable, so the teacher's grades are informative.
    • Merge the same-origin specialists with MOPD: route each prompt by domain to its teacher, use the per-token reverse-KL advantage, and optionally add a small outcome reward as MiMo-V2-Flash does. The search teacher is larger, so check the tokenizer is shared.
    • Check the loss reduction first (global token mean, sequence mean or prompt mean). Under a global token mean, an equal prompt mix gives instruction following only a few per cent of the gradient weight, the failure Open-MOPD diagnoses, so re-weight per domain toward the intended share. Under a per-sequence mean, long responses do not automatically dominate, and inverse-length re-weighting on top would over-correct.
    • The API model returns text only, so logit OPD is impossible. Use GAD-style discriminator rewards or SFT on its outputs for writing style. Keep RLVR for anything where you want an outcome reward to push beyond every teacher.
    • Track each domain against its own teacher, not a pooled average. After MOPD, MiMo-V2-Flash's BrowseComp ended 6.3 points below its best teacher while most benchmarks matched or beat theirs, so watch search accuracy, number of tool calls and answer length on held-out deep-research tasks.
  6. Research idea

    MOPD's authors found that swapping their same-origin math teacher for a stronger external model (Qwen3-235B-A22B) made math worse, with initial per-token KL about 0.19 versus 0.04. Propose a research programme on teacher–student compatibility in OPD: what to measure, what hypotheses to test, and what method could make stronger but less compatible teachers usable.

    What a strong answer covers
    • Measure initial per-token KL, the fraction of student-sampled tokens the teacher puts low probability on, entropy over training, and the sign balance of advantages. MOPD reports a predominantly negative signal and entropy falling from about 0.30 to 0.21 with the external teacher.
    • Hypothesis 1: most of the gap is style or format (different reasoning templates) rather than knowledge. Test by first SFT-ing the student on a few teacher samples, then re-measuring KL and OPD gains.
    • Hypothesis 2: reverse KL's mode-seeking makes it punitive when the student's modes lie in teacher low-density regions. Test forward KL, JSD or clipped divergences (as in OPSD) at matched compute.
    • Candidate methods: a curriculum from a same-origin teacher to the external one, mixing teacher and student sampling (MiniLLM's α), advantage clipping, or a bridge teacher fine-tuned toward the student's style.
    • Report per-domain results, several seeds, and absolute scores (not only normalised ones) so a regression on one benchmark is visible.

Done with this page?

Status