Simple Algorithm
Reinforcement Learning · Fixed Point · 26 min

Generative World Models

Transformer and video world simulators, and what they can and cannot yet do.

A model that generates the next frame, token by token or by denoising, can be played like a game: by a person, or by an agent learning inside it. Within a few years such models went from Atari to DOOM to playable worlds generated from a single image. This lesson treats them as what a reinforcement learning agent needs them to be, simulators: how they produce the next observation, why their rollouts drift and what fixes the drift, how agents are trained inside them, and how to tell a good simulator from a convincing video.

What you’ll learn

  • Describe the main families of generative world models (token transformers, diffusion world models, interactive video models with latent actions) and how each produces the next observation.
  • Prove the chain rule for the divergence between real and simulated trajectories, and use it to explain teacher forcing, drift and the noise-augmentation fix.
  • Explain how agents are trained inside generative world models (IRIS, DIAMOND, UniSim) and what the Atari 100k results do and do not show.
  • Evaluate a world model for fidelity, controllability, consistency and usefulness for control, and separate published results from announcements.

Generating the next observation

Dreamer's decoder is only a training signal: its agent never looks at a decoded image. In a generative world model the observation itself is the simulator's output, and an agent can be trained on generated frames exactly as on real ones. Four designs illustrate the field as of the mid-2020s.

FamilyExampleHow the next observation is madeNotes
Token transformerIRIS (Micheli, Alonso & Fleuret, 2023)A discrete autoencoder turns each 64×64 frame into 16 tokens from a vocabulary of 512; a GPT-like transformer predicts the next frame's tokens one at a time, then the reward and terminationImagination horizon 20; the policy acts on decoded frames
Latent transformerTWM (Robine et al., 2023)A Transformer-XL predicts the next latent state and reward from earlier latents, actions and rewardsAttends to past states directly instead of through a recurrent summary
DiffusionDIAMOND (Alonso et al., 2024)A diffusion model denoises the next frame, conditioned on the last 4 frames and actions3 denoising steps per frame; imagination horizon 15
Interactive videoGenie (Bruce et al., 2024); GameNGen (Valevski et al., 2025)Video generators conditioned on learned or real actionsTrained on recorded video and built to be played

On the Atari 100k benchmark, which allows 100,000 agent steps per game (about two hours of play), IRIS reached a mean human-normalized score of 1.046 with superhuman scores on 10 of 26 games, and DIAMOND reached 1.46 with 11 superhuman games, a new best at the time for agents trained entirely inside a world model.

Why autoregressive simulators drift

A generative world model is run autoregressively: each generated frame becomes context for the next. Training is usually teacher-forced: the model learns to predict frame t+1t+1 from real frames up to tt. How far apart can the real and the simulated distributions over whole trajectories then be?

DerivationProof
  1. P(τ)=μ(o1)∏t=1T−1π(at∣o≤t,a<t) P(ot+1∣o≤t,a≤t),P^(τ)=μ(o1)∏t=1T−1π(at∣o≤t,a<t) P^(ot+1∣o≤t,a≤t)P(\tau)=\mu(o_1)\prod_{t=1}^{T-1}\pi(a_t\mid o_{\le t},a_{<t})\,P(o_{t+1}\mid o_{\le t},a_{\le t}),\qquad\hat P(\tau)=\mu(o_1)\prod_{t=1}^{T-1}\pi(a_t\mid o_{\le t},a_{<t})\,\hat P(o_{t+1}\mid o_{\le t},a_{\le t})

    Both distributions factor by the chain rule of probability into the same first-observation and policy terms, and their own observation terms:

  2. DKL(P ∥ P^)=EP[∑t=1T−1ln⁡P(ot+1∣o≤t,a≤t)P^(ot+1∣o≤t,a≤t)]=∑t=1T−1κt\KL(P\,\|\,\hat P)=\E_P\Big[\sum_{t=1}^{T-1}\ln\frac{P(o_{t+1}\mid o_{\le t},a_{\le t})}{\hat P(o_{t+1}\mid o_{\le t},a_{\le t})}\Big]=\sum_{t=1}^{T-1}\kappa_t

    In the log-ratio, μ\mu and every policy factor cancel, leaving one log-ratio per step. Take the expectation under PP, conditioning each term on the real past:

  3. Pinsker's inequality, TV≤DKL/2\mathrm{TV}\le\sqrt{\KL/2}, and the bound ∣EPF−EP^F∣≤Fmax⁡ TV(P,P^)\abs{\E_PF-\E_{\hat P}F}\le F_{\max}\,\mathrm{TV}(P,\hat P) for F∈[0,Fmax⁡]F\in[0,F_{\max}] finish the proof, with T−1≤TT-1\le T. ■\blacksquare

What the identity says. Teacher-forced maximum likelihood minimizes ∑tκt\sum_t\kappa_t, up to entropies the model cannot change. So likelihood training does control the whole simulated trajectory for the policy that generated the data, and the total-variation gap grows only like T\sqrt T.

What it does not say. First, κ\kappa is far from zero for real models: a model that blurs or drops a detail in every frame assigns low likelihood to real frames, and the bound turns vacuous long before TT steps. The model then conditions on its own atypical outputs, contexts that teacher forcing never showed it, and errors compound. Second, the identity holds for the data's policy; an agent optimizing inside the model changes the actions and hence the contexts, which is model exploitation again. Third, KL weighs every pixel alike, so a small κ\kappa can hide a large error in the few pixels that decide the reward.

Predict before you look

A model's expected one-step KL on real contexts is κ=0.0005\kappa=0.0005 nats per frame. For a 100-step rollout under the data's policy, what bound on the total-variation distance between real and simulated trajectories does the chain rule give?

Show the answer

0.158

100×0.0005/2=0.025≈0.158\sqrt{100\times0.0005/2}=\sqrt{0.025}\approx0.158. Bounding each step's total variation by Pinsker, 0.0005/2≈0.0158\sqrt{0.0005/2}\approx0.0158, and adding over 100 steps gives 1.58, which says nothing: summing the KL first and converting once is T\sqrt T times tighter.

Fixes in practice. GameNGen corrupts its context frames with Gaussian noise of a random level during training and tells the model the level, so the model learns to repair imperfect contexts instead of amplifying them; its authors call this critical for keeping frame quality over time. DIAMOND chose a diffusion formulation that stays stable with few denoising steps. And DIAMOND, Genie and GameNGen all condition on a short window of recent frames rather than on the whole history.

Playable worlds learned from video

Genie (Bruce et al., 2024) learned from 30,000 hours of 2D-platformer gameplay videos, filtered from more than 200,000 hours, with no action labels at all. A video tokenizer turns frames into discrete tokens. A latent action model infers what happened between two frames: an encoder sees the frames up to tt and frame t+1t+1 and outputs a code from a codebook of just 8 entries, and a decoder must reconstruct frame t+1t+1 from the past frames and that code alone. Because the code is the only new information the decoder receives, it learns to encode the most meaningful change, which in platformers is mostly what the player did. A dynamics model then predicts the next frame's tokens from past tokens and latent actions, so a person can play a generated world by choosing among 8 latent actions. Genie has 11 billion parameters in all, and it ran at about one frame per second with 16 frames of memory.

Genie measured controllability with ΔtPSNR\Delta_t\mathrm{PSNR}: the peak signal-to-noise ratio, against the real frame tt, of the frame generated from the latent actions inferred from the real video, minus that of the frame generated from random latent actions (t=4t=4). If the actions did not matter, the two would be equal. The latent actions also transferred to control: a policy that imitated latent actions in expert videos of the game CoinRun, with the mapping to real actions learned from as few as 200 labeled samples, matched behavior cloning on the true actions.

GameNGen (Valevski et al., 2025) simulated the game DOOM with a diffusion model, and its data came from reinforcement learning: a PPO agent learned to play, and its whole training run, from random play to skilled play, was recorded, because the goal was diverse data rather than a strong player. Stable Diffusion v1.4 was then fine-tuned to generate the next frame from the last 64 frames and actions, a little over 3 seconds of history. With 4 denoising steps it ran at 20 frames per second on one TPU; its next-frame PSNR of 29.4 is comparable to lossy JPEG compression; and human raters shown 1.6-second and 3.2-second clips picked the real game over the simulation only 58% and 60% of the time.

ModelTrained onActionsMemorySpeed
Genie (2024)30,000 hours of platformer videos8 learned latent actions16 framesAbout 1 frame per second
GameNGen (2025)An RL agent's DOOM playReal game inputs64 frames, about 3 s20 frames per second on one TPU
DIAMOND's CS:GO model (2024)87 hours of Counter-Strike gameplayReal game inputsForgets what leaves the view10 frames per second on one RTX 3090
Genie 3 (reported, 2025)Not publishedNavigation, plus text-prompted world eventsVisual memory of about a minuteReal time at 720p and 24 frames per second
Genie 2 (December 2024) and Genie 3 (August 2025) were announced in blog posts, not peer-reviewed papers. Genie 2 generated playable 3D worlds from a single image that stayed consistent for up to a minute (most examples 10 to 20 seconds); Genie 3 was reported to stay consistent for a few minutes and was released only as a limited research preview.

Training agents in generated worlds

Generative world models serve agents in three ways.

  • As the training environment. IRIS and DIAMOND train their policies entirely in imagination, on generated frames, and collect real data only to improve the model; their Atari 100k scores are those of agents that learned inside the model.
  • As a simulator of the real world. UniSim (Yang et al., 2024) combined datasets that each cover one aspect of interaction (object variety in image data, densely sampled actions in robot data, camera motion in navigation data) into an action-conditioned video model that responds both to language instructions and to low-level controls. Its authors trained a high-level vision–language policy and a low-level RL policy purely inside it and report zero-shot deployment on real robots, a sim-to-real transfer from a learned rather than a hand-built simulator.
  • As a source of worlds for generalist agents. DeepMind reported that its SIMA agent followed instructions and pursued goals inside Genie 2 and Genie 3 worlds, with the world model simulating the consequences of the agent's actions (as of the mid-2020s, from blog posts only).

The Atari 100k numbers carry the usual caveats of a small-data benchmark: 26 games, aggregate scores that a few games can dominate, results that are sensitive to the number of runs, and implementation details that differ between papers. They show that agents can learn competent Atari play purely inside learned simulators. They do not show that pixel-level generation is the most efficient route, nor how such simulators behave in open-ended, partially observed worlds.

Check your understanding

A video world model trained on human gameplay passes a side-by-side "real or generated?" test on short clips. Why might an RL agent trained inside it still fail in the real game?

  1. RL agents cannot learn from images
  2. Short clips are uninformative about anything
  3. The agent will seek out unusual action sequences where the model is wrong, and short typical clips test neither those nor long-range consistency
  4. Human raters are better than agents at spotting errors
Show the answer

C. The agent will seek out unusual action sequences where the model is wrong, and short typical clips test neither those nor long-range consistency

An optimizing agent goes where the model is most favorable, which is often where it is wrong: rare actions, long horizons, situations the data barely covered. A test on typical short clips samples none of that. The mid-air jumps of DIAMOND's Counter-Strike model are an example.

Measuring a world model, and open problems

PropertyTypical measureWhat it misses
Per-frame fidelityPSNR or LPIPS of the next frame under teacher forcingErrors that compound in free-running rollouts
Realism of videoFréchet video distance; side-by-side human testsWhether actions have the right effects; rare situations
ControllabilityGenie's ΔtPSNR\Delta_t\mathrm{PSNR}: does the output change with the action?Whether the change is the correct one
Consistency and memoryReturning to a place or an object after looking awayUsually shown qualitatively: seconds for GameNGen, about a minute of visual memory reported for Genie 3
Physical and causal correctnessTests outside the training distributionHard to define for games with arbitrary rules
Usefulness for controlTrain an agent inside, evaluate it in the real environmentExpensive, and specific to an agent and a task
Only the last row measures what an RL agent needs; the others are proxies.

Key takeaways

  • Generative world models make the observation the simulator's output: tokens predicted by a transformer (IRIS), frames denoised by diffusion (DIAMOND), or video generated from learned or real actions (Genie, GameNGen).
  • For the data's policy, the KL between real and simulated trajectories is the sum of one-step KLs on real contexts, so likelihood training controls drift, with total variation growing like T\sqrt T; large real one-step errors, a changed policy and pixel-uniform weighting are why rollouts still drift.
  • The fixes are specific: noise-augmented contexts (GameNGen), samplers that stay stable with few steps (DIAMOND's EDM), short context windows, and keeping the visual detail that a coarse latent loses.
  • Agents have learned Atari purely inside generative models (mean human-normalized scores 1.046 for IRIS and 1.46 for DIAMOND on Atari 100k), robot policies trained in UniSim were reported to transfer zero-shot, and agents have been run inside announced systems such as Genie 3.
  • A convincing video is not a correct simulator: evaluate fidelity, controllability and consistency, and above all the real performance of agents trained inside.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

Teacher-forced maximum-likelihood training of a world model minimizes, up to terms the model cannot change, which quantity?

  1. The sum over steps of the expected one-step KL on real contexts, which equals the KL between the real and simulated trajectory distributions for the data's policy
  2. The expected one-step KL on contexts the model generated itself
  3. The divergence between real and simulated trajectories under every policy
  4. The return error of the optimal policy
Show the answer

A. The sum over steps of the expected one-step KL on real contexts, which equals the KL between the real and simulated trajectory distributions for the data's policy

The chain rule turns the trajectory-level KL into a sum of one-step KLs on real contexts, exactly what teacher forcing trains. The guarantee is for the data's policy and is only as good as the one-step errors.

Question 2

Why did GameNGen corrupt its context frames with noise during training?

  1. To speed up sampling
  2. To show the model imperfect contexts like its own outputs, so that it learns to correct drift instead of amplifying it
  3. To hide the actions from the model
  4. To imitate lossy JPEG compression
Show the answer

B. To show the model imperfect contexts like its own outputs, so that it learns to correct drift instead of amplifying it

Teacher forcing shows only clean real frames, but at play time the model conditions on its own imperfect frames. Training on noised contexts, with the noise level as an input, teaches it to map slightly-off contexts back toward the data.

Question 3

What does Genie's latent action model learn, and why does its codebook have only 8 entries?

  1. The real controller inputs stored with the videos; 8 is the number of buttons in the games
  2. Pixel reconstructions of each frame; 8 is the number of frames of context
  3. Rewards; 8 is the number of reward levels
  4. A discrete code for the change between consecutive frames, learned without labels; a small codebook forces the code onto the most meaningful change and keeps the world playable
Show the answer

D. A discrete code for the change between consecutive frames, learned without labels; a small codebook forces the code onto the most meaningful change and keeps the world playable

The decoder must reconstruct the next frame from past frames and the code alone, so the code learns to carry the change the past cannot predict, mostly what the player did. Limiting it to 8 codes makes the latent actions consistent enough for a person or a policy to use.

Question 4

Which evaluation measures most directly what a reinforcement learning agent needs from a world model?

  1. Next-frame PSNR under teacher forcing
  2. Fréchet video distance against real videos
  3. The performance in the real environment of an agent trained inside the model
  4. Human ratings of short clips
Show the answer

C. The performance in the real environment of an agent trained inside the model

The agent's real return is what the model is for. Frame and video metrics, and human ratings, are proxies that can all look good while the model is wrong exactly where an optimizing agent goes.

Further reading

  • V. Micheli, E. Alonso & F. Fleuret, "Transformers are sample-efficient world models," ICLR (2023).
  • E. Alonso, A. Jelley, V. Micheli, A. Kanervisto, A. Storkey, T. Pearce & F. Fleuret, "Diffusion for world modeling: visual details matter in Atari," NeurIPS (2024).
  • J. Bruce, M. Dennis, A. Edwards, J. Parker-Holder, Y. Shi et al., "Genie: generative interactive environments," ICML (2024).
  • D. Valevski, Y. Leviathan, M. Arar & S. Fruchter, "Diffusion models are real-time game engines," ICLR (2025).
  • S. Yang, Y. Du, S. K. S. Ghasemipour, J. Tompson, L. P. Kaelbling, D. Schuurmans & P. Abbeel, "Learning interactive real-world simulators," ICLR (2024).