World models: imagine, then act
A world model learns how observations change, then plans or trains inside its own predictions: Dreamer imagines rollouts, Genie infers actions from video, V-JEPA 2 plans to a goal, Cosmos is a platform.
What runs in CodeSplash
- VID062Dreamer Explained here
- VID063Genie Explained here
- VID066V-JEPA 2 and action-conditioned post-training Explained here
- VID067Cosmos World Foundation Model Platform Explained here
You will be able to
- Describe a recurrent state-space world model and training a policy in imagined rollouts
- Explain why imagined returns can mislead and how to measure real performance
- Describe latent actions learned from unlabeled video and what they need not mean
- Describe planning toward a latent goal with candidate action sequences
- Compare any learned future against a constant-velocity baseline
Learn the dynamics, then use them
ReadA world modelWorld modelA learned model of how the environment responds to actions, used to plan or to imagine training data. predicts how observations, often video frames, change, usually in response to actions. Once trained, it can be used instead of the real world: to imagine what an action would do, to plan, or to train a policy without costly real interaction.
This is where video models meet reinforcement learning. Actions and rewards make it different from passive video prediction: the question isn't "what comes next?" but "what comes next if I do this?".
Dreamer: train the policy in imagination
ReadDreamer learns a recurrent state-space modelRecurrent state-space modelA world model whose state has a recurrent part and a random part; rollouts in this state train the policy without the real world.: a recurrent state plus a random state , trained to rebuild observations and predict rewards, with a KLKullback–Leibler divergenceHow many extra nats it costs to describe draws from one distribution with a code built for another; 0 when they match. term keeping the predicted state close to the one inferred from real observations:
Actor and value networks then learn from imagined rollouts. In the reference's toy, three imagined steps earn rewards −1.0, −0.1 and −1.29, a discounted return of −2.259.
DExplorable · Gridworld: Q-learning, policy gradients and PPO
How do value-based and policy-gradient learners find a good route, and what makes them fail?
Learner
Q-learning learns action values; REINFORCE and PPO adjust a policy's preferences directly.
Trips from the start until the goal, the pit or 100 steps.
How much a reward one step later is worth now.
Step size of every update.
Q-learning only: share of steps that take a random action.
PPO only: how far the policy may move from the one that collected the batch.
Chance that a move turns 90° to either side.
Working…
Imagined success
PredictPredict first
A policy trained in a learned world model reaches a very high imagined return. What should you expect in the real environment?
Reveal
It may have found a trick the model gets wrong. Optimizing against a model rewards whatever the model overrates, and errors compound along long rollouts. Only returns in the real environment, over several seeds, count.
Errors grow with the horizon
ExploreEach predicted step feeds the next, so uncertainty widens with distance, as in a forecast fan. Drag the horizon and watch the band spread.
DExplorable · The forecast fan
Why do forecast intervals widen, and how fast depends on what?
How many times wider is the interval at the horizon than one step ahead?
Model
Interval
Commit your prediction above to see the result
Make your prediction to see the result.
A world model that looks accurate one step ahead can be useless thirty steps ahead. Test prediction errors at the horizons your planner uses.
Genie: actions nobody labeled
ReadGenie learns an interactive environment from videos with no action labels. A latent actionLatent actionA small code inferred from what changed between two frames, used as if it were the action that caused the change. model looks at two consecutive frames and infers a small discrete code for "what changed"; a dynamics model learns to generate the next frame from past frames and that code. At play time, choosing a code acts like pressing a button.
In the reference's toy, three observed changes map to action codes 0, 1 and 2. Those codes needn't match real controls: camera motion or a confounder can become an "action".
V-JEPA 2: plan toward a goal
ReadV-JEPA 2 first learns video features from a large amount of action-free video, then is post-trained on robot trajectories with actions to predict the next latent state. To act, it plans toward a latent goalPlanning toward a latent goalTry candidate action sequences in a learned model and pick the one whose predicted embedding lands closest to a goal image's.: try candidate action sequences in the model and pick the one whose predicted embedding is closest to the goal image's (for example with the cross-entropy methodCross-entropy method (CEM)Sample action sequences, keep the best-scoring few (the elites), refit the sampling distribution to them, repeat.).
In the reference's toy, three candidate sequences have costs 0, 4 and 16, so the first is chosen. The post-training stage uses action data; it isn't action-free.
Cosmos and a humble baseline
ReadCosmos is a platform: video data curation, tokenizers and several pretrained world models (some autoregressive over tokens, some diffusion), meant to be adapted to a domain. It isn't one architecture with one loss.
Any learned future should beat the simplest guess. In the reference's toy, a constant-velocity extrapolation predicts positions 3, 4 and 5; against the observed path, its rollout error is 0.647. Generated plausible futures aren't validated digital twins.
How to judge a world model
Read- Real outcomes: environment return or robot success over repeated trials and seeds, not imagined return.
- Baselines: constant velocity, model-free agents at the same interaction budget.
- Ablations: model versus policy contributions.
- Out of domain: new scenes, objects or robots, and the gap from simulation to reality.
- Separate claims: good video prediction, good control and calibrated 3D understanding are different things.
What runs here
Read| Entry | In CodeSplash |
|---|---|
| VID062 · Dreamer | Explained here |
| VID063 · Genie | Explained here |
| VID066 · V-JEPA 2 and action-conditioned post-training | Explained here |
| VID067 · Cosmos World Foundation Model Platform | Explained here |
Check: world models
CheckpointCheck yourself
How does Dreamer improve its behavior?
Show the answer
Answer: b
Imagination saves real interactions; the model's errors are the price.
Check yourself
Which result supports a Dreamer-style agent best?
Show the answer
Answer: a
Real returns across seeds are the evidence; imagined returns can be exploited errors.
Check yourself
What does the KL term in Dreamer's model loss do?
Show the answer
Answer: b
The prior must be good, because imagination runs on the prior alone.
Check yourself
Where do Genie's actions come from?
Show the answer
Answer: b
Latent actions are learned from unlabeled video; they behave like controls at play time.
Check yourself
A Genie-style model learns a latent action that pans the view. What is a risk?
Show the answer
Answer: a
Inferred actions need not be causal or real; test controllability and consistency outside training.
Check yourself
How does V-JEPA 2's action-conditioned model choose actions?
Show the answer
Answer: b
Planning by prediction: search over actions, score by distance to the goal in embedding space.
Check yourself
V-JEPA 2 pretrains on video without actions. How should the full planning system's supervision be described?
Show the answer
Answer: b
The post-training stage uses action information; say so when describing the system.
Check yourself
What is Cosmos?
Show the answer
Answer: b
The name covers several components; don't attribute one architecture to it.
Check yourself
A learned world model predicts object positions a few steps ahead. Which baseline should it beat first?
Show the answer
Answer: b
If a simple physical guess does as well, the learned model adds little for that horizon.
Recap
Recap- World models predict how observations change under actions, then plan or train in imagination.
- Dreamer trains policies in imagined rollouts; imagined returns can be exploited errors.
- Genie infers latent actions from unlabeled video; V-JEPA 2 plans toward a goal embedding after action post-training.
- Cosmos is a platform; any learned future must beat constant velocity and real-world tests.
Concepts in this lesson