TL;DR
This paper investigates activation sparsity in modern Large Language Models (LLMs), revealing that it's a universal property that scales with model size and offers significant potential for efficiency gains. The authors introduce a general framework to assess this sparsity and find that input-based sparsification is a practical, training-free approach for accelerating LLMs.
What Problem Does This Paper Address?
Modern LLMs, unlike older ReLU-based networks, use activation functions like SiLU and GELU that don't produce exact zeros. This makes it difficult to apply existing methods for exploiting activation sparsity, which rely on these exact zeros for efficiency gains (e.g., skipping computations). Consequently, research in this area is fragmented, with different approaches targeting various parts of the model without a unified understanding or clear guidelines. This gap hinders the development of more efficient and accessible LLMs.
Methods
The authors propose a general framework for evaluating sparsity robustness in LLMs. Their core method involves a top-p sparsification rule: for any activation vector, they identify the largest magnitude elements whose absolute values sum up to a certain fraction 'p' of the vector's total L1 norm. This creates a sparsity mask. They then define critical sparsity as the maximum sparsity level that results in at most a 1% performance drop. This allows for a standardized, data-free comparison of sparsity tolerance across different models and components. They also explore other sparsification rules like top-k and max-p for comparison.
Datasets
The paper evaluates several LLM families:
- Gemma3 (1B, 4B, 12B, 27B parameters)
- LLaMA3.1/3.2 (1B, 3B, 8B parameters)
- Qwen2.5 (0.5B, 1.5B, 3B, 7B, 14B, 32B parameters)
- LLaDA-8B (a diffusion-based LLM)
- OLMoE-7B-A1B (a Mixture-of-Experts model)
Evaluation is performed using the lm-eval-harness benchmark suite in a zero-shot setting, encompassing tasks like ARC-Easy, ARC-Challenge, PIQA, HellaSwag, WinoGrande, Lambada, SciQ, and TriviaQA.
Key Insights and Ideas
- Universal Sparsity: Activation sparsity is not an artifact of specific architectures or training regimes but a fundamental, universal property of modern LLMs.
- Scaling is Key: Larger models exhibit significantly higher critical sparsity, meaning they can tolerate more aggressive pruning without performance degradation. This suggests sparsity will become even more crucial for future, larger LLMs.
- Input Sparsity is Practical: Sparsifying input activations (or input and down-projection) is as effective as, and often more robust than, gate-based methods, without requiring additional training or complex predictors. This makes it the most practical approach for acceleration.
- Task-Dependent Sparsity: While models generally tolerate sparsity, the exact patterns and levels of tolerance can vary significantly across different downstream tasks, highlighting the need for careful consideration in practical applications.
- Diffusion LLMs are Sparsifiable: For the first time, the paper shows that diffusion-based LLMs also exhibit substantial activation sparsity, offering a promising avenue for their acceleration.
Key Results
- Critical Sparsity Increases with Model Size: Larger models (e.g., 27B parameters) can tolerate critical sparsity levels of 60-80% in FFN layers, compared to 30-50% in smaller models.
- Input Sparsity Outperforms Gate Sparsity: Input-based sparsification consistently achieves comparable or higher critical sparsity than gate-based methods across various models and tasks.
- Diffusion LLMs Show High Sparsity: LLaDA-8B (diffusion) exhibits higher critical sparsity (around 68% on average) than similarly sized autoregressive models.
- Training Recipe Matters: Instruction-tuned models show greater tolerance to activation sparsity than their pretrained counterparts.
- MoE Models Exhibit Sparsity: Mixture-of-Experts models also show significant activation sparsity, with individual experts exhibiting high sparsity levels.
Limitations and Future Work
- FFN Focus: The study primarily focuses on Feed-Forward Network (FFN) layers, excluding multi-head attention (MHA). While FFNs dominate inference costs for typical context lengths, MHA's role becomes more significant for very long sequences, and activation sparsity might be less practical there compared to other techniques like KV-cache compression.
- Data Dependency: The significant inter-task variance in sparsity patterns suggests that methods relying on auxiliary datasets for calibration might overfit and not generalize well. The authors advocate for data-free sparsification methods.
- Future Work: The authors suggest exploring model-specific solutions for diffusion LLMs, investigating the impact of massive activations on sparsity stability, and further analyzing the role of sparsity in MoE architectures. They also emphasize the need for evaluations that prioritize performance preservation and consider activation sparsity as a complementary technique to other acceleration methods.
Summary updated