Abstract
Large language models (LLMs) have demonstrated impressive capabilities, but their enormous size poses significant challenges for deployment in real-world applications. To address this issue, researchers have sought to apply network pruning techniques to LLMs. A critical challenge in pruning is allocation the sparsity for each layer. Recent sparsity allocation methods is often based on heuristics or search that can easily lead to suboptimal performance. In this paper, we conducted an extensive investigation into various LLMs and revealed three significant discoveries: (1) the layerwise pruning sensitivity (LPS) of LLMs is highly non-uniform, (2) the choice of pruning metric affects LPS, and (3) the performance of a sparse model is related to the uniformity of its layerwise redundancy level. Based on these observations, we propose that the layerwise sparsity of LLMs should adhere to three principles: non-uniformity, pruning metric dependency, and uniform layerwise redundancy level in the pruned model. To this end, we proposed Maximum Redundancy Pruning (MRP), an iterative pruning algorithm that prunes in the most redundant layers (i.e., those with the highest non-outlier ratio) at each iteration. The achieved layerwise sparsity aligns with the outlined principles. We conducted extensive experiments on publicly available LLMs, including the LLaMA2 and OPT, across various benchmarks. Experimental results validate the effectiveness of MRP, demonstrating its superiority over previous methods.
Introduction
Pruning—the process of removing unnecessary weights to make models smaller and faster—is essential for deploying Large Language Models (LLMs) on resource-constrained devices. However, most current techniques apply a uniform sparsity across all layers, which is fundamentally flawed. LLM layers are not created equal; some are highly sensitive to weight loss, while others are highly redundant. This work introduces Maximum Redundancy Pruning (MRP), a principled iterative approach to sparsity allocation that moves beyond heuristics to optimize performance.
Principles of Layerwise Sparsity
Through empirical study, the authors identified three core principles for effective sparsity allocation:
- Non-uniformity: Sensitivity to pruning varies significantly across layers, typically following a "U-shape" where the first and last layers are most sensitive.
- Metric Dependency: The sensitivity profile of a model is not fixed but depends on the pruning metric used (e.g., Magnitude vs. Wanda).
- Uniform Redundancy: A sparse model performs best when the remaining redundancy is balanced across all layers.
The Maximum Redundancy Pruning (MRP) Algorithm
MRP is an iterative algorithm designed to balance the Layerwise Redundancy Level (LRL) across the network. It uses a "non-outlier ratio" to quantify redundancy, identifying weights that don't contribute to high-magnitude activations. In each iteration, MRP identifies the most redundant layer and prunes a small step of weights from it. This iterative process is vital because pruning one layer alters the data distribution and redundancy of subsequent layers—a phenomenon known as inter-layer dependency.
Experimental Results
The researchers evaluated MRP on several architectures, including LLaMA2 and OPT, using WikiText2 for perplexity and a suite of zero-shot benchmarks for accuracy. MRP consistently outperformed both uniform pruning and state-of-the-art methods like OWL. For instance, on LLaMA2-7B at 70% sparsity using the Wanda metric, MRP achieved a perplexity of 23.54, compared to 80.40 for uniform pruning and 30.47 for OWL.
Beyond perplexity, MRP showed superior zero-shot accuracy across seven downstream tasks. Furthermore, the authors demonstrated that a LLaMA2-13B model pruned to 7B parameters using MRP and LoRA fine-tuning outperformed a standard LLaMA2-7B model, suggesting that pruning large models is a viable alternative to training smaller ones from scratch.
Conclusion
Maximum Redundancy Pruning (MRP) offers a robust, principle-driven framework for sparsity allocation in LLMs. By iteratively balancing redundancy across layers and accounting for metric dependency, MRP achieves state-of-the-art pruning performance. While the iterative nature of the algorithm introduces some computational overhead during the compression phase, the resulting efficiency and performance gains are significant for real-world LLM deployment.
Summary updated