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

Peng Xu, Wenqi Shao, Mengzhao Chen, Shitao Tang, Kaipeng Zhang, Peng Gao, Fengwei An, Yu Qiao, Ping Luo

Introduction

As Large Language Models (LLMs) scale to hundreds of billions of parameters, their computational footprint—encompassing memory requirements and energy consumption—presents a significant barrier to widespread deployment. Weight pruning, the process of removing redundant weights, has emerged as a primary solution. However, state-of-the-art post-training pruning methods such as SparseGPT and Wanda face two critical challenges: layer-wise error accumulation and manual sparsity allocation.

Existing methods typically minimize pruning error on a layer-by-layer basis. This isolated optimization allows small errors in early layers to compound as they propagate through the network, leading to significant output drift. Furthermore, these methods often apply a uniform pruning rate across all layers, ignoring the fact that certain layers are more critical to model performance than others. BESA (Blockwise Parameter-Efficient Sparsity Allocation) addresses these limitations by shifting the optimization target to the transformer block level and introducing a differentiable mechanism for automatic sparsity allocation.

Methodology

Blockwise Reconstruction

BESA departs from traditional layer-wise pruning by targeting an entire Transformer Block, which includes both the Self-Attention and Feed-Forward Network (FFN) modules. By minimizing the reconstruction error between the output of the original dense block and the pruned block, BESA allows the Attention and FFN components to mutually compensate for information loss. This holistic approach significantly reduces the cumulative error that typically plagues layer-wise methods.

Overview of BESA methodology and performance: (a) Block-wise pruning error, (b) Perplexity vs. Sparsity for different projections, (c) Prior layer-wise work, and (d) BESA's block-wise reconstruction.

Differentiable Sparsity Allocation

A core innovation of BESA is treating the pruning rate ($\alpha$) as a learnable, differentiable parameter. The framework employs a set of candidate pruning rates and learns a probability distribution over them. To enable gradient-based optimization through discrete pruning decisions, BESA utilizes a Straight-Through Estimator (STE).

Weight importance is determined using the Wanda metric—the product of weight magnitude and input activation norm. This allows BESA to identify and preserve the most critical weights while automatically allocating higher sparsity to redundant layers. Additionally, BESA supports Joint Compression, where pruning and 4-bit quantization (via OmniQuant) are optimized simultaneously to maximize model shrinkage.

Experimental Setup

The authors evaluated BESA using the LLaMA-1 and LLaMA-2 model families (7B to 70B parameters). Calibration was performed using 128 sequences from the C4 dataset. Performance was measured via perplexity on WikiText2, C4, and PTB, alongside a suite of zero-shot common-sense reasoning tasks (e.g., PIQA, BoolQ, HellaSwag).

Results and Discussion

State-of-the-Art Performance

BESA consistently outperforms SparseGPT and Wanda. On LLaMA-2-70B at 50% sparsity, BESA achieved a perplexity of 4.09 on WikiText2, compared to Wanda's 4.22. In zero-shot benchmarks, BESA-pruned models often maintained or even slightly exceeded the accuracy of their dense counterparts; for instance, BESA achieved 73.73% average accuracy on LLaMA-1-65B, surpassing the dense baseline of 73.71%.

Error Mitigation and Sensitivity

As shown in the block-wise pruning error analysis, BESA maintains a significantly lower error profile across the model's depth compared to Magnitude, SparseGPT, and Wanda. This confirms that block-level optimization effectively suppresses error accumulation.

Block-wise pruning error comparison across model depth, demonstrating BESA's superior error suppression compared to Magnitude, SparseGPT, and Wanda.

Furthermore, BESA's learned allocation reveals that different linear projections have varying sensitivities to sparsity. For example, the gate_proj typically exhibits higher sensitivity (leading to sharper perplexity increases) than the k_proj or q_proj. By automatically adjusting to these sensitivities, BESA achieves superior compression efficiency.

Efficiency and Hardware Speedup

Despite its sophisticated optimization, BESA is highly efficient, processing a 70B parameter model in approximately five hours on a single GPU. Hardware simulations indicate that BESA-pruned models can achieve 1.5x to 2x speedups in instruction cycles compared to dense models.

Conclusion

BESA introduces a robust framework for LLM pruning that overcomes the pitfalls of layer-wise error accumulation and manual sparsity tuning. By optimizing at the block level and utilizing differentiable sparsity allocation, it achieves state-of-the-art results with minimal computational overhead. Future work will explore extending BESA to N:M semi-structured sparsity to better leverage modern GPU acceleration kernels.

Summary updated

BibTeX
@inproceedings{xu2024besa,
  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},
  title = {{BESA: Pruning Large Language Models with Blockwise Parameter-Efficient Sparsity Allocation}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=gC6JTEU3jl},
}
Figure