World models: the building blocks
World models · Start here · No background needed
The handful of reinforcement-learning ideas every world-model page relies on, built one at a time on a robot in a five-tile hallway, then the one line of probability that ties a policy to a world model, derived from the same example.
World models · start here
The Building Blocks
How can a robot try something in its head before trying it for real? It takes a handful of ideas from reinforcement learning, and one line of probability that ties them together. This page builds them one at a time on a single tiny example. Then it shows where today's big ideas, such as video diffusion, plug in.
No background needed, and every number on the page is computed live from the sliders. When you are done, the landscape maps the whole field using exactly these words.
1 · Seven ideas, one hallway
The words, one at a time
A robot, a hallway, a charger
each step adds one idea to the same picture2 · The one line of probability
Policy times world model
Now ask a question that needs two of the pieces at once: from the robot's tile, what is the chance it steps right and ends up on the next tile?
Two things have to happen, in order. First the robot has to choose to step right, which is up to its policy. Then the floor has to let it through, which is up to the world. Chances along a path multiply. Tap any path to see its sum written out.
Every way the next step can go
choose a start tile, a habit and an iceWrite the same thing for any state and any action, and you get the line this whole field is built on:
- The left side is the chance of a pair, this action and this next state, given where the robot is now.
- The first factor is the policy. θ (theta) stands for the knobs, the weights, that the policy network learns. Other pages write it πθ.
- The second factor is the world model. ψ (psi) stands for the world model's own knobs. Other pages write it Tψ, T for transition.
- Why the split is allowed: it is the chain rule of probability, P(A and B) = P(A) · P(B given A). It holds for any two events; robots are just one example.
Common slip: calling the whole left side the world model
P(st+1, at | st) mixes the robot's choice with the world's response. Only the second factor is the world model. Keeping them apart is what lets you swap in a better habit while keeping the same world model.
3 · Planning
Imagine first, then choose
A world model earns its keep when the robot uses it to look ahead. For each action: imagine every outcome with the world model, score each one by its reward plus the value of the tile it lands on, and average using the world model's chances. The result is a score for the action, written Q (for quality):
Σ means “add up over every possible next tile”. Here γ = 1, so the bracket is simply the reward now plus the value from there.
Score both actions before moving
values come from the current habitThat is the whole trick of model-based planning: try actions in the world model, judge them with value, act on the best. Monte Carlo tree search repeats it many steps deep. Dreamer does it during training instead, to teach its policy. Acting on the better score, then working out the new values and repeating, is policy iteration.
4 · Advanced: when the state is a picture
Real robots see pixels, not tile numbers
In the hallway the state is one number. A real robot's state is a camera image, which is thousands of numbers. Its world model then has to answer: given this picture and this action, what will the next picture be? There are two ways to answer.
Draw the next picture
Generate every pixel of the next frame. Today this is often done with diffusion: start from random noise, then remove a little of it at a time, steered by the current frame and the action, until a clean picture is left. Video generators such as Sora work this way.
A cartoon of the idea: this simply blends towards the right answer so you can watch the picture sharpen. A real diffusion model has learned, from many videos, what noise to remove at each step, and it never sees the answer.
Predict a summary
Predict only a few numbers that describe the next moment, and never draw it. This is the idea behind JEPA. The summary is called a latent.
The catch: nobody hands the model the right summary. It has to learn which numbers matter, and a careless setup can make every summary come out the same. Predict the gist shows that failure live.
5 · Advanced: video without actions
A model that only watches
Robot data where every frame comes with the exact action taken is scarce and expensive. Internet video is plentiful, but it has no actions in it. Train on video alone and the best you can learn is P(st+1 | st): what usually happens next.
The math says exactly what that is. Add up the paths from section 2 that end on the same tile. This is the sum rule of probability:
A watcher learns the world model averaged over the habits of whoever was filmed.
What a watcher predicts
move the habit slider: the ice stays the sameChange the habit and the watcher's prediction changes, even though the ice did not. And ask it “what if I step left?” and it has no way to answer, because the action is not one of its inputs. One analogy compares a pure video model to a plant on the side of a building: it watches the world go by but cannot change it. Where the analogy breaks: the watcher is far from useless. Most of what it learns, how things move and fall, is the same whatever anyone does.
So the common recipe is pre-train, then add actions. First learn P(st+1 | st) from lots of video. Then fine-tune on a small set that does have actions, so the model learns Pψ(st+1 | st, at): what your actions do. Watch first, then practise builds that recipe step by step.
Common slip: a great video model is a world model
Predicting the future well is not enough to plan with. Without the action as an input, a model cannot tell you what would happen if you did something different, and that is the one question planning asks.
6 · Advanced: one model for both
Or model the whole left side at once
The equation has two halves, so the usual design trains two networks, a policy and a world model, and calls them one after the other. A joint world-action model learns the left side directly: given the state, it outputs the action and the predicted next state together.
One table, three readings
the same numbers as the paths in section 2Each cell is P(next tile, action | start). Each row total is the policy. Each column total is the watcher's prediction from section 5. Divide a cell by its row total and you get the world model back. A joint model outputs this whole table in one go; the separate design builds it by multiplying.
The case for the joint design: one call instead of two at decision time, and one training process. The case against: it needs data with actions in it, and you lose the freedom to swap the policy while keeping the world model. It is still an active research direction; separate vs. unified world-action models counts the calls.
7 · Next
Now read the map
You now have every word the landscape uses: what a model predicts (pictures or a summary), whether it takes an action, who picks the action (a person, a search, a habit, or one joint model), and how progress is scored (reward and value).
- More on value and policy: the Markov decision processes chapter, in a grid instead of a hallway.
- Model-based against model-free: world models vs RL.
- Summaries instead of pixels: predict the gist.
Based on the whiteboard factorization in the Y Combinator video on world models, JEPA and sample-efficient RL. The hallway, its numbers and every derivation are this page's own.
Sources. Reinforcement Learning: An Introduction (states, actions, rewards, policies, values) · Chain rule of probability · Sum rule (law of total probability) · Denoising diffusion probabilistic models (2020) · Video generation models as world simulators (Sora) · I-JEPA (2023) · Unified World Models (2025) · World Action Models are Zero-shot Policies (2026)