Aggressive Post-Training Compression on Extremely Large Language Models

Zining Zhang, Yao Chen, Bingsheng He, Zhenjie ZhangarXiv 2024 · OpenReview

Abstract

The increasing size and complexity of Large Language Models (LLMs) pose challenges for their deployment on personal computers and mobile devices. Aggressive post-training model compression is necessary to reduce the models' size, but it often results in significant accuracy loss. To address this challenge, we propose a novel network pruning technology that utilizes over 0.7 sparsity and less than 8 bits of quantization. Our approach enables the compression of prevailing LLMs within a couple of hours while maintaining a relatively small accuracy loss. In experimental evaluations, our method demonstrates effectiveness and potential for practical deployment. By making LLMs available on domestic devices, our work can facilitate a new era of natural language processing applications with wide-ranging impacts.

Introduction

Large Language Models (LLMs) have revolutionized natural language processing, but their massive parameter counts—often exceeding 100 billion—present significant deployment challenges. Post-training compression via pruning (removing weights) and quantization (reducing precision) is necessary for execution on consumer-grade hardware. However, conventional methods often encounter a "perplexity wall," where model performance degrades exponentially as sparsity increases beyond 50%. Existing techniques like SparseGPT typically apply uniform pruning across all layers, ignoring the varying sensitivity of different layers to weight removal.

Methodology: Layer-wise Sparsity Scheduling

We propose a novel layer-wise sparsity scheduler that intelligently distributes pruning budgets across the model. Our approach is based on two key technical insights:

Hessian-based Error Estimation

We utilize the inverse Hessian matrix to estimate the Mean Square Error (MSE) introduced by pruning each layer. This provides a mathematically grounded metric for layer sensitivity, allowing us to identify which parts of the network are most resilient to compression.

Log-level Clustering

Our analysis reveals that pruning errors follow an exponential "long-tail" distribution across layers. A few layers are extremely sensitive, while many are highly resilient. To address this, we apply k-means clustering to the logarithm of the estimated errors. This allows the scheduler to identify and protect highly sensitive layers—which the authors found are often the later layers in the model—while aggressively pruning more redundant ones.

Figure 5: Estimated loss across layers for various OPT models, illustrating the non-uniform, exponential distribution of pruning sensitivity when layers are ordered by error magnitude.

Experimental Results

The proposed method was evaluated on the OPT family and the massive BLOOM-176B model. Using 128 sequences from the C4 dataset for calibration, we achieved significant compression with minimal accuracy loss.

Figure 1: Perplexity of BLOOM-176B using the proposed method. The model maintains high performance up to 70% sparsity, significantly pushing past the typical limits of previous techniques.
  • State-of-the-Art Performance: On BLOOM-176B, our method achieved a perplexity of 11.02 at >70% sparsity, outperforming SparseGPT (11.30). For OPT-66B, we reached 11.65 perplexity, compared to SparseGPT’s 12.44.
  • Computational Efficiency: The scheduler is highly practical, requiring only 3 additional hours of computation on a single A100 GPU for the 176B parameter BLOOM model.
  • Quantization Synergy: The method is fully compatible with 4-bit quantization (INT4). When combined, these techniques can achieve a 1/8 total compression ratio while maintaining high performance.

Conclusion

By moving beyond uniform pruning and leveraging the exponential distribution of layer sensitivity, we enable aggressive compression of the world's largest language models. This work facilitates the deployment of high-performance AI on domestic devices, significantly reducing the hardware barriers to advanced natural language processing.

Summary updated

BibTeX
@misc{zhang2024aggressive,
  author = {Zining Zhang and Yao Chen and Bingsheng He and Zhenjie Zhang},
  title = {{Aggressive Post-Training Compression on Extremely Large Language Models}},
  year = {2024},
  eprint = {2409.20094},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.20094},
}
Figure