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'.

The top 3

  1. SwiGLU's Dominance in Modern LLMs: SwiGLU has become the standard activation in feed-forward networks for many state-of-the-art LLMs, including Meta's LLaMA, LLaMA 2, LLaMA 3, Google's PaLM, PaLM 2, and Mistral models. Its adoption is driven by consistent performance gains, improved training dynamics, and better scalability, outperforming earlier activations like GELU and ReLU, even when accounting for comparable parameter counts.
  2. GeGLU vs. SwiGLU: Gating Function Differences: Both GeGLU and SwiGLU are GLU variants that use a gating mechanism to modulate information flow. The key difference lies in their gating activation functions: GeGLU utilizes the GELU (Gaussian Error Linear Unit) function, while SwiGLU employs the Swish (or SiLU) function. This choice of gating activation influences their non-linear behavior, with SwiGLU's Swish providing smoother gradients and non-monotonicity, potentially contributing to its empirical advantages in many LLMs.
  3. Gating's Core: How GLU Structure Boosts Spike Magnitude: The inherent structure of Gated Linear Units (GLUs), particularly the element-wise multiplication of two parallel branches—one often non-linear—can lead to a wider dynamic range and significantly higher peak activations, amplifying quantization error compared to simpler activation functions.

Sources

Open the full topic