Course
The course builds the transformer from zero, one idea per chapter, until you can read the paper that introduced it.
Every chapter opens with its picture, an animation or a figure you can move, then the idea in plain words, a worked example with the tiny model's real numbers, the formula explained symbol by symbol, and why it matters at work. Each one ends with the section of the paper it prepares you for.
Part A: The pieces
- 1
What a language model doesIn the paper: section Abstract, 1
Open
- 2
TokensIn the paper: section 5.1
Open
- 3
Vectors and the dot productIn the paper: section 3.2.1
Open
- 4
Matrices: machines that turn vectorsIn the paper: section 3.2.2, 3.3
Open
- 5
EmbeddingsIn the paper: section 3.4
Open
- 6
Softmax: scores into probabilitiesIn the paper: section 3.2.1, 3.4
Open
Part B: Attention
- 7
Why attentionIn the paper: section 1, 2
Open
- 8
Queries, keys and valuesIn the paper: section 3.2
Open
- 9
Scaled dot-product attentionIn the paper: section 3.2.1
Open
- 10
MaskingIn the paper: section 3.2.3
Open
- 11
Multi-head attentionIn the paper: section 3.2.2
Open
- 12
Positions as sine wavesIn the paper: section 3.5
Open
Part C: The layer
- 13
The position-wise feed-forward networkIn the paper: section 3.3
Open
- 14
Residual connections and layer normalisationIn the paper: section 3.1, 5.4
Open
- 15
Shared embeddings and the outputIn the paper: section 3.4
Open
- 16
Stacking layersIn the paper: section 3.1Watch it now: a whole translation, step by step
Open
Part D: The paper's model
- 17
The encoderIn the paper: section 3.1, 3.2.3Watch it now: a whole translation, step by step
Open
- 18
The decoder and encoder–decoder attentionIn the paper: section 3.1, 3.2.3Watch it now: a whole translation, step by step
Open
- 19
Translating: greedy search and beam searchIn the paper: section 6.1
Open
- 20
Training as the paper didIn the paper: section 5.1–5.4
Open
- 21
Why self-attentionIn the paper: section 4
Open
Part E: Today's models
- 22
Decoder only: how GPT-style models use the designIn the paper: section 3.1
Open
- 23
From tiny to largeIn the paper: section 6.2
Open
Part F: Capstones
- 24
Translate a sentence end to endIn the paper: section 3, 6.2Watch it now: a whole translation, step by step
Open
- 25
Trace a next-word predictionIn the paper: section 3.2.3, 3.4
Open
If your team builds on LLMs and wants to know what goes on inside them, I can help. Work with me(opens in a new tab)