On-policy distillation (OPD) trains a student on completions sampled from its current policy, then compares its next-token distributions with a fixed teacher. This avoids relying only on teacher-generated data, which can create a student–inference distribution mismatch and encourage overestimation of low-probability teacher regions. The resulting optimization uses a reverse-KL objective inside an online policy-gradient reinforcement-learning framework. section 12.3.2
For prompt s, completion a, and token-level state s_t = (s, a_<t), OPD proceeds as follows:
- Sample a completion from the current student policy πθ(·|s), so training states reflect the behavior encountered during student inference. section 12.3.2
- Compare the student distribution πθ(·|s_t) with the fixed teacher distribution πT(·|s_t) using reverse KL, DKL(πθ || πT). section 12.3.2
Equation 12.5
\[\label{eq:opd_reverse_kl} \mathcal{L}_{\mathrm{OPD}}(\theta) = \mathbb{E}_{s, a \sim \pi_\theta(\cdot \mid s)} \sum_t D_{\mathrm{KL}}\left(\pi_\theta(\cdot \mid s_t) \;\|\; \pi_T(\cdot \mid s_t)\right).\]Formalizes the OPD loss as an expectation over student-generated trajectories and token-level reverse-KL comparisons with the teacher. section 12.3.2
Multiple specialist teachers
Multi-teacher OPD combines specialist or intermediate-checkpoint teachers, assigning prompt-dependent weights to their reverse-KL terms. Math and code teachers can therefore contribute differently across a training batch. OPD can also be combined with other advantage computations, while on-policy self-distillation lets a model verify completions itself or with external tools and train a weaker version. section 12.3.3
