Skip to main content
QUICK REVIEW

[Paper Review] BESA: Pruning Large Language Models with Blockwise Parameter-Efficient Sparsity Allocation

Peng Xu, Wenqi Shao|arXiv (Cornell University)|Feb 18, 2024
Natural Language Processing TechniquesComputer Science3 citations
TL;DR

BESA introduces a differentiable, blockwise sparsity allocation method for pruning large language models (LLMs), minimizing reconstruction error per transformer block and optimizing layer-specific sparsity via learnable binary masks. It achieves state-of-the-art results—pruning LLaMA2-70B by 50% in five hours on a single A100 GPU with only 0.16 perplexity improvement on WikiText2 compared to SparseGPT—while maintaining high efficiency and performance.

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.

Motivation & Objective

  • Address the limitations of layer-wise pruning in LLMs, where pruning error accumulates across layers and uniform pruning rates degrade performance.
  • Reduce the need for manual hyperparameter tuning (e.g., pruning rate) by enabling differentiable optimization of sparsity per layer.
  • Improve model efficiency and inference speed through joint pruning and quantization, while minimizing performance degradation.
  • Enable practical deployment of large models by achieving high compression with minimal accuracy loss on standard benchmarks.
  • Develop a parameter-efficient method that scales to models from 7B to 70B parameters using a single GPU.

Proposed method

  • Formulate the pruning problem as minimizing block-wise reconstruction error using differentiable binary masks for each weight, enabling gradient-based optimization.
  • Represent sparsity as learnable pruning probabilities per weight, with gradients computed via straight-through estimation to handle non-differentiable binary masks.
  • Optimize layer-specific sparsity rates in a blockwise manner, reducing error accumulation compared to layer-wise approaches.
  • Integrate pruning with quantization in a joint, differentiable framework to enable end-to-end compression of LLMs.
  • Use a ViTCoD hardware simulator to evaluate real-world speedup potential under imbalanced, layer-specific sparsity patterns.
  • Apply structured $n:m$ sparsity patterns in simulation to assess practical acceleration on modern accelerators.

Experimental results

Research questions

  • RQ1Can blockwise sparsity allocation reduce cumulative pruning error compared to layer-wise methods in LLMs?
  • RQ2Can differentiable sparsity optimization eliminate the need for manual hyperparameter tuning in LLM pruning?
  • RQ3Can joint pruning and quantization in a differentiable framework maintain high model performance while enabling high compression rates?
  • RQ4How does BESA compare to SOTA methods like SparseGPT and Wanda in terms of perplexity and inference speed on standard benchmarks?
  • RQ5What is the real hardware speedup potential of BESA-pruned models under realistic sparsity patterns?

Key findings

  • BESA achieves state-of-the-art performance in pruning LLaMA1 and LLaMA2 models, with a 50% parameter reduction on LLaMA2-70B in just five hours on a single A100-80GB GPU.
  • On WikiText2, BESA improves perplexity by 0.16 compared to SparseGPT when pruning LLaMA2-70B, demonstrating superior performance retention.
  • BESA reduces the average runtime of LLaMA-7B layers by up to 1.98× (for down_proj) and achieves 1.48× to 1.98× speedup across different layer types in ViTCoD simulation.
  • The method achieves a 53.87% sparsity on q_proj and 54.54% on k_proj in LLaMA-7B, with minimal performance drop across multiple benchmarks.
  • Joint compression via BESA outperforms Wanda-based post-pruning on quantized models across all evaluated models (7B, 13B, 30B) and datasets (WikiText2, C4, PTB).
  • BESA’s parameter-efficient design adds only 2.10% extra parameters per transformer block in LLaMA1-7B, making it highly practical for large-scale deployment.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.