Evaluating and Training LLMs for Math Copilots and Theorem Proving
Simon Frieder, Philip Vonderlind
International Conference on Machine Learning 2026 · Tutorial
Overview
The integration of artificial intelligence into mathematics represents a fundamental shift in how mathematical research, problem-solving, and verification are conducted. Presented at the ICML workshop on AI for math, this session—titled "No Country for Old Proofs"—explores the transition from traditional pen-and-paper mathematics to AI-assisted and formally verified workflows. The speakers examine the current landscape of Large Language Models (LLMs) used as math copilots, the complexities of benchmarking frontier mathematical capabilities, and the practical challenges of systems engineering required to run these models at scale.

Key moments
- 0:00 Introduction: AI for math landscape and motivations
- 2:00 The role of benchmarks and current limitations
- 20:00 Evaluating AIMO gold medal level performance
- 28:00 IMO Proof Pilot results and fully open models
- 44:00 Technical details: inference engines and harnesses
- 62:00 Lean repository-level verification and caching challenges
- 72:00 Audience Q&A: mathematicians' roles and tool usage
Evaluating and Training LLMs for Math Copilots and Theorem Proving
Speakers: Simon Frieder; Philip Vonderlind
Conference: ICML
YouTube: https://slideslive.com/39083468
Overview
The integration of artificial intelligence into mathematics represents a fundamental shift in how mathematical research, problem-solving, and verification are conducted. Presented at the ICML workshop on AI for math, this session—titled "No Country for Old Proofs"—explores the transition from traditional pen-and-paper mathematics to AI-assisted and formally verified workflows. The speakers examine the current landscape of Large Language Models (LLMs) used as math copilots, the complexities of benchmarking frontier mathematical capabilities, and the practical challenges of systems engineering required to run these models at scale.
Despite significant milestones—such as models achieving gold medal-level performance at competitions like the International Mathematical Olympiad (IMO)—the scientific community faces severe bottlenecks. These include benchmark saturation, silent errors in evaluation datasets, the opacity of commercial weights, and the fragile interplay between inference engines, scaffolding harnesses, and interactive theorem provers like Lean 4. This article details the methodologies, infrastructural stack, evaluation hurdles, and practical takeaways for building and deploying ML systems for mathematical reasoning.
Background
▶ Watch: Introduction: AI for math landscape and motivations (0:00)
For decades, automated theorem provers (ITPs) such as Lean, Isabelle, and Coq have existed as specialized tools for formal verification. However, a significant cultural and technical gap has historically separated mainstream mathematicians from formal methods. While ITPs provide absolute logical guarantees via trusted kernels, writing formal code requires deep domain-specific expertise.
The rise of the "talking way"—interacting with LLMs via natural language or code generation—has democratized access to mathematical computation. Early approaches focused on simple sampling (such as transformers learning to integrate functions) or localized heuristic searches in combinatorics. Today, the paradigm has shifted toward universal LLM copilots that interface with proof assistants, generate code, and solve competition-grade problems.
Yet, this rapid progress has introduced severe systems and evaluation challenges. While commercial models demonstrate impressive capabilities on standardized benchmarks, the underlying training data mixes, intermediate reasoning traces, and exact architectural optimizations are rarely fully open. This lack of reproducibility hampers fundamental scientific understanding, leaving researchers unable to dissect why a model succeeds or fails on a given mathematical conjecture.
Key Findings
▶ Watch: Evaluating AIMO gold medal level performance (20:00)
The speakers highlighted several critical discoveries regarding the current state of LLM-based mathematics:
- Gold Medal Performance vs. Consistency: While frontier models can achieve gold medal-equivalent scores on specific IMO benchmarks, their performance is highly sensitive to problem phrasing, topic distribution (e.g., combinatorics vs. group theory), and sampling variance. True 42-out-of-42 consistency across arbitrary IMO-level problems remains unachieved.
- The Final Answer Fallacy: Evaluating models solely on final numerical answers leads to high error rates in logical soundness. Empirical evaluations (such as those from the Open Proof Corpus) reveal a widespread divergence where an LLM yields the correct final answer via flawed, non-rigorous, or logically invalid reasoning traces.
- Benchmark Fragility and Silent Errors: Prominent benchmarks, including the Humanities Last Exam and FrontierMath, have documented high percentages of erroneous ground-truth answers. Correcting these errors frequently caused model scores to unexpectedly jump, illustrating that models were previously penalized for being right against broken ground-truth keys.
- The Fully Open Provenance Gap: Evaluations utilizing fully open model families (OLMo, Smaug, Aperture) reveal that reproducibility requires end-to-end transparency. Without access to training data mixes and intermediate checkpoints, analyzing the generalization bounds of mathematical LLMs remains fundamentally limited.
Technical Deep Dive
▶ Watch: Technical details: inference engines and harnesses (44:00)
Building, training, and evaluating LLMs for theorem proving and math copilot tasks requires a sophisticated hardware and software stack that extends far beyond standard conversational LLM deployments.
Inference Infrastructure
Running high-pass generation (e.g., Pass500) under strict time constraints (such as the 5-hour, 50-problem limit of the AIMO competitions) demands extreme inference throughput. The default choices in the ecosystem include:
- vLLM: The industry default utilizing PagedAttention for dynamic KV cache management and continuous batching. It natively supports a massive matrix of Hugging Face architectures and provides an OpenAI-compatible API.
- SGLang: Utilizes Radix attention to optimize prompt prefix sharing and structured outputs, making it highly effective for repetitive prompt-templating workloads.
- TensorRT-LLM: NVIDIA’s heavily optimized compilation stack, offering the lowest latency and highest raw throughput, though requiring static compilation of model weights to TensorRT formats.
Formal Lean Integration
When moving from natural language math to repository-level Lean 4 projects (which involve lakefile.toml, deep directory structures, and Mathlib dependencies), inference must interface directly with a formal checker.
- The Comparator: A specialized sandboxed checker designed for IMO projects, isolating execution, supporting Lean versions back to
4.15, and preventing malicious exploits (such as models silently deleting theorems or altering statements to trivial truths). - Caching Bottlenecks: Rebuilding large repository dependencies (
lake build) for thousands of evaluation steps is computationally prohibitive. Systems utilize custom caching strategies (such as the Numina Lean server), though developers must carefully avoid caching stale.oleanfiles that could introduce unauthorized external lemmas or exploit vectors.
Agentic Workflows & Tool Use
To solve complex mathematical tasks, models require external tool integration via agentic harnesses (such as the Numina Lean agent or Claude Code setups). These harnesses provide a Lean REPL console access loop, allowing models to write code, compile it, check error logs, and iteratively self-correct over multi-turn generation traces.
Experimental Setup & Results
▶ Watch: Lean repository-level verification and caching challenges (62:00)
Evaluations across competitive math benchmarks—most notably the AI Math Olympiad (AIMO) Kaggle competitions—provide rigorous empirical baselines:
- Dataset Scale: Competitions like AIMO feature unseen IMO-level problems divided into public leaderboards (50 problems) and private leaderboards (50 problems), backed by corpus collections totaling nearly one million data points.
- Headline Numbers: Across successive AIMO iterations, top-performing teams pushed solution rates from 29/50 up to 44/50 problems using optimized open-weight base models and custom Python/Lean verification harnesses. OpenAI evaluations reached 49/50 prior to IMO 2025.
- The IMO Proof Pilot: A recent ICML-exclusive evaluation constrained six top-performing teams exclusively to fully open model families (OLMo, Smaug, Aperture). Using compute grants from the Fields Model Initiative, teams developed solutions evaluated against rigorous human IMO rubrics by expert reviewers, successfully surpassing commercial proprietary baselines (such as Opus) in verifiable human grading transparency.
Practical Implications
▶ Watch: Audience Q&A: non-numerical verification and scaling proofs (104:00)
For infrastructure teams, model builders, and deployers, building math-capable LLM systems requires navigating steep technical tradeoffs:
- Inference Parameter Sensitivity: Misconfiguring chat templates, tokenizers, or sampling parameters can catastrophically degrade mathematical reasoning. Systems teams must strictly adhere to verified inference recipes and monitor upstream GitHub issues for sudden generation degeneracy (e.g., infinite loops or KV cache exhaustion over 40+ hour runs).
- The Version Drift Problem: The Lean ecosystem evolves monthly without long-term stability guarantees. Training a model on Lean version
4.9while evaluating against a benchmark written in4.28introduces breaking API incompatibilities, requiring extensive manual backporting or model retraining. - Context Bloat vs. Agentic Compression: Passing large mathematics libraries (e.g., 300,000 lines of code) directly into a prompt blows up context windows. Practitioners must deploy agentic retrieval loops that dynamically search, compress, and query repository files programmatically.
Key Takeaways
- Models are only a fraction of the system: Inference engines, answer extractors, parsing regex, and verification harnesses must be co-engineered for stable evaluation.
- Trust, but verify benchmarks: High scores on popular benchmarks can be misleading due to silent ground-truth errors and final-answer heuristics that bypass rigorous logical proof.
- Massive sampling is mandatory: Single-pass evaluation (
Pass1) provides almost no signal; rigorous evaluation requires high sampling limits (Pass500) coupled with trace analysis to capture failure distributions. - Open-weight provenance is essential: True scientific progress and reproducible debugging require fully open access to training data mixes, intermediate checkpoints, and model architectures.
- The mathematician's role is evolving: As auto-formalization and proof verification advance, human mathematicians will increasingly transition from manual proof-writers to knowledge curators and orchestrators of AI systems.
About the Speaker(s)
- Simon Frieder: Completed doctoral degree at Oxford with dual background in mathematics and computer science. Currently part of Tim Gowers' group in Cambridge. Founded the non-profit Benchkive (similar to arXiv but for benchmarks) and the Fields Model Initiative which offers compute for AI mathematics research. Serves as AI Math Olympiad prize manager for a competition on language models solving Olympiad-level math problems.
- Philip Vonderlind: Works at the AI Math Olympiad (AIMO) and will present technical aspects of the talk.
Reviews
→ Top-rated talks at International Conference on Machine Learning 2026
All talks from International Conference on Machine Learning 2026