Navigation menu
Video-Coder: Reinforcing Agentic Coding for Video Generation
Video-Coder: Reinforcing Agentic Coding for Video Generation
Chaoyang Wang, Sicheng Gao, Junan Hu, Kunyang Li, Dongyang Chen, Yiyang Zhou et al.
2026-11-09▲ 16arXiv 2611.09894v1Hugging FaceCode
AI-generated from the full paper (deepseek-flash). It may contain mistakes; check the original.
TL;DR
Video-Coder trains a Qwen3.5-9B multimodal coding agent with SFT plus harness-native agentic RL to write, execute and revise Blender programs whose rendered gray-clay draft videos guide a frozen downstream video generator toward physically consistent output.
Problem
Diffusion and autoregressive video generators fit the video distribution in pixel or latent space without explicitly modeling the 3D world, so prompts with precise spatial relations, multi-object interactions or physically governed motion yield wrong object counts and positions, inconsistent occlusions, implausible trajectories, and objects that deform or vanish. End-to-end generated videos are also hard to edit or reproduce, leaving users to rewrite prompts by trial and error. Prior LLM-based code-for-3D approaches mostly operate single-turn or in fixed prompting pipelines, without refining code from execution feedback or optimizing for final video quality.
Method
The agent writes Blender Python code that builds a dynamic 3D scene; executing it in a sandbox yields a rendered draft video and execution feedback, and the agent iterates in a write-run-revise loop using shell commands plus check_script and run_blender tools. A four-stage data pipeline (prompt construction, agentic trajectory generation with Gemini 3.8 Flash, ground-truth synthesis with MiniMax-H3, and three-level filtering) produces Video-Coder-SFT-6k and Video-Coder-RL-2k. The Video-Coder Harness renders every scene under one shared setting (untextured gray clay shading, fixed resolution and frame rate) so the draft carries only structure and motion, and re-runs the submitted script from scratch in a clean directory before accepting an episode. Training starts from Qwen3.5-9B: SFT on the trajectory set, then agentic RL with GRPO on prompt-reference pairs, using a dual reward of executable-program reward R_exe and VLM-judged video reward R_video. The combined reward anneals the execution term as R = α·R_video + exp(-steps/T)·R_exe with α = 0.5, while the downstream video generator stays fixed.
Results
- Video-Coder-9B + Minimax-H3 achieves the best average PhyGenBench score among all compared methods and ranks first on all four categories. §4.2
- On VBench-2.0 physical dimensions the method reaches the highest average plausibility, surpassing CogVideoX-1.5 and improving over MiniMax-H3. §4.2
- On the mechanics dimension the method exceeds the best baseline CogVideoX-1.5 and its base generator MiniMax-H3. §4.2
- On material, Video-Coder improves over MiniMax-H3 but still lags behind CogVideoX-1.5. §4.2
- Trained with Minimax-H3 as the RL rollout generator, the agent transfers to another generator, improving OmniWeaving. §4.2
- Ablation on PhyGenBench: SFT alone gives a small gain, full SFT+RL gives the best score, and removing either reward or the annealing schedule degrades performance. §4.3
Limitations
- Material-related phenomena lag CogVideoX-1.5 (75.02% vs. 83.19%); the paper attributes this to material response depending on fine-grained appearance while the white-model video intentionally encodes only structure and motion (§4.2).
- Evaluation is restricted to two physics-focused benchmarks, PhyGenBench and the physical dimensions of VBench-2.0 (mechanics, thermotics, material); no other aspects of video quality are measured (§4.1).
- The dataset size is stated inconsistently: Video-Coder-SFT-6k and Video-Coder-RL-2k in §3.1 versus Video-Coder-SFT-10k and Video-Coder-RL-4k in §4.1 and §5.
- During training the video generator remains fixed and only the 9B coding agent is optimized, so performance depends on the downstream generator, and RL rollouts use Minimax-H3 specifically (§3.3, §4.1).
Key points
- Task formulation: prompt c is mapped to a Blender program f; executing it in the Harness yields (v, l) where v is the rendered white-model video (empty on failure) and l is execution feedback. §3.2
- The agent edits its script with shell commands and verifies it with check_script (static check) and run_blender; the Harness returns execution feedback, content checks, and evenly spaced rendered frames as images. §3.2
- A submission is accepted only if an independent re-execution of the final script in a clean directory passes all checks, guaranteeing reproducibility from code alone. §3.2
- Data construction has four stages (text prompt construction, agentic trajectory generation, ground-truth video synthesis, cleaning and filtering) with filtering at three levels: execution validity, draft video quality, and prompt-video consistency judged by Seed2.0. §3.1
- Training is two-stage from Qwen3.5-9B: SFT teaches scene programming, tool invocation, feedback interpretation and revision; harness-native agentic RL then optimizes multi-turn programming strategies. §3.3
- Final reward anneals the execution term: R = α·R_video + exp(-steps/T)·R_exe with α set to 0.5, so execution reward stabilizes early training and video reward dominates later. §3.3
- Policy optimization uses GRPO with group-normalized advantages over G sampled trajectories per prompt, plus a KL penalty to a reference policy. §3.3
- Training used 8 NVIDIA H100 GPUs with learning rate 1e-5 for SFT and 1e-6 for RL, batch size 8, group size 8, maximum 100 interaction turns, 120K context, and took approximately 3 days; MiniMax-H3 rollouts ran on 16 additional H100 GPUs. §4.1
- Sensitivity analysis shows performance drops slightly at α = 0.4 and α = 0.7, while α = 0.5 and α = 0.6 give similar favorable results. §4.4
Mind map
Sign In
Choose a method to continue
By signing in, you agree to our Terms and Privacy Policy

