Skip to main content
Back

NUS's Code2Video Builds Educational Videos 9.7x Faster Using Python Code

Code2Video uses a three-agent pipeline to turn any knowledge point into a 3Blue1Brown-style animated video via Manim code — accepted at ICML 2026

  • Code2Video is an open-source, MIT-licensed framework from NUS Show Lab that generates Manim-based educational videos from a single knowledge point.
  • It uses a three-agent pipeline (Planner, Coder, Critic) to structure content, write Python/Manim code, and refine visual layouts automatically.
  • Achieves a 40% TeachQuiz boost and up to 50% aesthetics improvement over direct LLM code generation, while being 9.7x faster.
  • Ships with MMMC, the first benchmark for code-driven video generation: 456 expert videos across 13 domains including topology, physics, and neural networks.
  • Best results use Claude-4-Opus for code generation and Gemini-2.5-Pro for visual critique; requires API keys for both.
  • Accepted to ICML 2026; limitations include reliance on icon assets and weaker performance on highly abstract or narrative topics.

Code2Video is an open-source framework from Show Lab at the National University of Singapore that generates structured educational videos from a single knowledge point , not by prompting a diffusion model, but by writing and executing Python code. The system just got accepted to ICML 2026, and the approach is genuinely different from anything in the text-to-video space right now.

Recent generative models have made remarkable progress in pixel-space video synthesis, but they remain limited in producing professional educational videos, which demand disciplinary knowledge, precise visual structures, and coherent transitions. Code2Video sidesteps this entirely. Unlike pixel-based diffusion or text-to-video models, Code2Video treats code as the core generative medium, enabling precise visual control, transparency, and interpretability in long-form educational content.

Three agents, one video

Given a user inquiry, Code2Video renders an educational video via Manim code writing: the Planner converts a learning topic into a storyboard and retrieves visual assets; the Coder performs parallel code synthesis with scope-guided refinement to ensure efficiency and temporal consistency; the Critic uses visual anchor prompts to iteratively adjust spatial layout and clarity, yielding reproducible, educationally structured videos.

Manim is the Python animation library originally built by 3Blue1Brown , the same tool behind those iconic math explainer videos. Code2Video essentially automates the entire Manim workflow end-to-end. Here is how you kick off a single video generation: