TL;DR
Current state-of-the-art Large Language Model (LLM) pruning methods rely on greedy, single-weight heuristics to choose which parameters to drop, completely ignoring how weights interact. SparseFW instead relaxes the combinatorial mask selection problem into a tractable convex program solved via the projection-free Frank-Wolfe algorithm. By combining this convex relaxation with an anchor on top-saliency weights, SparseFW cuts per-layer pruning error by up to 80% and consistently improves downstream perplexity and zero-shot accuracy across modern open LLMs.
What Problem Does This Paper Address?
Pruning LLMs after pre-training reduces inference compute and memory footprint without requiring expensive full-model retraining. Prevailing post-training methods (like Wanda and RIA) formulate this as a layer-by-layer optimization problem: find a binary mask $M$ that minimizes output reconstruction error on a small calibration set, $\min_M \|WX - (M \odot W)X\|_F^2$, subject to a sparsity budget $\|M\|_0 \le k$.
However, finding the best subset of weights is an NP-hard quadratic combinatorial problem. Because examining every combination is impossible, standard methods resort to greedy heuristics—evaluating each parameter in isolation and dropping weights with the lowest scores. This single-weight viewpoint entirely bypasses weight interactions and feature correlations in the input activations $XX^\top$.
Methods
The authors propose SparseFW, which recasts discrete mask selection into continuous constrained optimization:
- Convex Relaxation: The binary constraint $M \in \{0, 1\}^{d_{out} \times d_{in}}$ is relaxed to its convex hull $\mathcal{C}_k = \{M \in [0, 1]^{d_{out} \times d_{in}} : \|M\|_1 \le k\}$. The objective becomes a smooth, convex quadratic program.
- Frank-Wolfe (Conditional Gradients): Rather than using Projected Gradient Descent (which requires an expensive projection onto $\mathcal{C}_k$), SparseFW uses the Frank-Wolfe algorithm. At each step, a Linear Minimization Oracle (LMO) finds an extreme point of the polytope by simply selecting the $k$ coordinates with the most negative gradient entries. Iterates update via convex combinations, maintaining feasibility naturally without projection.
- Precomputed Covariances: Because gradients only depend on activations via $G = XX^\top$ and $H = WG$, these matrices are precomputed once per layer, making iteration runtimes invariant to calibration sequence lengths or sample counts.
- Anchored Optimization ($\alpha$-ratio): Pure per-layer reconstruction error does not always align with global generation quality. To counter this, SparseFW fixes the top $\alpha$ fraction (typically 90%) of weights deemed most critical by Wanda, running FW updates only on the remaining 10% of borderline weights before applying a final top-$k$ thresholding.
- Pattern Flexibility: SparseFW extends straightforwardly to semi-structured $n:m$ sparsity (e.g., 2:4) by decomposing the LMO into independent sub-problems over consecutive blocks.
Datasets
- Calibration: Sequences of length 2048 randomly sampled from the C4 dataset (using between 64 and 512 samples; 256 by default).
- Evaluation:
- WikiText-2 for language modeling perplexity.
- EleutherAI LM Evaluation Harness for aggregate zero-shot accuracy across downstream benchmark tasks.
- Evaluated Models: LLaMA-3.1-8B, Gemma-2-9B, Yi-1.5-9B, DeepSeek-7B-base, Qwen2.5-7B, and Qwen2.5-14B.
Key Insights and Ideas
- Greedy methods are mathematically myopic: The authors prove that Wanda is mathematically equivalent to optimizing the reconstruction objective for a single pruned weight while ignoring the remaining weights.
- The "Local vs. Global" optimization trap: Optimizing unconstrained layerwise error to near-perfection actually hurts final text generation. Saliency heuristics like Wanda capture crucial inductive biases about outlier features that pure layer-level $L_2$ minimization discards. Anchoring the most salient weights ($\alpha = 0.9$) and letting Frank-Wolfe resolve the remaining borderline choices yields the sweet spot.
- Theoretical approximation guarantees: Unlike greedy pruning schemes, rounding the continuous Frank-Wolfe iterate after $T$ iterations back to a binary mask yields a bounded sub-optimality gap governed by the curvature $\lambda_{\max}(Q)$ and an $\mathcal{O}(1/T)$ optimization rate.
Key Results
- Layerwise Error: SparseFW cuts per-layer reconstruction error by 20% to 40% on average, and up to 80% on individual layers compared to Wanda.
- Downstream Perplexity & Zero-Shot Gains:
- On LLaMA-3.1-8B at 60% unstructured sparsity, Wanda reaches 21.53 perplexity and RIA achieves 19.14. SparseFW improves this to 17.97 (Wanda warmstart) and 18.16 (RIA warmstart). Zero-shot accuracy increases from 48.08% to 51.92% / 52.15%.
- At 2:4 semi-structured sparsity, LLaMA-3.1-8B perplexity drops from 24.82 (Wanda) down to 20.45 (SparseFW), outperforming RIA (23.70).
- Similar gains hold across Gemma-2-9B (perplexity drops from 17.41 to 15.81 at 2:4 sparsity) and Yi-1.5-9B (11.58 down to 10.61).
- Sample Scaling: Unlike Wanda, which quickly saturates with more calibration data, SparseFW scales effectively: increasing calibration samples from 64 to 512 continuously drives perplexity down.
Limitations and Future Work
- Increased Compute Overhead: Although precomputing $XX^\top$ keeps individual iterations cheap, running 2,000 iterations per layer is noticeably slower than one-pass heuristic scoring methods like Wanda or RIA.
- Dependence on Saliency Anchors: "Vanilla" Frank-Wolfe without fixed weights ($\alpha = 0.0$) degrades model perplexity. The method still relies on heuristic warm-starts to prevent pruning globally indispensable weights.
- Mask-Only Formulation: The current algorithm focuses exclusively on mask selection without jointly updating or compensating the unpruned weights (as done in SparseGPT's second-order weight reconstruction). Combining SparseFW mask selection with weight reconstruction remains an open direction.
Summary updated