# CineCoder: Training Visual Coding Agents via Agentic RL for Consistent Multi-Shot Video Generation

arXiv: https://arxiv.org/abs/2611.39699 · HTML: https://mlsanity.com/paper/2611.39699/

## Key facts

- No citing papers in the map yet (data through 2 Dec 2026).
- Placed in Video generation, one of 14 directions in Diffusion models.
- Builds on 26 of its 28 references that are in the map.
- Submitted 29 Nov 2026, announced 1 Dec 2026.

## Placed in

- Diffusion models / [Video generation](https://mlsanity.com/diffusion/video-generation/)
- LLM agents and tool use / [Multimodal and embodied agents](https://mlsanity.com/agents/multimodal-and-embodied-agents/)

## Builds on (most cited first, 26 of 26)

- [DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models](https://mlsanity.com/paper/2402.03300/) (2024)
- [DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning](https://mlsanity.com/paper/2501.12948/) (2025)
- [Wan: Open and Advanced Large-Scale Video Generative Models](https://mlsanity.com/paper/2503.20314/) (2025)
- [CogVideoX: Text-to-Video Diffusion Models with An Expert Transformer](https://mlsanity.com/paper/2408.06072/) (2024)
- [VBench: Comprehensive Benchmark Suite for Video Generative Models](https://mlsanity.com/paper/2311.17982/) (2023)
- [HunyuanVideo: A Systematic Framework For Large Video Generative Models](https://mlsanity.com/paper/2412.03603/) (2024)
- [MotionCtrl: A Unified and Flexible Motion Controller for Video Generation](https://mlsanity.com/paper/2312.03641/) (2023)
- [Holodeck: Language Guided Generation of 3D Embodied AI Environments](https://mlsanity.com/paper/2312.09067/) (2023)
- [StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation](https://mlsanity.com/paper/2405.01434/) (2024)
- [SceneCraft: An LLM Agent for Synthesizing 3D Scene as Blender Code](https://mlsanity.com/paper/2403.01248/) (2024)
- [3D-GPT: Procedural 3D Modeling with Large Language Models](https://mlsanity.com/paper/2310.12945/) (2023)
- [MovieDreamer: Hierarchical Generation for Coherent Long Visual Sequence](https://mlsanity.com/paper/2407.16655/) (2024)
- [HoloCine: Holistic Generation of Cinematic Multi-Shot Long Video Narratives](https://mlsanity.com/paper/2510.20822/) (2025)
- [MultiShotMaster: A Controllable Multi-Shot Video Generation Framework](https://mlsanity.com/paper/2512.03041/) (2025)
- [Code2Video: A Code-centric Paradigm for Educational Video Generation](https://mlsanity.com/paper/2510.01174/) (2025)
- [ShotStream: Streaming Multi-Shot Video Generation for Interactive Storytelling](https://mlsanity.com/paper/2603.25746/) (2026)
- [VideoCoCo: Code-as-CoT for Physically-Consistent Video Generation via an Agentic Dual-Engine System](https://mlsanity.com/paper/2607.27380/) (2026)
- [Code Plans, Diffusion Renders: Open-Ended Generative World Modeling](https://mlsanity.com/paper/2609.26458/) (2026)
- [JanusCoder: Towards a Foundational Visual-Programmatic Interface for Code Intelligence](https://mlsanity.com/paper/2510.23538/) (2025)
- [ShotVerse: Advancing Cinematic Camera Control for Text-Driven Multi-Shot Video Creation](https://mlsanity.com/paper/2603.11421/) (2026)
- [StateFlow: Building, Evolving, and Accessing 3D World States for Previsualization](https://mlsanity.com/paper/2608.12314/) (2026)
- [Video-Coder: Reinforcing Agentic Coding for Video Generation](https://mlsanity.com/paper/2611.09894/) (2026)
- [Mise-en-Video: Fine-Grained 3D Control for Multi-Shot Video Generation](https://mlsanity.com/paper/2610.26801/) (2026)
- [CineEvolve: An Agentic Self-Evolution Framework for Cinematic Multi-Shot Video Generation](https://mlsanity.com/paper/2610.29590/) (2026)
- [FilmFlow: Agentic System for 3D Virtual Film Cinematography](https://mlsanity.com/paper/2610.30753/) (2026)
- [CamPilot: A Multi-Agent Cinematic Assistant for Camera-Controlled Movie Generation](https://mlsanity.com/paper/2609.10943/) (2026)

## Abstract (arXiv)

Recent advances in video diffusion models and LLM-driven coding agents have enabled promising progress in automated video generation. However, generating coherent multi-shot narrative videos remains challenging: end-to-end diffusion models struggle to preserve object states across cuts and often alter the entire video when a single shot is edited, while existing 3D agents suffer from fragile spatial control and slow environment interaction that bottlenecks interactive coding. To provide a stable world state across cuts, we present CineCoder, a visual coding framework that anchors scenes, stateful objects, and characters in executable code before draft-aligned reference-to-video synthesis. When using draft videos as references, it utilize existing frozen DiT models to generate videos across multiple shots while maintaining consistency in draft scenes and motion. Furthermore, to overcome the slow feedback loop that limits reinforcement learning updates in existing agent environments, we develop CineCoder-Env in Three.js, a versatile agentic environment that combines diverse scenes, character actions, stateful assets, and camera controls with fast execution and visibility feedback. Building on CineCoder-Env, we post-train a 27B multimodal coding agent on real short dramas and synthesized multi-shot scripts, via supervised fine-tuning (SFT) without reasoning traces, followed by Group Relative Policy Optimization (GRPO) with chain-of-thought reasoning to strengthen 3D spatial planning. Finally, we construct DramaBench, a comprehensive multi-shot benchmark spanning diverse scene domains, task types, and difficulty levels, where CineCoder achieves promising performance across narrative faithfulness, visual quality, and local editing consistency.
