MiniPLM: Knowledge Distillation for Pre-Training Language Models
Yuxian Gu, Hao Zhou, Fandong Meng, Jie Zhou, Minlie Huang
2024-10-23

Summary
This paper discusses MiniPLM, a new method for training smaller language models (LMs) by using knowledge distillation, which helps these smaller models learn from larger, more powerful models without needing as much computing power.
What's the problem?
Training large language models can be very resource-intensive and expensive. Existing methods for knowledge distillation often require a lot of computing power and can lose important details in the training data, making it hard for smaller models to perform well.
What's the solution?
The authors propose MiniPLM, which improves the knowledge distillation process by refining the training data with insights from the larger 'teacher' model. MiniPLM allows for offline training, meaning it can prepare data without needing constant input from the teacher model. This method helps create better training data that is both diverse and challenging, allowing smaller 'student' models to learn more effectively.
Why it matters?
This research is significant because it makes it easier and cheaper to train smaller language models that can still perform well on various tasks. By improving how these models learn from larger ones, it opens up opportunities for using advanced AI in more applications, especially where resources are limited.
Abstract
Knowledge distillation (KD) is widely used to train small, high-performing student language models (LMs) using large teacher LMs. While effective in fine-tuning, KD during pre-training faces challenges in efficiency, flexibility, and effectiveness. Existing methods either incur high computational costs due to online teacher inference, require tokenization matching between teacher and student LMs, or risk losing the difficulty and diversity of the teacher-generated training data. To address these issues, we propose MiniPLM, a KD framework for pre-training LMs by refining the training data distribution with the teacher's knowledge. For efficiency, MiniPLM performs offline teacher LM inference, allowing KD for multiple student LMs without adding training-time costs. For flexibility, MiniPLM operates solely on the training corpus, enabling KD across model families. For effectiveness, MiniPLM leverages the differences between large and small LMs to enhance the difficulty and diversity of the training data, helping student LMs acquire versatile and sophisticated knowledge. Extensive experiments demonstrate that MiniPLM boosts the student LMs' performance on 9 widely used downstream tasks, improves the language modeling capabilities, and reduces pre-training computation. The benefit of MiniPLM extends to large pre-training scales, evidenced by the extrapolation of the scaling curves. Further analysis reveals that MiniPLM supports KD across model families and enhances the utilization of pre-training data. Our model, code, and data are available at https://github.com/thu-coai/MiniPLM.