GLU Variants: LLM's Biggest Activation Spike Culprit
Gated Linear Unit (GLU) variants, prevalent in the feed-forward networks (FFN) of modern LLMs like LLaMA, are identified as primary generators of "activation spikes"—excessively large values causing severe local quantization errors, particularly in early and late layers.
The top 3
- Top GLU Variants Fueling Spikes: SwiGLU & GeGLU: SwiGLU and GeGLU are the most common Gated Linear Unit (GLU) variants adopted in modern LLMs like LLaMA and PaLM. Their multiplicative gating structure, while boosting model performance, systematically generates the extreme activation values known as 'spikes'.
- How GLU Spikes Wreck Low-Bit Quantization Accuracy: GLU variants' activation spikes lead to severe local quantization errors, particularly in the early and late layers of the Feed-Forward Network (FFN) and for specific tokens. These excessive magnitudes exhaust the limited dynamic range of low-precision formats like INT8 or FP8, significantly degrading the performance of quantized LLMs.
- Why LLMs Still Choose Spiky GLUs: Performance Gains: Despite the quantization challenges posed by activation spikes, GLU variants, particularly SwiGLU, are widely adopted in state-of-the-art LLMs because they consistently deliver superior performance (e.g., lower perplexity, higher GLUE/SuperGLUE scores) and enhance training stability compared to traditional activations like ReLU and GELU.
Sources
Open the full topic