DriveBlox Project page · 2026

DriveBlox: Driving Video Generation from Code Blocks World with Instance-Level Memory

Min-Seop Kwak3*, Hyelin Nam1, Yunhao Luo1, Praveen Abbaraju2, Subrata Kumar Kundu2, Seungryong Kim3, Jeong Joon Park1

1University of Michigan 2Astemo Americas, Inc. 3KAIST

*Work done as a visiting researcher at the University of Michigan.

Real video → code-defined blocks world → generated photorealistic video, with instance-level long-horizon consistency.

Results

01 Overview

Editable Code World to Long-Horizon Video with Instance-Level Memory

  1. TL;DR: Almost every object in a driving scene can be abstracted as a 3D block. DriveBlox is conditioned on this rendered “blocks-world” for generation.
  2. Blocks-world is also a code world, easily built, easily controlled. A closed-loop LLM agent with off-the-shelf tools can convert any videos or images into this representation, no GT needed.
  3. For long-horizon generation, object-level KV caching greatly reduces the memory footprint while ensuring long-term consistency of each instance. We find it is a general methodology that works across various backbones and domains beyond driving.
DriveBlox overview. I. Observation to code blocks world: from a full video or an initial image, a closed-loop agent with code as its world interface builds a code-defined blocks world. II. Blocks-world conditioned video generation: driving video, weather and lighting, aerial camera and counterfactual scenarios. III. Instance-level persistent memory: a white van that leaves the view for 41 seconds returns consistent, with 24x less KV memory and compute per chunk and a 15x smaller cache than dense KV.

Instance-level KV Memory Based Long-Horizon Generation

Question: What happens after a U-turn? Comparative models (e.g. OmniDreams) forget and completely re-generate the path it just came through, but DriveBlox retains the structure and appearance of previous chunks' frames due to efficient instance-level KV memory.

02 Observation → Code World

Observation to Code World via a Closed-Loop Agentic Pipeline

A training-free, closed-loop LLM agent, inspired by SpatialClaw, operates in a stateful Python kernel: it calls off-the-shelf perception models, inspects the intermediate results, and revises the world until it agrees with the observation, without ground-truth labels or poses.

(a) Perception

Off-the-shelf tools, called on demand

Called only when a step needs them; none is trained for DriveBlox. Their outputs on one frame:

Depth Anything 3: Metric depth: how far away the road, cars and facades are
Depth Anything 3
Mask2Former: Semantic segmentation: road, sidewalk, buildings, vegetation, sky
Mask2Former
SAM 3: Text-prompted masks and tracks for vehicles, people and signs
SAM 3
WildDet3D: Monocular 3D boxes: size and heading of vehicles and people
WildDet3D
RTMPose: Body keypoints for every pedestrian
RTMPose
Mapillary Vistas: Lane and crosswalk markings
Mapillary Vistas

(b) Closed-loop agent tool call

Render, compare, revise

After every edit, the agent renders the world onto the image and a bird's-eye view, compares it with the observation, and revises it.

Call a toolRender image + BEVCompare with observationRevise the worlduntil itmatches

(c) Output

Editable Python scene file

  • Static world: buildings, walls, vegetation, lanes, poles, signs, traffic lights
  • Dynamic instances: persistent ID, fixed size, trajectory
  • scene_world.py, re-rendered within 10 cm and 7°
# scene_world.py (illustrative)
scene.building(slab, facade=[...])
scene.lane(polyline)
scene.light(pos, states={...})
car = scene.car("veh017", size,
    route=[...], timing={...})

Observation to Blocks Code World

The input video, the reconstructed blocks world, and bird's-eye views at near and far range.

03 Blocks-World Generation

Video Generation Conditioned on a Rendered Blocks World

DriveBlox generates driving video from a rendered blocks world. The blocks fix where every object is and how it moves, and this grounding holds for camera views and events never seen in training.

Video Generation from a Blocks World

Driving video generated from the blocks-world condition by DriveBlox, both with and without initial frames, on zero-shot Lyft-L5 dataset. Comparative baselines used GT HD Map and all their native conditions. DriveBlox shows superior performance.

Zero-Shot Out-of-Domain Generation

Blocks-world conditioned driving video generation allows for powerful controllability and robustness, enabling the video model to generate zero-shot for out-of-domain viewpoints and various counterfactual scenarios, without being fine-tuned on any such data.

Counterfactual Scenario Generation

Vehicle fires, smoke and jaywalking pedestrians, generated from edited blocks worlds of real drives.

Out-of-Domain Camera View Generation (Aerial Views)

The camera rises from the driver's view to an aerial view never seen in training.

04 Instance-Level KV Memory

Long-Horizon Video Generation with Instance-Level KV Memory

An instance-level KV memory caches each object's tokens and re-embeds them where its block reappears. It uses about 24× less KV memory (GiB) than frame-level caching, and re-identifies 45.6% of returning vehicles, against at most 11.0% for prior methods.

Each instance's tokens are cached in a per-ID token bank, warped to where its block projects in the target frame, re-embedded with target-coordinate RoPE, and aggregated into spatial self-attention.

(a) Cache

Per-instance KV storage

Keys and values are stored from each instance's most visible observations, together with box-local 3D coordinates.

(b) Re-embed

Re-embedding on return

When the instance reappears, its cached keys are re-embedded with rotary position where its block projects in the new frame.

(c) Attend

Instance-aware attention

An instance-aware attention mask lets each query read only the memory of the instance that owns it.

Identity after returnTop-1 re-identification of returning vehicles (%)
DriveBlox (Ours)45.6
TrackDiffusion11.0
MagicDrive-V27.5
DreamForge5.7
Panacea†5.4
Cost per chunkDense KV (frame-level) vs. ours (instance-level)
Dense KVOurs
K/V memory24× less
14.7 GiB
0.617 GiB
Compute24× less
33.1 PFLOP
1.38 PFLOP
Latency6.6× less
+161 s
+24.3 s
Cache sizeKV tokens kept over a 55 s drive
Dense KVOurs

Long-Horizon Driving Video Generation with Instance Consistency

Minute-long generations. In the U-turn scenes the ego vehicle turns around and drives back along the same street, so buildings and parked cars are seen again from the other side; the straight scenes continue for about a minute. All methods start from the same real first frame.

Ablation: Instance-level KV Caching

The memory components added one at a time. The target vehicle (green box) must keep its appearance across generation chunks, or after leaving the view and returning.

Instance-Level Memory for General Video

The instance-level KV memory is not specific to driving or to one video model. Added to Wan2.1-VACE, a general-purpose controllable video model, it keeps people and faces consistent: an instance that leaves the view or turns away at a chunk boundary returns with the same identity.

Pedestrian Identity across Generation Chunks

A person leaves the view and returns in the next generation chunk with the same appearance (outlined in blue before and orange after). Generation is conditioned on depth.

Face Identity after a Turn-Away

A face turns away at the chunk boundary and turns back with the same identity. Generation is conditioned on pose.

05 Citation

BibTeX

@article{kwak2026driveblox,
  title   = {DriveBlox: Driving Video Generation from Code-Defined Blocks World with Instance-Level Memory},
  author  = {Kwak, Min-Seop and Nam, Hyelin and Luo, Yunhao and Abbaraju, Praveen and
             Kundu, Subrata Kumar and Kim, Seungryong and Park, Jeong Joon},
  journal = {arXiv preprint arXiv:2612.04169},
  year    = {2026}
}