Multimodal Models·Question 38 of 67Advanced

How do text-to-video models like Veo or Sora work, and why is video generation so much more expensive than image generation?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Same recipe as latent image diffusion, lifted one dimension: compress the video into a spatiotemporal latent, cut it into spacetime patches, and run a diffusion transformer, now usually trained with flow matching, over all of them at once. The expense is token count, multiplied by attention's quadratic cost, multiplied again by sampling steps.

Full worked answer with diagram

Same recipe as latent image diffusion, lifted one dimension: compress the video into a spatiotemporal latent, cut it into spacetime patches, and run a diffusion transformer, now usually trained with flow matching, over all of them at once. The expense is token count, multiplied by attention's quadratic cost, multiplied again by sampling steps.

The components:

  • 3D video VAE. Open models such as HunyuanVideo and Wan compress roughly ~4x in time and ~8x8 in space, usually causally in time so the first frame is encoded on its own. That lets one model train on images (one-frame videos) and video together, which matters because well-captioned video is scarce next to images.
  • Spacetime patches. Each latent frame is patchified, commonly 2x2, into tokens. Five seconds of 720p at 24 fps becomes ~30 latent frames of ~3,600 tokens each, so ~100k tokens per clip.
  • DiT with full 3D attention. Every token attends across space and time. Factorised spatial-then-temporal attention is cheaper but weaker on motion coherence, which is why most strong open models pay for full attention.
  • Text conditioning from a large text encoder or an LLM. Training captions are rewritten densely by a VLM, and short user prompts are expanded the same way at inference, so train and test captions match.
  • Joint audio. Veo 3 and Sora 2 generate synchronised sound with the picture rather than dubbing it afterwards.

Cost arithmetic: ~100k tokens, 30-50 sampling steps, doubled by classifier-free guidance, is why a few seconds of video takes GPU-minutes. The levers are step distillation, guidance distillation, sparse or sliding-window attention, reusing features across adjacent steps, and generating at low resolution before a separate upsampler.

What stays hard: object permanence through occlusion, plausible physics, identity drift across a long shot, and length itself. Longer clips are produced by conditioning on the last frames of the previous chunk, and errors accumulate, which is why products cap clip length and build longer pieces by stitching shots.

Worth sketching. One loop over ~100k spacetime tokens is the whole cost story.

flowchart LR
    A["Text prompt"] --> B["Text encoder"]
    C["Noise in a spatiotemporal latent"] --> D["DiT with full 3D attention<br/>~100k spacetime tokens"]
    B -->|"conditioning"| D
    D -->|"30-50 steps, x2 for CFG"| E["Clean video latent"]
    E --> F["3D VAE decoder"]
    F --> G["Video frames"]

What a good answer covers

  • Same recipe as latent image diffusion, lifted one dimension
  • The expense is token count, multiplied by attention's quadratic cost, multiplied again by sampling steps
  • 3D video VAE
  • Spacetime patches
  • DiT with full 3D attention

Key terms: 3D video VAE · Spacetime patches · DiT with full 3D attention · Text conditioning · Joint audio

Interviewer follow-ups to expect

  1. Why does a causal 3D VAE make joint image and video training possible?

  2. You must cut generation cost 10x for a preview feature: which levers do you pull first and what quality do you lose?

  3. How would you evaluate temporal consistency automatically?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep