LLM-Neo: Parameter Efficient Knowledge Distillation for Large Language Models

Runming Yang, Taiqiang Wu, Jiahao Wang, Pengfei Hu, Ngai Wong, Yujiu YangarXiv 2024 · DOI

Abstract

LLM-Neo is a novel framework that integrates Knowledge Distillation (KD) with Low-Rank Adaptation (LoRA) to optimize the compression of Large Language Models (LLMs). By distilling knowledge from a large teacher model into the low-rank adapters of a smaller student model, LLM-Neo achieves state-of-the-art performance while significantly reducing GPU memory usage and training time by up to 25%.

Introduction

The deployment of Large Language Models (LLMs) on consumer-grade hardware is hindered by their immense size. Existing solutions like Knowledge Distillation (KD) and Low-Rank Adaptation (LoRA) offer partial remedies. KD enables a student model to learn from a teacher's logits but typically requires full-parameter updates, which is computationally expensive. Conversely, LoRA is parameter-efficient but often relies solely on ground-truth labels, missing the "dark knowledge" inherent in teacher outputs. LLM-Neo addresses this gap by providing a unified paradigm that combines the knowledge transfer capabilities of KD with the hardware efficiency of LoRA.

Methodology

The core of LLM-Neo is a unified paradigm demonstrating that KD and LoRA share a fundamental goal: updating model weights ($W_0 + \Delta W$) based on external information.

Comparison of KD, LoRA, and the proposed LLM-Neo framework.

The LLM-Neo pipeline involves inserting LoRA-style low-rank branches into a student model. During training, the student's backbone remains frozen, and only these low-rank branches are updated. The loss function combines Cross-Entropy and KL-Divergence to align the student's output with the teacher's. Empirical analysis suggests an optimal configuration using a rank ($r$) of 128 and a learning rate of 2e-4 to balance convergence speed and accuracy.

Experimental Setup

The framework was trained using the BAAI Infinity Instruct dataset. Evaluation spanned 10 major benchmarks, including MMLU, CMMLU, and C-Eval for general reasoning, alongside math-specific tasks like GSM8K and SVAMP. The primary experiments involved distilling Llama 3.1-8B into Llama 3.2-1B and Llama 2-7B into TinyLlama-1.1B.

Key Results and Insights

LLM-Neo consistently outperforms standard KD, standard LoRA, and Supervised Fine-Tuning (SFT). For instance, on Llama 3.2-1B, LLM-Neo achieved an average score of 63.88, surpassing the 63.57 of standard KD and the 63.24 of standard LoRA.

Performance comparison between Llama-3.2-1B-Instruct-Neo and the base model across various benchmarks.

Beyond accuracy, LLM-Neo offers substantial resource efficiency, reducing GPU memory consumption from 231G to 177G and cutting training time by approximately 20-25%. A key insight is that KD specifically benefits from higher ranks (128-256) compared to standard fine-tuning, as the student requires more capacity to model the teacher's complex distributions. Furthermore, LLM-Neo is compatible with advanced LoRA variants like MoSLoRA and works effectively on pre-pruned models, suggesting it can serve as a final optimization step in multi-stage compression pipelines.

Conclusion

LLM-Neo represents a significant step forward in parameter-efficient model compression. While currently focused on the Llama architecture, future work will explore its applicability to Mixture-of-Experts (MoE) and Mamba architectures, as well as its impact on long-context retrieval and creative writing tasks.

Summary updated

BibTeX
@misc{yang2024llm,
  author = {Runming Yang and Taiqiang Wu and Jiahao Wang and Pengfei Hu and Ngai Wong and Yujiu Yang},
  title = {{LLM-Neo: Parameter Efficient Knowledge Distillation for Large Language Models}},
  year = {2024},
  eprint = {2411.06839},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.06839},
}
Figure