GLU's Multiplicative Gating: Source of FFN Spikes
Modern LLMs' SwiGLU and GeGLU variants, common in FFNs, use multiplicative gating which amplifies intermediate values, systematically generating extreme activation spikes that challenge quantization.
The top 3
- GLU's Hadamard Product: Spike Genesis: The core of GLU's activation spike problem lies in the element-wise multiplication (Hadamard product) of two transformed input branches. Even moderately large values in both branches can result in significantly amplified outputs, a multiplicative effect that generates larger potential outliers compared to additive operations.
- Why GLU Outperforms in Spike Potential: Unlike simpler activation functions such as ReLU or GeLU, which apply non-linearity to a single input or sum, GLU's gating mechanism involves multiplying two distinct transformed inputs. This multiplicative nature inherently creates a higher potential for extreme outlier values or 'spikes' in the activation distribution.
- Key Locations of GLU Activation Spikes: GLU activation spikes exhibit a systematic pattern, predominantly occurring in the Feed-Forward Network (FFN) layers, particularly in the early and late layers of the model. These spikes are not uniformly distributed across sequences but are concentrated on a small subset of 'special' tokens, such as the Beginning-Of-Sentence (BOS) token, newlines, and apostrophes.
Sources
Open the full topic