Abstract
Neural Machine Translation (NMT) models have achieved state-of-the-art performance but often require massive computational resources, making them impractical for deployment on standard hardware or mobile devices. This paper introduces Sequence-Level Knowledge Distillation, a framework designed to compress large NMT models into significantly smaller and faster versions. By training a "student" model to mimic the sequence-level output distributions of a "teacher" model, the authors produce a student that is 10x faster and 13x smaller than the original, with minimal loss in translation quality.
Introduction
While NMT has revolutionized language processing, the "tax" for high accuracy is model size. State-of-the-art results typically rely on deep recurrent neural networks, such as 4-layer LSTMs with 1000 units per layer. These models are slow to train and even slower to execute during inference.
Traditional Knowledge Distillation (KD) has been effective in fields like image recognition by having a small student model learn from a large teacher. However, standard KD focuses on predicting the next word correctly (word-level). In translation, the goal is to get the entire sequence right. This paper addresses the gap by optimizing distillation for the sequential nature of language.
Methodology
The authors propose three distinct levels of distillation to bridge the performance gap between massive teachers and lean students:
- Word-Level KD: The student attempts to match the probability distribution the teacher assigns to every possible next word at each time step.
- Sequence-Level KD (Seq-KD): The student is trained on a synthetic dataset generated by the teacher. The authors perform a beam search with the teacher model on the original training data and use the teacher's top-ranked translated sequence as the new ground truth for the student.
- Sequence-Level Interpolation (Seq-Inter): A hybrid approach where the authors select the sequence from the teacher's beam (top $K$ guesses) that is most similar to the actual human "gold" translation. This provides a "best-of-both-worlds" target for the student.
To further reduce model size, these distillation methods are combined with Weight Pruning, which involves zeroing out the least significant connections in the network.
Experimental Setup
The methods were evaluated on two benchmarks:
- English → German (WMT 2014): A high-resource dataset (4M sentence pairs) using a 4-layer LSTM teacher (221M parameters).
- Thai → English (IWSLT 2015): A lower-resource dataset (90k sentence pairs) using a 2-layer LSTM teacher (47M parameters).
Key Insights
The Teacher as a Simplifier
A core finding is that training on the teacher's output (Seq-KD) often outperforms training on real human data. Human language is inherently "noisy" and diverse. The teacher model acts as a filter, providing a more consistent and simplified version of the data that is easier for a low-capacity student model to learn.
Eliminating Beam Search
Standard NMT models require computationally expensive beam search at test time to achieve high accuracy. However, students trained with Seq-KD become so proficient at mimicking the teacher's primary output mode that they can use greedy decoding (picking only the single best word at each step) and still maintain high performance. This leads to massive gains in inference speed.
Results
- Efficiency: The optimized 2-layer LSTM student ran 10 times faster than the teacher on a GPU.
- Compression: Combining Seq-KD with weight pruning resulted in a model with 13x fewer parameters, losing only 0.4 BLEU points.
- Decoding Performance: On the English-German task, a student trained with Seq-KD achieved a BLEU score of 18.9 using greedy decoding, outperforming a baseline student using full beam search (17.6).
- Deployment: The compressed models were successfully deployed on a Samsung Galaxy 6 smartphone, demonstrating real-world mobile readiness.
Conclusion
Sequence-level knowledge distillation effectively transfers the complex reasoning of large NMT models into compact architectures. While the initial distillation process is computationally intensive due to the required beam search over millions of sentences, the resulting models offer a path toward high-quality, real-time translation on edge devices. Future work may explore character-level models to further reduce memory footprints by eliminating large word embedding tables.
Summary updated