Skip to content

TeachMaster: Generative Teaching via Code

šŸ•’ Published (v1): 2025-12-07 12:52 UTC Ā· Source: Arxiv Ā· Venue: ACL 2026 Ā· link

Ask a follow-up

Open an assistant pre-loaded with this paper's context.

šŸ’¬ Ask ChatGPT✦ Ask Claude

TL;DR

TeachMaster is a multi-agent framework that uses code (Manim Python scripts) as an intermediate representation to automate end-to-end educational video production. It introduces "Generative Teaching," a paradigm where educators specify pedagogical intent and agents handle planning, visual synthesis, narration, and quality validation. The system reduces production costs to 0.3% of traditional online course production while approaching human-level quality.

Problem

High-quality educational video production is expensive (~$30,000/course), slow to update, and difficult to scale. End-to-end video generation models (e.g., diffusion-based) lack pedagogical structure, are uneditable, and computationally intensive. GUI-automation approaches require large multimodal trajectory datasets and expensive training. No existing system provides full-scale, editable, synchronized audio-visual educational content at industrial production quality.

Method

TeachMaster orchestrates a pipeline of specialized LLM agents across three stages:

  1. Content Planning: A composition agent applies cascaded skeletonization → expansion → length refinement to produce a manuscript; a Chain-of-Agents pagination agent segments it into page-level blueprints.
  2. Presentation Generation: A routing agent selects between a standard coding agent (geometric/abstract content) and an image-enhanced coding agent (photorealistic assets) to generate Manim Python code per page. A narration agent conditions on the page blueprint, prior script context, and visual code to ensure cross-modal coherence; a TTS agent (Minimax) synthesizes audio and quantifies speaking rate for downstream alignment.
  3. Quality Validation: A debugging agent runs an iterative render-and-repair loop with fallback to standard templates; a synchronization agent injects temporal wait statements using computed speaking rates to align animation events to narration; a layout agent detects and resolves geometric overlaps via heuristic coordinate retrieval. Human-in-the-loop refinement via natural language or direct code editing is supported.

The visual rendering engine is Manim; the coding backbone is switchable between Gemini-3 (API) and a locally fine-tuned Qwen3-32B (LoRA r=128, α=256 on 3,735 curated Manim annotation pairs with curriculum learning, trained on 8ƗA800 GPUs).

Key Contributions

  • Generative Teaching paradigm: reframes educators as high-level intent directors rather than manual content producers.
  • Code-as-intermediate-representation: uses executable Manim Python scripts instead of pixel-level generation, ensuring interpretability, editability, and precise control.
  • Multi-agent pipeline: specialized agents for planning, dual-path visual synthesis, narration, debugging, synchronization, and layout correction working in concert.
  • Dual-engine configuration: API-based Gemini-3 and locally fine-tuned Qwen3-32B for Manim code generation, supporting deployment flexibility.
  • Large-scale real-world deployment: >1,000 educators served, >30,000 minutes of content generated across 40+ disciplines.

Results

  • Production cost: ~$83.70 for a 45-hour course, or ~0.3% of traditional online course costs.
  • Production efficiency (Table 1): TeachMaster (Gemini) requires ~2.46 min production time per minute of video vs. >12 min for Sora 2 and 24.46 min for human production.
  • Video quality overall (Table 1): TeachMaster-Gemini 7.91, TeachMaster-Qwen 7.59, vs. Sora 2 7.57 and Human 8.29 (GPT-5.2 scored, 1–10 scale; differences from baselines statistically significant p≤0.05).
  • Script quality overall (Table 2): TeachMaster-Gemini 8.95 vs. Human 8.84 and Sora 2 4.39 (TeachMaster-Gemini surpasses human baseline).
  • Cross-modal alignment overall (Table 3): TeachMaster-Qwen 8.79, TeachMaster-Gemini 8.44, vs. Human 8.13 and Sora 2 6.65 (both TeachMaster variants exceed human on semantic coverage, referential accuracy, and visual-verbal symmetry).
  • Human-AI agreement: 81.71% agreement between expert panel and GPT-5.2 evaluator across 300 videos.
  • Human-in-the-loop efficiency: >75.2% of pages require zero manual intervention; remaining pages finalized in avg. 1.88 interaction rounds.

Limitations

  • Quality metrics rely on GPT-5.2 as a proxy evaluator, which, while validated at 81.71% human agreement, may not fully capture domain-specific pedagogical nuance.
  • Rendering is tied to the Manim engine, limiting visual style diversity to what Manim can express; photorealistic content requires fallback to image synthesis integration.
  • The fine-tuned Qwen3-32B was trained on only 3,735 annotation pairs, which may limit generalization to highly specialized or novel visual content types.
  • TeachMaster-Qwen scores notably lower than TeachMaster-Gemini on script completeness (8.17 vs. 9.67) and overall script quality (8.34 vs. 8.95), suggesting the local model is a meaningful quality trade-off.
  • The debugging fallback to standard templates when repair fails means complex animations may silently degrade to simpler representations.
  • Evaluation excludes comparison to existing slide-generation or AI tutoring systems due to functional gaps, leaving the comparison set narrow (only Sora 2 and human).

Relevance to Agentic AI / LLM Agents

TeachMaster is a concrete example of multi-agent orchestration applied to a complex real-world production pipeline, demonstrating how role-specialized agents (planner, coder, narrator, debugger, synchronizer, layout optimizer) can decompose a multi-modal generation task beyond what any single model handles well. The use of code as the agent communication medium — rather than natural language or pixel outputs — is an important design principle: it provides verifiable, executable, and editable intermediate state that enables downstream agents to precisely inspect and repair prior agents' outputs. The iterative render-and-repair debugging loop exemplifies an agentic self-correction pattern applicable well beyond education. This work is directly relevant to ongoing research on agentic code generation, tool-augmented LLMs, and structured output generation for domain-specific workflows.