Knowledge distillation—training a smaller "student" model to match the soft probability outputs of a larger "teacher" model—is making a major comeback in large language model (LLM) pretraining, exemplified by recent releases like the Llama-3.2 and Gemma model families.
Historically, distillation has been shown to improve statistical modeling. However, because teacher models are usually trained on vastly more data than their students, it has been difficult to determine if distillation genuinely improves the learning process or merely acts as a proxy for seeing more data. Furthermore, its impact on modern LLM paradigms—specifically test-time scaling (generating multiple answers and verifying the best one, measured via pass@k) and in-context learning (ICL) (adapting to information provided in the prompt)—has remained a black box.
This paper investigates these dynamics, revealing a fascinating trade-off: while distilled pretraining significantly boosts generation diversity and test-time scaling, it actively harms in-context learning by injecting noise into deterministic copying tasks.
Experimental Design
To isolate the true effects of distillation from the confounding variable of data volume, the authors employ a rigorous methodology:
- IsoData Distillation: The authors train an 8B parameter teacher and a 1B parameter student on the exact same 1 trillion tokens. They then compare this distilled student to a standard 1B model trained from scratch on the identical dataset.
- Bigram Sandbox: To understand the mechanics of why distillation behaves the way it does, the researchers utilize a simplified mathematical sandbox (a bigram model). This allows them to study how distillation affects "high-entropy" predictions (prompts with many valid next words) versus "low-entropy" predictions (deterministic tasks with only one correct answer).
- Token Routing: Based on their findings, the authors propose a novel intervention during training. They dynamically drop the distillation loss for the top 15% of tokens where the teacher is most "certain" (lowest entropy), falling back to standard hard-label training for those specific tokens.
The models were pretrained on a diverse mix of datasets (including DCLM, GitHub, DeepMind Math, and FineWeb-Edu) and evaluated across standard language modeling, reasoning/code generation, and specific in-context learning tasks.
Key Findings
1. Distillation is More Than a Data Proxy
Even in the "IsoData" setup where the teacher provides no new, unseen text, the distilled student outperforms the standard model on general benchmarks. Distillation genuinely improves the fundamental learning dynamic, rather than just simulating a larger training corpus.
2. The Core Trade-off: Test-Time Scaling vs. In-Context Learning
The authors uncover a stark dichotomy in how distillation affects advanced LLM capabilities.
The Diversity Boost (Test-Time Scaling): Distillation teaches the student the distribution of possible good answers (high-entropy), rather than forcing it to memorize a single word present in the text. This makes the model significantly better at generating diverse, plausible reasoning paths. On math reasoning (GSM8K), a distilled model achieved a 27% pass@16, compared to 23% for a standard model. Remarkably, the distilled model matched the pass@16 of a standard model trained on twice the data.
The In-Context Learning Penalty: Conversely, ICL relies heavily on "induction heads"—internal circuits that allow the model to copy tokens from earlier in the prompt. Copying is a low-entropy, deterministic task. When a teacher provides "soft" probability labels for a deterministic task, it accidentally injects slight uncertainty and noise. This actively hinders the student's ability to learn how to copy perfectly, degrading ICL performance on tasks like Needle-in-a-Haystack and Counterfactual QA.
3. Mitigating the ICL Penalty with Token Routing
By implementing their "Token Routing" strategy—turning off distillation for the 15% lowest-entropy tokens—the authors successfully mitigated the drop in ICL performance on the majority of tested tasks without sacrificing standard language modeling scores.
4. RL Teachers Outperform Base Teachers
Contrary to current industry practice, which often favors distilling from base models, the authors found that distilling from a Reinforcement Learning (RL)-trained teacher yielded a superior student across reasoning, coding, and general benchmarks.
Future Directions
This research highlights the need for a more nuanced approach to pretraining. Current pretraining datasets are scraped and filtered with standard next-token prediction in mind; the authors suggest a need for datasets specifically optimized for distilled pretraining. Furthermore, integrating distilled pretraining with other diversity-enhancing methods, such as Multi-Token Prediction (MTP), represents a highly promising frontier for developing more capable and efficient language models.
Summary updated