FastCWM: Streaming Code World Models That Learn from Their Own Renders

Hao Wu, Fan Zhang, Yuqi Li, Yizhou Zhao, Yingli Tian, Linsey Pang, Prakhar Mehrotra, Qingsong Wen, Ming-Hsuan YangarXiv 2026

TL;DR

FastCWM is a streaming "code world model" that pairs an executable 3D physics agent with a fast, 4-step video diffusion renderer over a shared memory cache. Instead of compiling a massive script from scratch every time you want to change something mid-simulation, it emits tiny incremental code patches synchronized to 17-frame video chunks—cutting mid-stream edit latency from minutes down to 3.73 seconds while letting the AI learn from its own rendered video mistakes.

What Problem Does This Paper Address?

If you want an AI to simulate an interactive 3D world—say, for robotics, autonomous driving, or gaming—you currently face an awkward trade-off:

  1. Pixel-only world models predict video frames directly. They look photorealistic, but because they lack an explicit 3D state, objects tend to drift, morph, or pass right through each other over time.
  2. Code world models fix the physics by having an LLM write an executable 3D scene program, which is then rendered into video. The catch? Existing pipelines compile the entire script before rendering offline. If a user intervenes mid-stream (e.g., "steer 15° left"), the whole script is invalidated, forcing a full restart that takes minutes.

Furthermore, because code generation and video rendering happen in separate, open-loop stages, the code agent never gets feedback on whether its 3D instructions actually looked right in the final video.

Figure 1. Overview of FASTCWM. Incremental symbolic delta patches, multi-modal proxies, and 4-step causal streaming ren- dering synchronize over a shared KV cache to enable restart-free editing and render-in-the-loop policy improvement.

Methods

FastCWM solves both bottlenecks by synchronizing symbolic code updates and causal video rendering at 17-frame chunk boundaries (0.71 s of video at 24 fps):

  • Incremental Delta Patches (FastCWM-Code): Rather than regenerating a full scene script, the code agent (an adapted Qwen3-Coder-30B-A3B with a shared dense kinematic adapter to ground continuous 3D scale) emits a compact 20–50 token state-transition patch ($\Delta c_t$) per chunk. A rigid-body/articulated geometry engine updates 3D structural proxies (semantic, metric depth, and grey-clay maps) in milliseconds.
  • 4-Step Streaming Renderer (FastCWM-Render): Distilled from a 35-step MiniMax-H3 teacher into a 4-step causal student, the renderer synthesizes video chunks over a 5-chunk (3.54 s) rolling KV cache with a static "sink" for the initial anchor frame. Because the code patches and video cache are synchronized, mid-stream user edits branch immediately from cached memory without re-rendering prefix history. To prevent blur and exposure drift in just 4 steps, the authors also introduce a frequency-split geometric conditioning and loss that separates low-frequency lighting from high-frequency edges.
  • Render-in-the-Loop Suffix Resampling: During offline training, 1-to-1 chunk alignment lets physical and visual verifiers pinpoint the exact chunk $t^*$ where a simulation fails. Instead of throwing away the whole trajectory, FastCWM forks 8 suffix continuations from the cached state at $t^*-1$, scores them, and distills the repairs into the single-pass policy.

Datasets

The authors introduce FastCWM-Bench, built from CARLA, nuScenes, ManiSkill3, BridgeData V2, TartanAir, Code2Worlds-2, and SolarRenderer across five domains: driving, manipulation, industrial robotics, gaming, and aerial navigation.

  • It includes 2,000 training clips, 400 in-distribution (ID) test tasks, and 200 Held-Out tasks featuring unseen environments, unseen assets, and unfiltered human prompts, all paired with counterfactual edit branches.
  • They also evaluate zero-shot on RGB-only WBench and WorldModelBench, and benchmark rendering quality on PAI-Bench-C.

Key Insights and Ideas

  • Shared-memory synchronization eliminates edit restarts: By aligning incremental code patches with a rolling KV cache, editing a simulation mid-flight no longer requires recomputing the past.
  • Splitting geometry by frequency stabilizes few-step diffusion: Applying a low-pass/high-pass split strictly to 3D geometric proxies (never RGB) preserves global illumination and sharp object boundaries in just 4 denoising steps.
  • Localized credit assignment beats full-trajectory RL: Pinpointing the exact failing chunk and resampling only the remaining suffix outperforms matched-compute Full-Trajectory GRPO and Repeated Best-of-N.

Key Results

  • Interactive Speed: Running at $1344 \times 768$ on five H100 GPUs, FastCWM achieves a 4.3 s warm time-to-first-chunk, 3.73 s to the first edited RGB frame, and 1.85 s per 0.71 s chunk ($0.38\times$ real-time playback).
  • Task Success: Reaches 83.1% Pass@1 on FastCWM-Bench ID (beating GPT-6 at 77.5% and Full-Trajectory GRPO at 76.4%) and improves Held-Out generalization by +15.0 percentage points over Stage-1 supervised fine-tuning (74.5% vs. 59.5%).
  • Rendering & Human Preference: Achieves 83.1 VBench and 0.547 DOVER on PAI-Bench-C while cutting total VRAM by 65.6% compared to SolarRenderer (98.4 GB vs. 286.0 GB). In blinded A/B tests, humans preferred FastCWM 78.4% of the time over SolarRenderer and 81.2% over Cosmos-Predict.
Figure 4. Two-stage progression of FASTCWM-CODE (3 seeds, shaded ±Std) on FASTCWM-BENCH. Stage-1 grounds 3D scale from 0.0% zero-shot success, and three Render-in-the-Loop rounds outpace matched-compute (384 h) Repeated Best-of-N and Full- Trajectory GRPO past GPT-6 and test-time Best-of-8.

Limitations and Future Work

  • Rigid-body scope: The current World-DSL supports rigid-body and articulated kinematics, but cannot model fluids or deformable fracture.
  • Sub-real-time pacing: At $1344 \times 768$, end-to-end generation runs at $0.38\times$ real-time ($0.44\times$ for the renderer alone), requiring a small pre-buffer or 8 fps preview for smooth interactive playback.
  • Memory horizon: Transient visual details are evicted once they pass the 3.54 s rolling KV window.

Future directions include extending the DSL to deformable physics, adding persistent memory beyond 3.54 s, running systematic ablations on chunk size and KV horizon, and optimizing for single-GPU streaming.

Summary updated

BibTeX
@misc{wu2026fastcwm,
  author = {Hao Wu and Fan Zhang and Yuqi Li and Yizhou Zhao and Yingli Tian and Linsey Pang and Prakhar Mehrotra and Qingsong Wen and Ming-Hsuan Yang},
  title = {{FastCWM: Streaming Code World Models That Learn from Their Own Renders}},
  year = {2026},
  eprint = {2612.01144},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.01144},
}
Figure