Pair each 2017 transformer ingredient with its 2026 production replacement
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Six swaps separate 2017 Vaswani from a 2026 Llama 4 block: RMSNorm, pre-norm, SwiGLU, GQA, RoPE, and untied embeddings. The recipe is unchanged, but every ingredient has moved.
Picture a 2017 transformer block as a kitchen with six labeled jars. Nine years later the kitchen layout is identical (same counters, same two cooking stations, same two storage shelves) but every jar has been replaced. Salt got swapped for a fancier seasoning that's cheaper to use. The bread got upgraded from sourdough to brioche. The old measuring cups got traded for a clever system that takes up less space without losing accuracy. The blueprint is the same recipe on the wall; the pantry is unrecognizable. That's exactly what happened to the transformer between Vaswani's original paper and Llama 4. You still have two sublayers wrapped in residuals and norms, but normalization, activation, attention, positional encoding, and word table sharing all moved to better defaults.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
7 min: walk the six swaps, separate the normalization axis from the attention axis, explain each swap's motivation, name the 2026 frontier models that adopted them, and finish with the unchanged block recipe.
| Axis | 2017 Vaswani | 2026 Llama 4 / Mistral Large 3 |
|---|---|---|
| Normalization | LayerNorm + post-norm | RMSNorm + pre-norm |
| FFN activation | ReLU, hidden = 4 x d_model | SwiGLU, hidden ~ 2.67 x d_model |
| Attention | MHA, one KV pair per query head | GQA, 4-8 query heads per KV head |
| Positional encoding | Sinusoidal, added at input | RoPE, rotates Q/K in each layer |
| Embeddings | Tied input and output | Often untied at frontier scale |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Pairing post-norm with RMSNorm or pairing RoPE with sinusoidal PE. Pre-norm vs post-norm is independent of LayerNorm vs RMSNorm; sinusoidal lives at the input, RoPE lives inside attention.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.