World Model · Self-Driving

LeWM Self-Driving
A Latent World Model for Autonomous Driving

Applying the LeWorldModel framework to Comma2k19 highway driving data. End-to-end JEPA training from raw pixels — no pretrained encoder, no reconstruction loss.

57.7M
Parameters
10×
Better than null
8/8
Future selection
0/384
Collapsed dims
H100
Training hardware
20ep
JEPA training

Abstract

End-to-end world modelling for highway driving

We adapt the LeWorldModel (LeWM) JEPA framework to the Comma2k19 self-driving dataset. The model learns to predict future driving scenes in a compact latent space from raw 224×224 pixel observations and vehicle control signals, without any reconstruction objective or pretrained vision backbone. SIGReg enforces a Gaussian-distributed latent space, preventing representation collapse throughout training.
End-to-end from pixels No pretrained encoder SIGReg anti-collapse Action-conditioned planning Comma2k19 dataset

The encoder is a Vision Transformer (ViT, 384-dim hidden, 12 layers, patch size 14) that maps each frame to a 384-dimensional CLS-token embedding via a projection MLP. The predictor is a causal Transformer (8 layers, 16 heads) that autoregressively predicts the next embedding conditioned on vehicle actions embedded via Adaptive Layer Normalization.

The training objective is the sum of a next-embedding MSE prediction loss, the SIGReg regularisation term (with 2000-step linear warmup), and a cosine similarity smoothness term on temporally adjacent embeddings. No reconstruction decoder is used during training. A separate decoder is trained afterwards for visualisation only.

Results

Benchmarks and diagnostics

All results are from a single run: 20 epochs of encoder/predictor training on 4 chunks of Comma2k19 (789 segments, ~33 hours of driving), followed by 25 epochs of decoder training on the evaluation split.

Open-loop L2 error
Open-loop prediction (BM1). The model achieves consistently lower latent error than the null constant predictor at all horizons — roughly 10× better than chance. Error distribution at horizon h=4 shown right.
Action sensitivity
Action sensitivity (BM2). L2 divergence in latent space when given two different action sequences from the same starting state. Mean divergence 0.508. Acceleration vs braking produces the strongest signal (1.17), confirming the predictor is responsive to control input.
CEM planner
CEM planner (BM3). CEM consistently finds action sequences closer to the goal than random search (ratio 0.957, reach 45%).
Prediction quality
Multi-step prediction (T3). Per-step latent MSE over 19 steps. Mean 0.0099 with no runaway accumulation.
Real vs decoded frames
Decoder reconstructions (BM4). Top: real frames. Bottom: decoded from predicted latents. Scene geometry, sky/road structure, and lighting are faithfully preserved. Blurriness is a decoder capacity limit after only 25 training epochs, not a representation quality issue.
Latent space t-SNE
Latent space structure (T2). t-SNE of 500 embeddings coloured by speed and steering. Clear spatial structure emerges without any explicit supervision on these quantities.
Embedding health
Embedding health (T8). 0/384 dimensions collapsed. Distribution matches SIGReg Gaussian target. Effective rank 34.9/384 at 20 epochs.
Temporal straightening
Temporal straightening (T9). Mean cosine similarity 0.165 — emergent temporal straightness with no explicit regularisation.
Future selection
Future-frame selection (VL1). Model selects the correct continuation 8/8 times (100%) from 4 candidates by nearest-latent matching.
Training curves
Training curves (T0). Prediction loss and SIGReg converge smoothly over 20 epochs with no instability.
Frame similarity
Frame similarity (TV1). Diagonal-dominant cosine structure confirms temporal coherence.
CEM rollout
CEM planning rollout (tA). Multi-step imagined trajectories remain stable under optimized control sequences.
Planning visualisation
Latent planning (tsd4). Full planning storyboard from context to goal-directed imagined trajectory.
Retrieval quality
Retrieval quality (tB). Latent nearest-neighbour retrieval improves speed and steering matching.
Retrieval visuals
Retrieval visuals. Query and neighbour panels show semantic consistency in latent search.
Decoder interpolation
Decoder interpolation (tdec1). Smooth visual transitions under linear latent interpolation.
Decoder heatmap
Decoder heatmap (tdec2). Per-pixel residual between real and decoded frames.
Decoder temporal consistency
Decoder temporal consistency (tdec3). Decoded trajectories remain smooth over short horizons.
Latent perturbations
Latent perturbations (tdec4). Single-dimension edits produce interpretable visual changes.
Speed memory
Speed memory (tsd1). Lagwise relation between latent drift and speed dynamics.
Speed latent alignment
Speed alignment (tsd3). Correlation between speed traces and latent features.
Summary panel
Summary panel (tE). Consolidated optimization and representation diagnostics.

Architecture

Model design

The model follows the LeWM blueprint exactly, adapted for driving. Actions are (steering, speed, brake) multiplied across frameskip=5 timesteps, embedded via Conv1D + MLP, then injected into the predictor through Adaptive Layer Normalization at every Transformer layer.

# Encoder
Encoder:   ViT (hidden=384, layers=12, heads=6, patch=14)
           CLS token → ProjMLP(384→2048→384) → z_t ∈ R^384

# Predictor
Predictor: CausalTransformer(depth=8, heads=16, mlp=2048, drop=0.1)
           Action conditioning via AdaLN at every layer
           ProjMLP(384→2048→384) output head

# Actions
Actions:   (steer, speed, brake) × frameskip=5 → R^15
           Conv1D + SiLU + Linear → R^384

# Loss
L = MSE(z_hat_{t+1}, z_{t+1})
  + λ · SIGReg(Z)          # λ=0.025, warmup 2000 steps
  + 0.02 · ReprCosine(Z)   # smoothness on nearby frames

Total params: 57.7M
Property This work PLDM DINO-WM
End-to-end from pixels Yes Yes No (frozen DINOv2)
Reconstruction-free Yes Yes Yes
Reward-free Yes Yes Yes
Anti-collapse guarantee SIGReg (provable) VICReg (heuristic) Frozen encoder
Loss hyperparameters 1 (lambda) 6 0
Real driving data Comma2k19 Sim only Mixed

Training details

Hardware, data, and configuration

Training was run on a single NVIDIA H100 80GB HBM3 GPU on Lightning.ai. The VRAM utilisation shown in training logs (~1.7 GB) reflects allocated memory as reported by torch.cuda.memory_allocated(). Total physical VRAM consumption was ~84 GB due to PyTorch reserved buffers, the compiled model, and the large batch of 128 sequences each of length 20 frames at 224×224 resolution.

Video decoding uses NVDEC (ffmpeg hevc_cuvid) for GPU-accelerated HEVC decode. Frame normalisation uses ImageNet statistics. CAN bus signals (speed, steering) and IMU data are loaded from comma2k19's processed_log directories and interpolated onto the frame timeline.

# Hardware
GPU        : NVIDIA H100 80GB HBM3
Precision  : bfloat16  +  torch.compile (reduce-overhead)

# Data
Dataset    : Comma2k19 chunks 1-4 (789 segments, ~33h driving)
Resolution : 224×224  |  frameskip=5  |  seq_len=20
Train/eval : 711 / 78 segments  |  78,665 training windows

# Optimiser
AdamW : lr=1e-4, weight_decay=1e-3, fused=True
Sched : cosine decay with 2-epoch linear warmup
Epochs: 20  (~19,660 steps)  |  Budget: 2.9h

# Decoder (visualisation only)
Arch     : FC(384→1024→256×7×7) + 5× ConvTranspose2d
Training : 25 epochs, MSE + 0.1 × edge loss, lr=3e-4

Code

Get started

# Install dependencies
pip install torch torchvision transformers einops matplotlib scipy scikit-learn av huggingface_hub

# Train (Lightning.ai, 4 Comma2k19 chunks, 2.9h budget)
python train.py --lightning --chunks 1 2 3 4 --budget-hours 2.9

# Train (custom data directory)
python train.py --data-dir ./comma2k19 --chunks 1 2 --budget-hours 3.0

# Evaluate — produces all benchmark plots
python tests.py --checkpoint ./checkpoints_v5/final.pt --lightning --output-dir ./results

The repository contains two files: train.py — full model, data pipeline, and training loop; and tests.py — the complete evaluation suite producing all benchmark plots above.

Citation

@article{maes2026leworldmodel,
  title   = {LeWorldModel: Stable End-to-End Joint-Embedding Predictive Architecture from Pixels},
  author  = {Maes, Lucas and Le Lidec, Quentin and Scieur, Damien and LeCun, Yann and Balestriero, Randall},
  journal = {arXiv:2603.19312},
  year    = {2026}
}