# On-Policy Distillation (OPD) 综述:原理、方法与最新进展 > 系统梳理 On-Policy Distillation(OPD)的核心方法、理论分析、工程实现与最新研究进展。 - **URL**: https://maosong.website/blog/on-policy-distillation/ - **Authors**: Mao Song - **Published**: May. 09, 2026 --- ## Introduction [SFT](/blog/on-policy-distillation/#connection-with-sft) (supervised fine tuning) 是现代用于提升 LLM/MLLM 基本能力的一个微调方法。 其具体做法是收集标注好的数据集,形成 prompt-response pair 数据集,然后基于 next token prediction loss 进行训练。 但是,SFT 的问题在于容易过拟合,导致模型出现灾难性遗忘现象。 为了解决这个问题,我们在本文中介绍现在主流的做法: OPD (on policy distillation). OPD 通过让学生模型自身尝试解决问题 (rollout), 然后教师模型在 token 层面使用 logits 进行指导。 GKD [@agarwal2024onpolicy] 首先提出了 on-policy KD 的概念,即训练数据不再从 off-policy dataset 中得到,即 $(x,y)\sim\mathcal{D}$, 而是由学生模型产生,即 $x\sim\mathcal{D}, y\sim\pi_{S}$, 这里 $\pi_S$ 就是我们的学生模型。 损失函数上,GKD 仍然使用 forward KL 作为损失函数。 后续的研究逐渐开始使用 reverse KL 作为损失函数,将 off-policy 的 imitation learning 变成了 on-policy 的 guided learning [@lu2025onpolicydistillation;@MiniLLM]. 此时, 相比于 SFT 来说,OPD 可以更大程度保留模型本身的能力,相比于 RL 来说,训练开销更小。 下面是使用 OPD 的一些模型: | Method | Description | Models | | ---------------------------- | ---------------------- | --------------------------------- | | OPD | Strong to Weak | Qwen3 | | MOPD (one expert per sample) | Multi expert to single | DeepSeek-V4, GLM-5, MiMo-V2-Flash | | Async MOPD | asynchronous MOPD | Nemotron 3 Super | ### Why OPD OPD 效果好的原因主要有以下几点: 1. Cheaper sampling: 教师模型只需要执行一次 prefill 就可以完成一次指导,而 prefill 效率与开销要远低于 decoding. 2. On-policy: on policy 让学生模型可以不停改进自己的策略,避免了学生模型因为 imitation learning 产生灾难性遗忘。 3. Reverse KL: 我们在 [KL divergence](https://maosong.website/blog/kl-divergence/) 中已经介绍了forward KL 与 reverse KL的不同之处,前者是 mean seeking, 后者是 mode seeking. 而 mode seeking 能够避免模型产生灾难性遗忘。 ## Method OPD 的目标函数如下所示 $ \htmlId{opd_objective}{\begin{equation} \mathcal{L}_{OPD}(\theta) = \mathbb{E}_{x\sim\mathcal{D},y\sim\pi_{\theta}}\left[\mathrm{KL}(\pi_\theta(y\mid x)\mid\mid \pi_T(y\mid x))\right] \end{equation}} $ 其中 $\pi_{\theta}$ 是学生模型,$\pi_T$ 是教师模型, $x\sim\mathcal{D}$ 为给定的 prompt, $\mathrm{KL}(\cdot\mid\mid\cdot)$ 是 [KL divergence](https://maosong.website/blog/kl-divergence/). 由 KL divergence 定义,我们有 $ \mathrm{KL}(\pi_\theta(y\mid x)\mid\mid \pi_T(y\mid x)) = \mathbb{E}_{y\in\pi_{\theta}(\cdot\mid x)}\left[\log\frac{\pi_\theta(y\mid x)}{\pi_T(y\mid x)}\right] $ 对于自回归语言模型,由 chain rule, 我们可以得到 $ \pi_\theta(y\mid x) = \prod_{t=1}^{|y|} \pi_{\theta}(y_t\mid y_{