Letters become tokens.
Start with “The ”. Select each character and compare its learned vector of numbers.
A language model, taken apart
Build a small GPT. Follow a prediction through the numbers.
Every prediction below comes from real model weights.
Each step samples with the selected seed; a full continuation advances the random generator.
A prediction is a distribution of possibilities. Sampling picks one.
Loading real model weights…
Probabilities include your temperature and top-k settings. Higher uncertainty means more possible next characters.
Each row distributes one token’s attention across itself and earlier tokens.
Loading recorded training measurements…
Lower loss means better next-character predictions. Validation uses held-out text the model did not train on.
Choose plain text, train a small GPT from scratch, then explore its predictions and attention in the lab. Your text stays on this device. No account, API key, or server training.
400–200,000 characters, 2–256 distinct characters. The first 90% trains the model; the last 10% is held out for validation.
One transformer layer, four attention heads, 32 embedding dimensions, and a 32-character context. This is smaller than the published Shakespeare model.
Choose your text to begin. Keep this tab open while training.
| Step | Train | Validation |
|---|
Start with “The ”. Select each character and compare its learned vector of numbers.
Inspect both e’s in “letter”. The same character shares a learned vector, even in different positions.
Try “The ”, then “The king ”. Watch how the same space leads to a different next character.
Disable an attention head, then re-enable it. See whether the likely next characters change.
Compare untrained, early, and trained checkpoints. A falling loss is evidence of learning, not a promise of wisdom.
Keep the same prompt and seed. Compare low and high temperatures as the distribution changes.