octlm · day 2 · modern decoder architecture
Modern decoder architecture
Day 1 built the textbook block: learned positions, LayerNorm, a GELU MLP, multi-head attention written by hand.
From GPT-2 to Llama, part by part
When each idea arrived
What each upgrade buys
A real modern config, annotated
Chapters
chapter 01 · act 1RoPE, properlyFrequencies, caches, conventions and long contextchapter 02 · act 1RMSNormRescale, skip the re-centeringchapter 03 · act 1SwiGLUA gated MLP with a smooth switchchapter 04 · act 2Grouped-query attentionMany queries, few keys and valueschapter 05 · act 2SDPAOne call, three backendschapter 06 · act 2FlashAttentionExact attention that respects memorychapter 07 · act 3The modern decoder blockEvery upgrade, assembled