Quy-Anh Dang

Quy-Anh Dang

Researcher, Knovel Engineering


← All work

Imagine Before You Act: World Models — Part 5: Generative World Models: Playable Video

November 21, 2026 · 9 min read · World Models, Diffusion Models, Machine Learning

In 2024, researchers showed a neural network running the 1993 shooter Doom, with no game engine underneath. Every frame was generated by a diffusion model from the previous frames and the player's keypresses, at 20 frames per second (GameNGen, Valevski et al.). The same year, DIAMOND trained Atari agents entirely inside a diffusion world model, and Genie learned playable 2-D worlds from internet videos with no action labels at all.

These are the second meaning of "world model" from Part 0: a generative simulator whose output is the observation itself, pixels you could show to a person. In the four-box picture, this part is all about decode.

By the end you'll know:

  1. why predicting the next frame with a regression loss gives blur, and why diffusion fixes it,
  2. how an action-conditioned diffusion model works (EDM, as in DIAMOND),
  3. why playing a model for many steps makes it drift, and the noisy context trick that helps,
  4. where Genie, Cosmos and friends fit.

We build a tiny version of each idea on GapWorld with the fly from Part 4. The fly's random flight makes the next frame genuinely uncertain, which turns out to be the whole point.

1. Why regression blurs#

The simplest next-frame model is a network trained with mean squared error: given the last frames and the action, output the next frame. MSE has a precise meaning: the best prediction under it is the average of all possible next frames.

When the future is certain, the average is the future, and all is well. The puck in GapWorld is deterministic given the past and the push. The fly is not: from where it is now, it could be a few pixels up, down, left or right. The average of all those possible frames is a faint orange smear, a fly that is everywhere a little bit and nowhere fully. Repeat for several steps and the smear spreads until it fades away.

ELI5: ask a hundred people to draw where a fly will be in a second, and average the drawings. You get a blurry cloud. Nobody drew a cloud, and no real fly looks like one.

2. Diffusion: draw one future, sharply#

A diffusion model doesn't predict the next frame directly. It learns to remove noise: given a noisy version of the next frame (plus the past frames and the action), predict the clean one. To generate, start from pure noise and denoise step by step. Each run starts from different noise and ends in a different, but sharp and plausible, frame. Instead of the average of all futures, you get one sample from them.

Our model follows DIAMOND (Alonso et al., 2024), which uses the EDM formulation (Karras et al., 2022):

  • Input: the noisy next frame, plus the last 4 real frames stacked as extra channels.
  • Conditioning: the noise level and the action (the push), fed into every block of a small U-Net (4.1 million parameters) through FiLM layers (a learned per-channel scale and shift).
  • Training: pick a random noise level , add that much noise to the true next frame, and train the network to recover it. EDM's preconditioning scales inputs and outputs so the network's job has a similar size at every noise level.
  • Sampling: 10 denoising steps with Heun's method, from down to .

We train three next-frame models on the same 3,000 episodes (153,000 frames), all with the same U-Net:

ModelWhat it is
Regression (MSE)the U-Net predicts the next frame directly
Diffusionthe same U-Net as an EDM denoiser, trained on clean past frames
Diffusion + noisy contextthe same, but during training random noise is added to the past frames, and the model is told how much (Section 3)

Does the diffusion model really draw different futures? Here we give it the same four starting frames and the same pushes four times, and look 8 steps ahead:

The last real frame, the real frame 8 steps later, and four futures sampled from the diffusion model. In all four samples the puck is at the same place as in the real frame. The fly is sharp in each one, but in a different place every time.

The puck is in the same place in every sample, and it matches the real frame: its motion is determined by the pushes, and the model knows it. The fly is somewhere different each time, and none of the four matches the real one. That's correct. Nobody can know where the fly will be, so a good model shouldn't pretend to. It should draw a plausible fly, sharply. The model has learned which parts of the world are predictable and which aren't.

3. Playing the model: drift#

To play a world model, you give it a few real frames to start, then feed its own generated frames back in as the past frames for the next step, for as long as you like. This is an autoregressive rollout, and it has the same problem as Part 1's compounding errors, in pixel form.

Here's the trap. During training, the past frames are always real. During play, they're generated, with small artefacts the model has never seen as input. It reacts to those artefacts slightly wrongly, the next frame has slightly bigger artefacts, and so on. The quality slowly drifts away from anything in the training data.

GameNGen's fix is simple: during training, add Gaussian noise of a random strength to the past frames, and tell the model the noise strength as an extra input. The model learns to treat its inputs as unreliable and to correct small errors instead of copying them. At play time, a small fixed amount of noise is added to the past frames (we used 0.1), so generated past frames look like the slightly noisy inputs the model was trained on.

Here are all three models played for 60 steps from the same four real frames, with the same pushes:

Frames from 60-step rollouts. Real: the puck moves down and left while the fly wanders. Regression: the puck follows the real one, but the fly fades to a smear by step 3 and is gone afterwards. Diffusion: the fly is sharp at first but has vanished by step 31. Diffusion with noisy context: a sharp fly and puck through step 60.

And the same thing measured over 32 rollouts. We find the puck in each generated frame (the centre of its blue pixels) and compare it with the real position, and we count the clearly orange pixels to see whether a sharp fly is still there:

Left: median puck position error over 60 generated steps. Regression rises to about 0.03. Both diffusion models rise faster, to between 0.03 and 0.06. Right: clearly orange pixels per frame. Real frames have about 16.5. Regression has zero from the first step. Plain diffusion drops from 16 to about 14. Diffusion with noisy context stays at the real level.

Three results, one for each model:

Regression never draws a fly. From the very first generated frame it has zero clearly orange pixels (real frames have about 16.5). The smear in the first frames is the blur from Section 1, and then it fades to nothing. The puck, on the other hand, it tracks best of all three: a median error of 0.03 after 60 steps, less than the puck's radius (0.04). For the deterministic part of the world, predicting the average is exactly right, and there's no sampling noise to add error.

Plain diffusion draws a sharp fly, and then sometimes loses it. The average count of orange pixels slides from 16 to about 14, because in some rollouts the fly disappears and never comes back, as in the example above by step 31. Once a generated frame has a faint fly, the next frame, generated from it, has a fainter one. That's drift.

Noisy context keeps the fly alive. With GameNGen's trick, the orange-pixel count stays at the real level for all 60 steps (17.1 at the end). A model trained on corrupted past frames has learned to repair a faint fly back into a solid one instead of copying the fading.

On the puck, the result is less tidy, and worth being honest about. Both diffusion models place the puck worse than regression (median error 0.04 to 0.06 at step 60 against 0.03), and noisy context helped only a little (a mean error over the last 20 steps of 0.077 against 0.094, with a quarter of rollouts off by more than 0.1 in both). Sampling adds a little randomness to everything it draws, including things that should be exact, and those small errors accumulate. Sharp is not the same as accurate. This is why video world models are judged on more than how good single frames look, a point Part 7 comes back to.

4. The bigger picture#

Our models are tiny, but they share the design of real systems:

  • GameNGen (2024) fine-tuned Stable Diffusion 1.4 to generate Doom, conditioned on 64 past frames and actions, with noise augmentation of the context. Human raters could barely tell short clips from the real game.
  • DIAMOND (2024) trained agents on Atari games entirely inside an EDM diffusion world model, and later built a playable model of the game Counter-Strike.
  • Genie (Bruce et al., 2024) learned from internet videos of 2-D platformer games, with no action labels. It learns a small set of latent actions ("whatever changed between these frames that the frames themselves don't explain") and then lets a person control generated worlds with them. Genie 2 and 3 extended this to 3-D worlds that stay consistent for minutes.
  • Cosmos (NVIDIA, 2025) is a family of open world foundation models trained on millions of hours of video, meant to be fine-tuned into simulators for robots and self-driving cars.
  • Oasis and similar projects generate playable Minecraft-like worlds in real time.

All of them share the challenges our miniature shows: drift over long rollouts, memory (a model that only sees the last few frames forgets what's behind you), and physical consistency (sharp frames aren't necessarily correct frames). Longer contexts, memory mechanisms, and training tricks like noise augmentation help. None of these is a full solution yet.

What about using them for decisions? A generative simulator can train agents (DIAMOND), evaluate policies cheaply, or let people explore. But Part 4's question still applies: to plan, you need the right information, not every pixel. Many robotics systems now combine a generative model for data and simulation with a compact latent model for planning.

5. Honest limits#

  • Our world is simple. GapWorld has a fixed background and two moving objects. Real video has lighting, texture, occlusion and thousands of moving parts.
  • Short contexts. Our models see only the last 4 frames, and anything older is forgotten. GapWorld needs little memory, because everything is always on screen. In a 3-D world, turning around and back again is enough to forget what was there.
  • One run each. As in the other parts, each model was trained once, and the drift curves come from 32 rollouts. The large effects (no fly at all under regression, the fly fading under plain diffusion) are clear. The differences in puck error between the two diffusion models are not.

6. In code#

The heart of the diffusion world model is the EDM denoiser (preconditioning) and the training step (from part5_train.py):

class Denoiser(nn.Module):
    """EDM preconditioning (Karras et al., 2022), as used by DIAMOND."""

    def __init__(self):
        super().__init__()
        self.net = UNet()

    def forward(self, x_noisy, sigma, ctx, action, ctx_noise):
        s = sigma[:, None, None, None]
        c_skip = SIGMA_DATA ** 2 / (s ** 2 + SIGMA_DATA ** 2)
        c_out = s * SIGMA_DATA / (s ** 2 + SIGMA_DATA ** 2).sqrt()
        c_in = 1 / (s ** 2 + SIGMA_DATA ** 2).sqrt()
        return c_skip * x_noisy + c_out * self.net(c_in * x_noisy, ctx, sigma.log() / 4, action, ctx_noise)

# one training step: ctx = the 4 past frames, target = the real next frame, act = the push
if kind == "diff_aug":                       # GameNGen: corrupt the context, and tell the model how much
    cn = torch.rand(64, device=DEV) * 0.7
    ctx = ctx + cn[:, None, None, None] * torch.randn_like(ctx)
sigma = (torch.randn(64, device=DEV) * 1.2 - 0.4).exp()                 # random noise level
noisy = target + sigma[:, None, None, None] * torch.randn_like(target)
pred = model(noisy, sigma, ctx, act, cn)
w = (sigma ** 2 + SIGMA_DATA ** 2) / (sigma * SIGMA_DATA) ** 2          # EDM loss weighting
loss = (w[:, None, None, None] * (pred - target) ** 2).mean()

Recap#

  • A generative world model predicts the next observation itself, from past frames and an action, so you can play it.
  • A regression model predicts the average future: fine for deterministic parts (the puck), a fading smear for random ones (the fly).
  • A diffusion model draws one sharp sample from the possible futures. Different samples give different, plausible flies.
  • Playing a model feeds it its own outputs, so small artefacts compound: our plain diffusion model gradually lost the fly. Noising the context during training (GameNGen) kept it at the real level for all 60 steps.
  • Sharp is not accurate. Both diffusion models placed the puck worse than plain regression did.
  • Real systems (GameNGen, DIAMOND, Genie, Cosmos) use the same ideas at vastly larger scale, and still struggle with long-horizon memory and physical consistency.

Next up — Part 6: Do Language Models Have World Models? The third meaning of "world model": nobody asks for one, but the model builds it anyway. We train a small transformer on Othello move sequences and look inside it for the board.


© 2026 Quy-Anh Dang. All rights reserved.