This model has 42,458 parameters and trains on one short story. After all four eras, can it do simple math — say, 2 + 2?
A model learns to predict what comes next
How can changing thousands of numbers turn random text into recognizable patterns?
Before you start. Demo 1 handed forward one idea — a model is a representation that can be trained — and ended on the transformer, the one network family behind text, image and audio models alike. This page trains one. It reads text as tokens (here, single characters), and everything it knows sits in its parameters, the numbers training changes. Nothing on this page is pretrained: the model starts as seeded random numbers, on your device.
Press Train · era 1 and watch the loss fall, then read the new sample against Era 0. In Try next-token prediction, change the prompt and the temperature — then type 2+2= as the prompt and read what comes back.
Training changes the parameters; inference runs the frozen parameters forward to score every possible next token. A small model trained on a little text learns the shape of the language long before it learns to say anything true.
Train the model
This small transformer begins with random parameters. Its only training text is one original story.
No loss samples yet.
Open the model’s training text
Try next-token prediction
Choose an era, give the model some text, and inspect the eight most likely next characters.
Lower temperature favors the strongest probability. Higher temperature makes lower-ranked tokens more likely. Other characters are omitted, so the eight displayed percentages need not sum to 100%.
Inspect the live model
Each view says which live checkpoint it reads.
This teaching model uses one character per token. Type to see each character’s numeric ID.
Its vocabulary contains 26 characters. Production language models commonly use larger word-piece vocabularies.
Tap a layer to inspect a heatmap from the latest trained checkpoint. This model has 42,458 parameters.
Choose a layer and head, then select a character. This view reads the prediction era selected above and shows its causal attention weights.
Attention weights show how strongly one position used earlier positions in this computation. They do not reveal the model’s intent or explain the whole prediction.
Era 4 writes much more like the training story than Era 0 did. What changed?
Answer from what you just watched in Train the model and Inspect the live model.
Worked steps give a model room to compute
Does training on intermediate arithmetic steps change how a small transformer performs?
Before you start. Stage 1’s model predicted one token at a time, and that is still all either model here does. The job gets harder — three-digit addition — and the one thing that differs between the two models is the text format they train on: the answer alone, or the worked steps that reach it. Both share the same core width, depth and head count.
Both models sit the same exam. Which scores higher — the one trained on answers alone, or the one trained on worked steps?
Press Run experiment · train both and read the two exam scores. Then try Run 1, 2, 4, and 8 attempts on frozen weights, and Fine-tune on accepted examples.
Room to write intermediate steps lets the same machinery reach answers it cannot produce in one jump — a real, measurable gain on this task, and not the same thing as understanding arithmetic.
Train and compare
Both are small transformers with the same core width, depth and head count. Their context lengths, seeds and training-step budgets differ to fit each text format.
Direct-answer model
Trains on problem → answer
Worked-step model
Trains on problem → written steps → answer
Runs both training jobs and a fixed exam, then prepares an under-trained model for the next two activities. Allow about two to three minutes on a recent phone.
Compare exam answers
These are live answers from the fixed unseen exam. Red marks a wrong final answer.
Direct-answer model
Worked-step model
Try more attempts
An under-trained worked-step model samples several answers. The verifier checks the arithmetic, and a verified answer is selected.
Starting accuracy: —
Train both models first.
Fine-tune on accepted examples
Fresh problems are generated outside the model. Verified chains with the known correct answer become supervised next-token training examples.
Train both models first. Each round samples fresh problems, checks their chains and answers, then fine-tunes on the accepted text.
The worked-steps model scores higher than the direct model on the same exam. What does that show?
Two of these are popular, and they are wrong in opposite directions.
Text becomes action when a loop can call tools
What changes when a model can choose an action, read the result, and continue?
Before you start. Stages 1 and 2 both ended at text. An agent wraps that text in a loop: name an action, let a tool run it, append the result to the context, repeat. The context is the model’s whole working memory and it has a fixed size — which is the constraint this stage is really about.
The same task, but with Visible context set to Tiny. Will the run still finish?
Press Watch the scripted policy on the full context. Then set Visible context to Tiny, press Restart run, and watch the same policy again.
Tools and a loop turn prediction into action, and the context window bounds what the loop can still see — a run can fail for want of memory, not for want of ability.
Run the agent
The menus, hours and 8% tax are given exercise data. Search and calculator tools really execute against that local data.
About autoplay: “Watch the scripted policy” uses a hand-written decision policy. Tool calls, results, context growth and truncation are live.
Inspect the exact visible context
On the Tiny context setting the same policy stops without finishing. Why?
Compare the two runs in Inspect the exact visible context.