PyLLM concepts, explained for a curious 12-year-old
These pages explain every big idea in PyLLM using real-world analogies — no jargon first. Read them roughly in this order; each builds on the last.
- The breadcrumb trail (autograd) — how a network remembers what it did so it can learn from mistakes.
- What is a token? — chopping text into Lego bricks.
- What is an embedding? — giving each token a place on a map of meaning.
- Attention is re-reading a sentence — how a token decides which earlier words matter.
- How a Transformer is built — stacking the pieces into a GPT.
- How a model learns — loss, gradients, the training loop.
- Sampling — how the model chooses what to say next (temperature, top-k).
- When there's no data, grow your own — the Pebble corpus: harvest, generate, and grade.
- The referee — grammar-constrained decoding: vetoing illegal characters so generated Pebble always parses.