TL;DR
When you watch a video of a kitchen, your brain effortlessly constructs a persistent 3D mental room; current AI video models, however, smash everything—objects, geometry, and camera motion—into opaque, frame-by-frame numbers. VIDEOCOS asks a fundamental question: what happens if we translate raw video into an explicit, executable 3D Blender program first, turning video reasoning into reading code and video generation into editing code? The authors discover a sharp divide—code-based world states are a superpower for 3D geometry, viewpoint shifts, and rigid planning, yet stumble on messy real-world physics and compounding estimation errors, pointing toward a future of hybrid code-and-neural world models.
What Problem Does This Paper Address?
Video frames are fleeting 2D observations of a persistent 3D reality. Today's Video-Language Models (VLMs) and video diffusion models represent this underlying "world state" implicitly inside high-dimensional latent vectors. Because object identity, 3D layout, and camera angles are entangled in those latents, models lose track of objects across occlusions, warp rooms during large camera rotations, and accidentally mutate background objects when asked to move a single cup.
Recent attempts have tried turning videos into executable 3D code, yet two major blind spots remained:
- Prior coding agents relied purely on visual guesswork without geometric priors (like depth or tracking), creating sloppy, intersecting 3D meshes.
- Nobody had rigorously tested what these noisy, reconstructed programs are actually good for downstream—do they genuinely beat raw video for answering questions and generating new clips, or do reconstruction errors ruin everything?
Methods
The authors reframe state-centric video tasks into a clean read–write formulation over a factorized world state $s_t = (\mathcal{E}, g_t, c_t)$: discrete Entities ($\mathcal{E}$), time-varying 3D Geometry ($g_t$), and Camera trajectories ($c_t$). Reasoning is a State Read (querying the program without changing it), while generation is a State Write (editing specific variables, running physics simulations, and rendering).
To test this cleanly, they build VIDEOCOS, a decoupled two-agent framework operating in Blender:
- The Codification Agent (Build Once): Instead of eyeballing the video, it first runs off-the-shelf perception models (like Depth-Anything 3, SAM 3, and SAM 3D) to extract depth maps, camera poses, and 3D meshes. Using this metric evidence, a coding agent writes a Python script (
scene.py) and refines it in a live build–check–fix loop—checking for syntax errors, floating objects, or collisions against source frames. - The Reasoning Agent (Reuse Everywhere): Loaded into a fresh Blender process, this agent never sees the raw video or rendered frames. For Reads, it calls Python inspection tools (measuring distances, projecting coordinates into another object's point of view). For Writes, it edits targeted code—orbiting just the camera or scripting a collision-free path for a mug—and renders the result (optionally passing the Blender render to a video diffusion model like MiniMax-H3 for visual polish).
Datasets
Rather than inventing synthetic toy tasks, the authors organize four existing public benchmarks into seven diagnostic task families (no new training datasets are used, as the framework is agentic):
- Read Tasks — VSI-Bench-Debiased (2,362 queries total): Regrouped into Entity Querying (counting across walkthroughs), Geometric Querying (metric sizes/distances), Viewpoint Querying (perspective-taking), and History Querying (chronological appearance order).
- Write Tasks: Kubric-4D (300 clips) for Novel-View Synthesis; Ego2Act (110 tasks) for Goal-Conditioned Planning; and Physics-IQ (66 clips) for Future Prediction across rigid and non-rigid physics.
Key Insights and Ideas
- Explicit 3D math crushes implicit imagination on viewpoint shifts: Asking a VLM "Is the stool left or right of the sofa from the TV's view?" forces mental gymnastics. In Blender code, changing perspectives is a trivial coordinate-matrix transformation.
- Pretty renders don't equal smart reasoning: A reconstructed room doesn't need to look photorealistic to answer questions well. Downstream QA accuracy correlates with the accuracy of the specific queried attribute ($\rho$ = 0.26–0.56), not visual similarity to the original video ($\rho$ near zero).
- Error tolerance is wildly task-dependent: Approximate geometry is plenty good for relative direction (code beats raw video until angle errors exceed $90^\circ$) and distances (up to 25% scene error). Conversely, discrete counting and chronological ordering are brittle: miscounting one cup or swapping one pair's appearance timestamp tanks performance.
- Code provides the skeleton; diffusion provides the skin: Feeding a rigid Blender plan into a neural video generator dramatically improves the generator's physical trajectory and goal completion, proving the two paradigms are complementary.
Key Results
- Viewpoint mastery (Read & Write): On VSI-Bench viewpoint queries, VIDEOCOS boosts GPT-5.6 Luna by +21.9 points (40.6% $\rightarrow$ 62.5%) and Gemini 3.8 Flash by +17.5 points (63.2% $\rightarrow$ 80.7%). On Kubric-4D novel-view synthesis, diffusion models collapse under $128^\circ$ camera rotations (mIoU $\le$ 0.004), while VIDEOCOS stays rock-solid (mIoU 0.224, PSNR 12.67).
- Planning & Hybrid Generation: On Ego2Act goal planning, pure Blender execution achieves a 68.2 task completion score (second only to Seedance-2.0's 77.3), though low physical realism (50.0) because objects float without hands. Conditioning MiniMax-H3 on VIDEOCOS plans lifts H3's Ego2Act task score from 54.3 $\rightarrow$ 63.5 and jumps its Physics-IQ score from 38.6 $\rightarrow$ 51.9.
- Compositional & Non-Rigid Bottlenecks: On History Querying (ordering 4 objects), Gemini drops from 77.7% (raw video) to 64.5% (code) as camera and placement errors compound. On Physics-IQ non-rigid dynamics (fluids, fractures), Blender's displacement error (9.9) lags behind neural generators (5.3–8.0).
- Amortized Cost: Codifying a scene costs $1.52 once, with queries costing $0.033 each—beating per-query agentic baselines like SpatialClaw ($0.180/query) from the 11th question onward (though still pricier than direct VLM video inference at $0.011/query).
Limitations and Future Work
Because VIDEOCOS models the world primarily as rigid 3D meshes and basic Blender physics, it struggles to represent human hands, articulated bodies, fluids, fire, and electromagnetism—causing objects to move telekinetically during planning tasks. Furthermore, compounding reconstruction noise hurts multi-object temporal queries, and upfront scene codification carries a $1.52 API overhead. Rather than viewing code as a total replacement for neural networks, the authors advocate for hybrid world models: using executable code as a persistent 3D memory and planning engine, paired with targeted neural diffusion models to render photorealistic textures, hands, and non-rigid physics.
Summary updated