TL;DR
BaWA (Balanced Weight and Activation) is a new one-shot pruning metric that significantly improves the efficiency of compressing Large Language Models (LLMs). By automatically balancing weight magnitudes and dampening the influence of activation outliers, BaWA achieves state-of-the-art results. For instance, it reduces perplexity by 2.49 and boosts accuracy by 3.08% on Mistral-7B compared to previous leading methods.
What Problem Does This Paper Address?
Deploying billion-parameter LLMs is a massive hardware challenge. Pruning—the process of removing unnecessary weights—is a go-to solution for model compression. However, the "one-shot" pruning methods favored for LLMs (which avoid expensive retraining) rely heavily on a pruning metric to decide which weights are "important."
The authors identify two fatal flaws in current metrics like Wanda:
- Imbalanced Weight Distribution: Weights across different channels aren't uniform. Some channels have naturally larger magnitudes, leading to "unfair" pruning where important weights in "quiet" channels are killed off simply because their neighbors are small.
- The Outlier Trap: LLM activations are notorious for having extreme outliers. A tiny fraction of outliers (less than 1%) can inflate a channel's norm by over 5x, tricking the pruning metric into preserving that channel even if it isn't actually the most useful for the model's performance.
Methods
BaWA introduces a novel metric that systematically balances these distributions through three main components:
- Magnitude Normalization: To fix weight imbalance, BaWA normalizes weight magnitudes across both input and output channels. This ensures that pruning decisions are made based on relative importance within a channel rather than absolute magnitude.
- Outlier Regularization: To handle activation spikes, the authors introduce learnable "power factors" ($\theta$). Instead of a standard $\ell_2$ norm, they use $||X_j||_2^{\theta}$, allowing the model to mathematically "turn down the volume" on outliers so they don't dominate the pruning decision.
- Automatic Hyperparameter Search: Since every layer in a transformer might have different distribution characteristics, the "optimal" balance isn't a single number. BaWA uses an efficient zeroth-order gradient-based optimization (similar to the MeZO optimizer) to automatically find the best power factors for each block in just a few minutes.
The final metric combines these into a single formula that evaluates the importance of weight $W_{ij}$ by considering its normalized magnitude and its regularized activation influence.
Datasets
The researchers evaluated BaWA across a comprehensive suite of benchmarks:
- Language Modeling: Perplexity scores on WikiText-2.
- Zero-Shot Reasoning: Seven standard tasks including HellaSwag, PIQA, ARC (Easy & Challenge), BoolQ, RTE, and Winogrande.
- General Knowledge: The MMLU (Massive Multitask Language Understanding) benchmark.
- Models: They tested on a wide range of architectures, including LLaMA (7B-65B), LLaMA2 (7B-70B), Mistral-7B, and Qwen2-72B.
Key Insights and Ideas
- Fairness Matters in Pruning: The "aha moment" here is that pruning isn't just about finding the "biggest" weights; it's about finding the most representative ones. By normalizing the weights, BaWA treats every channel as an equal participant.
- Outliers are Distractions: Previous methods treated high-magnitude activations as a signal of high importance. BaWA suggests that these are often just noise that biases the pruning mask. Regularizing them leads to a much more robust "mask" of preserved weights.
- Search is Better than Guessing: Most pruning papers pick a fixed hyperparameter (like $\theta=0.5$) and stick with it. BaWA proves that different layers have different needs; the early layers of an LLM are often less sensitive to pruning metrics than the later layers.
- Orthogonality: BaWA is a metric, not a reconstruction algorithm. This means it can be combined with other techniques like ADMM or weight tuning to get even better results.
Key Results
- SOTA Performance: On Mistral-7B with 2:4 sparsity (a hardware-friendly pattern), BaWA outperformed the previous best method (Wanda) by 3.08% in average accuracy and reduced perplexity by 2.49.
- Scaling Up: For massive models like LLaMA2-70B, BaWA achieved a perplexity of 6.30, a significant 12.3% improvement over fixed-scale baselines.
- Speed: The automatic search is remarkably fast. It takes only about 16 minutes to optimize a 70B parameter model on a single A100 GPU—faster than some methods that don't even include an optimization step.
- Hardware Gains: Using 2:4 sparsity, the authors demonstrated a 1.58x speedup in GEMM (General Matrix Multiply) operations on an NVIDIA A100.
Limitations and Future Work
While BaWA is highly effective for unstructured and N:M (semi-structured) pruning, the paper focuses less on structured pruning (removing entire neurons or heads), which is often easier for standard CPUs to accelerate but harder to do without losing accuracy.
Additionally, while the zeroth-order search is fast, it still requires a small "calibration" dataset. Future work could explore if these optimal power factors can be predicted analytically from weight distributions alone, potentially removing the need for a calibration set entirely.
Summary updated