TheoremExplainAgent: Towards Video-based Multimodal Explanations for LLM Theorem Understanding

Max Ku, Cheuk Hei Chong, Jonathan Leung, Krish Shah, Alvin Yu, Wenhu Chen

Executive Summary

TheoremExplainAgent (TEA) is a novel agentic framework designed to enable Large Language Models (LLMs) to generate long-form (5+ minute) educational videos. By utilizing the Manim animation engine, TEA produces complex STEM theorem explanations that move beyond simple text-based reasoning. A key finding of this research is that visual explanations serve as a "truth serum," revealing deep-seated conceptual flaws in AI models that standard text-based benchmarks often fail to detect.

The Challenge of Surface-Level Understanding

While LLMs have become remarkably proficient at solving mathematical problems and passing exams, there is a lingering concern that they often perform "surface-level pattern matching." Current benchmarks primarily rely on multiple-choice or short-answer text, which can be gamed by models sensitive to superficial cues.

Comparison of text-based vs. multimodal explanations for Bubble Sort, highlighting the increased interpretability of visual elements.

The authors argue that true understanding requires the ability to communicate abstract concepts through structured visualizations—a core component of human pedagogical intuition. However, generating a coherent, multi-minute educational video is a massive technical challenge for an LLM, requiring long-term planning, precise code generation for animations, and synchronized narration.

Methodology: TheoremExplainAgent (TEA)

The researchers developed TheoremExplainAgent (TEA), an agentic pipeline that mimics a human video production process through two primary roles:

  1. The Planner Agent: This agent takes a theorem and its context to create a high-level "storyboard," breaking the explanation into multiple scenes and defining the purpose, visual layout, and narration for each.
  2. The Code Agent: This agent translates the planner's vision into executable Python code using Manim (the animation engine utilized by educational channels like 3Blue1Brown).

To ensure system robustness, TEA includes an Agentic Retrieval-Augmented Generation (RAG) system that fetches specific Manim documentation and code snippets. It also features an iterative debugging loop: if the generated code fails to render, the agent analyzes error logs and attempts to fix the code (up to five times).

Evaluation: TheoremExplainBench (TEB)

The authors introduced TheoremExplainBench (TEB), a comprehensive benchmark designed to test multimodal explanation capabilities across 240 theorems in Mathematics, Physics, Chemistry, and Computer Science. Theorems are categorized by difficulty from High School to Graduate levels. Evaluation utilizes five automated metrics—Accuracy & Depth, Visual Relevance, Logical Flow, Element Layout, and Visual Consistency—alongside human expert reviews.

Key Insights and Results

  • Visuals Expose Reasoning Flaws: In a human study, participants initially judged a model's text-based explanation as correct. However, after watching the model-generated video, 60% realized the model had a fundamental misunderstanding. Visuals make "hallucinations" significantly harder to hide.
  • The Necessity of Agency: "Agentless" LLMs typically fail to produce videos longer than 20 seconds. The agentic approach of planning followed by coding allows for videos exceeding 10 minutes.
  • Model Performance: OpenAI’s o3-mini emerged as a top performer, achieving a 93.8% success rate in generating complete videos, significantly outperforming GPT-4o (55%) and Claude 3.5 Sonnet in code reliability.
  • Human Alignment: Automated metrics showed a strong correlation (up to 0.72 Spearman rho) with human ratings, suggesting that AI can effectively evaluate its own multimodal outputs.

Limitations and Future Work

Despite high success rates, the "perceptual quality" of videos requires improvement. Common issues include overlapping shapes, misaligned text, and inconsistent object sizes, indicating that agents still struggle with complex spatial reasoning. Future research will focus on improving spatial awareness, developing interactive visualizations, and building more "Manim-aware" retrieval systems to prevent code hallucinations.

Summary updated

BibTeX
@inproceedings{ku2025theoremexplainagent,
  author = {Max Ku and Cheuk Hei Chong and Jonathan Leung and Krish Shah and Alvin Yu and Wenhu Chen},
  title = {{TheoremExplainAgent: Towards Video-based Multimodal Explanations for LLM Theorem Understanding}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure