See exactly how LLMs work
Every number is inspectable
Section titled “Every number is inspectable”A small transformer runs in your browser, and every value it computes is on the screen. Nothing is animated for effect: if a number appears, you can see where it came from.
The browser engine is checked against an independent NumPy implementation to within 1e-9, and the hand-written backpropagation is checked against finite differences. The model is deliberately tiny and says so wherever it differs from production systems.
Start where you are
Section titled “Start where you are”Curriculum
Section titled “Curriculum”Each chapter opens with a box saying who can skip it, works through numbers before stating general rules, includes widgets you can poke, and ends with the research behind it.
Foundations
Functions, gradients, networks, probability and tokens. Everything later is built from these.
The transformer
Attention, the block, position, and the complete model.
- 6.Attention45 min
- 7.The transformer block40 min
- 8.Position and rotary embeddings40 min
- 9.The full model and its training loop35 min
Fast attention and inference
Why generation is memory-bound, and the designs that cut the cost.
Scaling the network
Experts and low-precision numbers.
- 14.Mixture of experts40 min
- 15.Floating point and quantization40 min
Training
Pretraining at scale, post-training and adaptation.
Systems
Prompting, retrieval, tools and agents.
Security and evaluation
The attacks and defenses, tied back to the papers, and how to measure any of it honestly.
Also here
Section titled “Also here”- Model teardowns: follow one token through gpt-oss-120b and DeepSeek-V3, layer by layer, with their real configurations.
- Hands-on labs: 10 exercises that make the chapters concrete.
- Public security guidance for AI systems: what NSA, CISA and allied agencies have published.
- All papers: every reference, with the chapters that cite it.
Every paper links to arXiv, and every id and title was checked against the arXiv API. Statements about specific models come from their technical reports or model cards, and anything that could not be confirmed is marked. Reading progress stays private to this browser.