[Paper Review] On-Policy Distillation of Language Models: Learning from Self-Generated Mistakes
This paper introduces Generalized Knowledge Distillation (GKD), a novel on-policy distillation method for autoregressive language models that trains students on their own self-generated sequences using teacher-provided token-level probabilities. GKD reduces distribution shift between training and inference, achieves up to 2.1× relative performance gains on summarization, and enables seamless integration with reinforcement learning fine-tuning.
Knowledge distillation (KD) is widely used for compressing a teacher model to reduce its inference cost and memory footprint, by training a smaller student model. However, current KD methods for auto-regressive sequence models suffer from distribution mismatch between output sequences seen during training and those generated by the student during inference. To address this issue, we introduce Generalized Knowledge Distillation (GKD). Instead of solely relying on a fixed set of output sequences, GKD trains the student on its self-generated output sequences by leveraging feedback from the teacher on such sequences. Unlike supervised KD approaches, GKD also offers the flexibility to employ alternative loss functions between the student and teacher, which can be useful when the student lacks the expressivity to mimic the teacher's distribution. Furthermore, GKD facilitates the seamless integration of distillation with RL fine-tuning (RLHF). We demonstrate the efficacy of GKD for distilling auto-regressive language models on summarization, translation, and arithmetic reasoning tasks, and task-agnostic distillation for instruction-tuning.
Motivation & Objective
- Address the distribution mismatch between training and inference in knowledge distillation for autoregressive language models.
- Overcome limitations of fixed-dataset distillation and forward KL minimization, which can lead to poor generalization when the student cannot expressively match the teacher.
- Enable effective distillation using on-policy student-generated sequences, improving alignment between training and inference distributions.
- Facilitate the integration of distillation with reinforcement learning fine-tuning, particularly for reward-based optimization.
- Demonstrate the flexibility of GKD with alternative divergence measures (e.g., reverse KL, JSD) to better suit student capacity constraints.
Proposed method
- Train the student model on sequences it generates during inference, using the teacher's token-level probabilities as supervision.
- Use on-policy data collection: the student generates sequences, and the teacher provides per-token probabilities to guide distillation.
- Allow optimization of various divergences between student and teacher distributions, including reverse KL, forward KL, and generalized JSD.
- Integrate GKD with reinforcement learning fine-tuning (e.g., RLAIF), where the student is jointly optimized for both distillation and sequence-level rewards.
- Apply GKD to both task-specific and task-agnostic distillation, including instruction tuning and reasoning tasks.
- Use a dynamic weighting scheme (e.g., JSD with temperature scaling) to balance distillation and reward objectives during joint training.
Experimental results
Research questions
- RQ1Can on-policy distillation using self-generated sequences reduce the distribution shift between training and inference in autoregressive language models?
- RQ2How does GKD compare to conventional knowledge distillation methods that rely on fixed teacher-generated or ground-truth sequences?
- RQ3Can GKD be effectively combined with reinforcement learning fine-tuning to improve policy alignment and performance?
- RQ4Which divergence measure (e.g., forward KL, reverse KL, JSD) yields the best performance under different student capacity and task constraints?
- RQ5Does GKD improve generalization in task-agnostic distillation, such as instruction tuning or reasoning benchmarks?
Key findings
- GKD achieves relative performance gains of 2.1× on summarization, 1.7× on machine translation, and 1.9× on arithmetic reasoning tasks compared to baseline KD methods.
- On the BBH and MMLU benchmarks, GKD yields 2% and 1% absolute accuracy improvements in task-agnostic distillation, respectively.
- On-policy distillation with GKD significantly reduces exposure bias and improves generalization compared to off-policy or fixed-dataset distillation.
- GKD enables seamless integration with RL fine-tuning, outperforming standard RLHF approaches by regularizing toward a teacher policy instead of an initial supervised model.
- Using reverse KL or generalized JSD in GKD leads to better performance than forward KL when the student has limited expressivity.
- GKD demonstrates scalability and robustness across T5 models of varying sizes, including students up to 26× smaller than the teacher.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.