See Before You Code: Learning Visual Priors and Spatial Grounding for Educational Animation Generation
cs.AI, cs.CV
Submitted: 2026-05-15
Updated: 2026-11-28
Comments: 40 pages, 7 figures, 13 tables
License: http://creativecommons.org/licenses/by/4.0/
The gist: Large language models can generate executable code for educational animations, yet the rendered outputs often suffer from viewport overflow, element overlap, remnant content, and scale mismatch.
Terminology
Abstract
Large language models can generate executable code for educational animations, yet the rendered outputs often suffer from viewport overflow, element overlap, remnant content, and scale mismatch. These failures expose gaps in planning valid layouts, implementing visual constraints in code, and repairing errors revealed by rendering. We propose OmniManim, an educational animation generation framework that integrates explicit visual planning, spatially grounded code learning, and render-feedback-aware repair. Its Vision Agent predicts sparse keyframe layouts through coarse-to-fine bounding-box denoising with interpolation-aware constraints. Spatially Grounded Code Supervision (SGCS) aligns plan-conditioned code generation and diagnostic-guided repair with these layouts. Failure-Localized Render Policy Optimization (FLRPO) associates rendered failures with objects, time intervals, and code regions, and optimizes local patches using measured rendering gains, global constraint preservation, and edit costs. Together, these components connect visual plans to executable code and targeted self-repair. We also construct ManimLayout-1K for visual-layout and aligned code supervision, and EduRequire-500 for evaluating executability, instructional quality, visual quality, and efficiency. Experiments on EduRequire-500, TheoremExplainBench, and VisualEDU cover two agent-only backbones (GPT-5.4 and Gemini) and three SGCS/FLRPO-trained backbones (Qwen3-14B, Gemma, and Llama). On EduRequire-500, agent-only GPT-5.4 improves Manim animation generation over Code2Video, raising final render success from 0.923 to 0.986 and layout quality from 0.742 to 0.931, and reducing time from 148 s to 72 s.
Sources
- Lumiere: A Space-Time Diffusion Model for Video Generation
- LayoutDM: Transformer-based Diffusion Model for Layout Generation
- Teaching Large Language Models to Self-Debug
- Code2Video: A Code-centric Paradigm for Educational Video Generation
- Imagen Video: High Definition Video Generation with Diffusion Models
- From EduVisBench to EduVisAgent: A Benchmark and Multi-Agent Framework for Reasoning-Driven Pedagogical Visualization
- VideoPoet: A Large Language Model for Zero-Shot Video Generation
- TheoremExplainAgent: Towards Video-based Multimodal Explanations for LLM Theorem Understanding
- ManiBench: A Benchmark for Testing Visual-Logic Drift and Syntactic Hallucinations in Manim Code Generation
- GPT-4 Technical Report
- TeachMaster: Generative Teaching via Code
- AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Related papers
- Beyond Moral Performance: Empirical Assessment of LLMs' Moral Competence Through Judgment Stability
- K12Vista: Exploring the Boundaries of MLLMs in K-12 Education
- A Matter of TASTE: Improving Coverage and Difficulty of Agent Benchmarks
- FlowSteer: Towards Agents Designing Agentic Workflows via Reinforced Progressive Canvas Editing
- Tokengeist: Multi-Turn Attribution Tracing in Agentic Conversations
- VESTA: Visual Exploration with Statistical Tool Agents