Skip to main content
QUICK REVIEW

[Paper Review] LLM Pruning and Distillation in Practice: The Minitron Approach

Sharath Turuvekere Sreenivas, Saurav Muralidharan|arXiv (Cornell University)|Aug 21, 2024
Metallurgical Processes and ThermodynamicsEngineering3 citations
TL;DR

This paper presents the Minitron approach to compressing Llama 3.1 8B and Mistral NeMo 12B models to 4B and 8B parameters using structured pruning and knowledge distillation. By introducing 'teacher correction'—fine-tuning the teacher model on the distillation dataset—it achieves state-of-the-art performance with up to 150× fewer training tokens, producing the MN-Minitron-8B model that outperforms all similarly sized open models on benchmarks.

ABSTRACT

We present a comprehensive report on compressing the Llama 3.1 8B and Mistral NeMo 12B models to 4B and 8B parameters, respectively, using pruning and distillation. We explore two distinct pruning strategies: (1) depth pruning and (2) joint hidden/attention/MLP (width) pruning, and evaluate the results on common benchmarks from the LM Evaluation Harness. The models are then aligned with NeMo Aligner and tested in instruct-tuned versions. This approach produces a compelling 4B model from Llama 3.1 8B and a state-of-the-art Mistral-NeMo-Minitron-8B (MN-Minitron-8B for brevity) model from Mistral NeMo 12B. We found that with no access to the original data, it is beneficial to slightly fine-tune teacher models on the distillation dataset. We open-source our base model weights on Hugging Face with a permissive license.

Motivation & Objective

  • To reduce the computational and data cost of training large language model families by compressing larger models into smaller, efficient variants.
  • To address the challenge of distillation failure due to data distribution mismatch when original training data is unavailable.
  • To achieve state-of-the-art performance in accuracy and inference speed for compressed models with minimal fine-tuning.
  • To demonstrate that knowledge distillation with teacher correction enables superior performance even when compressing from larger models without access to original data.

Proposed method

  • Applying structured weight pruning to compress the teacher model, using two strategies: depth pruning (removing entire layers) and width pruning (removing attention heads, MLP dimensions, and embedding channels).
  • Introducing 'teacher correction'—a lightweight fine-tuning step on the distillation dataset before pruning and distillation to align the teacher’s output distribution with the target data.
  • Using knowledge distillation to recover accuracy lost during pruning, training the student model to mimic the logits of the pruned and corrected teacher.
  • Optimizing inference using NVIDIA TensorRT-LLM with FP8 precision to improve throughput and latency on H100 GPUs.
  • Evaluating performance across multiple benchmarks including LM-Evaluation Harness, IFEval, MT-Bench, and ChatRAG, with consistent ablation and comparison across model variants.
  • Open-sourcing base model weights on Hugging Face under a permissive license for community use and further research.
Figure 1: High-level overview of our proposed pruning and distillation approach. The total number of tokens used for each step is indicated in parentheses.
Figure 1: High-level overview of our proposed pruning and distillation approach. The total number of tokens used for each step is indicated in parentheses.

Experimental results

Research questions

  • RQ1Does fine-tuning the teacher model on the distillation dataset (teacher correction) significantly improve distillation performance when original training data is unavailable?
  • RQ2How do depth pruning versus width pruning strategies compare in terms of accuracy and inference efficiency after distillation?
  • RQ3Can a compressed 8B model (MN-Minitron-8B) achieve state-of-the-art performance compared to other open-source 8B models despite using only 380B training tokens?
  • RQ4To what extent does knowledge distillation recover or even improve performance on downstream tasks like GSM8k and HumanEval after pruning?
  • RQ5What is the impact of structured pruning on reasoning and instruction-following capabilities in instruction-tuned variants?

Key findings

  • The MN-Minitron-8B model outperforms all similarly sized open-source models on all benchmarks, including 85.3% on Hellaswag and 70.1% on MMLU, despite using only 380B training tokens compared to 15T for the teacher.
  • The Llama-3.1-Minitron-4B-Width variant achieves 60.5% on MMLU and 41.2% on GSM8k, outperforming both the teacher Llama 3.1 8B and the previous-generation Minitron-4B model.
  • The Llama-3.1-Minitron-4B-Depth variant achieves a 2.7× throughput speedup over the teacher model on a single H100 GPU, while the width variant achieves 1.8× speedup in FP8 inference.
  • Teacher correction reduces LM validation loss by over 6%, demonstrating its critical role in mitigating data distribution mismatch during distillation.
  • The MN-Minitron-8B model improves on the teacher Mistral NeMo 12B in two benchmarks: GSM8k (58.5% vs. 55.7%) and HumanEval (36.2% vs. 23.8%), despite no additional training beyond distillation.
  • Width pruning with retention of attention heads and pruning of MLP and embedding dimensions yields stronger accuracy than depth pruning, especially in reasoning and function-calling tasks.
Figure 2: Pruning and distillation process outlined in the original paper [ 1 ] . We follow the same approach in this work.
Figure 2: Pruning and distillation process outlined in the original paper [ 1 ] . We follow the same approach in this work.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.