Inside an LLM
A real trained GPT, small enough to read, runs in your browser: watch a prompt become matrix math become the next character. Then corrupt a weight and see for yourself that the model is just a file of numbers.
Inside an LLM
Every time you prompt a language model, a file of frozen numbers gets multiplied against your text until one more token falls out. No database of answers or any hidden reasoning module. Nothing learns while you chat. That claim is easy to repeat and strangely hard to believe, so this page ships an actual trained transformer, all 29,600 weights of it, and runs it in front of you. Type a prompt, step through the machine, read the numbers in flight, then break a weight and watch the consequences. It is the same kind of machine as the frontier models, shrunk a millionfold.
The only dice in the building
Everything left of the sampler is deterministic arithmetic. Whether the output varies between runs is decided entirely here, by one knob and one seed.
Same weights, same prompt, same sampler settings: the output cannot differ, because nothing else in the pipeline has anywhere to hide state. When a hosted model gives you two different answers to one prompt, you are seeing the sampler's dice (plus some floating-point scheduling noise on parallel hardware), not a change of mind.
The model is a file
The weights are a const array baked in at build time. Generating ten tokens or ten thousand never writes a single byte back: the checksum above is recomputed from the live arrays on every render and only moves if you deliberately damage them below. Training, the process that does edit these numbers, finished before this page was built. When a vendor says a model "learned" something new, they shipped a different file.
Break the weights
If the constants are the model, damaging them should damage the behavior, on cue and reproducibly. Pick a tensor and find out.
The degradation is itself deterministic: greedy decoding over the damaged file gives the same broken text every time, because the text was never anywhere except in those numbers. Zeroing an embedding table usually lobotomizes it outright; noising one attention projection produces something eerier, a model that still spells but loses the plot. Restore puts the original constants back, and the checksum above returns to its old value.
Now scale it
| model | params | blocks | vector dim | context | vocab |
|---|---|---|---|---|---|
| this page | 29.6 k | 2 | 32 | 64 chars | 65 |
| GPT-2 small (2019) | 124 M | 12 | 768 | 1,024 | 50,257 |
| Llama 3 70B (2024) | 70 B | 80 | 8,192 | 8,192+ | 128,256 |
Every row is the same diagram you stepped through above: embed, attend, MLP, repeat, norm, score, sample, append. Frontier models differ by stacking the block forty times deeper, widening every vector a few hundredfold, and training on a few trillion times more text. More of the same machine, plus engineering to make it fast (the KV cache from the block inspector being the first such trick). Nothing in the loop changes kind on the way up.
- Tokenization and BPE: how real models chop text into subwords instead of characters.
- Word embeddings: why a vector of numbers is a workable stand-in for meaning.
- Attention, from the ground up: the q/k/v machinery inside each block, hand-draggable.
- Next-token prediction: temperature, top-k, and top-p, the rest of the sampler's knobs.
- KV cache eviction: the recomputation this page does naively, and how production engines avoid it.