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 Python/Manim code as an intermediate representation to automate end-to-end educational video production. It introduces "Generative Teaching," a paradigm where educators supply pedagogical intent and a staged agent pipeline handles planning, visual synthesis, narration, and quality validation. Deployed at scale, it reduces production costs to 0.3% of traditional course production (\(83.70 for a 45-hour course vs. ~\)30,000 conventional).
Problem¶
High-quality educational video production is expensive (~$30,000/course), slow, and unscalable. End-to-end diffusion/video models (e.g., Sora 2) ignore pedagogical structure, produce short uneditable clips, and are computationally intensive. GUI-mimicking agent approaches require large multimodal trajectory datasets and expensive training. Both categories yield black-box outputs incompatible with educator review or iteration.
Method¶
TeachMaster decomposes production into three sequential stages, each implemented as a specialized agent subteam:
-
Content Planning: A composition agent cascades semantic skeletonization \(S\), content expansion \(E\), and iterative length refinement \(R\) to produce a manuscript \(L_\text{out} = R(E(S(k)), t)\). A pagination agent then segments \(L_\text{out}\) into per-slide blueprints \(\{P_i\}\) using a Chain-of-Agents (CoA) framework that partitions long text into segments for parallel local agents.
-
Presentation Generation: A routing agent selects between a Standard coding path or an ImageEnhanced path (for photorealistic assets) per blueprint \(P_i\); code \(C_i\) is rendered via the Manim engine using either Gemini-3 or fine-tuned Qwen3-32B. A narration agent generates script \(T_i\) conditioned on \(P_i\), prior context \(T_{i-1}\), and code \(C_i\) (cross-modal conditioning). A TTS agent produces audio \(A_i\) and speaking rate \(r_i\).
-
Quality Validation: Three specialized agents run sequentially: (a) a debugging agent employing an iterative render-and-repair loop \(C_i^\text{debug} = F_\text{debug}(C_i, \text{Error}(C_i))\) with a fallback-to-template mechanism after \(\tau\) failures; (b) a synchronization agent that injects temporal control logic (wait statements) into code using event anchors and \(r_i\); (c) a layout agent that detects geometric overlaps \(O_i\), computes corrected coordinates \(\Omega_i\) via heuristic scanning order, and applies code-level patches.
Human-in-the-loop is supported via natural language refinement or direct code editing before final rendering.
Qwen3-32B was fine-tuned on 3,735 human-annotated Manim code pairs via LoRA (\(r=128\), \(\alpha=256\)) with curriculum learning on 8×A800 GPUs.
Key Contributions¶
- Generative Teaching paradigm: reframes educator role from content producer to high-level director specifying pedagogical intent.
- Code-as-intermediate-representation: substitutes opaque pixel-level generation with interpretable, editable Manim programs, enabling modularity and precise control.
- End-to-end multi-agent pipeline: planning → generation → validation with fallback mechanisms, synchronization logic, and human-in-the-loop editing.
- Real-world deployment at scale: 1,000+ educators, 30,000+ minutes of content, 40+ disciplines; production cost reduced to 0.3% of traditional methods.
- Fine-tuned local code model: Qwen3-32B specialized for Manim generation, enabling privacy-sensitive or offline deployment.
Results¶
- Video quality (Overall, GPT-5.2 scored 1–10): TeachMasterGemini 7.91†, TeachMasterQwen 7.59†, Sora 2 7.57, Human 8.29.
- Production efficiency (Ratio = production min / video min): TeachMasterGemini 2.46, TeachMasterQwen 3.47, Sora 2 12.80, Human 24.46.
- Script quality (Overall): TeachMasterGemini 8.95†, Human 8.84, TeachMasterQwen 8.34†, Sora 2 4.39.
- Cross-modal semantic alignment (Overall): TeachMasterQwen 8.79†, TeachMasterGemini 8.44†, Human 8.13, Sora 2 6.65 — both TeachMaster variants surpass human-crafted content on this dimension.
- Human-in-the-loop burden: 75.2% of slides require zero manual intervention; remaining slides finalized in avg. 1.88 interaction rounds.
- Human-AI agreement: 81.71% between GPT-5.2 evaluator and a 3-expert panel over 300 videos.
Limitations¶
- Rendering is tightly coupled to the Manim engine; content types requiring non-geometric visual idioms (e.g., live video, complex UI mockups) fall back to static image integration.
- Quality metrics rely on GPT-5.2 as proxy evaluator; human panel covers only 300 sampled videos.
- Local (Qwen) deployment requires an 8×A800 GPU cluster; accessibility for resource-constrained institutions is limited.
- Fine-tuning dataset of 3,735 pairs is modest; generalization to highly domain-specific or visually unusual content (e.g., surgical procedures) is not validated.
- The paper does not report failure rate statistics across disciplines beyond aggregate counts.
Relevance to Harnesses / Meta-Harnesses¶
TeachMaster is a direct instantiation of a production harness: it wraps a heterogeneous set of specialist agents (planner, coder, narrator, TTS, debugger, synchronizer, layout corrector) behind a unified pipeline abstraction that converts a high-level intent specification into a finished artifact. The render-and-repair loop with threshold-triggered fallback is a canonical harness resilience pattern — structurally identical to retry-with-degradation loops in code-execution harnesses. The human-in-the-loop interface acts as an optional override layer, consistent with meta-harness designs that preserve human authority over agent decisions. For researchers tracking harness architecture, TeachMaster provides a well-documented case study of how staged orchestration, intermediate-representation contracts (code rather than pixels), and per-stage validation agents compose into a robust end-to-end harness with measurable quality and efficiency outcomes.