Search

Search papers and lessons

GAIA-1: A Generative World Model for Autonomous Driving

Anthony Hu, Lloyd Russell, Hudson Yeo et al. · 2023

Hu et al. (2023) model driving video as discrete tokens predicted by a 6.5B-parameter autoregressive transformer, then render them with a video diffusion decoder, with text and action inputs for control.

On this page

  • Colour = topic mix
  • Probability
  • Calculus
  • Linear algebra
  • Generative models
  • Neural network basics
  • Architectures
  • Sign in to see your progress

TL;DR

GAIA-1 treats a driving video as a sequence of discrete tokens and trains a large autoregressive transformer to predict the next image token, as a language model predicts the next word. A separate video diffusion model turns the predicted tokens into pixels. Text and vehicle speed and curvature are fed in as extra tokens, so a user can steer the rollouts.

Where you'll see it: neural simulators for autonomous driving, where a learned model generates future camera views for a planned or hypothetical action, and the video-world-model line of work that reuses the next-token recipe from language models.

The problem

A self-driving system has to predict what happens next, including how other road users respond to what the car does. World models are a standard way to learn this: a model of how the environment evolves given actions. Earlier driving world models had two limits, as the paper describes them. Many relied on labelled data, which is hard to collect at scale, and low-dimensional state representations made it hard to produce realistic future frames.

Generative video models went the other way. They produce convincing frames from large unlabelled video, but they do not learn a representation of how the scene evolves under actions, which is the part a planner needs. The paper's aim is to keep both properties: the realism and scale of a video generator, and a predictive model of the world that can be conditioned on what the car does.

Key idea

GAIA-1 splits the job in two. The world model works on discrete tokens and does the reasoning about scene layout, objects and dynamics. It is an autoregressive transformer, and it predicts the next image token given everything before it, so the training objective is the same as for a language model. The video decoder is a diffusion model that takes the predicted tokens and renders high-resolution video with realistic detail and temporal consistency.

The discrete tokens come from an image tokenizer that compresses each 288 by 512 frame into 576 tokens from a vocabulary of 8192. The tokenizer is trained to reconstruct images, and it is also pushed to match the features of a self-supervised image model, DINO, so that the tokens carry semantic meaning (a token for road looks like other road tokens) rather than only pixel detail.

flowchart LR
  T[Text: 32 tokens per step] --> I[Interleaved token sequence]
  V[Video frames: 576 tokens each] --> I
  A[Speed and curvature: 2 tokens] --> I
  I --> W[World model: autoregressive transformer]
  W --> P[Predicted next image tokens]
  P --> D[Video diffusion decoder]
  D --> O[Video at 25 Hz]

The method

Tokenising video, text and action

Each frame is discretised into n=576n = 576 tokens. With a downsampling factor D=16D = 16 on a 288×512288 \times 512 input, the grid is 18×32=57618 \times 32 = 576 positions, each holding one of K=8192K = 8192 codebook entries. Text is encoded with a pretrained T5-large model into m=32m = 32 tokens per time step, and the action is two scalars, speed and curvature, each mapped to one token. The paper writes the input for each step as text, image, action, in that order: (c1,z1,a1,…,cT,zT,aT)(\mathbf{c}_1, \mathbf{z}_1, \mathbf{a}_1, \ldots, \mathbf{c}_T, \mathbf{z}_T, \mathbf{a}_T). Positions are given by a factorised embedding, one learned temporal embedding per step and one learned spatial embedding per position within a step, so there are m+n+l=610m + n + l = 610 spatial embeddings of dimension d=4096d = 4096.

The world model is the usual next-token objective with a causal mask. For each frame, each image token is predicted from all earlier frames, all earlier tokens of its own frame, and the conditioning:

Lworld model=−∑t=1T∑i=1nlog⁡p(zt,i∣z<t, zt,j<i, c≤t, a<t)L_{\text{world model}} = -\sum_{t=1}^{T} \sum_{i=1}^{n} \log p\big(z_{t,i} \mid \mathbf{z}_{<t},\, z_{t,j<i},\, \mathbf{c}_{\leq t},\, \mathbf{a}_{<t}\big)

Conditioning is dropped at random during training: 20 percent of examples are unconditioned, 40 percent action-conditioned and 40 percent text-conditioned. That one model can then do all three kinds of generation.

Video is temporally subsampled from 25 Hz to 6.25 Hz before tokenisation, so the world model sees 26 frames for a clip of roughly 4 seconds. The paper says the total sequence length is 26×610=15,86026 \times 610 = 15{,}860 tokens.

The image tokenizer

The tokenizer is a discrete image autoencoder built on a fully convolutional U-Net, with a nearest-neighbour lookup into a learned codebook. Its training loss is a weighted sum of L1L_1, L2L_2, a perceptual loss, a GAN loss, the codebook and commitment losses, and a DINO term. The DINO term is a cosine-similarity loss between the quantised features and the features of a pretrained DINO model. The paper's Figure 3 shows that this makes tokens of the same class (vehicle, road, sky) cluster together. Since the decoder was trained on single images, it is not temporally consistent on its own, which is why the video decoder is needed.

The paper argues that the sequence-length versus vocabulary trade-off, familiar from text tokenisation, applies here too. Its chosen downsampling of 16 keeps the sequence short while the codebook keeps a rich vocabulary.

The video decoder

The decoder is a 3D U-Net with factorised spatial and temporal attention, trained as a denoising diffusion model with the v-parameterisation. It is conditioned on the image tokens. One network is trained for four tasks, sampled equally: image generation, video generation, autoregressive decoding (forward and backward), and video interpolation. Each conditioning token is dropped with probability p=0.15p = 0.15 so the decoder does not depend on every token.

At inference the decoder decodes the first 7 frames together, then continues in overlapping windows of 7 with 2 frames of context, and finally upsamples from 6.25 Hz to 12.5 Hz and then to 25 Hz. The paper uses the DDIM sampler with 50 steps. It also mixes a per-frame denoiser and a joint video denoiser at random during sampling, with probability 0.25 per step and weight 0.5, to balance information content against temporal consistency. The paper reports that decoding the remaining frames backward from the end of the clip reduced flicker on the horizon.

Sampling from the world model

Choosing the next token is the delicate step, and the paper reports three findings. Taking the argmax at every step produces futures that repeat themselves. Sampling from the full distribution occasionally picks a token from the unreliable tail, which pushes the model off the data. Top-k sampling avoids both, and the paper's Figure 6 compares perplexity of real tokens with argmax, full sampling and top-kk with k=50k = 50, and finds top-kk matches the real-token distribution.

Text guidance uses classifier-free guidance: the output logits are lfinal=(1+t) lconditioned−t lunconditionedl_{\text{final}} = (1 + t)\, l_{\text{conditioned}} - t\, l_{\text{unconditioned}}. The scale tt is scheduled across tokens, with linearly decreasing guidance within a frame, and across frames, with a cosine decay. Longer videos use a sliding window of context.

Results

The paper's results are mostly qualitative. It shows generated clips (Figure 10 for minutes-long rollouts from imagination), several plausible futures from one context video (Figure 11), text-prompted weather and lighting changes (Figure 12), and action-conditioned rollouts in which the ego-vehicle steers out of its lane and the model renders the scene consistent with that (Figure 13).

The one quantitative analysis in the text is a scaling study. The authors train models with less than 20×20\times the final compute, between 0.65 million and 650 million parameters, and fit a power law of the form f(x)=c+(x/a)bf(x) = c + (x/a)^b to held-out cross-entropy on a geofenced validation set. They report that the cross-entropy of the full GAIA-1 model can be predicted with high accuracy from this fit, and that the extrapolation suggests room for gains from more data and compute. The text does not give the fitted coefficients, a reported final cross-entropy value, or any driving benchmark score, so claims about driving performance rest on the qualitative examples alone.

The training budgets are stated: the tokenizer is 0.3B parameters, trained for 200k steps over 4 days on 32 A100s. The world model is 6.5B parameters, trained for 100k steps over 15 days on 64 A100s with batch size 128, and uses FlashAttention-2 in its transformer. The video decoder is 2.6B parameters, trained for 300k steps over 15 days on 32 A100s. The paper also reports that autoregressive generation does not run in real time.

Example
Checking the sequence-length arithmetic

Use the numbers from the paper.

  1. Tokens per frame: 18×32=57618 \times 32 = 576.
  2. Embedding slots per time step: m+n+l=32+576+2=610m + n + l = 32 + 576 + 2 = 610.
  3. Total sequence for T=26T = 26 steps: 26×610=15,86026 \times 610 = 15{,}860, matching the paper.
  4. Clip duration: 26/6.25=4.1626 / 6.25 = 4.16 seconds. The paper calls these "4s-long videos", which is a rounding of 4.16.
  5. Compression of the tokenizer: raw frame bits are 288×512×3×8=3,538,944288 \times 512 \times 3 \times 8 = 3{,}538{,}944. Token bits are 576×log⁡28192=576×13=7,488576 \times \log_2 8192 = 576 \times 13 = 7{,}488. The ratio is 472.6472.6. The paper's formula gives about 470.

Interpretation: a 4-second clip is turned into about 16 thousand tokens, which is the length the transformer has to handle. The tokenizer stores each frame in about 1/470 of its raw bits, and that compression is what makes next-token prediction over video tractable at this scale.

Example
Why top-k sampling and not argmax

A toy distribution over four next tokens, with illustrative probabilities.

  1. Probabilities: 0.550.55, 0.300.30, 0.100.10, 0.050.05.
  2. Argmax always returns the first token, so a rollout that reaches a repeated state keeps choosing it.
  3. Full sampling picks the fourth token with probability 0.050.05 at each step. Over 100 steps the expected number of such picks is 55.
  4. Top-2 sampling renormalises over the first two tokens: 0.55/0.85=0.6470.55 / 0.85 = 0.647 and 0.30/0.85=0.3530.30 / 0.85 = 0.353. The tail token is never picked, and the rollout still varies.

Interpretation: the paper's argument is that argmax is too deterministic and full sampling too noisy. Top-k keeps the high-probability choices and drops the tail. The toy numbers are illustrative only and are not from the paper.

Why it mattered

The paper's own claims are the ones to rely on here. It says GAIA-1 shows emergent properties such as learning scene structure and dynamics, generalising to combinations of objects and to driving outside the road boundaries, and reacting to the ego-vehicle's controlled behaviour with plausible moves by other road users. It says the model can act as a neural simulator that generates data for training and validating driving systems, and that its action-conditioned rollouts could support planning and closed-loop exploration. These are the authors' interpretations of qualitative results, and the paper does not measure them against a driving benchmark in the text.

The paper also says the scaling trend it observed is similar to the one reported for language models, which it takes as a sign that the next-token recipe transfers to driving. It presents that as its finding, not as a general result.

Reading guide

  • Section 1, Introduction. Needs World Model for the idea of a predictive model that supports decisions, and Autoregressive Model for next-token prediction, which the paper uses as its main analogy to language models.
  • Section 2.1, Encoding video, text and action. Needs Transformer for the input sequence and positional embeddings. The sequence arithmetic is the part to check with pencil and paper.
  • Section 2.2, Image tokenizer. Needs Vector Quantization for the nearest-neighbour codebook and the commitment loss, and Self-Supervised Learning for why DINO features are a useful target. The U-Net is described in U-Net.
  • Section 2.3, World model. Needs Cross-Entropy Loss for the negative log likelihood objective. Causal masking is the same as in the autoregressive lesson.
  • Section 2.4 and Section 5.2, Video decoder and its inference. Needs Diffusion Model for denoising and DDIM Sampler for the 50-step sampler. Classifier-free guidance, used for text control in Section 5.1, is in Classifier-Free Guidance. The latent-space idea behind the decoder is in Latent Diffusion Model.
  • Section 3, Data. No prerequisite lesson is needed. Note that the dataset is proprietary and the weighting scheme is part of the method.
  • Section 4, Training procedure. The hyperparameters are listed per component. FlashAttention-2 is used in the transformer, see FlashAttention-2: Faster Attention with Better Parallelism.
  • Section 5.1, Sampling. Needs the top-k and argmax ideas. Figure 6 is the key figure.
  • Section 6, Scaling. Needs Neural Scaling Laws for power-law fits of loss against compute, and Training Compute-Optimal Large Language Models (Chinchilla) if you want a comparison with how language-model compute is allocated.
  • Section 7, Capabilities. Qualitative. Read the figure captions, which state what each example shows.

Check yourself

QuestionWhy does GAIA-1 use a separate video diffusion decoder rather than decoding each predicted frame with the image tokenizer's decoder?Show answer

The image tokenizer's decoder is trained on single images, so decoding each frame independently gives frames that are not consistent in time. The video decoder denoises a sequence of frames jointly and is conditioned on the image tokens, which gives temporal consistency and higher quality. The paper states this as its reason.

QuestionThe world model predicts 576 image tokens per frame, with 32 text tokens and 2 action tokens per time step. How many tokens does a 26-step sequence contain, and how long is the clip at 6.25 Hz?Show answer

Per step there are 576+32+2=610576 + 32 + 2 = 610 tokens, so 26×610=15,86026 \times 610 = 15{,}860 tokens in total. At 6.25 Hz, 26 frames last 26/6.25=4.1626 / 6.25 = 4.16 seconds, which the paper rounds to 4 seconds.

QuestionA researcher says the paper proves GAIA-1 is ready for use as a driving simulator. What does the text actually support?Show answer

The text supports qualitative examples of realistic, controllable and multimodal rollouts, plus a scaling fit of validation cross-entropy. It reports that autoregressive generation is not real time, and it gives no driving benchmark score or measured simulator fidelity. So the claim that it is ready for use is not established by the paper.

QuestionWhy does the paper prefer top-k sampling to both argmax and full sampling when generating the next image token?Show answer

Argmax makes the rollout deterministic, so generated futures can get stuck in repeated loops. Full sampling can pick low-probability tokens from the tail, which move the model off the data distribution. Top-k keeps variety among the likely tokens and removes the tail. The paper's Figure 6 compares perplexity distributions to show top-k=50 matches real tokens.

Sources

Read the full paper

Anthony Hu, Lloyd Russell, Hudson Yeo et al., 2023. arXiv:2309.17080