Reassessing Layer Pruning in LLMs: New Insights and Methods

Yao Lu, Hao Cheng, Yujie Fang, Zeyu Wang, Jiaheng Wei +4 more
11/23/2024
cs.LGcs.CV

No official code found. Best implementation: yaolu-zjut/Navigation_LLM_layer_pruning (9 stars, last commit 2025-03-12).

Abstract

Although large language models (LLMs) have achieved remarkable success across various domains, their considerable scale necessitates substantial computational resources, posing significant challenges for deployment in resource-constrained environments. Layer pruning, as a simple yet effective compression method, removes layers of a model directly, reducing computational overhead. However, what are the best practices for layer pruning in LLMs? Are sophisticated layer selection metrics truly effective? Does the LoRA (Low-Rank Approximation) family, widely regarded as a leading method for pruned model fine-tuning, truly meet expectations when applied to post-pruning fine-tuning? To answer these questions, we dedicate thousands of GPU hours to benchmarking layer pruning in LLMs and gaining insights across multiple dimensions. Our results demonstrate that a simple approach, i.e., pruning the final 25\% of layers followed by fine-tuning the \texttt{lm\_head} and the remaining last three layer, yields remarkably strong performance. Following this guide, we prune Llama-3.1-8B-It and obtain a model that outperforms many popular LLMs of similar size, such as ChatGLM2-6B, Vicuna-7B-v1.5, Qwen1.5-7B and Baichuan2-7B. We release the optimal model weights on Huggingface, and the code is available on GitHub.

View on arXivView PDF

Code Implementations(1)

91PythonSep 22, 20241 years ago

Similar Papers

Cite this paper

@article{lu2024reassessing,
  title  = {Reassessing Layer Pruning in LLMs: New Insights and Methods},
  author = {Yao Lu and Hao Cheng and Yujie Fang and Zeyu Wang and Jiaheng Wei and Dongwei Xu and Qi Xuan and Xiaoniu Yang and Zhaowei Zhu},
  year   = {2024},
  eprint = {2411.15558},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.15558v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.15558.svg)](https://codeofpaper.com/paper/2411.15558)

Discussion