Distillation and RL

Copying a stronger model is often cheaper than RL. On-policy distillation combines the two, and has become the final stage of several frontier recipes.

Key idea
Off-policy distillation, rejection sampling, on-policy distillation, and how much RL actually teaches
Real world
Learning chess three ways: replay grandmaster games move by move, play your own games and only learn whether you won, or play your own games with a coach annotating every move you made.
In an LLM
DeepSeek fine-tuned small models on 800,000 reasoning traces from R1. The distilled small models beat the same small models trained with RL directly.

Three ways to learn from a better model

MethodWho writes the training textSignal per tokenChess version
Distillation (SFT)The teacher"Write exactly this"Replay grandmaster games
RLThe studentOne reward for the whole answerPlay, learn only win or lose
On-policy distillationThe studentThe teacher's opinion of every tokenPlay, with a coach marking each of your moves

Distillation is ordinary fine-tuning on a stronger model's answers. It’s cheap and gives feedback on every token, but it is off-policy: the student imitates text it would never have written, and never sees its own mistakes corrected.

RL trains on the student's own answers, which fixes that, but gives only one number per answer.

On-policy distillation gets both. The student writes an answer; the teacher computes its probability for every token the student wrote; each token is pushed toward what the teacher would have done.

example · on-policy distillation on two tokens

The student solving 17 × 6 writes two tokens worth looking at:

TokenStudent's probabilityTeacher's probabilityAdvantage ln⁡pT−ln⁡pS\ln p_T - \ln p_S
112 (wrong)0.400.02−3.0
Let me check0.600.90+0.41

The wrong token is pushed down hard, the self-check is pushed up a little. No answer key is needed, and every token gets its own signal instead of sharing one reward.

Try it

reward (answer key)0
steps with a strong signal1 of 9
reverse KL at selected step1.097
At “112”: what each model would write here
teacherstudent
The teacher pinpoints the slip: “112” gets −3.0 (the teacher would almost never write it), the self-check is pushed up, and the correct steps are left nearly alone. No answer key needed.
The student answers “What is 17 × 6?”. Each chip is one step it wrote, coloured by the push it gets: green up, red down, stronger colour for a bigger push. Click a chip to compare the student and teacher at that point.
example · the coach

After your game, a coach goes through it and marks each of your moves: good, dubious, blunder. You learn from positions you reached, which replaying grandmaster games never shows you, and you learn far more per game than from the result alone.

Rejection sampling and expert iteration

A simple middle ground: sample many answers, keep the ones that are correct, and fine-tune on them. Repeat. This is STaR, RAFT or "expert iteration" depending on the paper. It's the baseline that RL has to beat, and it's a standard stage in recipes like DeepSeek-R1.

How much does RL teach?

An outcome reward is roughly one bit of information per answer: right or wrong. Distillation gives the teacher's full preference at every token. Thinking Machines used this argument to explain why LoRA (a small add-on that trains far fewer numbers) matches full fine-tuning for RL even when made very small: there isn't much information to store. A related finding, "RL's razor": because RL changes the model only as much as the reward requires, it forgets less of what the model knew than fine-tuning does.

In frontier recipes

Since late 2025, several labs train separate RL "experts" for maths, code, agents and so on, then merge them into one model with on-policy distillation from all of them. A September 2026 study found that running on-policy distillation first and RL second beats either alone, and beats mixing them: distillation widens what the model can do, and RL then sharpens it. See frontier recipes.

going deeper

On-policy distillation objective

The student πθ\pi_\theta samples yy; minimise the per-token reverse KL to the teacher πT\pi_T:

L=Ey∼πθ[∑tKL(πθ(⋅∣st) ∥ πT(⋅∣st))]L = \mathbb{E}_{y \sim \pi_\theta}\Big[\sum_t \mathrm{KL}\big(\pi_\theta(\cdot \mid s_t)\, \|\, \pi_T(\cdot \mid s_t)\big)\Big]

A cheap estimator uses only the sampled token: per-token advantage log⁡πT(ot∣st)−log⁡πθ(ot∣st)\log \pi_T(o_t \mid s_t) - \log \pi_\theta(o_t \mid s_t), plugged into the usual policy-gradient loss. Using the full vocabulary distribution is lower-variance and more expensive.

Papers and posts

Related

  • rlvr - Let a program check the answer, run GRPO on hard maths and code, and models learn to think longer. This is the recipe behind DeepSeek-R1 and today's reasoning models.
  • pass-at-k - RL makes a model reliably solve what it could already solve sometimes. Whether it can solve anything genuinely new is one of the field's main open questions.
  • frontier-recipes - Modern post-training (everything after the first big round of learning from text) chains supervised fine-tuning, several kinds of RL, and distillation. This page maps the published recipes onto the ideas in this course.