Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Shortened LLaMA: Depth Pruning for Large Language Models with Comparison of Retraining Methods

About

Structured pruning of modern large language models (LLMs) has emerged as a way of decreasing their high computational needs. Width pruning reduces the size of projection weight matrices (e.g., by removing attention heads) while maintaining the number of layers. Depth pruning, in contrast, removes entire layers or blocks, while keeping the size of the remaining weights unchanged. Most current research focuses on either width-only or a blend of width and depth pruning, with little comparative analysis between the two units (width vs. depth) concerning their impact on LLM inference efficiency. In this work, we show that simple depth pruning can effectively compress LLMs while achieving comparable or superior performance to recent width pruning studies. Our pruning method boosts inference speeds, especially under memory-constrained conditions that require limited batch sizes for running LLMs, where width pruning is ineffective. In retraining pruned models for quality recovery, continued pretraining on a large corpus markedly outperforms LoRA-based tuning, particularly at severe pruning ratios. We hope this work can help build compact yet capable LLMs. Code and models can be found at: https://github.com/Nota-NetsPresso/shortened-llm

Bo-Kyeong Kim, Geonmin Kim, Tae-Ho Kim, Thibault Castells, Shinkook Choi, Junho Shin, Hyoung-Kyu Song• 2024

Related benchmarks

TaskDatasetResultRank
Language ModelingWikiText2
Perplexity16.6515
1875
Language ModelingWikiText-2 (test)
PPL20.52
1541
Language ModelingC4
Perplexity13.8046
1182
Language ModelingPTB
Perplexity54.5982
650
Video UnderstandingMVBench
Accuracy30
247
Video UnderstandingVideoMME
Overall Score32.3
192
Zero-shot EvaluationEight datasets average
Accuracy62.99
87
Video UnderstandingEgoSchema
Accuracy8.1
49
Commonsense ReasoningReasoning Suite Zero-shot Aggregate
Aggregate Score63.49
45
Video Question AnsweringNextQA MC
Score21.3
24
Showing 10 of 16 rows

Other info

Follow for update