arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.18364cs.AIcs.GRcs.MA
收藏

基于LLM的Manim动画生成的训练与代理推理策略

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

Department of Computer Science, Nottingham Trent University, Nottingham, United Kingdom(计算机科学系,诺丁汉特伦特大学,诺丁汉,英国)

Ravidu Suien Rammuni Silva, Ahmad Lotfi, Isibor Kennedy Ihianle, Golnaz Shahtahmassebi, Jordan J. Bird

AI总结:

本文提出ManimTrainer和ManimAgent,结合监督微调与强化学习,提升文本到代码到视频的转换性能,通过ManimBench评估17种模型,结果显示GRPO和RITL-DOC策略显著提升动画生成质量。

摘要:

使用Manim库生成程序化动画对大语言模型(LLMs)提出了独特挑战,需要空间推理、时间序列处理以及对领域特定API的熟悉,而这些在通用预训练数据中代表性不足。本文引入ManimTrainer,结合监督微调(SFT)与基于组相对策略优化(GRPO)的强化学习,使用统一奖励信号融合代码和视觉评估信号;并引入ManimAgent,采用循环渲染(RITL)和API文档增强的RITL(RITL-DOC)策略。通过这些技术,本文首次系统研究了文本到代码到视频的统一训练和推理方法。在ManimBench上评估了17种开源子30B LLMs的九种训练和推理策略组合。结果表明,SFT通常提高代码质量,而GRPO增强视觉输出并增加模型在推理时对外部信号的响应性。Qwen 3 Coder 30B模型在GRPO和RITL-DOC策略下实现了94%的渲染成功率(RSR)和85.7%的视觉相似度(VS),优于基线GPT-4.1模型。此外,分析显示代码和视觉指标之间的相关性在SFT和GRPO中增强,但在推理时间增强中减弱,突显了训练和代理推理策略在Manim动画生成中的互补作用。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑