Activation Spikes: Token-Specific & Layer-Bound in FFNs
These problematic activation spikes in FFN layers are not uniform but occur predominantly in specific early and late layers, and are concentrated on a few individual tokens rather than being broadly distributed.
The top 3
- Top 3 Tokens Triggering LLM Activation Spikes: Specific tokens like the Beginning-of-Sentence (BOS) token, newline characters (\n), and apostrophes (') are identified as major culprits, often generating the largest activation spikes particularly on their first occurrence within a sequence.
- GLU's Core: How FFN Gates Create Activation Outliers: Gated Linear Unit (GLU) variants, such as SwiGLU, within Feed-Forward Network (FFN) layers are a primary architectural source of activation spikes. Their multiplicative gating mechanism and the FFN's role in amplifying hidden states via residual connections contribute to these excessively large activation values.
- Top 3 Techniques to Mitigate Activation Spikes: To counter activation spikes, researchers use SmoothQuant, which migrates quantization difficulty from activations to weights by scaling down problematic activation channels and scaling up corresponding weights. Other methods include direct activation clipping to limit extreme values, and mixed-precision quantization that keeps outliers in higher precision while quantizing other activations.
Sources
Open the full topic