Numerical Pruning for Efficient Autoregressive Models

Xuan Shen, Zhao Song, Yufa Zhou, Bo Chen, Jing Liu, Ruiyi Zhang, Ryan A. Rossi, Hao Tan, Tong Yu, Xiang Chen, Tong Sun, Pu Zhao, Yanzhi Wang, Jiuxiang Gu

Abstract

Large-scale autoregressive Transformers have set new benchmarks in language and image generation but impose significant computational and memory burdens. This paper introduces Numerical Pruning, a training-free structural pruning framework that optimizes pruning masks using Newton’s method and employs a closed-form compensation algorithm to restore model performance. Our approach demonstrates superior accuracy and robustness across various LLaMA models and image generation tasks, providing significant hardware speedups without the need for expensive retraining.

Introduction

The proliferation of large-scale autoregressive models, such as the LLaMA family, has revolutionized artificial intelligence. However, their deployment is often hindered by massive memory requirements and slow inference speeds. While pruning is a common strategy to mitigate these costs, existing methods face two primary challenges: the trade-off between hardware-unfriendly unstructured pruning and accuracy-degrading structural pruning, and a lack of cross-modal applicability, particularly in autoregressive image generation.

Numerical Pruning addresses these issues by formulating structural pruning as a formal optimization problem. Unlike heuristic-based methods, it provides a mathematically grounded approach to identify and compensate for redundant weights, making it effective for both text and image modalities.

Methodology

The Numerical Pruning framework consists of three main stages designed to minimize the error between original and pruned model outputs.

1. Numerical Score Calculation

Instead of relying on simple weight magnitude, the authors use Newton’s method to calculate a "numerical score" for each Attention head and MLP channel. This score quantifies the importance of a specific structure to the model's overall output.

Structural components of the Transformer architecture targeted by Numerical Pruning.

2. Global Pruning and Scaling

Importance scores are ranked globally across all layers. To account for the different parameter counts in Attention heads versus MLP channels, a scaling factor ($\alpha$) is introduced. This ensures a balanced pruning process that preserves critical "bottleneck" layers while aggressively removing redundancy elsewhere.

3. Closed-Form Compensation

To recover performance lost during pruning, a mathematical compensation step is applied. Using a closed-form analytical solution, the remaining weights are updated to minimize the discrepancy caused by the removed rows. This process is highly efficient, requiring as few as 128 calibration samples.

Experimental Results

The researchers evaluated Numerical Pruning on the LLaMA-1, LLaMA-2, and LLaMA-3 families for language tasks, and LlamaGen for image generation.

Performance in Language Modeling

Numerical Pruning consistently outperforms existing structural pruning methods like LLM-Pruner, SliceGPT, and FLAP. As shown in the figure below, our method maintains significantly lower perplexity across various pruning ratios, demonstrating exceptional robustness even at 50% sparsity where other methods begin to fail.

Perplexity comparison on LLaMA-2 7B across different pruning ratios.

Cross-Modal Success

The method also shows remarkable results in image generation. For LlamaGen-3B at 20% sparsity, Numerical Pruning achieved an FID of 20.16, a stark contrast to the 162.15 FID produced by the FLAP baseline. This indicates that the "next-token prediction" paradigm allows pruning logic to transfer effectively from text to pixels.

Conclusion

Numerical Pruning offers a robust, training-free solution for compressing large autoregressive models. By treating pruning as an optimization task and providing a precise compensation mechanism, it achieves state-of-the-art results across modalities. Future work will focus on closing the performance gap in image generation and exploring data-free variants of the numerical pruning algorithm.

Summary updated

BibTeX
@inproceedings{shen2025numerical,
  author = {Xuan Shen and Zhao Song and Yufa Zhou and Bo Chen and Jing Liu and Ruiyi Zhang and Ryan A. Rossi and Hao Tan and Tong Yu and Xiang Chen and Yufan Zhou and Tong Sun and Pu Zhao and Yanzhi Wang and Jiuxiang Gu},
  title = {{Numerical Pruning for Efficient Autoregressive Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i19.34249},
}
Figure