BESA: Pruning Large Language Models with Blockwise Parameter-Efficient Sparsity Allocation

Peng Xu, Wenqi Shao, Mengzhao Chen, Shitao Tang, Kaipeng Zhang +4 more
2/18/2024
cs.LGcs.AIcs.CL

Official code: OpenGVLab/LLMPrune-BESA (17 stars, last commit 2024-03-04). 1 more implementation below.

Abstract

Large language models (LLMs) have demonstrated outstanding performance in various tasks, such as text summarization, text question-answering, and etc. While their performance is impressive, the computational footprint due to their vast number of parameters can be prohibitive. Existing solutions such as SparseGPT and Wanda attempt to alleviate this issue through weight pruning. However, their layer-wise approach results in significant perturbation to the model's output and requires meticulous hyperparameter tuning, such as the pruning rate, which can adversely affect overall model performance. To address this, this paper introduces a novel LLM pruning technique dubbed blockwise parameter-efficient sparsity allocation (BESA) by applying a blockwise reconstruction loss. In contrast to the typical layer-wise pruning techniques, BESA is characterized by two distinctive attributes: i) it targets the overall pruning error with respect to individual transformer blocks, and ii) it allocates layer-specific sparsity in a differentiable manner, both of which ensure reduced performance degradation after pruning. Our experiments show that BESA achieves state-of-the-art performance, efficiently pruning LLMs like LLaMA1, and LLaMA2 with 7B to 70B parameters on a single A100 GPU in just five hours. Code is available at https://github.com/OpenGVLab/LLMPrune-BESA.

View on arXivView PDF

Code Implementations(2)

BESA is a differentiable weight pruning technique for large language models.

171C++, CudaJan 12, 20242 years ago
LinkAnonymous/BESACommunity100%
120C++, CudaSep 29, 20233 years ago

Similar Papers

Cite this paper

@article{xu2024besa,
  title  = {BESA: Pruning Large Language Models with Blockwise Parameter-Efficient Sparsity Allocation},
  author = {Peng Xu and Wenqi Shao and Mengzhao Chen and Shitao Tang and Kaipeng Zhang and Peng Gao and Fengwei An and Yu Qiao and Ping Luo},
  year   = {2024},
  eprint = {2402.16880},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.16880v2},
  journal = {ICLR 2024 2024}
}

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/2402.16880.svg)](https://codeofpaper.com/paper/2402.16880)

Discussion