Introduction
Modern Large Language Models (LLMs) like LLaMA and PaLM rely on activation functions such as Swish or GELU. While effective, these functions produce dense outputs where nearly every neuron activates for every input, leading to significant computational overhead during inference. Activation sparsity—where a large portion of neurons output zero—offers a path toward substantial inference acceleration. However, simply replacing dense activation functions with sparse alternatives like ReLU often results in severe performance degradation or insufficient sparsity levels.
ProSparse is a novel "ReLUfication" framework designed to bridge this gap. It converts dense LLMs into highly sparse versions (~89% sparsity) while maintaining the original model's performance, enabling up to a 4.52x inference speedup on commodity hardware.
The ProSparse Framework
The ProSparse workflow consists of three distinct stages designed to help the model adapt to increasing sparsity without collapsing its internal representations.
- Activation Function Substitution: The process begins by replacing the original non-sparse activation (e.g., Swish) with ReLU. The model then undergoes continual training to adapt to this new functional form.
- Progressive Sparsity Regularization: This core innovation applies an $L_1$ penalty ($\lambda$) that increases gradually across multiple stages. Following a flat "warmup" period, the regularization factor follows a smooth sine-curve increase. This gradual pressure allows the model to "re-wire" itself incrementally, preventing violent shifts in activation distributions that typically occur with sudden regularization.
- Activation Threshold Shifting (FATReLU): To further enhance sparsity, the authors introduce Formalized Activation Thresholding (FATReLU). By applying a small positive threshold ($t$), neurons with weak activations are zeroed out, pruning elements that contribute minimally to the final output.
Experimental Evaluation
The authors evaluated ProSparse using LLaMA2 (7B and 13B) and MiniCPM (1B) models. Training utilized a diverse mix of raw corpora (StarCoder, Wikipedia, The Pile) and instruction-tuning datasets (UltraChat, Flan). Performance was measured across standard benchmarks, including HumanEval (coding), MMLU (general knowledge), and GSM8K (math).
Key Results
ProSparse achieves state-of-the-art activation sparsity without sacrificing the "intelligence" of the base models. As shown in the table below, ProSparse-7B reaches 89.32% average sparsity while slightly outperforming the original dense LLaMA2-7B on average benchmark scores.
Significant findings include:
- Scalability: The method scales effectively from 1B to 13B parameter models, with MiniCPM-1B reaching 87.89% sparsity.
- Massive Speedups: Using the PowerInfer framework, the authors achieved up to a 4.52x inference speedup. Custom sparse GPU operators also provided up to a 2.44x speedup specifically for the FFN layers.
- Predictability: A negative exponential relationship exists between the regularization factor and final sparsity, allowing engineers to dial in specific, controllable sparsity targets.
- Efficiency: The ReLUfication process is relatively inexpensive, requiring only approximately 2.7% of the original pre-training token count to reach high sparsity.
Discussion and Limitations
A key insight from ProSparse is that the path to sparsity is as critical as the target itself; the sine-wave scheduling of the $L_1$ penalty is essential for maintaining performance. However, the study notes that sparsity is not uniform: higher layers in the LLM tend to be significantly sparser than lower layers, and highly formatted instruction data yields higher sparsity than messy, raw web text.
Current limitations include the focus on Feed-Forward Network (FFN) layers, leaving Attention layers dense. Future work may explore extending these sparsification techniques to the attention mechanism and testing the framework on larger models (70B+ parameters).
Summary updated