Sheared LLaMA: Accelerating Language Model Pre-training via Structured Pruning
Mengzhou Xia, Tianyu Gao, Zhiyuan Zeng, Danqi Chen

TL;DR
This paper introduces Sheared-LLaMA, a structured pruning method that efficiently reduces large language models to smaller sizes, maintaining performance while significantly lowering training costs.
Contribution
The paper presents a novel structured pruning approach combined with dynamic batch loading to create smaller, high-performing LLMs from larger pre-trained models.
Findings
Pruned LLaMA models outperform similar-sized open-source models.
Achieves comparable performance with only 3% of the training compute.
Successfully reduces LLaMA2-7B to 1.3B and 2.7B parameters.
Abstract
The popularity of LLaMA (Touvron et al., 2023a;b) and other recently emerged moderate-sized large language models (LLMs) highlights the potential of building smaller yet powerful LLMs. Regardless, the cost of training such models from scratch on trillions of tokens remains high. In this work, we study structured pruning as an effective means to develop smaller LLMs from pre-trained, larger models. Our approach employs two key techniques: (1) targeted structured pruning, which prunes a larger model to a specified target shape by removing layers, heads, and intermediate and hidden dimensions in an end-to-end manner, and (2) dynamic batch loading, which dynamically updates the composition of sampled data in each training batch based on varying losses across different domains. We demonstrate the efficacy of our approach by presenting the Sheared-LLaMA series, pruning the LLaMA2-7B model…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
- 🤗princeton-nlp/Sheared-LLaMA-1.3Bmodel· 3.5k dl· ♡ 993.5k dl♡ 99
- 🤗princeton-nlp/Sheared-LLaMA-2.7Bmodel· 881 dl· ♡ 61881 dl♡ 61
- 🤗Aryanne/Sheared-LLaMA-2.7B-ggufmodel· 18 dl· ♡ 318 dl♡ 3
- 🤗princeton-nlp/Sheared-Pythia-160mmodel· 165 dl· ♡ 4165 dl♡ 4
- 🤗princeton-nlp/Sheared-LLaMA-1.3B-ShareGPTmodel· 803 dl· ♡ 10803 dl♡ 10
- 🤗princeton-nlp/Sheared-LLaMA-2.7B-ShareGPTmodel· 814 dl· ♡ 8814 dl♡ 8
- 🤗llama-moe/LLaMA-MoE-v1-3_0B-2_16model· 195 dl· ♡ 11195 dl♡ 11
- 🤗llama-moe/LLaMA-MoE-v1-3_5B-4_16model· 281 dl· ♡ 16281 dl♡ 16
- 🤗llama-moe/LLaMA-MoE-v1-3_5B-2_8model· 796 dl· ♡ 15796 dl♡ 15
- 🤗LoneStriker/Sheared-LLaMA-2.7B-ShareGPT-3.0bpw-h6-exl2model· 4 dl4 dl
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Natural Language Processing Techniques
MethodsPythia · Pruning
