Revisiting Knowledge Distillation for Autoregressive Language Models

Qihuang Zhong, Liang Ding, Li Shen, Juhua Liu, Bo Du, Dacheng Tao

Introduction: The Large Teacher Paradox

Knowledge Distillation (KD) is a cornerstone technique for compressing massive Large Language Models (LLMs) into smaller, more efficient "student" models. Conventionally, the field has operated under the assumption that a more capable teacher model inevitably leads to a higher-performing student. However, recent research into autoregressive models reveals a "large teacher paradox": as the capacity gap between teacher and student grows, student performance often plateaus or even declines.

This phenomenon occurs because standard distillation objectives, such as KL-Divergence, treat every token in a sequence with equal weight. Furthermore, as teachers scale, they become increasingly overconfident in their predictions. This peakiness in the probability distribution hides "dark knowledge"—the subtle relationships between non-target tokens—that is essential for a student to learn the underlying structure of language rather than merely memorizing the next word.

Methods: Adaptive Teaching Knowledge Distillation (ATKD)

To address these challenges, this paper introduces Adaptive Teaching Knowledge Distillation (ATKD), a framework built on the philosophy of "Teach Less, Learn More." The authors mathematically decompose the standard distillation loss into two distinct components:

  1. Target-oriented KD (TKD): Encourages the student to match the teacher's probability for the correct target token (rote learning).
  2. Diversity-oriented KD (DKD): Encourages the student to match the teacher’s distribution across all non-target tokens (contextual learning).

ATKD introduces an Adaptive Strategy that sorts tokens into "easy-to-learn" and "hard-to-learn" categories based on the teacher's uncertainty. For easy tokens, the method skips TKD entirely to prevent the student from over-mimicking the teacher's shallow stylistic confidence. For hard tokens, both TKD and DKD are utilized. Crucially, ATKD decouples the diversity signal from the teacher's uncertainty, ensuring that even when a teacher is highly confident, the student can still extract distributional nuances from the remaining probability mass.

Analysis of Token Difficulty

A key insight of this work is that not all data contributes equally to student learning. Empirical results show that training exclusively on the most "uncertain" (hard) tokens can actually yield better performance than using the entire dataset. Conversely, forcing a student to match a teacher's exact probability on easy tokens (e.g., common function words like "the") can lead to overfitting and "shallow mimicry," damaging the student's ability to generalize.

Figure 3: Impact of training on hard-to-learn vs. easy-to-learn tokens compared to the full dataset.

Experimental Evaluation

The researchers evaluated ATKD across a diverse set of benchmarks and model families:

  • Models: Students from the OPT (125M), Pythia (410M), and LLaMA (68M) families were paired with teachers ranging from 350M to 7B parameters.
  • Training Data: The Alpaca-GPT4 dataset (52k instruction-response pairs).
  • Tasks: Evaluation spanned generative tasks ($S_{NLG}$) like DollyEval and VicunaEval, and understanding tasks ($S_{NLU}$) including MMLU, Drop, and BBH.

Results and Discussion

ATKD successfully reverses the large teacher paradox. While baseline KD methods see performance drops when moving from a 1.3B to a 6.7B teacher, ATKD allows the student to continue benefiting from the larger teacher's knowledge.

Figure 1: Performance comparison across different teacher model sizes, showing ATKD reversing the performance drop seen in larger teachers.

Key findings include:

  • Consistent Gains: ATKD provided average score increases of up to +3.04% and proved to be "plug-and-play," boosting the performance of existing state-of-the-art methods like GKD and f-distill.
  • Improved Generalization: Students trained with ATKD performed significantly better on out-of-distribution tasks that the teacher was not specifically fine-tuned for.
  • Optimization Stability: Visualizations of the loss landscape revealed that ATKD leads to a flatter, more stable optimization surface, which correlates with better generalization.

Limitations and Future Work

While ATKD effectively bridges the capacity gap for models up to 7B parameters, further research is required to see if these trends hold for "frontier" models exceeding 70B parameters. Additionally, while the method improves quality, future studies should investigate its impact on training efficiency and robustness against adversarial attacks. The current implementation relies on two hyperparameters (token split ratio $k$ and loss weight $\lambda$) which, while stable in these tests, may require tuning for specialized datasets.

Summary updated

BibTeX
@inproceedings{zhong2024revisiting,
  author = {Qihuang Zhong and Liang Ding and Li Shen and Juhua Liu and Bo Du and Dacheng Tao},
  title = {{Revisiting Knowledge Distillation for Autoregressive Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.587},
}
Figure