World Models & Video Generation
Learning how the world evolves.
A world model predicts what happens next, given what you do. Agents have learned to drive and play inside their own learned simulators, video generators produce long stretches of plausible footage, and some researchers argue that predicting in an abstract space rather than in pixels is the road to common sense. This lesson develops the mathematics of latent dynamics models, the reasons rollout errors compound and pixel prediction blurs, and what is and is not known about whether video models learn physics.
What you’ll learn
- Define action-conditioned latent world models and derive the sequence ELBO that trains recurrent state-space models.
- Explain learning in imagination, from Ha & Schmidhuber's V–M–C agent to Dreamer's actor–critic on -returns, and prove that rollout error grows at most linearly per step and quadratically in the horizon for values.
- Prove that squared-error prediction of an uncertain future returns its conditional mean, and contrast the generative and joint-embedding (JEPA) responses.
- Assess the claim that video generators are world simulators: what interactive models such as Genie and GameNGen do, and what the evidence on physical generalization shows.
What a world model is
Ha and Schmidhuber's World Models (2018) made the idea vivid with three parts. V, a variational autoencoder (Variational Autoencoders & the ELBO), compresses each frame to a latent . M, an LSTM with 256 hidden units and a mixture-density output, predicts as a Gaussian mixture. C, a linear controller , has just parameters for the three actions of the CarRacing task, few enough to optimize with the evolution strategy CMA-ES. In a VizDoom task they trained the controller entirely inside M's "dream" and transferred it to the real game.
Latent dynamics, imagination and compounding error
The model's joint distribution of latents and observations, given the actions, factorizes along time:
Multiply and divide by the filtering posterior , and apply Jensen's inequality to the log of the marginal likelihood:
Group the terms by time step. Each step contributes a reconstruction term and a KL term that pulls the posterior toward the action-conditioned prior:
The KL term is what makes imagination possible: it trains the prior, which never sees , to predict what the posterior will infer once it does. Reward and other prediction heads add terms of the same form as the reconstruction term.
PlaNet (Hafner et al., 2019) made this practical with the recurrent state-space model (RSSM). Its state has a deterministic part that carries memory reliably and a stochastic part that represents uncertainty about the future: purely stochastic transitions made long-term memory hard to learn, and purely deterministic ones cannot represent several possible futures. Dreamer (Hafner et al., 2020) learns behavior entirely in imagination. From posterior states of real sequences it rolls the prior forward steps (about 15) under the current actor, trains a critic to regress -returns, and trains the actor by backpropagating those returns through the differentiable latent dynamics:
Write and for the state-to-state kernels under the policy, acting on distributions as row vectors, so and . Telescope:
A Markov kernel never increases the norm of a signed measure, and because every row differs by at most in :
A reward in changes in expectation by at most per step; sum with discounting. Distribution errors grow linearly with the horizon and their effect on value quadratically in , the compounding of the simulation lemma in Bellman Equations & Contraction:
A learned model has one-step error . After how many imagined steps does the bound on the state distribution's error reach 1 and become vacuous?
Show the answer
50
at . Beyond that the bound says nothing, and in practice imagined trajectories drift visibly well before. Dreamer's horizon of about 15 steps, with a critic bootstrapping the rest, and MBPO's short rollouts branched from real states are designed around this.
Predicting in pixels or in latents
Proof. For any , , because the cross term has zero conditional mean; the second term vanishes exactly at . A ball that may roll left or right becomes two half-transparent balls, and texture whose details are unpredictable becomes gray mush: the blur of early video predictors (Mathieu, Couprie & LeCun, 2016).
There are two responses. Generative world models sample from instead of averaging: autoregressive models over discrete video tokens, or diffusion models over latent video (Diffusion Models; Ho et al., 2022). They represent every plausible future, at the price of expensive sampling.
Joint-embedding predictive architectures (JEPA; LeCun, 2022) predict in representation space. A context encoder embeds the visible part , a target encoder embeds the hidden part , and a predictor minimizes , where says where or when the target lies and stops gradients. The encoder can discard what is unpredictable or irrelevant, such as the exact motion of leaves, so the conditional mean of the representation is a sensible prediction instead of a blur. I-JEPA (Assran et al., 2023) predicts the representations of several image blocks from one context block, with an exponential-moving-average target encoder and no hand-crafted augmentations, and reported strong semantic features at lower pretraining cost than pixel-reconstruction methods such as MAE. V-JEPA (Bardes et al., 2024) applies the recipe to video.
A network is trained with squared error to predict the next frame of videos in which a coin, tossed in the last context frame, lands heads or tails with equal probability. What does it output for the landed coin?
- A sharp image of heads or tails, chosen at random
- An image of the coin still in the air
- Always heads
- A blend of the heads and tails images, roughly their pixel-wise average
Show the answer
D. A blend of the heads and tails images, roughly their pixel-wise average
The squared-error optimum is the conditional mean, , a superimposed image that matches neither outcome. A sharp outcome requires a model that samples (a generative model) or a loss that does not average in pixel space.
Video generators as world simulators?
Modern video generators are diffusion models over latent spacetime patches, typically transformers conditioned on text or images. The Sora technical report (OpenAI, 2024) called them "world simulators" and argued that scaling video generation is a promising path toward general-purpose simulators of the physical world, citing apparent 3D consistency and object permanence over short spans. That is a claim in a technical report, not a peer-reviewed result, and it is contested.
Interactive world models add actions. Genie (Bruce et al., 2024) learned from unlabeled internet videos of 2D platform games: a latent action model infers which of 8 discrete latent actions occurred between consecutive frames, and an autoregressive dynamics model over video tokens predicts the next frame from the past and a latent action, so a user can "play" a generated world by choosing actions. GameNGen (Valevski et al., 2024) trained a diffusion model, conditioned on past frames and actions, on the play of a reinforcement-learning agent in DOOM, and simulated the game interactively at about 20 frames per second on one TPU. To fight compounding error, training corrupted the context frames with noise, so the model learned to correct its own drift instead of amplifying it.
Key takeaways
- A latent world model pairs an encoder (posterior) with an action-conditioned prior, a decoder and a reward head. The sequence ELBO trains them, and its KL term teaches the prior to imagine without observations.
- Learning in imagination (V–M–C, Dreamer) is data-efficient but exploitable: with one-step error , distributions drift by at most after steps and values by , which motivates short rollouts with bootstrapped critics.
- Squared-error prediction returns the conditional mean, so uncertain futures blur. Generative models sample instead, and JEPAs predict in a learned representation that can drop unpredictable detail but must be kept from collapsing.
- Video generators and interactive models such as Genie and GameNGen simulate convincingly over short spans; whether they learn generalizable physics is contested, and a controlled study found failures out of distribution.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
In the sequence ELBO of a latent world model, what does the term accomplish?
- It makes the decoder reconstruct observations sharply
- It trains the action-conditioned prior, which never sees , to predict what the posterior infers from , so the prior can generate imagined trajectories
- It maximizes the reward
- It forces the latent states to be independent across time
Show the answer
B. It trains the action-conditioned prior, which never sees , to predict what the posterior infers from , so the prior can generate imagined trajectories
Imagination runs on the prior alone. The KL term pulls the prior toward the posterior (and regularizes the posterior toward what is predictable), which is what lets the model roll forward without observations. Reconstruction quality is the other term's job.
Why does Dreamer imagine only about 15 steps ahead and let a critic estimate the value beyond that?
- Longer rollouts would not fit in memory
- The discount factor makes later rewards irrelevant after 15 steps
- Model error compounds with rollout length, by up to in distribution after steps, so trusting the model only briefly and bootstrapping from a learned value limits the damage
- The environment always ends after 15 steps
Show the answer
C. Model error compounds with rollout length, by up to in distribution after steps, so trusting the model only briefly and bootstrapping from a learned value limits the damage
The telescoping bound shows that one-step errors accumulate linearly in distribution and quadratically in the effective horizon for values. Short imagined rollouts keep the model inside its accurate regime, and -returns with a critic account for rewards beyond the horizon without rolling the model further.
What keeps a joint-embedding predictive architecture from collapsing to a constant representation?
- The squared-error prediction loss itself
- Architectural asymmetry, a predictor plus a slowly updated, stop-gradient target encoder, or explicit variance and covariance regularization
- Reconstructing pixels in a decoder
- Using a very large batch of negatives
Show the answer
B. Architectural asymmetry, a predictor plus a slowly updated, stop-gradient target encoder, or explicit variance and covariance regularization
A constant encoder makes the prediction loss exactly zero, so the loss cannot be what prevents collapse. I-JEPA, like BYOL, relies on asymmetry between online and target networks; VICReg-style methods add terms that forbid constant outputs. Pixel decoders and negatives would prevent collapse too, but JEPAs avoid them by design.
Kang et al. (2024) trained video diffusion models on simulated physics. Which summary of their findings is accurate?
- The models inferred Newton's laws and extrapolated them to unseen speeds
- The models failed even on test videos drawn from the training distribution
- Generalization was near-perfect in distribution and improved with scale for new combinations, but failed out of distribution, with predictions imitating similar training cases
- Scaling the models solved out-of-distribution generalization
Show the answer
C. Generalization was near-perfect in distribution and improved with scale for new combinations, but failed out of distribution, with predictions imitating similar training cases
In-distribution performance was excellent and combinatorial generalization improved with scale, yet extrapolation, for example to speeds outside the training range, failed, and the models appeared to retrieve and adapt similar training examples. It is one controlled study, and the broader debate is unsettled, but it is evidence against the strongest "world simulator" claims.
Further reading
- D. Ha & J. Schmidhuber, "Recurrent world models facilitate policy evolution," NeurIPS (2018).
- D. Hafner, T. Lillicrap, J. Ba & M. Norouzi, "Dream to control: learning behaviors by latent imagination," ICLR (2020).
- M. Assran, Q. Duval, I. Misra, P. Bojanowski, P. Vincent, M. Rabbat, Y. LeCun & N. Ballas, "Self-supervised learning from images with a joint-embedding predictive architecture," CVPR (2023).
- J. Bruce et al., "Genie: generative interactive environments," ICML (2024).
- T. M. Moerland, J. Broekens, A. Plaat & C. M. Jonker, "Model-based reinforcement learning: a survey," Foundations and Trends in Machine Learning (2023).