Large Language Models (LLMs) are transformative, but their "billions of parameters" nature makes them computational gluttons. Pruning—the process of removing redundant weights—is a go-to strategy for compression. However, researchers have long been stuck between a rock and a hard place: Global Pruning provides the best performance but requires loading the entire model into GPU memory (impossible for massive models), while Local Pruning is memory-efficient but suboptimal because it ignores how changes in one layer affect the rest of the network.
In their NeurIPS 2024 paper, researchers from Emory University and Argonne National Laboratory introduce SparseLLM, a framework that offers the best of both worlds. It achieves the performance of global coordination with the resource efficiency of local methods.
TL;DR
SparseLLM redefines global pruning as a series of coordinated subproblems using auxiliary variables and alternating optimization. This allows for "globally-aware" pruning on a budget, significantly outperforming state-of-the-art methods like SparseGPT and Wanda, especially in high-sparsity regimes (80%+).
What Problem Does This Paper Address?
The fundamental issue with current LLM pruning is over-alignment. Existing "local" solvers like SparseGPT prune one layer at a time, trying to make the pruned layer's output match the original layer's output as closely as possible. While this sounds logical, it’s myopic. By forcing every intermediate activation to stay exactly the same, the model loses the flexibility to adapt to the cumulative errors of pruning.
True global pruning would minimize the error at the final output, allowing intermediate layers to shift and compensate for one another. But since you can't fit a 175B parameter model on a single GPU to run a global optimization, we’ve settled for suboptimal local solutions—until now.
Methods
SparseLLM breaks the "memory wall" by using a mathematical technique called problem decomposition.
- Modular Formulation: The authors conceptualize the LLM as a chain of modular functions (linear layers followed by non-linearities like ReLU or SiLU).
- Auxiliary Variables: They introduce "slack" variables for activations and outputs. Instead of forcing a layer to match a fixed target, these variables allow the targets to evolve during optimization.
- Alternating Optimization: The framework solves three manageable subproblems iteratively:
- Updating Weights: Pruning the weights given the current activation targets (using solvers like SparseGPT).
- Updating Activations: Adjusting the internal signals to better bridge the gap between layers.
- Updating Outputs: Refining the layer outputs to ensure global consistency.
- Strategic Focus: Since Feed-Forward Networks (FFNs) account for over two-thirds of LLM parameters, SparseLLM prioritizes global coordination for FFN blocks while maintaining a simpler local strategy for Attention modules, balancing performance and compute.
Datasets
The authors evaluated SparseLLM across a variety of models and benchmarks:
- Models: The OPT family (125M to 66B parameters), LLaMA-2 (7B, 13B), and the recent LLaMA-3 (8B).
- Perplexity Benchmarks: WikiText2, PTB, and C4 validation sets.
- Zero-Shot Tasks: A suite of seven benchmarks including BoolQ, RTE, HellaSwag, WinoGrande, ARC (Easy/Challenge), and OpenBookQA.
Key Insights and Ideas
- The Power of Coordination: The "aha moment" is that you don't need to solve the whole model at once to get global benefits. By letting adjacent layers "talk" to each other through auxiliary variables, the model can absorb pruning errors that would otherwise crash a locally-pruned model.
- Resilience at High Sparsity: Most pruning methods "break" when you try to remove more than 60-70% of weights. SparseLLM remains remarkably stable even at 80% or 90% sparsity because its global view prevents the "error explosion" seen in local methods.
- Analytic Efficiency: Despite the complex-sounding optimization, the authors derived closed-form solutions for the subproblems. This means the per-epoch complexity remains $O(h^3)$ (where $h$ is the hidden dimension), making it computationally comparable to existing local solvers.
Key Results
SparseLLM consistently sets new state-of-the-art marks for unstructured pruning:
- Perplexity Gains: On OPT-1.3B at 80% sparsity, SparseLLM achieved a WikiText2 perplexity of 58.92, a massive improvement over SparseGPT’s 69.67.
- High Sparsity Superiority: In the extreme 90% sparsity regime, SparseLLM often reduced perplexity by over 50% compared to SparseGPT.
- Zero-Shot Accuracy: On LLaMA-2 7B at 3:4 semi-structured sparsity, SparseLLM maintained a mean accuracy of 36.13%, outperforming SparseGPT’s 35.59%.
- Fast Convergence: The training loss typically plateaus within just 2 to 3 epochs, proving the method is not just effective but also fast.
Limitations and Future Work
- Homogeneous Sparsity: Currently, the method assumes every layer is pruned to the same percentage. The authors note that exploring heterogeneous sparsity (pruning some layers more than others) is a promising next step.
- Calibration Data: Like most post-training pruning methods, it still requires a small amount of calibration data (e.g., 128 segments of text) to guide the optimization.
- Structural Constraints: While the paper focuses on unstructured pruning, the framework could potentially be adapted for structured pruning (removing entire neurons or heads), which is more hardware-friendly.
Source Code: https://github.com/BaiTheBest/SparseLLM
Summary updated