Abstract
In the field of large language models (LLMs), Knowledge Distillation (KD) is a critical technique for transferring capabilities from teacher models to student models. However, existing KD methods face limitations and challenges in distillation of LLMs, including efficiency and insufficient measurement capabilities of traditional KL divergence. It is shown that LLMs can serve as an implicit reward function, which we define as a supplement to KL divergence. In this work, we propose Direct Preference Knowledge Distillation (DPKD) for LLMs. DPKD utilizes distribution divergence to represent the preference loss and implicit reward function. We re-formulate KD of LLMs into two stages: first optimizing and objective consisting of implicit reward and reverse KL divergence and then improving the preference probability of teacher outputs over student outputs. We conducted experiments and analysis on various datasets with LLM parameters ranging from 120M to 13B and demonstrate the broad applicability and effectiveness of our DPKD approach. Meanwhile, we prove the value and effectiveness of the introduced implicit reward and output preference in KD through experiments and theoretical analysis. The DPKD method outperforms the baseline method in both output response precision and exact match percentage.
Introduction
Knowledge Distillation (KD) serves as the primary mechanism for compressing the intelligence of massive teacher models into smaller, more efficient student architectures. Traditionally, this process relies on minimizing the Kullback-Leibler (KL) divergence between the teacher and student probability distributions. However, as LLMs have scaled, the limitations of KL divergence have become apparent. It often fails to capture the nuanced quality of generation when the gap between teacher and student capability is large, frequently leading to "mode-seeking" behavior where the student ignores valid portions of the teacher's knowledge. Furthermore, traditional KD often results in a length bias, where models default to shorter, less informative responses to minimize divergence.
Methodology: Direct Preference Knowledge Distillation
Direct Preference Knowledge Distillation (DPKD) reimagines distillation as a preference optimization problem, drawing inspiration from Direct Preference Optimization (DPO) used in human alignment. Instead of merely mimicking token probabilities, DPKD treats the teacher as a preference provider.
The DPKD framework utilizes a two-stage optimization process:
- Implicit Reward Optimization: The student first optimizes an objective that combines an implicit reward function (derived from the teacher's log-probabilities) and reverse KL divergence.
- Preference Probability Improvement: The model is then trained to increase the probability of choosing the teacher's high-quality output over its own generated response.
To address common pitfalls in KD, DPKD incorporates length normalization to prevent the generation of overly brief responses and includes an auxiliary language modeling loss on a pre-training corpus to maintain the student's general linguistic capabilities.
Key Results
The effectiveness of DPKD was evaluated using GPT-2 (1.5B teacher) and OPT (13B teacher) families across three diverse instruction-tuning datasets: Dolly, SelfInst, and SuperNaturalInstructions (S-NI).
As shown in Table 1, DPKD consistently outperforms standard KD, SeqKD, and specialized methods like MiniLLM. For instance, on the DollyEval benchmark with a GPT-2 120M student, DPKD achieved a Rouge-L score of 24.6, significantly higher than the 22.8 achieved by traditional KD. These gains are consistent across different model sizes and benchmarks, demonstrating the broad applicability of the preference-based approach. Furthermore, GPT-4 evaluations confirmed that DPKD-trained models produce responses that are preferred or tied with reference answers more frequently than those from baseline methods.
Key Insights and Theoretical Analysis
A critical finding of this research is the relationship between divergence and reward. By visualizing the training progression, the authors identified a "sweet spot" for distillation.
As illustrated in Figure 1, the optimal performance is not found at the point of lowest KL divergence. Instead, there is an "arc vertex" where the implicit reward is maximized while maintaining a relatively low divergence. This suggests that the goal of distillation should not be perfect mimicry, but rather maximizing the quality (reward) of the output within a reasonable distance from the teacher's distribution.
Theoretically, the paper bridges KD and Reinforcement Learning (RL) by linking DPKD to the Q-function. This formulation suggests that distillation can be viewed as a form of offline RL, where the teacher model defines the environment and provides the rewards for the student's actions (token generations).
Conclusion and Future Work
DPKD represents a significant shift in LLM distillation, moving from distribution matching to preference optimization. By treating the teacher as a gold standard to be preferred rather than a distribution to be copied, DPKD achieves superior performance, particularly in complex instruction-following tasks and longer response generation.
While highly effective, the authors note that focusing on relative preference can occasionally obscure absolute token probabilities. Future research will explore more complex preference expressions and the scalability of DPKD to frontier models beyond the 13B parameter range.
Summary updated