Skip to content

Training and Agentic Inference Strategies for LLM-based Manim Animation Generation

Apr 2026 · arXiv.org · Vol abs/2604.18364 · 2 citations · 37 references
Computer Science

TL;DR

This study presents the first unified training and inference study for text-to-code-to-video transformation with Manim, and shows that the correlation between code and visual metrics strengthens with SFT but weakens with inference-time enhancements, highlighting the complementary roles of training and agentic inference strategies in Manim animation generation.

Abstract

Generating programmatic animation using libraries such as Manim presents unique challenges for Large Language Models (LLMs), requiring spatial reasoning, temporal sequencing, and familiarity with domain-specific APIs that are underrepresented in general pre-training data. A systematic study of how training and inference strategies interact in this setting is lacking in current research. This study introduces ManimTrainer, a training pipeline that combines Supervised Fine-tuning (SFT) with Reinforcement Learning (RL) based Group Relative Policy Optimisation (GRPO) using a unified reward signal that fuses code and visual assessment signals, and ManimAgent, an inference pipeline featuring Renderer-in-the-loop (RITL) and API documentation-augmented RITL (RITL-DOC) strategies. Using these techniques, this study presents the first unified training and inference study for text-to-code-to-video transformation with Manim. It evaluates 17 open-source sub-30B LLMs across nine combinations of training and inference strategies using ManimBench. Results show that SFT generally improves code quality, while GRPO enhances visual outputs and increases the models'responsiveness to extrinsic signals during self-correction at inference time. The Qwen 3 Coder 30B model with GRPO and RITL-DOC achieved the highest overall performance, with a 94% Render Success Rate (RSR) and 85.7% Visual Similarity (VS) to reference videos, surpassing the baseline GPT-4.1 model by +3 percentage points in VS. Additionally, the analysis shows that the correlation between code and visual metrics strengthens with SFT and GRPO but weakens with inference-time enhancements, highlighting the complementary roles of training and agentic inference strategies in Manim animation generation.

View source

Similar papers

#artificial intelligence Preprint Sep 2026

GlyphBench: A Playground for Language-Model Reinforcement Learning

These experiments provide empirical evidence that reasoning gains from gameplay can yield stronger transfer than math or code, and highlight GlyphBench's value as a testbed for systematic research on how language-model agents learn, interact, and generalize.

Roger Creus Castanyer, Marc-Alexandre Côté, Matthew J. Sargent et al. · 0 citations
#artificial intelligence Preprint Sep 2026

UnifiedPlayers: Enhance Tool-Integrated Reasoning in Agentic Reinforcement Learning

UnifiedPlayers, a cooperative framework comprising a Planning Player that generates tasks, an Execution Player that produces multi-turn trajectories with Python tool calls, and an Evaluation Player that constructs executable verifiers, highlights cooperation among specialized players as a promising path toward self-enh...

Wen-Jie Liao, Liang Zhao, Ze-Hong Cao · 0 citations
Preprint Sep 2026

Dissecting Advantage-Guided Post-Training for Vision-Language-Action Policies

This work dissects advantage-guided VLA post-training through a controlled empirical study that separates these design choices while accounting for their distinct estimands, and develops stage-specific offline evaluation methods to screen alternative choices efficiently, without requiring extensive real-robot policy ev...

Jia-Hang Cao, Han-Ye Zhao, Hang Lai et al. · 0 citations
Review Open access Aug 2026

Reinforcement Learning for Multimodal Foundation Models: A Survey

A coherent map of the rapidly expanding landscape of visual RL is provided to provide researchers and practitioners with a coherent map of the rapidly expanding landscape of visual RL and to highlight promising directions for future inquiry.

Weijia Wu, Chen Gao, Joya Chen et al. · 0 citations
#machine learning Preprint Sep 2026

PlayTrain: An Efficient Reinforcement Learning Framework for LLM-Generated Adaptable JavaScript Games

Through PlayTrain, an RL framework that combines the abilities of large language models to robustly generate JavaScript games from a minimal human prompt, and an efficient pipeline that can run any JS game in a standard'gym'environment, this work reimagine RL VGE development.

R. Truong, Lance Ying, Samuel Gershman et al. · 0 citations
#artificial intelligence Preprint Oct 2026

Selective Transfer of RL Updates for Visual Reasoning

This work isolates the RL-stage update, retains its dominant matrix-wise directions with magnitude preservation, and transfers them to the language modules of a VLM, which improves full-update interpolation in 12 of 15 comparisons, including an 8.55 percentage-point MathVision gain on the Qwen recipient.

Su-Xin Ji, Hung-Tao Wan, Ming-Jun Liu et al. · 0 citations

Related blog posts

Hugging Face Blog Oct 20, 2026

MPS in PyTorch 2.15

We’re on a journey to advance and democratize artificial intelligence through open source and open science.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.