VideoCoCo: Code-as-CoT for Physically-Consistent Video Generation via an Agentic Dual-Engine System

Haodong Li, Tianfei Ren, Xiaoxiao Ma, Chunmei Qing, Zhen Fang, Sipeng He, Ziyu Guo, Haoyu Wu, Juanxi Tian, Yihang Zou, Ruichuan An, Dongzhi Jiang, Boxue Yang, Ji Xie, Xu Huang, Wenhao Yan, Jialv Zou, Zhengrong Yue, Yaxin Luo, Xiaotong Li, Yuzhu Wang, Junyan Ye, Jinjing Zhao, Zehui Chen, Lin Chen, Renye Yan, Feng Zhao, Pheng-Ann HengarXiv 2026

TL;DR

VideoCoCo introduces an agentic dual-engine framework that uses executable Blender Python code as a process-level Chain-of-Thought (CoT) for video generation. By decoupling physical simulation from photorealistic rendering, it achieves state-of-the-art physical consistency on challenging benchmarks like PhyGenBench and VBench-2.0, transforming low-fidelity physics drafts into high-fidelity videos.

What Problem Does This Paper Address?

While modern text-to-video (T2V) diffusion models generate visually stunning frames, they frequently stumble when it comes to real-world physics. Objects might float unnaturally, fluids might defy gravity, and collisions often lack proper impact.

The authors attribute this to Causal Opacity: text prompts are highly compressed semantic descriptions that leave the underlying physical laws unstated. As a result, standard T2V models are forced to implicitly infer complex spatiotemporal dynamics while simultaneously trying to synthesize high-fidelity pixels. Prior attempts to fix this using Chain-of-Thought (CoT) paradigms rely on textual plans, sparse keyframes, or intermediate visual states. However, these representations are typically non-executable or temporally sparse, failing to provide precise, continuous control over the physical process.

Comparison of different visual Chain-of-Thought (CoT) paradigms for video generation.

Methods

VideoCoCo solves this by splitting the video generation task into two distinct, specialized stages using an agentic dual-engine architecture:

  1. Executable Simulation Engine (Stage 1): Given a text prompt, a LLM-based coding agent ($A_{code}$) synthesizes a self-contained Blender Python script that explicitly defines the scene geometry, object properties, and physical animations. This script is executed inside a sandboxed Blender environment to render a low-fidelity, "white-clay" spatiotemporal draft video. This draft serves as a dense, deterministic physical scaffold.
  2. Generative Video Engine (Stage 2): To turn the low-fidelity draft into a photorealistic video, an instruction agent ($A_{edit}$) reads both the prompt and the draft to compose a detailed, appearance-focused editing instruction. A draft-conditioned video editor ($G_\theta$, initialized from the OmniWeaving base model) then takes the draft and the instruction to synthesize the final high-fidelity video.

To train the video editor to ground its generations in these white-clay simulation drafts, the authors fine-tune the model using a standard conditional denoising objective, comparing full fine-tuning against parameter-efficient LoRA adaptation.

Overview of the VideoCoCo dual-engine framework, separating physical simulation from generative refinement.

Datasets

  • VideoCoCo-3K: Because off-the-shelf video editing datasets lack pairs of simulated white-clay drafts and natural videos, the authors built their own. They generated 3,000 aligned triplets consisting of a simulation draft, an appearance instruction, and a photorealistic target video (rendered using a powerful teacher model, Seedance 2.0).
  • Evaluation Benchmarks: The framework was evaluated on two physics-focused benchmarks: PhyGenBench (probing mechanics, optics, thermal, and material dynamics) and VBench-2.0 (focusing on mechanics, thermotics, and materials).

Key Insights and Ideas

  • Code as the Ultimate CoT: Unlike text plans or static image layouts, executable code is explicit, deterministic, and fully inspectable. If the physics are wrong, the code can be debugged or re-executed before rendering pixels.
  • Decoupling Physics from Appearance: By offloading spatiotemporal dynamics to a classical physics engine (Blender), the generative diffusion model no longer has to "imagine" physical laws from scratch. It can dedicate its entire capacity to what it does best: rendering textures, lighting, and photorealistic details.
  • LoRA Prevents Visual Drift: In ablation studies, LoRA tuning outperformed full fine-tuning. Restricting the adaptation to a low-rank subspace allowed the model to learn the specific draft-to-realistic mapping without overfitting to the limited simulation dataset or erasing the base model's rich visual priors.

Key Results

VideoCoCo achieved state-of-the-art average performance across both evaluation suites:

  • PhyGenBench: VideoCoCo boosted the OmniWeaving baseline's average score from 0.48 to 0.56, outperforming strong open-source baselines like Wan2.2-TI2V-5B (0.54) and commercial models like Gen-3. The most dramatic improvements occurred in material (+0.133) and thermal (+0.078) dynamics, where traditional data-driven visual priors are typically weakest.
  • VBench-2.0: The framework raised the baseline average from 52.18% to 77.88% (a massive 25.70-point absolute gain). It achieved the highest scores among all tested models in mechanics (92.31%) and thermotics (72.92%).
Qualitative comparison showing how VideoCoCo accurately preserves complex physical processes like sublimation and vacuum collapse compared to baseline models.

Limitations and Future Work

Despite its strong physical fidelity, the authors note a few key limitations:

  • Inference Latency: Introducing an intermediate code-generation and rendering step adds computational overhead compared to direct end-to-end T2V generation.
  • Simulator Boundaries: The framework's physical accuracy is fundamentally bounded by the expressiveness of Blender. Highly complex, chaotic phenomena—such as turbulent fluid dynamics—remain difficult to synthesize zero-shot.

Future Directions: The team aims to explore more specialized physical simulation backends (such as Taichi) and investigate knowledge distillation techniques to bake these executable physical priors directly into end-to-end video models, potentially eliminating the need for test-time simulation entirely.

Summary updated

BibTeX
@misc{li2026videococo,
  author = {Haodong Li and Tianfei Ren and Xiaoxiao Ma and Chunmei Qing and Zhen Fang and Sipeng He and Ziyu Guo and Haoyu Wu and Juanxi Tian and Yihang Zou and Ruichuan An and Dongzhi Jiang and Boxue Yang and Ji Xie and Xu Huang and Wenhao Yan and Jialv Zou and Zhengrong Yue and Yaxin Luo and Xiaotong Li and Yuzhu Wang and Junyan Ye and Jinjing Zhao and Zehui Chen and Lin Chen and Renye Yan and Feng Zhao and Pheng-Ann Heng},
  title = {{VideoCoCo: Code-as-CoT for Physically-Consistent Video Generation via an Agentic Dual-Engine System}},
  year = {2026},
  eprint = {2607.27380},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.27380},
}
Figure