Multimodal Generation

Foundation Models · M.Sc. AIS @ UniTN 2026

Paolo Rota, Jacopo Staiano, Federico Bartsch

{name.surname}@unitn.it

University of Trento

From understanding to generation

Where we left off

Four tools from the last two lectures, and where each one comes back when the model has to draw.

From What we had Here
Understanding: CLIP A text encoder whose embeddings live in the same space as images. It steers Stable Diffusion, and it scores the result (CLIPScore). (Sections 3, 7)
Understanding: ViT An image is a grid of patches, each turned into a token. Patches of a latent become tokens for a diffusion transformer (DiT, Sora). (Sections 3, 6)
Language block: next-token prediction One loss trains an LLM on any sequence of tokens. Turn an image into discrete tokens, and the same loss draws it. (Sections 4–5)
Training & Alignment: reward models, DPO Learn what people prefer from pairs “A beats B”. Human preference scores and win rates for images. (Section 7)

One warning we carry over

The model that steers the generator is also often the one that grades it.

  • In Understanding, CLIP failed Winoground: it could not tell “plants surrounding a lightbulb” from “a lightbulb surrounding plants”, because it treats a caption almost as a bag of words.
  • Stable Diffusion reads the prompt through a CLIP text encoder; CLIPScore grades the output with a CLIP model.

Question for the whole lecture: if the text encoder cannot see word order, can the generator draw it, and can the metric notice when it does not?

The plan: five ways to generate

From one pass (GANs) to many small steps (diffusion), to one token at a time (autoregressive), to one model that reads and draws, to a model you can act in.

1. The problem

What do we want to generate?

  • Text → image: “an astronaut riding a horse, oil painting”.
  • Text → video: short clips that stay consistent over time.
  • Editing: fill a hole (inpainting), extend the canvas (outpainting), “make it winter”.
  • Other conditions: a layout, a pose, a reference image, another modality.

Formally, we want to sample from \(p(\text{image} \mid \text{prompt})\): draw one image, and a different plausible one the next time we ask.

Why generation is hard

  • High-dimensional. A 512 × 512 RGB image is 786,432 numbers, strongly correlated with each other. Plausible images are a tiny, curved subset (a manifold) of that space: random pixel values are almost never a picture.
  • Many right answers. One prompt fits many images. The model must be able to produce all of them; their average is a blurry image.
  • Prompt fidelity. The output must actually match the text: objects, attributes, counts, relations.

Blurry averages and missing variety (mode collapse) are the two classic failures.

Activity: where will the ball be?

You train a network to predict the ball’s position after the fork, with the squared error as the loss. What does it learn to predict?

Predict +1 (or −1)

Expected loss \(= 0.5 \cdot (1-1)^2 + 0.5 \cdot (1-(-1))^2 = \mathbf{2}\)

Predict 0 (the middle)

Expected loss \(= 0.5 \cdot (0-1)^2 + 0.5 \cdot (0-(-1))^2 = \mathbf{1}\), the minimum.

From the ball to images

  • An image has thousands of “forks”: where exactly the edge of the hair falls, which way the dog looks, what texture the grass has. Averaging all of them gives a blur.
  • What we need is a model that picks one branch (a sample), and picks a different one next time with the right probability.

A generator must sample from the distribution; predicting its mean gives one blurry average.

2. Baselines

Baseline 1 — Autoencoders / VAE

  • Encode an image \(x\) into a small code \(z\), decode \(z\) back into \(\hat{x}\).
  • VAE (variational autoencoder): also push the codes towards a standard Gaussian, so that a random \(z \sim \mathcal{N}(0, I)\) decodes into a plausible image. To generate: sample \(z\), decode.
  • Problem: the reconstruction loss is a pixel-wise squared error (a Gaussian likelihood), so the decoder learns the average of the images that fit a code: blurry samples. The ball, again.

A VAE maps a sharp input through an encoder and a regularized latent space to a blurry reconstruction.

Kingma, D. P. & Welling, M. (2014). Auto-encoding variational Bayes. ICLR.

Baseline 2 — GANs

  • Two networks play a game. The generator turns noise into an image; the discriminator tries to tell generated images from real ones. The generator is trained to fool it.
  • The loss is no longer pixel-wise: a blurry image is easy to spot, so it is punished. Sharp images.
  • Problems: training is unstable (two networks chasing each other); mode collapse: the generator can fool the discriminator with a few kinds of images and ignore the rest of the data (bottom of the figure).

A GAN trains a generator against a discriminator; below, mode collapse leaves two of three real-data modes uncovered.

Goodfellow, I. et al. (2014). Generative adversarial nets. NeurIPS.

The gap

We want a generator that is, at the same time:

VAE GAN wanted
stable to train ✓ ✗ ✓
sharp samples ✗ ✓ ✓
covers all modes (diverse) ✓ ✗ ✓
conditioned on free-form text hard hard ✓

Diffusion delivers the first three, and text conditioning comes cheaply on top: the workhorse of modern generation.

3. Diffusion

DDPM — the question

  • Destroying an image is easy: add a little Gaussian noise, again and again, until only noise is left.
  • Sohl-Dickstein et al. (2015) proposed to learn to undo each small step: every step is a small denoising problem, much easier than producing an image in one shot.
  • Five years later, still no evidence that they could produce high-quality images.

Question: with the right parameterisation, can a chain of small denoising steps match GANs on sharpness, and keep a simple, stable loss?

Sohl-Dickstein, J. et al. (2015). Deep unsupervised learning using nonequilibrium thermodynamics. ICML.

Ho, J., Jain, A. & Abbeel, P. (2020). Denoising diffusion probabilistic models. NeurIPS.

The forward process: add noise

  • One step: \(q(x_t \mid x_{t-1}) = \mathcal{N}\big(x_t;\ \sqrt{1-\beta_t}\,x_{t-1},\ \beta_t I\big)\): shrink the image a little, add noise of variance \(\beta_t\).
  • Shortcut to any step \(t\): \(\ x_t = \sqrt{\bar\alpha_t}\,x_0 + \sqrt{1-\bar\alpha_t}\,\epsilon,\quad \epsilon \sim \mathcal{N}(0,I),\quad \bar\alpha_t = \prod_{s \le t} (1-\beta_s)\).
  • \(\bar\alpha_t\) = how much of the original image is left: from ≈ 1 at \(t = 0\) to ≈ 0 at \(t = T\).

Ho, J., Jain, A. & Abbeel, P. (2020). Denoising diffusion probabilistic models. NeurIPS. Eq. 2, 4; Sec. 4. Our rendering with the DDPM schedule.

DDPM — the idea: learn to predict the noise

\[ L_\text{simple} = \mathbb{E}_{x_0,\,\epsilon,\,t}\ \big\lVert\, \epsilon - \epsilon_\theta(x_t, t)\, \big\rVert^2 \]

Training: take a clean image, a random step \(t\), a random noise \(\epsilon\); mix them; ask the network which noise was added. Sampling: start from pure noise and remove a little predicted noise at each of the \(T\) steps.

Ho, J., Jain, A. & Abbeel, P. (2020). Denoising diffusion probabilistic models. NeurIPS. Eq. 14, Algorithms 1–2. Redrawn.

DDPM — a worked example: one training step

One pixel of a training image, \(x_0 = 0.8\). Sampled noise \(\epsilon = -0.5\). The network predicts \(\hat\epsilon = -0.3\). Same error, two noise levels:

Low noise, \(t = 100\) (\(\sqrt{\bar\alpha} = 0.95\), \(\sqrt{1-\bar\alpha} = 0.32\))

Noisy input: \(x_t = 0.95 \cdot 0.8 + 0.32 \cdot (-0.5) = 0.60\)

Loss: \((\epsilon - \hat\epsilon)^2 = (-0.5 + 0.3)^2 = \mathbf{0.04}\)

Implied clean pixel: \(\hat x_0 = \dfrac{x_t - 0.32\,\hat\epsilon}{0.95} = \mathbf{0.73}\) (true 0.8)

Small noise: a small error in \(\hat\epsilon\) barely moves \(\hat x_0\).

High noise, \(t = 500\) (\(\sqrt{\bar\alpha} = 0.28\), \(\sqrt{1-\bar\alpha} = 0.96\))

Noisy input: \(x_t = 0.28 \cdot 0.8 + 0.96 \cdot (-0.5) = -0.26\)

Loss: \((\epsilon - \hat\epsilon)^2 = (-0.5 + 0.3)^2 = \mathbf{0.04}\)

Implied clean pixel: \(\hat x_0 = \dfrac{x_t - 0.96\,\hat\epsilon}{0.28} = \mathbf{0.12}\) (true 0.8)

Same loss, but the guess of the image is far off: at high noise the network can only guess the average.

Diffusion uses MSE too: why is it not blurry?

  • At high noise, the network’s guess of the clean image is a blur: the average of everything compatible with \(x_t\) (the ball’s middle).
  • But sampling never jumps to that guess. Each step moves a little towards it, then adds fresh noise. The random noise picks a branch at each fork, a bit at a time.
  • After many steps the choices are made, and the remaining uncertainty is small: at low noise the average of the compatible images is a sharp image.

Each step is a small regression; the chain of steps, with fresh noise, is a sampler.

DDPM — the evidence

Generated samples, CelebA-HQ 256 × 256.
CIFAR-10, unconditional FID ↓ IS ↑
StyleGAN2 + ADA 3.26 9.74
DDPM (\(L_\text{simple}\)) 3.17 9.46
  • Best FID in the table, also better than the class-conditional models but one, with a plain MSE loss and no adversary.
  • The price: 1000 network evaluations per sample, against one for a GAN.

How it’s measured. FID (Fréchet Inception Distance): distance between the feature statistics of real and generated images, lower is better. IS (Inception Score): are the images confidently classified, and into many different classes? Higher is better. Both are explained in Section 7.

Ho, J., Jain, A. & Abbeel, P. (2020). Denoising diffusion probabilistic models. NeurIPS. Fig. 1, Table 1.

Latent diffusion — the question

  • Pixel-space diffusion runs a big U-Net on every pixel, at every one of hundreds of steps: training the best models “often consumes hundreds of GPU days” (150–1000 V100 days for ADM), and 50K samples take about 5 days on one A100.
  • Most of the bits of an image are imperceptible details. A good autoencoder can compress them away almost without visible loss.

Question: can we compress the image once with an autoencoder, and run the expensive diffusion only on the small latent?

Rombach, R. et al. (2022). High-resolution image synthesis with latent diffusion models. CVPR.

Latent diffusion — the idea

  • Stage 1: train an autoencoder (\(E\), \(D\)) to compress and reconstruct images (with perceptual and adversarial losses, so the reconstructions stay sharp). Then freeze it.
  • Stage 2: run DDPM on the latents \(z = E(x)\). The text enters the U-Net through cross-attention: the image features are the queries, the text-encoder tokens are keys and values.

Rombach, R. et al. (2022). High-resolution image synthesis with latent diffusion models. CVPR. Redrawn from Fig. 3.

Latent diffusion — the evidence

FID on ImageNet during training, for autoencoders with downsampling factor \(f\) = 1 (pixels) to 32. Lower is better.
  • \(f = 1\) (pixels, blue): slow to train. \(f = 32\) (brown): too much lost in compression, it stalls. \(f = 4\)–\(16\): the sweet spot.
  • After 2M steps, FID gap of 38 between pixel space and \(f = 8\).
  • ImageNet 256, class-conditional: LDM-4 3.60 FID vs ADM 4.59, with 271 vs 962 V100-days of training.

How it’s measured. FID (Section 7): distance between generated and real image features, lower is better. ImageNet numbers with classifier-free guidance (next slides). V100-days: training compute, number of GPUs × days.

Rombach, R. et al. (2022). High-resolution image synthesis with latent diffusion models. CVPR. Fig. 6, Tables 3, 18.

Classifier-free guidance — the question

  • Conditional diffusion models often ignore part of the prompt: the samples are diverse but loosely related to the text.
  • Classifier guidance pushed each sampling step towards images a classifier recognises as the target class. But it needs a separate classifier trained on noisy images, at every noise level.

Question: can the diffusion model guide itself, with no extra classifier?

Dhariwal, P. & Nichol, A. (2021). Diffusion models beat GANs on image synthesis. NeurIPS.

Ho, J. & Salimans, T. (2021). Classifier-free diffusion guidance. NeurIPS Workshop on Deep Generative Models and Downstream Applications.

Classifier-free guidance — the idea

  • Training: drop the prompt at random (replace it with an empty one \(\varnothing\)) for 10–20% of the examples. One network learns both \(\epsilon_\theta(x_t, c)\) and \(\epsilon_\theta(x_t, \varnothing)\).
  • Sampling: run it twice per step and extrapolate from the unconditional towards the conditional prediction:

\[ \tilde\epsilon = \epsilon_\theta(x_t,\varnothing) + s\,\big(\epsilon_\theta(x_t,c) - \epsilon_\theta(x_t,\varnothing)\big) \]

  • \(s\) = guidance scale, a number chosen by the user. \(s = 1\): plain conditional model. \(s > 1\): exaggerate what the prompt changes.

Ho, J. & Salimans, T. (2021). Classifier-free diffusion guidance. NeurIPS Workshop on Deep Generative Models and Downstream Applications. Eq. 6, Algorithms 1–2.

Classifier-free guidance — a worked example

One step, a 2-pixel “image” (illustrative numbers). Without the prompt: \(\epsilon_u = (0.20,\ 0.10)\). With the prompt: \(\epsilon_c = (0.50,\ -0.10)\). What the prompt adds: \(\epsilon_c - \epsilon_u = (0.30,\ -0.20)\).

\(s = 1\)

\((0.20, 0.10) + 1 \cdot (0.30, -0.20) = \mathbf{(0.50, -0.10)}\)

Exactly \(\epsilon_c\): no guidance.

\(s = 3\)

\((0.20, 0.10) + 3 \cdot (0.30, -0.20) = \mathbf{(1.10, -0.50)}\)

Three times the prompt’s push.

\(s = 7.5\) (Stable Diffusion default)

\((0.20, 0.10) + 7.5 \cdot (0.30, -0.20) = \mathbf{(2.45, -1.40)}\)

Far beyond anything the model predicted: a step the data never showed.

Classifier-free guidance — the evidence

Class “malamute”, ImageNet 64 × 64. Guidance increases from left (none, \(w = 0\)) to right (\(w = 3\)).

ImageNet 128 × 128, guidance \(w\) (= \(s - 1\)) 0 (none) 0.3 1.0 4.0
FID ↓ 7.27 2.43 7.86 21.53
IS ↑ 82.45 158.47 297.98 421.03

More guidance: more typical, more alike images. FID first improves, then worsens; IS keeps rising.

How it’s measured. FID rewards realism and variety, so too much guidance (less variety) hurts it. IS rewards confidently classified images of many classes, so it keeps rising with guidance. Both in Section 7.

Ho, J. & Salimans, T. (2021). Classifier-free diffusion guidance. NeurIPS Workshop on Deep Generative Models and Downstream Applications. Fig. 1, Table 2.

DiT — the question

  • Every diffusion model so far uses a U-Net, a convolutional architecture from image segmentation.
  • Language and vision understanding moved to transformers, whose quality improves predictably with compute.

Question: is the U-Net necessary? If we replace it with a plain transformer over latent patches, does generation scale like the rest of the field?

Peebles, W. & Xie, S. (2023). Scalable diffusion models with transformers. ICCV.

DiT — the idea and the evidence

  • Idea: take the Stable Diffusion latent (32 × 32 × 4 for a 256 × 256 image), cut it into \(p \times p\) patches as a ViT does, run a plain transformer, predict the noise. The time step \(t\) and the class enter by scaling and shifting the layer norms (adaLN-Zero, gates initialised to 0).
  • Scale: four sizes (S, B, L, XL) × three patch sizes (8, 4, 2). Smaller patches = more tokens = more compute.

Left: FID after 400K training steps; each colour is a model size, bubble area = compute per forward pass (Gflops), darker = smaller patches. Right: the largest DiT with guidance vs earlier diffusion models.

How it’s measured. FID-50K on ImageNet 256 × 256 (50,000 samples; Section 7), lower is better. Gflops: billions of floating-point operations for one forward pass of the network.

Peebles, W. & Xie, S. (2023). Scalable diffusion models with transformers. ICCV. Fig. 2, Table 2.

4. Autoregressive: images as tokens

Images as tokens: VQ-VAE and VQGAN

Quantisation: each vector of the encoder’s grid is replaced by the nearest entry of a learned codebook; the image becomes a grid of integers, like word ids. A transformer then models them with the same next-token loss as an LLM.

van den Oord, A., Vinyals, O. & Kavukcuoglu, K. (2017). Neural discrete representation learning. NeurIPS.

Esser, P., Rombach, R. & Ommer, B. (2021). Taming transformers for high-resolution image synthesis. CVPR.

VQ — a worked example

Codebook (2-D for the example): \(e_0 = (0,0)\), \(e_1 = (1,0)\), \(e_2 = (0,1)\), \(e_3 = (1,1)\). Encoder output for one cell: \(z = (0.8, 0.3)\).

1 · nearest code

\(\lVert z - e_0\rVert^2 = 0.64 + 0.09 = 0.73\)

\(\lVert z - e_1\rVert^2 = 0.04 + 0.09 = \mathbf{0.13}\)

\(\lVert z - e_2\rVert^2 = 0.64 + 0.49 = 1.13\)

\(\lVert z - e_3\rVert^2 = 0.04 + 0.49 = 0.53\)

→ token 1; the decoder receives \(e_1 = (1, 0)\).

2 · move the code

Codebook loss: \(\lVert \text{sg}[z] - e_1 \rVert^2 = \mathbf{0.13}\)

sg = stop-gradient: \(z\) is treated as a constant, so only \(e_1\) moves, towards \((0.8, 0.3)\).

3 · commit the encoder

Commitment loss: \(\beta \lVert z - \text{sg}[e_1] \rVert^2 = 0.25 \cdot 0.13 = \mathbf{0.03}\)

Only the encoder moves, towards \(e_1\), so it does not drift away from the codebook. \(\beta = 0.25\) as in VQ-VAE.

van den Oord, A., Vinyals, O. & Kavukcuoglu, K. (2017). Neural discrete representation learning. NeurIPS. Eq. 1–3.

DALL·E and Parti — scale the transformer

  • DALL·E (2021): up to 256 text tokens followed by 1,024 image tokens (a 32 × 32 grid, 8,192 codes), modelled as one stream by a 12B transformer trained on 250M image–text pairs.
  • Parti (2022): the same recipe with a better tokenizer (ViT-VQGAN) and an encoder–decoder transformer, at 350M → 750M → 3B → 20B parameters. Same prompt, bigger model:

“A portrait photo of a kangaroo wearing an orange hoodie and blue sunglasses standing on the grass in front of the Sydney Opera House holding a sign on the chest that says Welcome Friends!” Left to right: 350M, 750M, 3B, 20B.

MS-COCO zero-shot FID: 14.10 → 10.71 → 8.10 → 7.23. Only the 20B model writes the sign correctly.

How it’s measured. Zero-shot FID on MS-COCO: generate one image per caption of the validation set without training on COCO, compare with the real COCO images (Section 7). Lower is better.

Ramesh, A. et al. (2021). Zero-shot text-to-image generation. ICML. Sec. 2.

Yu, J. et al. (2022). Scaling autoregressive models for content-rich text-to-image generation. TMLR. Fig. 9, Fig. 10, Table 5.

Activity: count the forward passes

A 1024 × 1024 image. Option A: autoregressive, a tokenizer with downsampling \(f = 16\), one token per forward pass. Option B: latent diffusion with 50 sampling steps.

How many sequential forward passes of the big network does each need?

1 minute, individually.

A: \((1024 / 16)^2 =\) 4,096 passes, one per token.   B: 50 passes (100 with classifier-free guidance), each over the whole latent.

Diffusion vs autoregressive

Diffusion Autoregressive
Image is continuous (pixels or a latent) discrete tokens from a codebook
One sample 20–1000 denoising steps over the whole image one forward pass per token, in order
Loss MSE on the noise next-token cross-entropy
Detail no quantisation loss the codebook limits fine detail
Reuses the LLM toolbox partly (DiT) fully: same loss, same code, same scaling
Typical systems Stable Diffusion, DiT, Sora DALL·E, Parti, Chameleon

The next section asks: can one model have both, and also read images?

5. Unified understanding + generation

Why one model?

  • The understanding lecture ended with VLMs that read images and write text. The generators of this lecture write images from text. Two separate systems.
  • A single model could edit an image in a conversation, explain what it is drawing, or interleave text and pictures in one answer.

Question: what does the image look like inside such a model: discrete tokens, continuous latents, or both?

Three ways to unify

Chameleon Team (2024). Chameleon: mixed-modal early-fusion foundation models. arXiv.

Zhou, C. et al. (2025). Transfusion: predict the next token and diffuse images with one multi-modal model. ICLR.

Wu, C. et al. (2025). Janus: decoupling visual encoding for unified multimodal understanding and generation. CVPR.

Transfusion — the evidence

Text tokens (blue) are predicted one by one; the image patches between <BOI> and <EOI> (red) are denoised. Against a Chameleon-style model trained by the authors on the same data (7B, 0.5T tokens):

7B, 0.5T tokens COCO FID ↓ compute needed to match Chameleon’s FID
Chameleon-style (discrete VQ tokens) 29.6 1×
Transfusion (continuous patches, diffusion loss) 16.8 ≈ 1/34

How it’s measured. FID on MS-COCO captions (Section 7), lower is better. Parity FLOP ratio: the fraction of Chameleon’s training compute at which Transfusion reaches the same score (0.029 for FID).

Zhou, C. et al. (2025). Transfusion: predict the next token and diffuse images with one multi-modal model. ICLR. Fig. 1, Table 3.

Janus — the evidence

Ablation: same 1.3B model, same data; only the visual encoders and the training tasks change.

Janus 1.3B, ablation trained on POPE ↑ MMBench ↑ COCO FID ↓
one shared VQ tokenizer both 60.1 35.0 8.72
SigLIP + VQ (Janus) both 87.0 69.4 8.53
SigLIP only understanding 85.9 70.6 –
VQ only generation – – 8.92

Decoupled ≈ the specialists on both sides. Text-to-image: GenEval 0.61, vs SDXL 0.55.

How it’s measured. POPE: yes/no questions “is there a [object]?”, accuracy, catches hallucinated objects (Understanding lecture). MMBench: multiple-choice questions over 20 abilities, accuracy. COCO FID: realism of generated images (Section 7). GenEval: fraction of generated images that contain exactly the requested objects, counts, colours and positions (Section 7).

Wu, C. et al. (2025). Janus: decoupling visual encoding for unified multimodal understanding and generation. CVPR. Tables 3, 5.

6. World models

What is a world model?

A world model predicts what the world will look like next given an action. A video generator only has to produce a plausible clip; a world model must respond to what you do.

Ha, D. & Schmidhuber, J. (2018). Recurrent world models facilitate policy evolution. NeurIPS.

Sora — video generation as world simulation

  • The recipe, from a technical report with no model details: a network compresses video in space and time; the latent is cut into spacetime patches that act as transformer tokens; a diffusion transformer (DiT) denoises them. Trained on videos of any length, resolution and aspect ratio.
  • The claim: “emerging simulation capabilities” from scale alone: 3D consistency, objects that persist when occluded (“often, though not always”), simple interactions (a bite stays in a burger).
  • The limits, in the same report: it “does not accurately model the physics of many basic interactions, like glass shattering”.

A model that looks physically right in a clip is not yet a simulator: you cannot act in it, and nobody measured its physics.

Brooks, T. et al. (2024). Video generation models as world simulators. OpenAI technical report.

Genie — the question

  • A world model needs actions: “what happens if I press jump?”. Video with action labels is rare (game logs, robot logs).
  • The internet has hundreds of thousands of hours of gameplay video, with no record of which buttons were pressed.

Question: can a model learn what the actions are and what they do from unlabelled video alone, and then let you play?

Bruce, J. et al. (2024). Genie: generative interactive environments. ICML.

Genie — the idea: actions without labels

Bruce, J. et al. (2024). Genie: generative interactive environments. ICML. Redrawn from Fig. 2, 7.

Genie — the evidence

Each pair: the prompt image (left) and the frame after taking the same latent action several times (right). Rows: images from a text-to-image model, hand-drawn sketches, real photos.

Never trained on sketches or photos, yet the character moves. A 2.5B Genie trained on robot videos (no actions) learns consistent latent actions such as “down”, “up”, “left”.

Bruce, J. et al. (2024). Genie: generative interactive environments. ICML. Fig. 9, 12.

V-JEPA 2 — plan without generating pixels

  • Stage 1: self-supervised video encoder (1B), trained to predict masked parts of videos in embedding space (no pixels), on more than 1M hours of video.
  • Stage 2: freeze it; train an action-conditioned predictor on 62 hours of unlabelled robot videos (Droid).
  • Zero-shot on Franka arms in two new labs, from a goal image: pick-and-place 80% / 65% (cup / box) vs 15% / 10% for Octo; 16 s to plan one action vs 4 min for Cosmos.

Assran, M. et al. (2025). V-JEPA 2: self-supervised video models enable understanding, prediction and planning. arXiv. Redrawn from Fig. 7; Tables 2, 3.

How big? How open?

Model Year Size Weights Used for
Genie (DeepMind) 2024 11B ✗ 2D platformer worlds from video
Sora / Sora 2 (OpenAI) 2024 / 25 undisclosed ✗ (API shut down 2026) text-to-video
Genie 3 (DeepMind) 2025 undisclosed ✗ (research preview) real-time 720p worlds
Oasis (Decart & Etched) 2024 500M ✓ MIT real-time playable Minecraft-like game
Muse / WHAM (Microsoft) 2025 1.6B ✓ research-only licence gameplay ideation
V-JEPA 2 (Meta) 2025 1B encoder + 300M predictor ✓ robot planning
Cosmos Predict 1–2.5 (NVIDIA) 2025 2–14B ✓ NVIDIA Open Model License physical-AI simulation

The open-weight frontier is physical AI and games. Real-time interactive models are kept small (0.5–1.6B) to reach the frame rate.

Kanervisto, A. et al. (2025). World and human action models towards gameplay ideation. Nature. · NVIDIA (2025). Cosmos world foundation model platform for physical AI. arXiv.

Decart & Etched (2024). Oasis: a universe in a transformer. Blog and model card. · Parker-Holder, J. & Fruchter, S. (2025). Genie 3: a new frontier for world models. Google DeepMind blog.

What are world models good for?

  1. Neural game engine: playable frames straight from actions, no hand-coded engine. Oasis, Muse, Genie 3.
  2. Simulator and synthetic data: train robots and self-driving policies in generated worlds. Cosmos, Genie.
  3. Planning “in imagination”: a policy tries out futures inside the model to choose actions. V-JEPA 2-AC, DreamerV3.

Mode 3 is the bridge to the VLA lecture: the world model becomes the simulator a robot policy plans in.

7. Evaluation: how we score a generator

Task metrics

Question Metric: what it measures Needs
Do the images look like the real data? FID ↓: distance between feature statistics real images, ≥ 10K samples → coming up
Is each image recognisable, the set varied? Inception Score ↑ no real images → coming up
Quality or missing variety? Precision / Recall ↑ real images → coming up
Does it match the prompt? CLIPScore ↑, GenEval ↑ prompts only → coming up
Do people prefer it? win rate, Elo; learned preference scores human votes → coming up
Does the video move right? FVD ↓ real videos → coming up

FID — Fréchet Inception Distance ↓

Compute. Embed real and generated images with Inception-v3 (2048-d features); fit a Gaussian to each set, then measure the distance between them:

\[ \text{FID} = \underbrace{\lVert \mu_r - \mu_g \rVert^2}_{\text{means: is the average image right?}} + \underbrace{\mathrm{Tr}\!\left(\Sigma_r + \Sigma_g - 2(\Sigma_r \Sigma_g)^{1/2}\right)}_{\text{covariances: same spread \& correlations?}} \]

  • The first term is the gap between the two average feature vectors \(\mu_r, \mu_g\).
  • The second term compares the shape of the two feature clouds: \(\mathrm{Tr}\) (the trace) sums the diagonal of a \(2048 \times 2048\) matrix into one number, which is \(0\) only when the covariances match (\(\Sigma_r = \Sigma_g\)). It reacts to samples with too little spread (all alike, or mode collapse).

Measures. How close the real and generated feature distributions are: fidelity and diversity in one number. Lower = better.

✓ grows steadily with noise, blur and other corruptions (unlike IS); one number; the field standard.    ✗ assumes Gaussian features; depends on the number of samples (standard: 50K); Inception is an ImageNet classifier, so FID can improve without better images; ignores the prompt.

Heusel, M. et al. (2017). GANs trained by a two time-scale update rule converge to a local Nash equilibrium. NeurIPS. Eq. 6, Fig. 3.

Chong, M. J. & Forsyth, D. (2020). Effectively unbiased FID and Inception Score and where to find them. CVPR.

Kynkäänniemi, T. et al. (2023). The role of ImageNet classes in Fréchet Inception Distance. ICLR.

Activity: rank the generators by FID

In one dimension FID is \((\mu_r - \mu_g)^2 + (\sigma_r - \sigma_g)^2\). Real data: \(\mu = 0\), \(\sigma = 1\). Which generator is best? What does the score tell you about what went wrong?

C is the worst (0.81). A and B tie at 0.25, for completely different reasons: one number cannot tell too narrow from shifted.

Inception Score (IS) ↑

Compute. Run each generated image through an Inception classifier and ask two things at once: is this image recognisable, and is the whole set varied?

\[ \text{IS} = \exp\!\Big( \mathbb{E}_x\, \mathrm{KL}\big(\underbrace{p(y\mid x)}_{\text{per image: sharp?}}\,\Vert\,\underbrace{p(y)}_{\text{overall: diverse?}}\big) \Big) \]

  • \(p(y\mid x)\): the classifier’s label distribution for one image; peaked when the image clearly shows one recognisable object.
  • \(p(y)=\mathbb{E}_x[p(y\mid x)]\): the average label distribution over all generated images; spread out when the model covers many classes.
  • The KL is large exactly when each image is confident and the set is varied; \(\exp\) rescales it. Range: from \(1\) to the number of classes.

Measures. “Recognisable objects, and many kinds of them.” It never looks at real images. Higher = better.

✓ needs no real data; cheap; historic baseline.    ✗ only meaningful for ImageNet-like classes; blind to variety within a class; easy to game; no text alignment.

Salimans, T. et al. (2016). Improved techniques for training GANs. NeurIPS.

Precision & Recall for generators ↑

  • Precision = quality: what fraction of generated images fall inside the region covered by real ones?
  • Recall = coverage: what fraction of real images fall inside the region covered by generated ones?
  • The region of a set is the union of small balls around its points in feature space (VGG-16 features); each ball’s radius is the distance to the point’s \(k\)-th nearest neighbour (\(k = 3\)).

✓ says whether the problem is quality or missing variety.    ✗ depends on the feature extractor and on \(k\); outliers inflate the regions (Density & Coverage fix this).

Kynkäänniemi, T. et al. (2019). Improved precision and recall metric for assessing generative models. NeurIPS. Sec. 2.

Naeem, M. F. et al. (2020). Reliable fidelity and diversity metrics for generative models. ICML.

CLIPScore: does it match the prompt? ↑

Compute. Embed the image and the prompt with CLIP; take the cosine similarity, clip negatives to 0, rescale:

\[ \text{CLIPScore} = w\cdot\max\!\big(\cos(E_\text{img},\,E_\text{txt}),\,0\big),\qquad w = 2.5 \]

\(w = 2.5\) only stretches the observed cosines (roughly 0 to 0.4) towards \([0, 1]\). Born for captioning (score a caption against its image, with no reference captions), reused for text-to-image.

Measures. How well the image matches the prompt, as CLIP sees it. Higher = better.

✓ needs no reference image or caption; fast; the default for prompt adherence.    ✗ inherits CLIP’s blind spots: counting, positions, which attribute goes with which object (the opening warning).

Hessel, J. et al. (2021). CLIPScore: a reference-free evaluation metric for image captioning. EMNLP. Sec. 3.

GenEval: check the objects ↑

Compute. Prompts built from COCO object names, in six tasks. An object detector finds the objects in each generated image; positions come from the boxes, colours from CLIP on a crop. An image scores 1 only if everything in the prompt is right.

Single object Two objects Counting Colours Position Attribute binding Overall
SD v1.5 0.97 0.38 0.35 0.76 0.04 0.06 0.43
SD v2.1 0.98 0.51 0.44 0.85 0.07 0.17 0.50
SDXL 0.98 0.74 0.39 0.85 0.15 0.23 0.55
IF-XL 0.97 0.74 0.66 0.81 0.13 0.35 0.61

How it’s measured. Fraction of images judged correct, per task (e.g. position: “a dog left of a cup”; attribute binding: “a red car and a blue bench”); Overall = mean of the six. Higher is better. Detector: Mask2Former trained on COCO.

Ghosh, D., Hajishirzi, H. & Schmidt, L. (2023). GenEval: an object-focused framework for evaluating text-to-image alignment. NeurIPS Datasets & Benchmarks. Table 2.

Human preference ↑

Idea. Skip the proxies and ask people. “Rate this image 1–10” is noisy and drifts between raters, so we ask the easy question: which of these two is better?

Compute. Same prompt, an image from model A and one from model B; a person picks the winner. Repeat over many prompts, people and pairs, then aggregate:

  • Win rate: the % of duels a model wins (“A beats B 63% of the time”).
  • Elo / Bradley–Terry: turn all the pairwise wins into one rating per model, as in chess: beating a strong opponent is worth more than beating a weak one. Public text-to-image arenas rank models this way.

Learned stand-ins. Train a model to predict the human vote, as the reward model of the alignment lecture: ImageReward (137K expert comparisons), PickScore (500K+ choices by real users), HPSv2 (798K choices).

✓ captures what automatic metrics miss: aesthetics, realism, prompt correctness at once.    ✗ expensive, slow, noisy, prompt-set dependent; learned stand-ins can be hacked like any reward model.

Xu, J. et al. (2023). ImageReward: learning and evaluating human preferences for text-to-image generation. NeurIPS.

Kirstain, Y. et al. (2023). Pick-a-Pic: an open dataset of user preferences for text-to-image generation. NeurIPS.

Wu, X. et al. (2023). Human preference score v2: a solid benchmark for evaluating human preferences of text-to-image synthesis. arXiv.

FVD — Fréchet Video Distance ↓

Idea. FID scores single images. Run it on a video and it judges each frame on its own, so a clip that flickers, jumps, or moves unnaturally can still look fine to it. FVD scores whole clips, so the motion counts too.

Compute. Same formula as FID; only the feature extractor changes. FVD reads a short clip with I3D, a network trained to recognise actions in videos (Kinetics-400), whose features capture movement as well as appearance:

\[ \text{FVD} = \underbrace{\lVert \mu_r - \mu_g \rVert^2}_{\text{average clip: right look and motion?}} + \underbrace{\mathrm{Tr}\!\left(\Sigma_r + \Sigma_g - 2(\Sigma_r \Sigma_g)^{1/2}\right)}_{\text{same spread of clips?}} \]

Measures. How good each frame looks and whether the motion across frames is plausible. Lower = better.

✓ the standard for video; penalises temporal artefacts FID cannot see.    ✗ sensitive to how clips are sampled (frame rate, offsets) and resized; I3D features weigh per-frame look more than motion; inherits FID’s Gaussian assumption.

Unterthiner, T. et al. (2018). Towards accurate generative models of video: a new metric & challenges. arXiv. Sec. 4, Table 1.

Skorokhodov, I., Tulyakov, S. & Elhoseiny, M. (2022). StyleGAN-V: a continuous video generator with the price, image quality and perks of StyleGAN2. CVPR. App. C.

Ge, S. et al. (2024). On the content bias in Fréchet video distance. CVPR.

A caveat on metrics

Metric Sees Misses
FID how far the generated features are from the real ones the prompt; what went wrong
IS recognisable objects of many classes real data; variety within a class
Precision / Recall quality and coverage, separately the prompt; aesthetics
CLIPScore broad prompt alignment counting, positions, word order
GenEval objects, counts, colours, positions style, realism
Human preference overall preference it is expensive, noisy, prompt-set dependent

No single metric captures generation quality. Report one for realism, one for diversity, one for prompt adherence, and check with people.

8. Demo

Demo: the diffusers library

diffusers (Hugging Face) is to diffusion models what transformers is to LLMs: a pipeline object bundles the text encoder, the denoiser, the VAE decoder and the sampler (the scheduler), and pipe(prompt) runs the whole chain of the LDM slide.

  • from_pretrained(...) downloads the weights of every component.
  • num_inference_steps: how many denoising steps the sampler takes (50 by default); training still uses \(T = 1000\) noise levels.
  • guidance_scale: the \(s\) of classifier-free guidance.

Demo: enrich the prompt (lab VLM)

import os
from openai import OpenAI

client = OpenAI(
    base_url=os.environ.get("VLLM_BASE_URL", "http://LAB-HOST:8000/v1"),  # the lab vLLM endpoint
    api_key=os.environ.get("VLLM_API_KEY", "EMPTY"),
)

msg = [{"role": "user", "content":
        "Expand into a vivid text-to-image prompt, one sentence: 'an astronaut and a horse'."}]
prompt = client.chat.completions.create(
    model="Qwen/Qwen2.5-VL-7B-Instruct", messages=msg, max_tokens=80
).choices[0].message.content
print(prompt)

Demo: generate and sweep the guidance

import torch
from diffusers import StableDiffusionPipeline

pipe = StableDiffusionPipeline.from_pretrained(
    "stable-diffusion-v1-5/stable-diffusion-v1-5",   # SD v1.5: CLIP text encoder + U-Net + VAE
    torch_dtype=torch.float16
).to("cuda")

for s in [1.0, 3.0, 7.5, 15.0]:                  # s = 1: no guidance; 7.5: the default
    g = torch.Generator("cuda").manual_seed(0)   # same starting noise x_T for every s
    image = pipe(prompt, guidance_scale=s, num_inference_steps=30, generator=g).images[0]
    image.save(f"out_s{s}.png")

Predict before running: which \(s\) gives the most faithful image? The most varied? The most “over-cooked”?

Closing: what does each family give?

Back to the opening table

Family How it samples What it gives What it struggles with
VAE / GAN one pass fast; sharp (GAN) blur (VAE); instability, mode collapse (GAN)
Diffusion many small denoising steps sharp and diverse; guidance as a dial slow sampling; prompt binding through CLIP
Autoregressive one token at a time the LLM toolbox, unchanged thousands of sequential steps; codebook detail
Unified text tokens + image tokens or latents read and draw in one model the two tasks compete for the same weights
World models next frame given an action an environment to act and plan in long-horizon consistency, physics

The CLIP question from the start: the text encoder steers, CLIPScore grades: check binding with something that is not CLIP.

Discussion questions

  1. Diffusion vs autoregressive image generation: what does each buy you, and when would you pick which?
  2. Why is a unified understand-and-generate model attractive, and what makes it hard to train?
  3. What does a world model need for a robot, compared with a nice video? Why are the real-time ones small?
  4. You improved FID but GenEval did not move. What did your model learn?

Exit ticket: one prompt you expect a text-to-image model to get wrong, and why.

Next: with all this power, what about bias, safety and responsibility?

Questions?