Stage 3 of 4
Transformer
Self-attention and a small Transformer: watch attention learn where to look, and the model write its answer one token at a time. Checked against PyTorch.
- algorithms
- 2
- in every lab
- 2D + 3D
- articles for every lab
- EN / 中文
Live · computing in your browser
Algorithms in Transformer
In the recommended learning order. Hover a card to replay how that algorithm computes.
- 01
Self-attention and multi-head attention
Scaled dot-product and multi-head attention, trained live: every Q, K, V, score, mask and softmax, and the patterns heads learn.
Open the lab - 02
Transformer
A small GPT trained in your browser on copy, reverse, sort and addition: residual stream, every block, attention maps and sampling.
Open the lab