NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Compact Language Models via Pruning and Knowledge Distillation

Saurav Muralidharan, Sharath Turuvekere Sreenivas, Raviraj Bhuminand Joshi, Marcin Chochowski, Mostofa Patwary, Mohammad Shoeybi, Bryan Catanzaro, Jan Kautz, Pavlo Molchanov

TL;DR

Training different sizes of Large Language Models (LLMs) from scratch is incredibly expensive. This paper introduces a highly efficient method to create smaller models by pruning a large, pre-trained LLM and retraining it using knowledge distillation with less than 3% of the original data. The resulting "MINITRON" models match or beat state-of-the-art models of similar sizes while saving up to 40x in training compute.

What Problem Does This Paper Address?

To serve different hardware constraints and deployment budgets, AI companies usually release a "family" of LLMs (e.g., a 7B, 13B, and 70B parameter version of the same model). Currently, the standard practice is to train each of these variants completely from scratch. This requires trillions of tokens and massive GPU clusters for every single model size, which is highly redundant and compute-intensive.

The authors ask a practical question: Can we just train the largest model once, and then "shrink" it to create the smaller versions without losing its capabilities, and without needing to retrain on trillions of tokens?

Methods

The authors propose a pipeline combining structured pruning and knowledge distillation (KD) to efficiently compress these models.

Iterative pruning and distillation pipeline
  1. Importance Estimation: Before cutting parts of the model, you need to know what's important. Instead of using memory-heavy gradient calculations, the authors use purely activation-based metrics. They run a tiny calibration dataset (just 1024 samples) through the model and measure which layers (depth) and attention heads/neurons (width) contribute the most to the outputs.
  2. Lightweight Architecture Search: They generate several candidate architectures that meet the target size (e.g., 8 Billion parameters). They briefly retrain these candidates on a small amount of data (1.8B tokens) to see which architecture recovers best, and select the winner.
  3. Knowledge Distillation Retraining: Instead of retraining the pruned model using standard next-token prediction on text data, they use the original, unpruned large model as a "teacher." The pruned "student" model is trained to mimic the exact output probabilities (logits) of the teacher.

Key Insights and Ideas

  • Width over Depth (with a catch): For models under 15B parameters, pruning the width (neurons, attention heads) ultimately yields a better model than pruning the depth (removing entire layers). However, right after pruning, depth-pruned models look better. The superiority of width pruning only reveals itself after a short period of retraining.
  • Distillation is King: Retraining the pruned model by having it mimic the teacher model's outputs (Knowledge Distillation) vastly outperforms conventional training on the same amount of data.
  • Iterative Pruning for Big Jumps: If you want to shrink a 15B model down to 4B, doing it all at once causes too much brain damage to the model. Pruning iteratively (15B → 8B, retrain, then 8B → 4B) preserves the model's baseline capabilities much better.
  • Keep the Loss Simple: If you aren't heavily pruning the depth of the model, simple logit-based distillation (just matching the final output probabilities) is sufficient. You don't need complex loss functions that try to map intermediate hidden states between the teacher and student.

Key Results

The authors successfully compressed the Nemotron-4 15B model into MINITRON 8B and MINITRON 4B.

Performance vs. Training Cost for Minitron and other LLMs
  • Deriving these smaller models required only 94 Billion tokens of retraining data—up to 40x fewer tokens than training them from scratch.
  • This approach resulted in a 1.8x overall compute cost savings for producing the entire model family (15B, 8B, and 4B).
  • MINITRON 8B outperforms LLaMa-2 7B and the older Nemotron-3 8B, and performs on par with Llama-3 8B, Mistral 7B, and Gemma 7B.
  • MINITRON 4B outperforms similarly sized models like Gemma2 (2.6B) and compares favorably to Phi-2.

Limitations and Future Work

The authors acknowledge a few limitations. First, they have currently only validated this specific set of pruning best practices on NVIDIA's Nemotron family of models; future work will need to verify if these exact heuristics hold true for other architectures like LLaMA or Mistral. Additionally, while the retraining phase is incredibly short compared to training from scratch, it still requires a full model retraining run over 94 billion tokens, which remains a non-trivial computational task for average users.

Summary updated

BibTeX
@inproceedings{muralidharan2024compact,
  author = {Saurav Muralidharan and Sharath Turuvekere Sreenivas and Raviraj Bhuminand Joshi and Marcin Chochowski and Mostofa Patwary and Mohammad Shoeybi and Bryan Catanzaro and Jan Kautz and Pavlo Molchanov},
  title = {{Compact Language Models via Pruning and Knowledge Distillation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=9U0nLnNMJ7},
}
Figure