Building Production Video Generation and World Models at Scale

xai · Tech · 2025 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.5 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Production video generation and world models

xAI needed to build production image, video, audio-video, and world-model capabilities from a zero-to-one starting point while managing data-pipeline gaps, huge video storage costs, inference latency, prompt quality, temporal context, and real-time interactivity requirements.

Constraints:

Architecture

The system architecture combines a visual-model training pipeline with language-model-driven control. The training side starts with synthetic text-video/image pairs, VLM or human captioning, image-model pretraining, VAE-style tokenization, diffusion-transformer training, and step distillation for fast inference. The product side relies heavily on language models for prompt rewriting, planning, tool calling, and video-agent behavior, while diffusion/video models act as rendering tools. For longer horizons, the team adds video extension with historical context, reference-based generation to preserve characters or objects, and world-model work aimed at real-time interactive long-horizon video.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  user-prompt[User prompt] --> prompt-rewriter[Prompt rewriter]
  user-prompt --> video-agent[Video agent]
  prompt-rewriter --> diffusion-video-model[Diffusion video model]
  video-agent --> prompt-rewriter
  video-agent --> diffusion-video-model
  video-agent --> video-extension-engine[Video extension engine]
  synthetic-data-pipeline[Synthetic data pipeline] --> vlm-captioner[VLM captioner]
  synthetic-data-pipeline --> human-labelers[Human labelers]
  synthetic-data-pipeline --> training-pipeline[Training pipeline]
  vlm-captioner --> synthetic-data-pipeline
  human-labelers --> synthetic-data-pipeline
  training-pipeline --> vae-tokenizer[VAE tokenizer]
  vae-tokenizer --> diffusion-video-model
  training-pipeline --> diffusion-video-model
  training-pipeline --> evaluation-loop[Evaluation loop]
  diffusion-video-model --> step-distillation[Step distillation]
  step-distillation --> inference-infrastructure[Inference infrastructure]
  inference-infrastructure --> video-agent
  diffusion-video-model --> audio-video-alignment-model[Audio-video alignment model]
  diffusion-video-model --> video-extension-engine
  video-extension-engine --> reference-image-conditioning[Reference image conditioning]
  reference-image-conditioning --> diffusion-video-model
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
User prompt Simple user instruction that may be too underspecified for direct visual generation. Prompt rewriter, Video agent
Prompt rewriter Large language model that expands user instructions into detailed descriptions for the video model. User prompt, Diffusion video model, Video agent
Synthetic data pipeline Creates detailed language-video or language-image training pairs from videos, VLMs, and human labeling. VLM captioner, Human labelers, Training pipeline
VLM captioner Captioning model used to describe videos for training data creation. Synthetic data pipeline, Human labelers
Human labelers Bootstrap source for exhaustive visual descriptions when captioning models are insufficient. Synthetic data pipeline, VLM captioner
VAE tokenizer Compresses images or videos from pixel space into latent visual tokens for transformer training. Training pipeline, Diffusion video model
Training pipeline Runs data acquisition, algorithm iteration, smaller-scale training, and evaluation cycles. Synthetic data pipeline, VAE tokenizer, Diffusion video model, Evaluation loop
Diffusion video model Visual renderer that denoises compressed visual tokens into images, video, or audio-video outputs. Prompt rewriter, VAE tokenizer, Step distillation, Video extension engine, Video agent
Step distillation Inference optimization that trains a fewer-step student model from a many-step teacher model. Diffusion video model, Inference infrastructure
Inference infrastructure Production serving layer that combines distillation and infrastructure optimization for speed. Step distillation, Video agent
Audio-video alignment model Joint generation capability that aligns audio and video tokens by time step. Diffusion video model, Synthetic data pipeline
Video extension engine Long-horizon generation feature that conditions on previous generated clips and selected history. Diffusion video model, Reference image conditioning, Video agent
Reference image conditioning Lets users provide character, object, or scene references to preserve consistency without full-context replay. Video extension engine, Diffusion video model
Video agent Language-model agent that orchestrates generation, editing tools, ffmpeg, and iterative refinement for longer outputs. User prompt, Prompt rewriter, Diffusion video model, Inference infrastructure, Video extension engine
Evaluation loop End-to-end cycle for comparing model iterations and finding data or training bugs. Training pipeline

Data flow

Training starts by collecting videos and generating synthetic language-video pairs through VLM captioning and human labels. Images/videos are compressed into latent tokens, paired with language tokens, and used to train diffusion transformers through denoising. Image models are trained first because image-language mappings are cheaper and denser, then video models are bootstrapped. At inference time, a language-model prompt rewriter expands the user's prompt, the diffusion model renders visual output, step distillation reduces generation steps, and video agents can call editing tools or ffmpeg to iteratively compose longer videos. For long-horizon generation, video extension carries selected historical context and reference images rather than naively stuffing all prior video tokens into context.

8 supporting quotes
“the data you need is a 100% syntheatic pair of language and image or language to video because on the on the internet actually the the videos don't naturally associate with text.”transcript, stated
“the first step is to you have to generate synthetic pair of language with the videos. So you get the videos from the internet and you you use a VLM to caption the videos.”transcript, stated
“you need to train a tokenizer which can go from image to latent space and latent space back to image. >> That's why we named the podcast. [laughter] >> Exactly. >> But basically you're talking about vocabulary size. >> So like what is what is like a million”transcript, stated
“you train the model to unmask some of the noise. So you you add you add random noise to the visual tokens and then you train the model to remove those noise”transcript, stated
“you usually you train you first train this image diffusion models and then you bootstrap the video model from there.”transcript, stated
“the prompt writer's task is to take take a user instruction and convert it to extremely detailed description of the video.”transcript, stated
“the Gawk imagine video extension is has historical context of all of the previous generated videos. >> It can uh it has it has a context of uh who's speaking and what what objects have appeared and everything having that to generate the next video. So if we”transcript, stated
“minute uh video like which which is not possible if you ask the same prompt to video models but this model will iterally call different tools to do that. So yeah this is actually an interesting thing. So when when we first release a video editing model like I see on X some”transcript, stated

Why this architecture

The architecture separates language intelligence from visual rendering because the source argues that many visual-quality gains now come from language models: prompt rewriting, planning, tool calling, and agentic editing. It also separates training and serving concerns: image-first bootstrapping improves language-vision alignment, VAE tokenization makes transformer training feasible, step distillation makes diffusion serving practical, and reference/video-extension mechanisms handle long context without blindly carrying every prior video token.

5 supporting quotes
“the visual intelligence are actually mostly coming from language like these video models especially from now since the diffusion model technology is more mature”transcript, stated
“the gain comes from language model not not coming from the the v the video model itself like the the real distriution model themselves”transcript, stated
“image image models are cheaper to train and they have much denser connection between language and text. So uh sorry, language and images. For example, you you train a billion you turn on a billion images and there's a mapping from from the tax to to the”transcript, stated
“might be a little bit hard to reduce that cost and for for the inference side the biggest gain is from the dissolation of these models. So you you can it's called step dissolation slightly different from knowledge dissolution in all. So you typically for flow matching models you need like 100 steps”transcript, stated
“The long the video agents can use all all sorts of tools. So you don't have to put all of the capabilities into the transition model itself.”transcript, stated

Models used: Grok Imagine 0.9 · Diffusion video models · Image diffusion models · VLM captioning models · Prompt rewriter language models · Llama or Mixtral in Cosmos · Step-distilled student models · Teacher diffusion models · Audio-video joint generation model · Video agent language models

Scale

Alternatives considered (roads not taken)

Train video models directly from sparse internet metadata

Rejected because: Titles, comments, and descriptions often do not match the actual video content, so supervised visual generation needs synthetic detailed descriptions.

“on YouTube, you have the title and you have the description and the comments of a video, but usually they're not relevant to to the video itself”transcript, stated
“they have they have not no correlation at all. So the first step is to you have to generate synthetic pair of language with the videos. So you get the videos from the internet and you you use a VLM to caption the videos. So that part here's a question like how do you how do you get the VLM to begin”transcript, stated

Train directly on raw pixels

Rejected because: Raw images and videos produce impractically long token sequences for transformer training.

“one image like uh it's a thousand by a thousand is like 1 million tokens 1 million pixels. It's impossible to train transformer on that.”transcript, stated
“you need to train a tokenizer which can go from image to latent space and latent space back to image. >> That's why we named the podcast. [laughter] >> Exactly. >> But basically you're talking about vocabulary size. >> So like what is what is like a million”transcript, stated

Train video before image models

Rejected because: Image models are cheaper and provide denser language-vision alignment before bootstrapping video generation.

“image image models are cheaper to train and they have much denser connection between language and text. So uh sorry, language and images. For example, you you train a billion you turn on a billion images and there's a mapping from from the tax to to the”transcript, stated
“that's why you usually you train you first train this image diffusion models and then you bootstrap the video model from there.”transcript, stated

Serve full 100-step diffusion models

Rejected because: Production serving needs few-step generation, so the team relies on step distillation.

“you typically for flow matching models you need like 100 steps or something like uh diffusion model even need need even more like a thousand steps”transcript, stated
“usually these models serve in productions they only run in a few steps. In in cosmos I believe we have we have like four step and eight steps.”transcript, stated

Extend videos by conditioning only on the last frame or last second

Rejected because: Quality degrades over repeated extensions and the model lacks long-range knowledge about prior characters, objects, and dialogue.

“use the last frame as a first frame for the second video. It kind sometimes it works but if you do it a few times it it says the call to a degree”transcript, stated
“the video quality would look much worse than the first video. Second another problem is that the model doesn't have long range knowledge of like what's happening before. So if they generate some dialogue some to people speaking and their voice might change over over some time especially if”transcript, stated

Put all previous video tokens into context

Rejected because: Video-token context length explodes rapidly for long-horizon generation.

“if we naively do this you you can imagine like just put all the previous history video tokens into the context the context lens will easily explode”transcript, stated
“million context I would imagine [snorts] with that >> yeah for example like in cosmos I think just 5 seconds of video is like a 50 50k or 60k number of tokens. So like if you do if you do 50 seconds as a 5 500k tokens, if you you do longer than that easily explode this long horizon”transcript, stated

Put every capability inside the video transition model

Rejected because: Video agents can combine deterministic tools, editing tools, and generative models instead of forcing one model to do all operations.

“The long the video agents can use all all sorts of tools. So you don't have to put all of the capabilities into the transition model itself.”transcript, stated
“if you want to exactly add a add a blob of text at this time step. The videos model video models might not get that intention very precisely”transcript, stated

Patterns

prompt-chaining (agent-architecture)

A prompt rewriter expands underspecified user requests into detailed descriptions before the video model renders output.

“there's a prompt rewriter or the prompt up sampler part I think in uh in cosmos we use llama or we use mix throw”transcript, stated
“the prompt writer's task is to take take a user instruction and convert it to extremely detailed description of the video.”transcript, stated

tool-use-orchestration (agent-architecture)

Video agents orchestrate video models, editing tools, ffmpeg, and other deterministic tools to create outputs that no single video model can produce alone.

“It can also use uh image editing tools from Photoshop. You can use uh video video editor, ffmpeg whatever to take combination of these”transcript, stated
“maybe generate a a one minute uh video like which which is not possible if you ask the same prompt to video models but this model will iterally call different tools to do that. So yeah this is actually an interesting thing.”transcript, stated

context-compaction (context-engineering)

Long-horizon video extension keeps recent context and selected references instead of naively carrying every previous video token.

“just put all the previous history video tokens into the context the context lens will easily explode”transcript, stated
“you only need that character where where you need. So that's why uh I help build another feature. It's a reference to video.”transcript, stated

synthetic-data-generation (data)

The training pipeline creates synthetic text-video and text-image pairs because internet metadata does not reliably describe visual content.

“you have to generate synthetic pair of language with the videos. So you get the videos from the internet and you you use a VLM to caption the videos.”transcript, stated
“in the beginning it's like you ask human to describe the the video as as detailed as possible”transcript, stated

model-distillation (model-operations)

Step distillation trains few-step student models from many-step teacher diffusion models for production serving.

“A step distillation is try to learn to generate few step from the model itself.”transcript, stated
“usually these models serve in productions they only run in a few steps.”transcript, stated

latency-optimization (operations)

Production video serving depends on distillation and inference infrastructure so generated media can be fast enough for users.

“just for >> it's in the benchmark somewhere in imagine API blog post that they have all the the speed things uh it mostly combination of distillation plus inference >> yeah there there are a bunch of things like we talk about dillation If you talk about thinking if you don't have any thinking”transcript, stated
“the inference infra team was very talented and they were they were able to accelerate a hell lot of these models.”transcript, stated

Tradeoffs

Put intelligence in language-model control rather than only in video diffusion

Chose Prompt rewriters and video agents around specialized visual renderers over Relying on a monolithic video model to understand, plan, edit, and render everything.

Rationale: The source argues that many gains in visual generation come from language intelligence, prompt rewriting, tool calling, and editing workflows.

“the video models capability increase actually come from language model being more intelligent.”transcript, stated
“video agents mostly language models they'll call these uh generative model either it's a separate model or diffusion head whatever as tool.”transcript, stated

Train image models before video models

Chose Image-first bootstrapping over Starting directly with expensive video training.

Rationale: Images provide cheaper, denser language-vision mappings, improving the base before extending to video.

“image image models are cheaper to train and they have much denser connection between language and text.”transcript, stated
“the cost to train the same like the a billion a billion tax to a billion videos that that's much more expensive”transcript, stated

Use step-distilled models for serving

Chose Four/eight-step or other few-step students over Serving full hundred-step or thousand-step teacher models.

Rationale: The teacher captures the complex internet distribution, while the student only has to imitate the teacher distribution for faster production inference.

“you use the full model to generate in 100 steps and then you you take a model that only generate 10 steps and let that model learn from the perfect one.”transcript, stated
“But the step distill model is just trying to learn from the teacher. The teacher is is a model and the size is fixed.”transcript, stated

Use reference conditioning as an intermediate long-context solution

Chose Up to seven reference images plus selective history over Full prior-video context for every extension.

Rationale: References preserve important characters, objects, or scenes without paying the token cost of all intervening frames.

“reference video allow you to like upload up to seven images as condition and generate a video.”transcript, stated
“It doesn't need to have a very long context, but it's I feel like it's a intermediate solution.”transcript, stated

Use deterministic tools inside video agents

Chose Editing tools and ffmpeg for precise operations over Asking video models to perform every exact edit directly.

Rationale: Some edits, such as placing text at an exact time step, are better handled by deterministic tools than by generative video models.

“if you want to exactly add a add a blob of text at this time step. The videos model video models might not get that intention very precisely”transcript, stated
“The videos model video models might not get that intention very precisely but these are possible using these deterministic tools. The long the video agents can use all all sorts of tools.”transcript, stated

Gotchas (what bit them)

Internet video metadata is not usable training supervision by itself.

Root cause: Titles and comments often have little correlation with the video content.

Resolution: Build a synthetic-pair pipeline using VLM captioning and human-generated detailed descriptions.

“the videos don't naturally associate with text. So you can say, oh, like on YouTube, you have the title and you have the description and the comments”transcript, stated
“So you can say, oh, like on YouTube, you have the title and you have the description and the comments of a video, but usually they're not relevant to to the video itself and say maybe like the video is a natural scene of mountains or something and the title is like I'm so happy today.”transcript, stated

Video training can become IO-bound and storage-bound before GPU math is the only cost.

Root cause: Large video corpora and compressed features require petabytes of storage and repeated data movement.

Resolution: Optimize caching/data loading and account for storage and egress in the training architecture.

“you're basically like also more IO bound than normal training. >> Yes. Yes. >> Cuz like data loading caching everything becomes super important.”transcript, stated
“in Cosmos we did a lot of optimizations to make it not IO bound.”transcript, stated

Simple prompts make video diffusion models produce literal, low-quality outputs.

Root cause: The video model was trained on exhaustive descriptions and interprets underspecified prompts literally.

Resolution: Use a language-model prompt rewriter to expand simple instructions into detailed scene descriptions.

“they would literally show a t a cat in maybe a white background because you didn't describe the background.”transcript, stated
“the cat is not moving because you didn't describe it. It it takes the instruction quite literally. It's kind of it's kind of dumb and the the prompt writer is actually a much bigger model which a language model that takes the the user instruction and expanded.”transcript, stated

Naive video extension loses long-range coherence.

Root cause: Conditioning only on the last frame or last second omits prior characters, voices, objects, and events.

Resolution: Use historical context and reference conditioning to preserve relevant long-range information.

“the model doesn't have long range knowledge of like what's happening before. So if they generate some dialogue some to people speaking and their voice might change”transcript, stated
“has a context of uh who's speaking and what what objects have appeared and everything having that to generate the next video.”transcript, stated

Audio-video generation needs finer alignment than text-video generation.

Root cause: Audio tokens must line up with video frames by time step, while text-image/video data is only loosely aligned.

Resolution: Design the model to be time-aware and train with audio-specific synthetic/human labeling.

“the model the model has to know like the video and audio the it has to have a time based alignment”transcript, stated
“If you think about like text text and image text and video they are loosely aligned. So you can you can have a description of what's going on in the video, but you don't have to exactly uh you typically don't have exact description.”transcript, stated

Coding models can speed research enough to make compute the bottleneck again.

Root cause: If algorithms and synthetic-data jobs can be implemented in hours, researchers need enough compute to try all ideas.

Resolution: Treat compute scheduling and rapid iteration capacity as first-class product-development infrastructure.

“coding models are much more efficient and can help help us implement stuff much faster. compute might become a bottleneck again”transcript, stated
“now you have to have enough compute to to try all of the ideas.”transcript, stated

Evaluation

The transcript emphasizes iteration speed, end-to-end train/evaluate loops, spotting bugs in data and training pipelines, production inference speed, and qualitative product milestones rather than a single benchmark table. It also notes that model iteration speed depends on data acquisition, algorithm changes, smaller-scale training, evaluation, and compute availability.

Metrics: Iterations per day · End-to-end train/evaluate cycle time · Data-pipeline and model-training bugs found · Storage and egress cost · Training token volume · Diffusion inference steps · Production generation speed · Audio-video alignment quality · Long-horizon video coherence

4 supporting quotes
“the top important thing is like how many uh how many iterations can you do like per per day”transcript, stated
“from acquire new data and maybe design new algorithms and train a new model maybe a smaller scale.”transcript, stated
“a lot of the improvements does not come from new algorithms. It comes from finding small bugs here and there in the data pipeline”transcript, stated
“it's in the benchmark somewhere in imagine API blog post that they have all the the speed things uh it mostly combination of distillation plus inference”transcript, stated

Outcomes

Concrete scale includes three months to Grok Imagine 0.9, a billion-video/5 PB storage example, $100k/month S3 storage and $230k egress estimates for 5 PB, 19B dense and 20B active/100B total model-size examples, tens of trillions of visual tokens, 50k-60k tokens for 5 seconds of Cosmos video, up to seven reference images, and sub-10ms to 200ms real-time interaction targets.

4 supporting quotes
“we we built it in three months and released the first model Gro imagine 0.9”transcript, stated
“Gawk imagine 0.9 I I believe it's is the first first audio video trans model deployed at a large scale.”transcript, stated
“the Gawk imagine video extension is has historical context of all of the previous generated videos.”transcript, stated
“there's the Gro Gro imagine agent beta that that was the that was the first attempt in that direction.”transcript, stated