Gated Linear Units › GLU in Modern Architectures

Michael BrenndoerferUpdated June 14, 20252 min read
Language AI HandbookAll chapters
Part 15 of 67Transformer Blocks
Chapter 109Gated Linear Units › GLU in Modern Architectures
Reading section 12 of 16 · GLU in Modern Architectures · 2 minSection 12 of 16 · 2 min

Book contents

Section 12 of 16 · 2 min read

Gated Linear Units › GLU in Modern ArchitecturesOne section · Sections in this chapter12 / 16 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Gated Linear Units have become the de facto standard in modern large language models. Here's how different architectures implement GLU variants:

  • LLaMA (Meta, 2023): Uses SwiGLU with dff=83×dmodeld_{ff} = \frac{8}{3} \times d_{\text{model}} rounded to the nearest multiple of 256 for hardware efficiency. The rounding ensures tensor dimensions align well with GPU architectures. Biases are completely removed from the FFN.

  • Mistral (2023): Also uses SwiGLU but with a higher ratio (dff≈3.5×dmodeld_{ff} \approx 3.5 \times d_{\text{model}}), trading parameters for expressiveness. Like LLaMA, no biases are used.

  • PaLM (Google, 2022): Uses SwiGLU with a 4x expansion ratio, accepting the higher parameter count in exchange for expressiveness. The model uses separate embedding and softmax matrices and applies RMS normalization.

  • Falcon (TII, 2023): Uses GELU rather than Swish in its GLU variant, following the BERT tradition while still benefiting from the gating mechanism.

Out[32]:
Visualization
Timeline showing model releases with color coding for FFN type, showing transition from standard to gated variants.
Timeline of GLU adoption in major language models. The shift from standard ReLU/GELU FFNs to gated variants accelerated after SwiGLU demonstrated consistent improvements. Modern models (2022+) almost universally use gated activations.