
Preprint: Training on failed renders helps a small model repair educational animations
Zhengyang Liang, Lizi Liao
arXiv preprint
Ringkasan 500 kata

A 4-billion-parameter open model reached render success rates of 96.6% and 97.0% on two scene-level animation benchmarks after training on a new dataset that preserves the messy process of fixing failed renders. The same untrained model reached only 52.6% and 82.0% under an identical loop. The improvement comes from learning not just to write animation code but also to inspect rendered frames, describe visual defects, and decide what code changes will repair them. Reinforcement learning on the model's own failures contributes additional gains.
A successfully rendered educational animation can still be pedagogically poor. A program may execute while labels overlap, objects fall outside the frame, or explanations omit important steps. The video does not directly identify the code changes needed to correct these visual failures, so existing agentic frameworks typically rely on large models, often proprietary, to inspect output and revise code. Existing Manim datasets mostly contain final programs and discard the errors, visual critiques, and corrections that led to them, leaving little material for training a smaller model to do that reflective work.
To address this gap, Liang and Liao built ManimData. They collected programs from community datasets and generated requests from Wikipedia STEM topics, then ran each through a render-guided pipeline. A strong open multimodal model wrote or revised each program, executed it, checked layout, and reviewed eight frames for request alignment, content completeness, visual clarity, and animation quality. Execution errors, layout diagnostics, and critiques were fed back to revise the program, with retrieved API documentation available. Only records whose best candidate achieved a mean review score of at least 3.75 were kept. The dataset contains 24,034 render-verified, quality-filtered records with full revision trajectories.
The authors used those trajectories to train one model for three roles through role-conditioned supervised fine-tuning: a Writer, a Reviewer, and a Reviser. Because the training trajectories came from a stronger model, they applied reinforcement learning to the Reviser on states the small model generated itself. For repair states, a rendering bonus was tied to request alignment and content completeness. For critique states, revised videos were compared with the original in both presentation orders, and the model was rewarded when an external judge preferred the revision in both orders. This required no reference program or target video.
In scene-level tests, ManimCode outperformed larger general-purpose models on render success and had video quality near recent mixture-of-experts models. An ablation showed the untrained loop raised render success from 7.0% to 52.6% on ManimData-test, supervised training on examples of revisions lifted it to 88.6%, and reinforcement learning for the revision step added 8.0 points. Video quality rose from 2.48 to 2.94 on a 1–5 scale on ManimData-test. When substituted into Code2Video and TheoremExplainAgent as the scene generator, completed videos rose from 19 of 117 topics to 107 of 117, and from 53 of 239 to all 239. Automated judges also gave higher ratings for educational content and visual quality.
Open issues remain. A small human evaluation found agreement with the automatic judge on 79% of pairs when quality gaps exceeded 0.5, but only 29% below 0.25. Some revision failures introduced new layout defects while fixing earlier ones. The keep-best strategy prevented regressions but could not repair defects the reviser failed to address. This arXiv preprint describes scene-level animation code, not measured student learning outcomes.


