Overview
As Large Language Models (LLMs) scale to hundreds of billions of parameters, their computational and memory requirements become prohibitive. Network pruning—removing redundant weights—is a classic solution, but traditional methods struggle in the LLM era.
Historically, pruning required retraining, which is financially and computationally impossible for massive models like LLaMA-65B. Recent "training-free" methods like SparseGPT avoid retraining but rely on complex second-order information (Hessian matrices) to reconstruct weights, remaining computationally intensive. Meanwhile, the simplest approach—magnitude pruning (removing the smallest weights)—performs surprisingly poorly on LLMs, even at low sparsity levels.
To bridge this gap, researchers introduce Wanda (Pruning by Weights and activations), a remarkably simple yet effective post-training pruning method. Wanda achieves competitive sparsity levels without any retraining or computationally expensive weight updates.
How Wanda Works
Wanda stands out for its "prune-and-go" simplicity. Unlike methods that update the values of remaining weights to compensate for removed ones, Wanda leaves the unpruned weights exactly as they were. The method relies on two core components:
- The Pruning Metric: Instead of evaluating the weight magnitude $|W_{ij}|$ in isolation, Wanda calculates a score $S_{ij} = |W_{ij}| \cdot \|X_j\|_2$, where $\|X_j\|_2$ is the $\ell_2$ norm of the input activations for that specific weight. This norm is estimated from a small set of calibration data. This approach ensures that weights connected to high-magnitude "outlier" features—a known phenomenon in LLMs—are preserved even if the weight itself is small.
- Per-Output Comparison: Rather than pruning globally across a layer or the whole model, Wanda compares weights locally within each output neuron (each row of the weight matrix). This "per-output" approach maintains a balanced pruning ratio across the network.
Key Insights
- Activations Matter More Than You Think: Weight magnitude alone is a poor proxy for importance in LLMs. Because LLMs develop extreme outlier features in their hidden states, a small weight multiplied by a massive activation can have a much larger impact on the output than a large weight multiplied by a tiny activation.
- The Hessian is Overkill: SparseGPT uses second-order information to minimize reconstruction error. Wanda’s metric acts as a diagonal approximation of that same logic. By ignoring the off-diagonal elements of the Hessian, Wanda trades a tiny bit of accuracy for a massive gain in simplicity and speed.
- Local is Better: Pruning "per-output" (row-wise) consistently outperforms "per-layer" pruning. Maintaining the internal "balance" of each neuron proves more important than finding the absolute smallest weights in the entire layer.
- Exact Sub-networks Exist: Because Wanda doesn't update weights, its success proves that LLMs contain "exact" sparse sub-networks that perform well without any adjustment to the original pretrained parameters.
Experimental Results
The authors evaluated Wanda across several model families (LLaMA, LLaMA-2, OPT, BLOOM, Pythia) using benchmarks like WikiText perplexity, zero-shot tasks (BoolQ, RTE, HellaSwag, etc.), and MMLU.
- Performance: On LLaMA-65B at 50% unstructured sparsity, Wanda achieved a zero-shot accuracy of 66.67%, nearly matching the dense model's 66.97% and significantly outperforming magnitude pruning (62.74%).
- Speed: Wanda is roughly 300x faster to execute than SparseGPT. It requires only a single forward pass to collect activation statistics and can prune a 65B model in seconds on a single GPU.
- Robustness: Wanda is highly robust to the amount of calibration data. Even with just a single calibration sequence, Wanda produces a highly functional sparse model, whereas SparseGPT's performance degrades significantly with fewer samples.
Limitations and Future Work
While Wanda is highly effective, it has limitations. There is still a performance drop at 50% sparsity on smaller models (e.g., 7B parameters); the gap only truly vanishes as model size increases to 65B+. Additionally, Wanda struggles more with structured N:M sparsity (like 2:4) compared to unstructured sparsity, where SparseGPT’s weight updates still provide a noticeable edge. Finally, while theoretical speedups exist for 2:4 sparsity, actual wall-clock speedups depend heavily on hardware support (like NVIDIA's Ampere Sparse Tensor Cores) and optimized kernels.
Future directions include exploring whether Wanda can be integrated into the training process itself or used to find optimal sparsity patterns for even more aggressive compression.
Summary updated