AnyLearn
All lessons
AIintermediate

Interactive Generative World Models: From Video to Playable Worlds

How a video generator becomes a world you can act in. Covers learning controls from unlabeled video with Genie's latent actions, a toy version in code, autoregressive drift and how GameNGen fights it, agents trained inside DIAMOND, the Genie 2 and 3 consistency gains, and how neural and engine simulators differ.

Updated · AI-authored, review-gated · how lessons are made

Progress1 / 10

From video generator to world model

A video generation model already predicts how scenes evolve: given a prompt or a first frame, it renders a plausible continuation. The mechanics of those models, diffusion over video latents, are covered in the lesson Video generation models; this lesson is about what it takes to turn one into a world model someone can act in.

NVIDIA's Cosmos technical report gives a crisp definition of a world foundation model: a model that predicts the future observation at time t+1t+1 from past observations and a perturbation, where the perturbation can be an action, a random perturbation, or a text description. Three requirements follow:

  1. Action conditioning. The next frame must depend on what the player or agent does, not only on what usually happens next.
  2. Frame-by-frame generation. A clip generated all at once cannot respond to input that arrives halfway through. The model must produce one frame, accept the next action, and continue.
  3. Speed. Interaction needs frames at the pace of the controls. A model that takes seconds per frame is a forecaster, not a game.

Each requirement hits a different wall: missing action labels, accumulating errors, and compute.

Sign in free to save your progress and earn certificates.

Full lesson text

All 10 steps on one page, for reading, reference, and search.

Show

1. From video generator to world model

A video generation model already predicts how scenes evolve: given a prompt or a first frame, it renders a plausible continuation. The mechanics of those models, diffusion over video latents, are covered in the lesson Video generation models; this lesson is about what it takes to turn one into a world model someone can act in.

NVIDIA's Cosmos technical report gives a crisp definition of a world foundation model: a model that predicts the future observation at time t+1t+1 from past observations and a perturbation, where the perturbation can be an action, a random perturbation, or a text description. Three requirements follow:

  1. Action conditioning. The next frame must depend on what the player or agent does, not only on what usually happens next.
  2. Frame-by-frame generation. A clip generated all at once cannot respond to input that arrives halfway through. The model must produce one frame, accept the next action, and continue.
  3. Speed. Interaction needs frames at the pace of the controls. A model that takes seconds per frame is a forecaster, not a game.

Each requirement hits a different wall: missing action labels, accumulating errors, and compute.

2. The missing action labels

Action conditioning needs data that pairs frames with the actions that caused them. Game logs and robot recordings have such labels, but they are small. Internet video is vast and has none: nobody recorded which buttons the player of a gameplay video pressed.

Genie (Bruce and colleagues at Google DeepMind, 2024) solved this with a latent action model. During training, an encoder looks at the past frames and the next frame and outputs a code from a tiny vocabulary, just 8 possible latent actions. A decoder must then reconstruct the next frame from the past frames plus that code alone.

Key idea: The bottleneck does the labelling. With only 8 codes to choose from, the cheapest way to help the decoder is to encode what changed that the past could not predict, which in a game is mostly what the player did. Meaningful controls such as left, right and jump emerge without a single label.

At play time the encoder is thrown away. A person, or an agent, simply picks one of the 8 codes each step, and the dynamics model renders the consequence. The same recipe applied to robot videos without action labels also produced consistent latent actions, according to the paper.

3. Discovering actions without labels, in code

Genie's latent action model is a neural network, but the principle fits in a few lines. Here a hidden player moves a character left, right, up (jump) or not at all, and only positions are recorded. Clustering the frame-to-frame changes into 4 codes stands in for the 8-code bottleneck:

import numpy as np
rng = np.random.default_rng(1)

# Unlabeled "video": a character's (x, y) position per frame. A hidden player
# pressed left, right, jump or nothing, but no action labels are recorded.
moves = {"left": (-1, 0), "right": (1, 0), "jump": (0, 2), "noop": (0, 0)}
names = list(moves)
true = rng.integers(0, 4, size=2000)
deltas = np.array([moves[names[k]] for k in true]) + rng.normal(0, 0.2, (2000, 2))

# Latent action model, minimal version: cluster frame-to-frame changes into
# K=4 codes (k-means). Each code becomes an action the user can press later.
K = 4
codes = deltas[:1]                        # farthest-point initialisation
while len(codes) < K:
    d = ((deltas[:, None] - codes) ** 2).sum(-1).min(1)
    codes = np.vstack([codes, deltas[d.argmax()]])
for _ in range(20):
    z = np.argmin(((deltas[:, None] - codes) ** 2).sum(-1), axis=1)
    codes = np.array([deltas[z == k].mean(0) for k in range(K)])

for k in range(K):
    share = np.bincount(true[z == k], minlength=4) / (z == k).sum()
    print(f"latent action {k}: mean change {codes[k].round(2)}, "
          f"{share.max():.0%} of its frames were '{names[share.argmax()]}'")

# Now "play": press latent action k and the dynamics model predicts the next frame
pos = np.array([5.0, 0.0])
for k in (int(np.argmax(codes[:, 0])), int(np.argmax(codes[:, 1]))):
    pos = pos + codes[k]
    print(f"pressed latent action {k}: predicted position {pos.round(2)}")

Output:

latent action 0: mean change [0.99 0.01], 99% of its frames were 'right'
latent action 1: mean change [0.01 2.  ], 100% of its frames were 'jump'
latent action 2: mean change [-1. -0.], 99% of its frames were 'left'
latent action 3: mean change [ 0.   -0.02], 98% of its frames were 'noop'
pressed latent action 0: predicted position [5.99 0.01]
pressed latent action 1: predicted position [6. 2.]

Each of the 4 codes lines up with one true action in 98 to 100 percent of its frames, though no label was ever used, and "pressing" a code then moves the character the way that action would. Real video is harder in two ways the toy hides: the change between frames mixes the player's action with everything else that moves, and the codes have no names. A person discovers what each latent action does by trying it.

Gotcha: The initialisation line matters. With a naive random start, the same clustering split "jump" across two codes and smeared "noop" into the codes for "left" and "right". Learned action vocabularies can be degenerate in exactly this way, and nothing in the loss announces it.

4. Genie's three components

Genie combines the latent action model with a video tokenizer and a large dynamics model. Figures from the Genie paper:

ComponentRoleDetails
Video tokenizer (ST-ViViT)compress frames into discrete tokensVQ-VAE with a spatiotemporal transformer; 200M parameters; 1,024 codes
Latent action modelinfer actions between frames8 discrete latent actions; discarded at play time
Dynamics modelpredict the next frame's tokens from past tokens and a latent actionMaskGIT-style transformer; 10.1B parameters, 10.7B for the whole system

Training data was over 30,000 hours of 2D platformer gameplay, 6.8 million 16-second clips filtered from about 244,000 hours of raw video, at 160 by 90 pixels and 10 frames per second. Given one image, even a hand-drawn sketch, Genie turns it into a controllable side-scrolling world.

The paper is candid about the limits: it runs at around 1 frame per second, it remembers only 16 frames of context, and like any autoregressive transformer it can hallucinate unrealistic futures. Playable, then, but not yet interactive in the everyday sense.

5. How Genie generates the next frame

Training uses all three components; at play time the latent action comes from the player instead of the encoder.

flowchart LR
  F["Past frames"] --> T["Video tokenizer"]
  T --> K["Frame tokens"]
  F --> L["Latent action model, training only"]
  N["Next frame, training only"] --> L
  L --> A["One of 8 latent actions"]
  P["Player picks an action at play time"] --> A
  K --> D["Dynamics model"]
  A --> D
  D --> X["Next frame tokens"]
  X --> R["Decoded next frame"]

6. Drift, and how neural game engines fight it

Frame-by-frame generation has a structural weakness. During training, the model predicts frame t+1t+1 from real past frames. During play, it predicts from its own previous outputs. Every small error becomes part of the input to the next step, and the errors compound: textures smear, objects melt, the scene slowly drifts away from anything coherent.

Valevski and colleagues' GameNGen (ICLR 2025), a diffusion model that runs the game DOOM, shows the standard counter-measures:

  • Data from an agent. A reinforcement learning agent plays the game and its sessions are recorded, giving frames paired with real actions.
  • Conditioning augmentation. During training the context frames are deliberately corrupted, so the model learns to repair imperfect history rather than amplify it.
  • A fine-tuned decoder to keep small details such as on-screen numbers legible.

The paper reports 20 frames per second on a single TPU, stable play over multi-minute sessions, a next-frame PSNR of 29.4, comparable to lossy JPEG compression, and human raters only slightly better than chance at telling short generated clips from real gameplay.

7. Agents that train inside a generative model

A neural game engine is also a training ground. Alonso and colleagues' DIAMOND (NeurIPS 2024) trains a reinforcement learning agent entirely inside a diffusion world model, the Dreamer recipe from the previous lesson with a pixel-level generator in place of a compact latent model.

Their argument is in the subtitle, visual details matter. Compact discrete latents can drop small features that decide a game, such as a distant enemy or the exact position of a ball. A diffusion model that keeps the pixels keeps those details. On the Atari 100k benchmark, which allows only 100,000 interactions per game, DIAMOND reports a mean human-normalised score of 1.46, which the paper describes as a new best for agents trained entirely within a world model. The same model, trained on recorded Counter-Strike gameplay, also runs as an interactive neural game engine.

Compact latent model (Dreamer)Pixel generative model (DIAMOND, Genie)
Cost per imagined stepvery lowhigh
Small visual detailscan be lostpreserved
Inspectable by peopleonly through a decoderdirectly
Typical roletraining agents cheaplytraining agents, and human play

8. From seconds of memory to minutes

The Genie line shows how fast the consistency problem has moved. Figures from the Genie paper and Google DeepMind's announcements of Genie 2 and Genie 3:

GenieGenie 2Genie 3
Starts froman image of a 2D gamea single image, rendered as a 3D worlda text prompt
ModelMaskGIT transformer over tokensautoregressive latent diffusionautoregressive, frame by frame
Interactionaround 1 frame per secondkeyboard and mouse actionsreal time, 24 frames per second at 720p
Consistency16 frames of memoryup to about a minute; most examples 10 to 20 secondsa few minutes; visual memory reaching back about a minute

Two mechanisms stand out. First, the consistency is not built on an explicit 3D representation. DeepMind contrasts Genie 3 with NeRFs and Gaussian splatting: a place looks the same when you return only because the model learned to condition each frame on the long trajectory it has already generated. Second, Genie 3 adds promptable world events, text that changes the running world, such as new weather or a new object, which lets a user stage "what if" situations for an agent.

9. Neural simulator versus engine simulator

A learned generative world and a hand-built simulator such as a physics engine or game engine trade very different things:

Engine simulatorGenerative world model
Ruleswritten by people, exact within the modellearned from data, approximate
Contentwhatever artists and engineers buildanything the training data suggests, from a prompt
Stateexplicit: positions, velocities, contacts can be read outimplicit: only pixels come out
Guaranteesthe same input gives the same physicsplausible, not guaranteed
Cost of a new scenarioengineering timea prompt or an image
Main gap to realitymissing visual and behavioural richnessmissing reliable physics

Gotcha: "Implicit state" has a practical sting. In an engine you can ask where the ball is, or whether two objects touched, and get an exact answer to score an agent with. In a generative world model there is nothing to query; success has to be judged from the frames, by a person or another model. That makes scoring, the subject of the next lesson, much harder than it looks.

10. What these models are for, and their stated limits

The stated purpose of the Genie line is not entertainment but training and evaluating embodied agents. DeepMind paired Genie 2 and Genie 3 with its SIMA game-playing agent: the agent sends navigation actions, the world model renders the results, and longer consistency allows longer action sequences and more complex goals. A world that can be generated on demand offers an unbounded supply of new training environments, including ones no one has built.

DeepMind's Genie 3 announcement lists its own limits:

  • the range of actions an agent can take directly is limited;
  • interactions between several independent agents remain an open problem;
  • real places cannot be reproduced with geographic accuracy;
  • legible text usually appears only when it is in the prompt;
  • interaction lasts minutes, not hours.

In practice: Read the list as a map of what is hard about learned simulation in general: rich action spaces, multi-agent interaction, faithfulness to a specific real place, and long horizons. The next lesson follows these simulators into robotics and driving, where the same limits decide whether a learned world can be trusted.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. Why does an interactive world model need to generate frame by frame rather than a whole clip at once?
    • Frame-by-frame generation always gives higher image quality
    • Whole clips cannot be generated by diffusion models
    • It avoids the need for any training data
    • Actions arrive during play, so each frame must be able to depend on the latest input
  2. How does Genie's latent action model obtain controls from unlabeled video?
    • It reads button presses from metadata stored with the videos
    • A tiny 8-code bottleneck forces the code to capture what changed that the past frames could not predict, mostly the player's action
    • It asks human annotators to label a small subset of clips
    • It copies the action space of a game engine
  3. What problem does GameNGen's conditioning augmentation, corrupting context frames during training, address?
    • Drift: at play time the model conditions on its own imperfect outputs, so it must learn to repair rather than amplify errors
    • The lack of action labels in internet video
    • The slow speed of the RL agent that records gameplay
    • The cost of storing high-resolution frames
  4. Per DeepMind, how does Genie 3 keep a place looking the same when the user returns to it?
    • It stores an explicit NeRF of the scene
    • It reloads the original prompt image
    • Consistency emerges from conditioning each new frame on the long trajectory already generated
    • It uses a physics engine to track every object
  5. Which is a genuine disadvantage of a generative world model compared with an engine simulator?
    • New scenarios require far more engineering time
    • It cannot produce photorealistic images
    • It needs explicit hand-written rules for every object
    • Its state is implicit, so there are no exact positions or contacts to query when scoring an agent

Related lessons

AI
intermediate

Learned Simulators for Robots and Cars, and How World Models Fail

How world models train and test robots and driving systems, and where they break. Covers learning to walk in an hour with DayDreamer, driving world models, ranking robot policies in a video simulator, compounding error in code, model exploitation and its defences, hallucinated physics, and why evaluation is the hardest part.

10 steps·~15 min
AI
advanced

Dreaming in Latent Space: World Models, PlaNet, Dreamer and MuZero

How agents learn compact latent world models from pixels and plan inside them. Covers Ha and Schmidhuber's dream-trained controller, PlaNet's recurrent state-space model, Dreamer's actor-critic in imagination with lambda-returns in code, the later Dreamer versions, and MuZero's value-equivalent model.

12 steps·~18 min
AI
intermediate

What a World Model Is, and How an Agent Plans With One

A world model is a learned simulator that predicts what happens if an agent acts. This lesson covers its parts, why model-based learning needs far less real experience, Dyna versus model-predictive control, a working planner in code, and why a planner exploits model errors.

10 steps·~15 min
AI
advanced

Synthesis: Why Three Seconds Is Enough to Clone a Voice

Once audio is a sequence of tokens, generating speech becomes the same shape of problem as generating text, and the whole language modelling toolkit transfers. That reframing produced zero-shot voice cloning from about three seconds of audio. This lesson covers the codec language model approach, why so little reference suffices, the flow-matching alternative, and what the capability implies.

9 steps·~14 min