Introduction
Knowledge Distillation (KD) has become a cornerstone of the post-training pipeline for Large Language Models (LLMs), enabling smaller models to inherit the capabilities of larger "teacher" models. However, its application during the resource-intensive pre-training phase—where models ingest trillions of tokens—remains largely underexplored. This research systematically maps the design space of "pre-training distillation" (PD), addressing logistical hurdles and identifying the optimal configurations for foundational training.
The Logistical Challenge: The 4000x Storage Hack
The primary barrier to PD is the sheer volume of data. Storing full teacher logits (e.g., a 150k vocabulary) across a 100-billion-token corpus would require nearly 60 Petabytes of storage. To overcome this, the authors introduce a top-$p$-$k$ truncation method. By applying nucleus sampling ($p=0.95$) followed by a hard cutoff ($k=100$) and re-normalization, storage requirements were slashed to just 15 Terabytes—a 4000x reduction—without sacrificing student performance.
Exploring the Design Space
The study investigates four critical dimensions of pre-training distillation:
- Loss Functions: While Mean Squared Error (MSE) is common in other domains, it fails significantly in LLM pre-training. Kullback–Leibler Divergence (KLD) emerged as the superior loss function.
- Loss Scheduling: A dynamic Warmup-Stable-Decay (WSD) approach, where the KD loss ratio peaks at approximately 90% during the stable phase, proved most effective.
- Teacher-Student Dynamics: The research reveals a "capacity gap." Distilling from a massive 32B teacher into a small 330M student can actually yield worse results than using a smaller 9B teacher, as the student lacks the capacity to model the teacher's complex distributions.
- Offline vs. Online: Offline distillation (using a fixed, pre-trained teacher) outperforms online distillation (training teacher and student simultaneously), as early-stage teacher logits are too noisy for effective guidance.
Scaling Laws and the Capacity Gap
A surprising finding is that larger student models benefit more from pre-training distillation than smaller ones. As the student model scales from 330M to 6.8B parameters, the performance gain over standard language modeling (LM) loss increases.
Key Results
The optimized PD configuration (PD), utilizing KLD loss and WSD scheduling, consistently outperforms both standard LM loss and "vanilla" distillation approaches. For a 6.8B parameter student, PD improved average benchmark scores from 44.9% to 49.8%.
Conclusion and Future Work
This exploration establishes a practical playbook for pre-training distillation. While the benefits are clear, limitations remain: the study was capped at 500 billion tokens, and the combinatorial complexity of all design variables remains high. Future research may explore "weak-to-strong" generalization, investigating whether smaller teachers can effectively guide the pre-training of even larger student models.
Summary updated