Video-Coder: Reinforcing Agentic Coding for Video Generation

Chaoyang Wang1Sicheng Gao2Junan Hu3Kunyang Li1Dongyang Chen4Yiyang Zhou5Huaxiu Yao5Yong Jae Lee6Radu Timofte2Yuzhang Shang1†
1University of Central Florida2University of Würzburg3Microsoft Research4Tsinghua University5UNC-Chapel Hill6UW–Madison

† Corresponding Author.

University of Central Florida University of Würzburg Tsinghua University Microsoft Research UNC-Chapel Hill University of Wisconsin–Madison

The first work to train a code‑driven video generation agent.

Introduction

Video-Coder is a coding agent that writes and runs Blender code to build a draft video. A video generator then turns the draft into the final video.

+24VBench-2.0 over MiniMax-H3
+6PhyGenBench over MiniMax-H3
6k + 2kopen SFT / RL samples
Direct video generation vs. Video-Coder
Figure 1: Overview of our proposed Video-Coder. Unlike direct video generation, Video-Coder writes and executes code to build a 3D scene and renders a draft video, which guides the downstream video generator with explicit structure and motion signals.

Method

The agent works in the Video-Coder Harness, an environment where it writes, runs, inspects and revises its program. We train Qwen3.5-9B with SFT, then agentic RL with an execution reward that anneals into a video reward.

Four-stage data pipeline
Figure 2: Overview of our data construction pipeline. It consists of four stages: text prompt construction, agentic trajectory generation, ground-truth video synthesis, and data cleaning and filtering, yielding two datasets: Video-Coder-SFT-6k and Video-Coder-RL-2k.

Results

Experiments show that Video-Coder consistently improves video generation performance across different backbones, bringing around 7 points gains for MiniMax-H3 on PhyGenBench, demonstrating that explicitly constructing 3D scenes with executable code effectively enhances the physical plausibility and controllability of generated videos.

Table 1: Performance of different models on the PhyGenBench benchmark. Best performance is in bold.
MethodMechanics
(↑)
Optics (↑)Thermal (↑)Material (↑)Average (↑)
Pika0.350.560.430.390.44
Gen-30.450.570.490.510.51
Kling0.450.580.500.400.49
CogVideoX0.390.550.400.420.45
Open-Sora V1.20.430.500.440.370.44
LaVie0.300.440.380.320.36
Vchitect-2.00.410.560.440.370.45
Minimax-H30.610.730.520.550.61
HunyuanVideo0.330.390.260.300.33
OmniWeaving0.480.560.430.390.48
Wan2.2-TI2V-5B0.550.580.530.500.54
Cosmos-Predict2.50.300.330.410.390.35
LTX-Video-2B0.510.580.480.450.51
Video-CoCo0.510.580.480.450.51
Video-Coder-9B + OmniWeaving0.520.580.520.440.51
Video-Coder-9B + Minimax-H30.680.790.600.610.67
Table 2: Performance of different models on the VBench-2.0 benchmark. Best performance is in bold.
MethodMechanics (↑)Thermotics (↑)Material (↑)Average (↑)
Sora62.22%43.36%64.94%56.84%
Kling 1.665.55%59.46%68.00%64.34%
HunyuanVideo76.09%56.52%64.37%65.66%
Minimax-H367.59%47.22%48.94%54.58%
CogVideoX-1.580.80%67.13%83.19%77.04%
Video-Coder-9B + Minimax-H388.67%70.88%75.02%78.19%
Table 3: Ablation study of Video-Coder on PhyGenBench.
MethodsPhyGenBench
Minimax-H30.61
+ Video-Coder-SFT0.63
+ Video-Coder-wo-annealing0.65
+ Video-Coder-wo-video reward0.64
+ Video-Coder-wo-execution reward0.63
+ Video-Coder0.67

Qualitative Examples

Prompt← Draft video (Video-Coder)Generated video (MiniMax-H3) →
Figure 3: Drag each video to compare the draft from Video-Coder's Blender code with the final video from MiniMax-H3.