First time here? Start with tokenization: how many positions does a sentence take up? Follow those positions through multi-head attention to see how they exchange information. Then put attention, residuals and the FFN together in the original Transformer.
From there, pick a question. Why can BERT read the words on the right when GPT can't? Compare their inputs. How much cache does sharing K/V actually save? Change the head layout in the Transformer Lab. The full directory follows if you want to explore further.
22 core notes, about 4 h. 20 deep dives fold under the notes they extend.
Sequences & tokens1 core · 1 deep
How text becomes token IDs and vectors, and what BPE-style tokenizers learn
The whole Transformer1 core · 2 deep
The whole model first: the core path, the diagram as matrix maths, six optimizations
- The Transformer architectureThe diagram as matrix maths, checking causality, position and cache equivalence15 min
- Core knowledge: from tokens to generationThe core path from tokens to generation: what each part computes, and why2 min
- The Transformer, interactively: structure, optimizations, and model familiesOne morphing diagram: what six optimizations save in memory, traffic or compute10 min
The parts of a layer4
What attention, residuals, normalization and the FFN each compute
- Multi-head attention: from equations to implementationFrom a weighted sum: how Q and K set weights, what masks hide, how heads combine23 min
- Residual connectionsEach layer learns an edit: the residual keeps the input and gives gradients a path9 min
- Normalization: BatchNorm, LayerNorm, and RMSNormWhich axis each norm averages over, and why train and eval modes behave differently18 min
- FFNs and SwiGLU: what happens after attention?What each position computes after attention: widen, narrow, and SwiGLU's gated path4 min
Three architectures3
Encoder-decoder, encoder-only and decoder-only: three ways to wire the same parts
- Vanilla TransformerOne translation through encoder and decoder, and the question each attention asks13 min
- BERT: how an encoder learns to readSame word, different vectors: how BERT is pretrained and then given a task27 min
- Decoder-only: autoregressive generationParallel in training, token by token in generation: causal masks, prefill and decode17 min
Position and long context1 core · 2 deep
Where order comes from, and how long contexts store less and read less
- RoPE and long context: fitting the input is not understanding itFitting 128K is not reading it: what RoPE and YaRN change, and how to test10 min
- Can a model track order without positional encoding?“Pay, then ship” or the reverse: where order comes from with no positional encoding10 min
- MLA and sparse attention: storing less or reading less?MLA stores less, sparse attention reads less: two separate costs of a long history12 min
New parts: gates and memory1 core · 4 deep
What recent parts change in the computation: gates, linear memory, lookups, links across depth
- Advanced reading: what does each component change?Put FlashAttention, MLA, MoE and gates back in the computation: what each changes4 min
- Gated Attention: deciding how much of an attention output to useA learned gate on attention output, worked through two heads by hand5 min
- Gated DeltaNet: decay the state, then correct its predictionHow a fixed-size memory forgets a little, then updates on its prediction error4 min
- Engram: looking up recurring local patternsA learned lookup for recurring phrases, with context deciding how much of it to use4 min
- Attention Residuals: choosing information across depthAttention across depth: how a token at one layer combines what earlier layers left4 min
MoE: experts and routing4 core · 3 deep
Many parameters, few used per token: routing, balance, expert shapes and serving costs
- MoE: why make a model sparseEight FFNs, two used per token: count what MoE stores apart from what it uses4 min
- MoE: fine-grained and shared expertsFiner experts, far more combinations: 2 of 16 gives 120, 8 of 64 about 4.4 billion4 min
- LatentMoE: must experts be as wide as the backbone?Narrow the representation before the experts: do the savings buy more experts?8 min
- MoE: what it costs to train and serveMoE's serving bill at DeepSeek-V3 size: all-to-all traffic and GPU memory6 min
- MoE: how the router picks expertsHow the router learns despite top-k, and how tokens are dispatched and combined back9 min
- MoE: load balancingHow many tokens each expert gets: capacity limits, auxiliary loss, or just a bias10 min
- MoE: review questionsReview: total versus active parameters, and why Mixtral 8x7B has 46.7B, not 56B4 min
Looped: depth and shared weights2 core · 4 deep
Reuse one block: what extra loops buy, and what they cost in latency, cache and training
- Looped Transformers: reusing one blockRun a four-layer block three times: twelve layer passes from four layers of weights3 min
- Looped Transformers: why loops help reasoningLoops add serial depth, which is not the same as an extra reasoning step3 min
- Looped Transformers: how many loops per tokenWhich positions deserve more loops: from ACT and PonderNet to Mixture-of-Recursions4 min
- Looped Transformers: what today's looped LMs look likeHuginn, Ouro and retrofitted loops: their structure, and how to read their numbers3 min
- Looped Transformers: costs and limitsLoops run in series: latency, per-loop KV cache, harder training, and when it pays4 min
- Looped Transformers: review questionsReview: loops versus ALBERT's sharing, and why fixed weights still cost more compute3 min
Reading model reports5 core · 4 deep
With the parts in hand, read GPT, Llama, Qwen, DeepSeek and Gemma with the same questions
- Model family deep dives: beyond the parameter tableRead every model report with the same questions: problem, design, training4 min
- How to read a model reportPractice: trace a token, cost out GQA, and sort the claims into three columns4 min
- Gemma deep dive: model design from deployment constraintsHow much cache Gemma 3's local/global attention saves, and what 3n and 4 change8 min
- Reading GPT: how does a model learn a new task?GPT-1 to InstructGPT: skills learned into the weights versus supplied in the context10 min
- Reading Llama: from one block to training and inference trade-offsLlama as a baseline: where a token goes, and how much cache GQA saves9 min
- Qwen deep dive: one family across scales and reasoning modesOne family across budgets: dense and MoE, many sizes, thinking and non-thinking modes12 min
- Qwen 1–2.5: separating architecture changes from training changesQwen 1–2.5 gains, separated into tokenizer, architecture, data and post-training7 min
- DeepSeek deep dive: architecture, systems, and reasoning training togetherV3's architecture and R1's post-training, read separately: MLA, fine-grained MoE, MTP11 min
- DeepSeek-V4: What Remains After Compressing History?What V4's two attention types save, counting storage and reads separately9 min
No notes match.