Modern LLM Architectures
Explore the 6 production upgrades powering today's frontier models: RoPE, RMSNorm, GQA, MLA, SwiGLU, and MoE.
The vanilla transformer (2017) was a breakthrough, but today's production LLMs are built on 6 evolved components. Each upgrade targets a specific bottleneck: faster normalization, better position encoding, smaller KV caches, more expressive FFNs, and sparse computation. Together they let a model like DeepSeek-V3 match GPT-4 performance while activating only 37B of its 671B parameters per token.
Every open-source frontier model released since 2023 uses RMSNorm + RoPE + SwiGLU as a baseline. GQA and MLA solve the KV cache bottleneck that limits how long a context window you can serve. MoE (Mixture of Experts) lets you scale total parameter count without proportionally scaling compute.
Which Models Use Which Techniques?
Every formula below is validated from the original research paper. Here is how they map to production models today.
| Model | RMSNorm | RoPE | GQA | MLA | SwiGLU | MoE |
|---|---|---|---|---|---|---|
| LLaMA 3 (Meta) | โ | โ | โ | - | โ | - |
| DeepSeek-V3 | โ | โ | - | โ | โ | โ |
| Mistral 7B | โ | โ | โ | - | โ | - |
| Mixtral 8ร7B | โ | โ | - | - | โ | โ |
| Qwen 2.5 | โ | โ | โ | - | โ | - |
| Gemma 2 (Google) | โ | โ | โ | - | โ | - |
| Claude 3 (Anthropic) | โ | โ | โ | - | โ | - |
Formulas follow the forward-pass order through a modern transformer layer: normalize โ position-encode queries/keys โ attention โ FFN.
RMSNorm - Root Mean Square Normalization
Applied before every attention and FFN sub-layer (Pre-Norm). Replaces LayerNorm in nearly all modern LLMs by dropping the mean-centering step - achieving 7โ64% speedup with no quality loss.
RMSNorm Formulation
RoPE - Rotary Position Embedding
Applied to each query and key vector before computing attention scores. Encodes absolute position as a rotation so that the dot product QยทKแต naturally produces relative positional information.
RoPE Rotation Matrix
GQA - Grouped-Query Attention
Standard multi-head attention requires one KV pair per query head. GQA shares a single KV pair across a group of query heads - dramatically shrinking the KV cache during inference.
Grouped-Query Attention Equation
MLA - Multi-Head Latent Attention (DeepSeek)
Instead of caching full-dimension K and V vectors, MLA compresses them into a tiny low-rank latent vector. During inference this latent is all that needs to be stored - 93.3% fewer KV elements than MHA.
MLA Low-Rank KV Compression
SwiGLU - Swish-Gated Linear Unit
The feed-forward sublayer in every modern LLM uses SwiGLU instead of the original GELU FFN. Two parallel linear projections - one acts as a gate that controls how much of the other passes through.
SwiGLU Feed-Forward Formulation
MoE - Mixture of Experts (DeepSeekMoE)
Replace each FFN with N expert FFNs. A router selects the top-K experts for each token. DeepSeek-V3 activates only 37B of its 671B parameters per token.
DeepSeekMoE Routing & Aggregation
Putting It All Together: 2017 vs. 2024+ Frontier LLMs
A modern LLM forward pass through one layer contrasts dramatically with the original Attention Is All You Need paper.
| Stage | Vanilla Transformer (2017) | Modern LLM (2024+) |
|---|---|---|
| Normalize | LayerNorm (mean + var) | RMSNorm (var only, faster) |
| Position | Sinusoidal PE (additive, fixed) | RoPE (multiplicative, relative) |
| Attention KV | Full KV per head (MHA) | Shared KV groups (GQA) or latent (MLA) |
| FFN | GELU: xWโ โ GELU โ Wโ | SwiGLU: (Swish(xWโ) โ xV) Wโ |
| FFN Architecture | Dense: same FFN for every token | MoE: route token to top-K of N expert FFNs |
- RMSNorm drops mean-centering from LayerNorm - 7โ64% faster with identical training dynamics.
- RoPE encodes position as rotation, yielding relative positional distances for free via dot-product geometry.
- GQA shares KV heads across query head groups - 8ร KV cache reduction in LLaMA 3 vs. standard MHA.
- MLA (DeepSeek) compresses KV into a low-rank latent - 93.3% KV cache reduction vs. MHA.
- SwiGLU replaces GELU FFN with a gated bilinear product - consistently +1โ2% quality boost across LLM benchmarks.
- MoE routes each token to top-K of N expert FFNs - DeepSeek-V3 activates 37B of 671B params per token.
Review the Model Adoption table: note how modern frontier models combine RMSNorm + RoPE + SwiGLU as a standard baseline, while scaling models like DeepSeek innovate on MLA and MoE for extreme efficiency.