Three self-contained pages explaining how large language models work, from the matrix arithmetic up to why your API bill is mostly cache reads. They were written for someone comfortable with vectors, dot products and optimisation who has never had reason to learn machine-learning vocabulary — so every ML term is defined where it first appears, and no mechanism is introduced before the problem it solves.
Each page has a TL;DR at the top and a glossary at the bottom. They build on each other in order, but any one works alone.
How does a pile of matrices turn text into a prediction?
How does that become something you can hand a codebase to?
Why is my usage breakdown mostly cache reads, and what breaks it?
| if you turned up wanting… | go to |
|---|---|
| to understand the thing properly, from the bottom | transformers, then straight on |
| to know why an API bill looks the way it does | cache |
| to explain to someone why the model "forgot" something | llms, the turn section |
| to work out whether the 1-hour TTL is worth buying | cache, the calculator |
| to know why it can't count letters or do arithmetic | transformers, step 1 |
| to know why it sometimes agrees with everything you say | llms, post-training |
Worth being explicit, since the interactive parts could otherwise be taken for more than they are.
Computed live, and correct: the attention arithmetic (dot products, scaling, masking, softmax, weighted sum) on a hand-picked 4×4 toy; the sinusoidal positional encoding; the sampling softmax under temperature and top-p; every figure in the cache calculator and TTL simulator.
Illustrative, and labelled as such in place: the tokeniser is a heuristic, not a learned merge table; embedding-table values are seeded random numbers; the multi-head attention patterns are hand-drawn to show what specialised heads look like, not extracted from a trained model.
Prices and thresholds in the cache page were checked against Anthropic's documentation in September 2026 and are the sort of thing that moves — the page links its sources so you can re-check before acting on any number.