MoReGen: Multi-Agent Motion-Reasoning Engine for Code-based Text-to-Video Synthesis

Xiangyu Bai, He Liang, Bishoy Galoaa, Utsav Nandi, Shayda Moezzi, Yuhang He, Sarah Ostadabbas

TL;DR

MoReGen is a novel text-to-video framework that shifts generation from probabilistic pixel denoising to deterministic code execution. By combining multi-agent Large Language Models (LLMs) with physics simulators, it synthesizes videos that strictly obey Newtonian mechanics, significantly outperforming state-of-the-art diffusion models in physical accuracy.

What Problem Does This Paper Address?

While modern text-to-video (T2V) models like OpenAI's Sora or Google's Veo excel at generating photorealistic videos, they frequently fail at a fundamental level: they do not understand physics. As purely data-driven systems, they replicate statistical correlations rather than causal reasoning. Consequently, they often produce physically absurd behaviors—such as objects disappearing during collisions, incorrect momentum conservation, or unnatural gravity.

Furthermore, standard evaluation metrics (like FID and FVD) only measure visual and distributional similarity to training data, completely overlooking whether a video maintains temporal consistency or obeys physical laws. The authors address this dual challenge by proposing a physics-grounded generation engine and a trajectory-based evaluation framework.

Failures of current commercial T2V models in basic physics scenarios.

Methods

Instead of generating pixels directly, MoReGen generates executable code for physics engines and renderers. The framework relies on a coordinated multi-agent architecture:

  1. Text-Parser Agent ($A_{\text{text}}$): A supervised fine-tuned (SFT) LLM (Qwen2.5-Coder-14B) that extracts physical parameters, initial conditions, and object descriptors from a natural language prompt into a structured JSON schema.
  2. Code-Writer Agent ($A_{\text{coder}}$): Translates this structured specification into executable Python code utilizing open-source physics libraries (e.g., Pymunk, Blender, or Manim).
  3. Video-Render Agent ($A_{\text{render}}$): Runs the code in a sandboxed environment to simulate the physics, records precise object trajectories (telemetry), and renders the final video.
  4. Evaluator Loop: To ensure robustness, an evaluator analyzes the rendered video using object detection (GroundedDINO) and point tracking (CoTracker3) to estimate the visual trajectory. A Vision-Language Model (VLM) compares this back to the simulator's ground truth and provides iterative feedback to the Code-Writer to fix code errors or physical discrepancies.
Figure 2. Overview of our multi-agent motion-reasoning engine (MoReGen) for physics-grounded text-to-video synthesis. MoReGen focuses on achieving high-precision Newtonian motion through coordinated multi-agent reasoning. Given a natural language prompt, the text-parser agent Atext extracts physical parameters and motion descriptors, which are then translated into executable simulation code by the code-writer agent Acoder. The resulting code is executed within a sandboxed video-render agent Arender to produce a physically plausible video. This video serves as the basis for evaluator feedback, guiding enhancements in code robustness and physical fidelity for subsequent iterations. By leveraging open-source LLMs, few-shot tuning of Atext and multi-modal evaluator, MoReGen enables accurate and reproducible Newtonian motion synthesis from natural language instructions.

Datasets

The authors introduce MoReSet, a benchmark suite containing 1,275 videos across nine fundamental Newtonian physics categories (including gravity, collisions, buoyancy, and pulley mechanics):

  • Training Set: 1,200 Blender-generated simulations paired with free-form text descriptions and high-quality JSON physical specifications.
  • Test Set: 75 real-world laboratory videos, meticulously human-annotated with scene descriptions, spatiotemporal relations, and precise pixel-level object trajectories.

Key Insights and Ideas

  • Simulation over Imagination: Bypassing the pixel-generation phase entirely for physics dynamics eliminates the "hallucinations" inherent to diffusion models. Deterministic physics engines guarantee that objects conserve momentum and follow exact gravitational trajectories.
  • Scale Doesn't Solve Physics: A key finding is that scaling up model parameters improves visual aesthetics but does not inherently fix physical reasoning. Massive commercial models perform similarly to or worse than smaller open-source models when evaluated strictly on trajectory accuracy.
  • Flaws in Existing "Physics" Metrics: Prior data-driven physics evaluators (like Trajan or VideoPhy) are heavily biased toward appearance. They often award high scores to physically impossible videos simply because the visual quality looks realistic or matches their training distribution.

Key Results

The authors evaluated MoReGen against top-tier T2V models using MoRe Metrics (Dynamic Time Warping [DTW] and Procrustes Analysis) to measure trajectory fidelity against ground truth:

  • Trajectory Accuracy: MoReGen achieved a DTW score of 8.93, significantly outperforming OpenAI's Sora 2 (11.21), Google's Veo3 (13.35), and CogVideoX-5B (12.94). Lower scores indicate closer alignment with true physical trajectories.
  • Ablation Success: Without supervised fine-tuning and the evaluator loop, the base 14B coder agent failed to generate executable code due to syntax errors. With the feedback loop active, the 14B model successfully generated robust code, even outperforming GPT-5 on physics accuracy metrics.
Qualitative comparison of Newton's cradle simulation across different models.

Limitations and Future Work

While MoReGen guarantees physical accuracy, its visual output is currently limited by the rendering engines used in the pipeline (such as 2D pygame scripts). The generated videos lack the rich photorealism of end-to-end diffusion models.

To bridge this gap, the authors plan to extend MoReGen to advanced 3D rendering suites like Unreal Engine, Unity, or full Blender pipelines. This would combine the framework's flawless physical trajectories with photorealistic environmental assets.

Summary updated

BibTeX
@inproceedings{bai2026moregen,
  author = {Xiangyu Bai and He Liang and Bishoy Galoaa and Utsav Nandi and Shayda Moezzi and Yuhang He and Sarah Ostadabbas},
  title = {{MoReGen: Multi-Agent Motion-Reasoning Engine for Code-based Text-to-Video Synthesis}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=p7AGxfV81e},
}
Figure