Autoregressive Knowledge Distillation through Imitation Learning

Alexander Lin, Jeremy Wohlwend, Howard Chen, Tao Lei

Introduction

Modern Natural Language Generation (NLG) relies heavily on autoregressive models like the Transformer. These models generate text sequentially, using previous outputs as context for subsequent tokens. Despite their power, their computational cost makes real-time deployment challenging. Knowledge Distillation (KD) is a common solution, where a compact "student" model is trained to mimic a larger "teacher."

However, standard Sequence-level KD (SeqKD) is plagued by exposure bias. During training, the student is exposed only to "perfect" ground-truth or teacher-provided sequences. At inference, a single error can lead the student into unfamiliar states, causing a cascade of failures. Standard KD fails to teach the student how to recover from its own mistakes.

Methodology: ImitKD

The authors propose ImitKD (Imitation-based Knowledge Distillation), framing the distillation process as an imitation learning task inspired by the DAgger algorithm. In this framework, the teacher model acts as a dynamic "oracle."

Comparison of training variants, context states, and loss functions.

Unlike static KD, ImitKD allows the student to generate its own partial sequences during training. The teacher then provides the optimal next token for that specific, potentially imperfect, context. Key features of the method include:

  • Data Mixture & Annealing: Training begins with the student following teacher-provided data to ensure stability. Over time, a mixing parameter is annealed, gradually forcing the student to rely on its own generated states while receiving corrective feedback from the teacher.
  • Efficiency via Pooling: To overcome the latency of on-the-fly generation during training, the authors implement a "pooling" strategy, generating student sequences in parallel batches every few iterations to maintain high training throughput.

Experimental Results

The researchers evaluated ImitKD across three major benchmarks: IWSLT 2014 (De-En), WMT 2016 (En-De), and CNN/DailyMail. The results demonstrate that ImitKD significantly outperforms standard KD baselines.

Performance and Speed

Student models, particularly those using the Simple Recurrent Unit (SRU) architecture, achieved inference speeds 4x to 14x faster than their Transformer teachers. Remarkably, on the IWSLT dataset, a 3-layer SRU student trained with ImitKD achieved a BLEU score of 34.8, surpassing its 8-layer Transformer teacher (34.4).

Robustness to Sequence Length

A critical advantage of ImitKD is its robustness during long-form generation. While vanilla and SeqKD models typically see a sharp decline in BLEU scores as sequence length increases due to compounding errors, ImitKD models maintain significantly higher stability across all tested architectures (SRU, GRU, LSTM, and Transformer).

BLEU score performance across different sequence lengths for various architectures.

Conclusion

ImitKD effectively addresses the exposure bias inherent in traditional autoregressive distillation. By treating the teacher as a live guide rather than a static dataset, student models learn to recover from errors, leading to more robust and efficient text generation. This approach paves the way for deploying high-performance NLG models on resource-constrained devices. Future work will explore more advanced imitation learning algorithms and the distillation of massive pre-trained models.

Summary updated

BibTeX
@inproceedings{lin2020autoregressive,
  author = {Alexander Lin and Jeremy Wohlwend and Howard Chen and Tao Lei},
  title = {{Autoregressive Knowledge Distillation through Imitation Learning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.494},
}
Figure