TAI BUI
Back to curriculum
BuildPython

World Models & Video Diffusion

A video model that predicts what happens next in a scene is already a world simulator. Condition that prediction on actions and you've built a learned game engine.

TIME: ~75 minutesPREREQUISITES: Phase 4 Lesson 10 (Diffusion), Phase 4 Lesson 12 (Video Understanding), Phase 4 Lesson 23 (DiT + Rectified Flow)

Learning Objectives

  • Explain the difference between a pure video generation model (Sora 2) and an action-conditioned world model (Genie 3, DreamerV3)
  • Describe a video DiT: spatio-temporal patches, 3D position encoding, joint attention across (T, H, W) tokens
  • Trace how a world model plugs into robotics: VLM plans → video model simulates → inverse dynamics emits actions
  • Pick between Sora 2, Genie 3, Runway GWM-1 Worlds, Wan-Video, and HunyuanVideo for a given use case (creative video, interactive sim, autonomous-driving synthesis)

The Problem

A world model is a model that predicts what a scene looks like next, given what it looks like now and, often, what action gets taken. Video generation and world modeling turned out to be the same problem once models got good enough at the first one. Generate a coherent minute of video and you've implicitly learned how the world behaves: objects stay solid, things fall, actions have consequences, and a scene's visual style holds together from the first frame to the last. Condition that prediction on an action (walk left, open the door) and the video model becomes a simulator you can steer: a game engine, a driving simulator, a robotics test environment — all learned, none of it hand-coded.

The stakes are concrete. Genie 3 generates a playable environment from a single image. Runway GWM-1 Worlds synthesizes an explorable scene with no fixed edges. Sora 2 produces minute-long video with synchronized audio and physics that mostly holds together. NVIDIA Cosmos-Drive, Wayve Gaia-2, and Tesla DrivingWorld generate driving footage realistic enough to train on. Sim-to-real for robotics is quietly rebuilding itself on top of this same idea.

This is the big-picture lesson for Phase 4: it ties image generation, video understanding, and agentic reasoning together into the architecture pattern the field is converging on.

Warm-up0/3
1. A video game responds the instant you press a key or move the stick. A movie plays out the same way no matter what you do while it's running. What's the basic difference between those two experiences?Warm-up
A box labelled video game and a box labelled movie, above a dashed question mark box reading basic difference, question mark.
Only the two everyday names from the question; what sets them apart is left blank.
2. Self-attention compares every token in a sequence with every other token. If a sequence grows from 1,000 to 2,000 tokens, the number of comparisons grows by roughly what factor?Warm-up
Four small boxes labelled t1 through t4 with dashed lines connecting every pair, next to a dashed question mark box reading grows by about question mark.
A small illustrative set of tokens with every pair connected, not the question's own sequence lengths.
3. A convolution with kernel size 4 and stride 4 slides over a 64x64 image. What does its output grid look like?Warm-up
A square standing for the 64 by 64 image with three 4 by 4 kernel windows at its top left corner, the first solid and the next two dashed, beside a dashed question mark box reading output grid, question mark.
The image and the kernel at the sizes the question gives, with the resulting grid left blank.
Check: The Problem0/2
1. What is a world model?Define
Three boxes labelled Genie 3, DreamerV3 and GWM-1 Worlds, above a dashed question mark box reading what the term means, question mark.
Three models the lesson groups under this term; what the term itself means is left blank.
2. Why does the lesson say video generation and world modeling turned out to be the same problem?Explain
A box labelled video generation and a box labelled world modeling, above a dashed question mark box reading why the same problem, question mark.
The two things named only; why the lesson calls them the same problem is left blank.

The Concept

Three families of world modeling

Mermaid diagram

  • Sora 2 is pure video generation conditioned on a prompt. There's no action interface, and you can't steer it mid-rollout.
  • Genie 3, GWM-1 Worlds, and Mirage / Magica are action-conditioned world models. They infer a latent action from observed video, then condition future frame predictions on that action, so pressing a key or moving a camera changes what the scene does next.
  • DreamerV3 and the classic RL world-model family predict in a latent space with explicit action conditioning, trained on a reward signal. Less visual. More useful for sample-efficient RL.

Video DiT architecture

A video DiT is a diffusion transformer that treats a video clip the way an image DiT treats a picture, except the patches now span time as well as space. Cut the clip into small chunks along (T, H, W), turn every chunk into one token, and run the same denoising transformer from Lesson 23 over that longer token sequence.

Video latent:          (C, T, H, W)
Patchify (spatial):    grid of P_h x P_w patches per frame
Patchify (temporal):   group P_t frames into a temporal patch
Resulting tokens:      (T / P_t) * (H / P_h) * (W / P_w) tokens

Positional encoding is 3D: a rotary or learned embedding per (t, h, w) coordinate. Attention comes in three flavors:

  • Full joint: every token attends to every other token. O(N^2) with N tokens, which gets prohibitive fast for long videos.
  • Divided: alternate temporal attention (same spatial position, across time: (H*W) * T^2) and spatial attention (same timestep, across space: T * (H*W)^2). What TimeSformer and most video DiTs actually use.
  • Window: local windows in (t, h, w). What Video Swin uses.

Every 2026 video diffusion model runs one of these three patterns, plus AdaLN conditioning (Lesson 23) and rectified flow.

Conditioning on actions: latent action models

Genie learns a latent action per frame by discriminatively predicting the action between a pair of consecutive frames. Its decoder then conditions on that inferred latent action, not on explicit keyboard keys. At inference, you can specify a latent action directly, or sample one from a fresh prior, and the model generates the next frame consistent with it.

Sora skips the action interface entirely. Its decoder predicts the next spacetime tokens from past spacetime tokens. The prompt sets the scene at the start; nothing steers it once generation begins.

Physical plausibility

Sora 2's 2026 release explicitly advertised physical plausibility: weight, balance, object permanence, cause-and-effect. The team measured it with hand-rated plausibility scores, and the model visibly improves on dropped objects, characters colliding, and failures on purpose (a missed jump) compared with Sora 1.

Plausibility is still the dominant failure mode. The 2024-2025 wave of videos showing people eating spaghetti or drinking from glasses exposed the same underlying problem: no persistent object representation. 2026 models (Sora 2, Runway Gen-5, HunyuanVideo) reduce this. They don't eliminate it.

Autonomous driving world models

Driving world models generate realistic road scenes conditioned on trajectories, bounding boxes, or navigation maps.

  • Cosmos-Drive-Dreams (NVIDIA): generates minutes of driving video for RL training.
  • Gaia-2 (Wayve): trajectory-conditioned scene synthesis for policy evaluation.
  • DrivingWorld (Tesla): simulates varied weather, time of day, and traffic conditions.
  • Vista (ByteDance): reactive driving scene synthesis.

They replace expensive real-world data collection for corner cases (pedestrian jaywalks at night, icy intersections, unusual vehicle types) that would otherwise require millions of miles of driving.

Robotics stack: VLM + video model + inverse dynamics

The emerging three-component robotics loop:

  1. VLM parses the goal ("pick up the red cup") and plans a high-level action sequence.
  2. Video generation model predicts observations N frames ahead: what executing each action would look like.
  3. Inverse dynamics model extracts the concrete motor commands that would produce those observations.

This replaces reward shaping and sample-heavy RL. The world model does the imagining; the inverse dynamics model closes the loop on actuation. Genie Envisioner is one instantiation, and plenty of research groups are converging on the same structure.

Evaluation

  • Visual quality: FVD (Fréchet Video Distance), user studies.
  • Prompt alignment: CLIPScore per frame, VQA-style evaluation.
  • Physical plausibility: hand-rated on a benchmark suite (Sora 2's internal benchmark, VBench).
  • Controllability (for interactive world models): action → observation consistency; can you go back to a prior state?

Model landscape in 2026

ModelUseParametersOutputLicense
Sora 2text-to-video, audioundisclosed1-min 1080p + audioAPI only
Runway Gen-5text/image-to-videoundisclosed10s clipsAPI
Runway GWM-1 Worldsinteractive worldundisclosedinfinite 3D rolloutAPI
Genie 3interactive world from image11B+playable framesresearch preview
Wan-Video 2.1open text-to-video14Bhigh-quality clipsnon-commercial
HunyuanVideoopen text-to-video13B10s clipspermissive
Cosmos / Cosmos-Driveautonomous driving sim7-14Bdriving scenesNVIDIA open
Magica / Mirage 2AI-native game engineundisclosedmodifiable worldsproduct
Check: The Concept0/26
1. What is a video DiT?Define
Four overlapping frame rectangles labelled video latent with the shape C, T, H, W, beside a dashed question mark box reading video DiT, question mark.
The clip tensor the model reads, written the way the lesson writes it; what the model is is left blank.
2. What is divided attention in a video transformer?Define
Four frame rectangles side by side, each holding a small grid of token squares, above a dashed question mark box reading divided attention, question mark.
A schematic of where a clip's tokens sit; how divided attention is organized over them is left blank.
3. What is a latent action in a model like Genie?Define
A wide box labelled Genie, generates a playable environment from a single image, above a dashed question mark box reading latent action, question mark.
The model the term comes from, described the way the lesson describes it; what the term means is left blank.
4. What does object permanence mean for a video model?Define
A box labelled frame 1, object present, and a box labelled frame N, same scene, later, above a dashed question mark box reading object permanence means, question mark.
Two frames from the same clip, far apart in time; what the term means for them is left blank.
5. What does FVD measure?Define
A box labelled real clips and a box labelled generated clips, above a dashed question mark box reading FVD measures, question mark.
The two sets of clips being compared; what the comparison measures is left blank.
6. In the robotics stack of VLM, video generation model and inverse dynamics model, what does the inverse dynamics model do?Define
Three boxes in a row labelled VLM, video generation model and inverse dynamics model with the third highlighted, above a dashed question mark box reading third one does what, question mark.
The stack in the order the question gives it; what the highlighted component does is left blank.
7. Which model is an open-weights world model for autonomous-driving simulation, used for RL and evaluation?Define
A card listing the requirement: open-weights world model for autonomous-driving simulation, used for RL training and evaluation, above a dashed question mark box reading model name, question mark.
The requirement exactly as asked; no candidate model is named.
8. Which evaluation axis asks whether an action leads to a consistent observation and whether you can go back to a prior state?Define
A card stating the description from the question: an action leads to a consistent observation, and you can go back to a prior state, above a dashed question mark box reading axis name, question mark.
The description exactly as the question gives it; which named evaluation axis it is is left blank.
9. What is full joint attention in a video transformer?Define
A row of nine token squares followed by an ellipsis, labelled N tokens from one clip, above a dashed question mark box reading full joint attention, question mark.
The tokens a clip becomes, with no attention drawn between them; what the named pattern is is left blank.
10. Why can't you steer Sora 2 once a rollout has started?Explain
A box labelled Sora 2, rollout has started, next to a dashed question mark box reading why can't steer it, question mark.
The model's name and the fact that a rollout is already running; why it can't be steered is left blank.
11. How does DreamerV3 differ from Genie 3 as a world model?Explain
Two dashed question mark boxes side by side, one reading DreamerV3, question mark, the other reading Genie 3, question mark.
Only the two names; how either one works is left blank.
12. Why does Genie condition on an inferred latent action instead of explicit keyboard keys?Explain
A box labelled latent action, what Genie uses, and a box labelled explicit keyboard keys, the alternative, above a dashed question mark box reading why latent, not keys, question mark.
The two alternatives named only; why Genie uses one instead of the other is left blank.
13. Why does a video DiT add a position encoding per (t, h, w) coordinate?Explain
A wide box labelled spatio-temporal patches, (t,h,w) grid, above a dashed question mark box reading why add a position, question mark.
The patch grid before any position encoding; why one gets added is left blank.
14. Why is divided attention cheaper than full joint attention?Explain
A box labelled divided attention and a box labelled full joint attention, above a dashed question mark box reading why cheaper, question mark.
The two attention patterns named only; why one costs less than the other is left blank.
15. In the robotics stack, why does the video model sit between the VLM and the inverse dynamics model?Explain
A box labelled VLM, parses goal and plans, an arrow to a dashed question mark box, and an arrow onward to a box labelled inverse dynamics, last step.
The stack's two named ends only; what the middle model does is left blank.
16. Sora 2's 2026 release advertised better physical plausibility. Which failure modes did that target?Explain
A box labelled Sora 2, 2026 release, and a box labelled physical plausibility, above a dashed question mark box reading failure modes targeted, question mark.
The release and the named property only; which failure modes it targeted is left blank.
17. Why is physical plausibility still the dominant failure mode, even for 2026 models?Explain
A box labelled 2026 models and a box labelled physical plausibility, above a dashed question mark box reading why still dominant, question mark.
The models and the named failure category only; why it is still the dominant one is left blank.
18. Autonomous-driving teams use world models such as Cosmos-Drive, Gaia-2 and DrivingWorld to replace what cost?Explain
Three boxes labelled Cosmos-Drive, Gaia-2 and DrivingWorld, joined by a dashed bracket below to a dashed question mark box reading cost replaced, question mark.
Three model names only; what cost they replace is left blank.
19. A video latent of shape (C=4, T=16, H=32, W=32) is patchified with patch_t=2, patch_h=4 and patch_w=4. How many tokens result?Apply
The VideoPatch3D conv line and forward call for an input of shape 1 by 4 by 16 by 32 by 32 with patch sizes 2, 4 and 4, above a dashed question mark box reading token count, question mark.
The lesson's own patchify code with these given sizes; the resulting token count is left blank.
20. A token grid of (4, 8, 8) has 256 tokens. Roughly how many token pairs does one full joint attention pass compare, versus one temporal pass using (H*W) * T^2?Apply
A box labelled full joint attention, all 256 tokens, and a box labelled temporal pass, H times W times T squared, above a dashed question mark box reading pairs compared, question mark.
The grid size and the two named patterns; the actual pair counts for each are left blank.
21. A generated clip shows someone lifting a fork, but the food disappears before it reaches their mouth. Which underlying weakness does this point to?Analyze
A card stating the scenario: someone lifts a fork and the food disappears before it reaches their mouth, above a dashed question mark box reading underlying weakness, question mark.
The clip exactly as the question describes it; which weakness it points to is left blank.
22. A team picks a video model for its stunning fidelity, then finds that its product needs players to press a key and see the world respond. What was the wrong assumption?Analyze
A card stating the situation: a model picked for its stunning fidelity, while the product actually needs pressing a key and the world responding, above a dashed question mark box reading wrong assumption, question mark.
The team's situation exactly as given; what they assumed wrongly is left blank.
23. A model scores very well on FVD, yet its clips show hands passing through glasses. Which evaluation axis was left unchecked?Analyze
A card stating the model scores very well on FVD, and its clips show hands passing through glasses, above a dashed question mark box reading axis left unchecked, question mark.
The score and the visible failure exactly as given; which evaluation axis was skipped is left blank.
24. A video DiT using full joint attention becomes unaffordable as clips get longer. Which change keeps the transformer but avoids all-pairs attention?Analyze
A card stating the given fact: a video DiT using full joint attention becomes unaffordable as clips get longer, above a dashed question mark box reading change that avoids this, question mark.
The cost problem exactly as given; what change avoids it is left blank.
25. You need to generate a driving scenario where a pedestrian jaywalks in front of the car at night, so a self-driving policy can be evaluated against it before it ever happens on a real road. Which model category fits, and why?Design
A card stating the scenario to generate: a pedestrian jaywalking at night, with the goal of evaluating a self-driving policy before it happens for real, above a dashed question mark box reading model category plus why, question mark.
The scenario exactly as given; which model category fits and why is left blank.
26. You must ship self-hosted text-to-video inside a commercial product. Which model fits the license and hosting constraints in the model landscape?Design
A card listing the requirements: self-hosted text-to-video, shipped inside a commercial product, above a dashed question mark box reading model that fits, question mark.
The requirements exactly as given; no candidate model is named.

Build It

Step 1: 3D patchify for video

python
import torch
import torch.nn as nn
 
 
class VideoPatch3D(nn.Module):
    def __init__(self, in_channels=4, dim=64, patch_t=2, patch_h=2, patch_w=2):
        super().__init__()
        self.proj = nn.Conv3d(
            in_channels, dim,
            kernel_size=(patch_t, patch_h, patch_w),
            stride=(patch_t, patch_h, patch_w),
        )
        self.patch_t = patch_t
        self.patch_h = patch_h
        self.patch_w = patch_w
 
    def forward(self, x):
        # x: (N, C, T, H, W)
        x = self.proj(x)
        n, c, t, h, w = x.shape
        tokens = x.reshape(n, c, t * h * w).transpose(1, 2)
        return tokens, (t, h, w)

A 3D conv with stride equal to kernel acts as the spatio-temporal patchifier: (T, H, W) -> (T/2, H/2, W/2) grid of tokens.

Step 2: 3D rotary position encoding

Rotary Position Embeddings (RoPE) separately applied along t, h, w axes:

python
def rope_3d(tokens, t_dim, h_dim, w_dim, grid):
    """
    tokens: (N, T*H*W, D)
    grid: (T, H, W) sizes
    t_dim + h_dim + w_dim == D
    """
    T, H, W = grid
    n, seq, d = tokens.shape
    if t_dim + h_dim + w_dim != d:
        raise ValueError(f"t_dim+h_dim+w_dim ({t_dim}+{h_dim}+{w_dim}) must equal D={d}")
    assert seq == T * H * W
    t_idx = torch.arange(T, device=tokens.device).repeat_interleave(H * W)
    h_idx = torch.arange(H, device=tokens.device).repeat_interleave(W).repeat(T)
    w_idx = torch.arange(W, device=tokens.device).repeat(T * H)
    # Simplified: just scale channels by frequencies. Real RoPE rotates pairs.
    freqs_t = torch.exp(-torch.log(torch.tensor(10000.0)) * torch.arange(t_dim // 2, device=tokens.device) / (t_dim // 2))
    freqs_h = torch.exp(-torch.log(torch.tensor(10000.0)) * torch.arange(h_dim // 2, device=tokens.device) / (h_dim // 2))
    freqs_w = torch.exp(-torch.log(torch.tensor(10000.0)) * torch.arange(w_dim // 2, device=tokens.device) / (w_dim // 2))
    emb_t = torch.cat([torch.sin(t_idx[:, None] * freqs_t), torch.cos(t_idx[:, None] * freqs_t)], dim=-1)
    emb_h = torch.cat([torch.sin(h_idx[:, None] * freqs_h), torch.cos(h_idx[:, None] * freqs_h)], dim=-1)
    emb_w = torch.cat([torch.sin(w_idx[:, None] * freqs_w), torch.cos(w_idx[:, None] * freqs_w)], dim=-1)
    return tokens + torch.cat([emb_t, emb_h, emb_w], dim=-1)

Simplified additive form. Real RoPE rotates paired channels at frequencies; the positional information is the same.

Step 3: Divided attention block

python
class DividedAttentionBlock(nn.Module):
    def __init__(self, dim=64, heads=2):
        super().__init__()
        self.time_attn = nn.MultiheadAttention(dim, heads, batch_first=True)
        self.space_attn = nn.MultiheadAttention(dim, heads, batch_first=True)
        self.ln1 = nn.LayerNorm(dim)
        self.ln2 = nn.LayerNorm(dim)
        self.ln3 = nn.LayerNorm(dim)
        self.mlp = nn.Sequential(nn.Linear(dim, 4 * dim), nn.GELU(), nn.Linear(4 * dim, dim))
 
    def forward(self, x, grid):
        T, H, W = grid
        n, seq, d = x.shape
        # time attention: same (h, w), across t
        xt = x.view(n, T, H * W, d).permute(0, 2, 1, 3).reshape(n * H * W, T, d)
        a, _ = self.time_attn(self.ln1(xt), self.ln1(xt), self.ln1(xt), need_weights=False)
        xt = (xt + a).reshape(n, H * W, T, d).permute(0, 2, 1, 3).reshape(n, seq, d)
        # space attention: same t, across (h, w)
        xs = xt.view(n, T, H * W, d).reshape(n * T, H * W, d)
        a, _ = self.space_attn(self.ln2(xs), self.ln2(xs), self.ln2(xs), need_weights=False)
        xs = (xs + a).reshape(n, T, H * W, d).reshape(n, seq, d)
        xs = xs + self.mlp(self.ln3(xs))
        return xs

The time attention attends within each spatial position across time. The space attention attends within each frame across positions. Two passes costing O((HW) * T^2) and O(T * (HW)^2) instead of one O((THW)^2): this is the core of TimeSformer and every modern video DiT.

Step 4: Compose a tiny video DiT

python
class TinyVideoDiT(nn.Module):
    def __init__(self, in_channels=4, dim=64, depth=2, heads=2):
        super().__init__()
        self.patch = VideoPatch3D(in_channels=in_channels, dim=dim, patch_t=2, patch_h=2, patch_w=2)
        self.blocks = nn.ModuleList([DividedAttentionBlock(dim, heads) for _ in range(depth)])
        self.out = nn.Linear(dim, in_channels * 2 * 2 * 2)
 
    def forward(self, x):
        tokens, grid = self.patch(x)
        for blk in self.blocks:
            tokens = blk(tokens, grid)
        return self.out(tokens), grid

Not a working video generator. Just a structural demo that proves every piece is shaped correctly.

Step 5: Check shapes

python
vid = torch.randn(1, 4, 8, 16, 16)  # (N, C, T, H, W)
model = TinyVideoDiT()
out, grid = model(vid)
print(f"input  {tuple(vid.shape)}")
print(f"tokens grid {grid}")
print(f"output {tuple(out.shape)}")

Expect grid = (4, 8, 8) and out = (1, 256, 32) after patching. The head then projects each token back into its own spatio-temporal patch, ready to be un-patchified into video.

Check: Build It0/4
1. In the lesson's `VideoPatch3D`, a 3D convolution whose stride equals its kernel size patchifies the video. For an input of shape (N, C, 8, 16, 16) with patch_t=2, patch_h=2 and patch_w=2, what is the resulting token grid?Apply
The VideoPatch3D conv line and its forward call for an input of shape 1 by 4 by 8 by 16 by 16, above a dashed question mark box reading token grid, question mark.
The lesson's own patchify code with the given input shape; the resulting token grid is left blank.
2. `rope_3d` is called on tokens with D=64, using t_dim=16, h_dim=16 and w_dim=16. What happens?Apply
A code box showing tokens of shape n by T times H times W by 64 and a call to rope_3d with t_dim, h_dim and w_dim all 16, above a dashed question mark box reading what happens, question mark.
The call exactly as the question makes it, with the function's own body left out.
3. In `DividedAttentionBlock` with N=1 and grid (4, 8, 8), the time attention reshapes the tokens into which (batch, sequence, dim) layout?Apply
The DividedAttentionBlock time-attention reshape line, given N equals 1 and grid 4, 8, 8, above a dashed question mark box reading xt dot shape, question mark.
The lesson's own reshape line with the given grid; the resulting shape is left blank.
4. `TinyVideoDiT` receives a tensor of shape (2, 4, 4, 8, 8) in (N, C, T, H, W) order. What is `out.shape`?Apply
The TinyVideoDiT output projection line and forward call for an input of shape 2 by 4 by 4 by 8 by 8, above a dashed question mark box reading out dot shape, question mark.
The lesson's own output layer and the given input shape; the final output shape is left blank.

Use It

Production access in 2026 breaks down like this:

  • Sora 2 API (OpenAI): text-to-video with synchronized audio, priced at a premium.
  • Runway Gen-5 / GWM-1 (Runway): image-to-video and interactive worlds.
  • Wan-Video 2.1 / HunyuanVideo: open-source, self-hosted.
  • Cosmos / Cosmos-Drive (NVIDIA): driving simulation, open weights.
  • Genie 3: research preview, request access.

Building an interactive world-model demo: start with Wan-Video for quality, then layer on a latent-action adapter for interactivity. Building an autonomous-driving simulation: Cosmos-Drive is the 2026 open reference.

For robotics, the stack that's actually running in the wild:

  1. Language goal -> VLM (Qwen3-VL) -> high-level plan.
  2. Plan -> latent-action video model -> imagined rollout.
  3. Rollout -> inverse dynamics model -> low-level actions.
  4. Actions executed -> observation fed back into step 1.
Check: Use It0/3
1. In a VLM, video model and inverse dynamics stack, the plan is sensible and the imagined rollout looks right, but the arm's motions do not reproduce it. Which component is the best suspect?Analyze
A card listing three outcomes: the plan is sensible, the imagined rollout looks right, and the arm's actual motions do not reproduce it, above a dashed question mark box reading best suspect, question mark.
The three outcomes exactly as given; which component is the best suspect is left blank.
2. You want an interactive world-model demo that you host yourself, with quality as the priority. Which plan does the lesson recommend?Design
A card listing the requirements: an interactive world-model demo, self-hosted, with quality as the priority, above a dashed question mark box reading plan, question mark.
The requirements exactly as given; no plan is named.
3. A robot must pick up the red cup and cope with the cup being nudged mid-task. Which loop fits the lesson's stack?Design
A card stating the scenario: pick up the red cup, and cope with the cup being nudged mid-task, above a dashed question mark box reading loop that fits, question mark.
The task exactly as given; what control loop fits it is left blank.

Ship It

This lesson produces:

  • outputs/prompt-video-model-picker.md: picks between Sora 2, Runway, Wan, HunyuanVideo, and Cosmos given task, license, and latency.
  • outputs/skill-physical-plausibility-checks.md: a skill defining automated checks (object permanence, gravity, continuity) to run on any generated video before shipping.
Author's Note

The distinction that actually matters here isn't "video model" versus "world model." It's whether the thing has an action interface. Sora 2 is a phenomenal renderer with no steering wheel; Genie 3 is a much rougher renderer you can actually drive. I've seen teams get excited about Sora-quality output and then stall for months because the product needed interactivity, not just fidelity, and no amount of prompt engineering adds a steering wheel after the fact — fidelity doesn't buy you control.

If your use case needs someone to press a key and watch the world respond, start from the action-conditioned side, even if the visuals are rougher today. Visual quality catches up faster than an architecture retrofit does. Pick the wrong side of that split early and you'll be re-platforming a year in.

Exercises

  1. (Easy) Compute the token count for a 5-second 360p video at patch-t=2, patch-h=8, patch-w=8. Reason about memory for attention at this size.
  2. (Medium) Swap the divided attention block above for a full joint attention block and measure the shape and parameter count. Explain why divided attention is necessary for real video models.
  3. (Hard) Build a minimal latent-action video model: take a dataset of (frame_t, action_t, frame_{t+1}) triples (any simple 2D game), train a tiny video DiT conditioned on action embeddings, and show that different actions produce different next frames.

Key Terms

TermWhat people sayWhat it actually means
World model"Learned simulator"A model that predicts future observations given state and action
Video DiT"Spacetime transformer"Diffusion transformer with 3D patchification and divided attention
Latent action"Inferred control"Discrete or continuous action latent inferred from frame pairs; used to condition next-frame generation
Divided attention"Time then space"Two attention operations per block, one across time and one across space, that keep O(N^2) manageable
Object permanence"Things stay real"Scene property that video models must learn; classic failure mode on food, glassware
FVD"Fréchet Video Distance"Video equivalent of FID; primary visual quality metric
Inverse dynamics model"Observations to actions"Given (state, next state), output the action that connects them; closes robotics loop
Cosmos-Drive"NVIDIA driving sim"Open-weights autonomous-driving world model for RL and evaluation

Further Reading