← Latest papers
💬 NLP

Optimizing the Cost-Quality Tradeoff of Agentic Theorem Provers in Lean

This paper introduces an action routing agent with data and control planes that optimizes the cost-quality tradeoff in agentic theorem proving for Lean by dynamically deciding whether to continue or restart proof attempts based on failure signals, achieving a 25.8% reduction in compute costs on PutnamBench while maintaining performance.

Original authors: Kári Rögnvaldsson, Chenhao Sun, Jasper Dekoninck, Martin Vechev

Published 2026-06-04
📖 4 min read☕ Coffee break read

Original authors: Kári Rögnvaldsson, Chenhao Sun, Jasper Dekoninck, Martin Vechev

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to solve a very difficult math puzzle, like the kind found in the famous Putnam competition. In the past, using Artificial Intelligence (AI) to solve these puzzles in a strict, computer-readable language called Lean was like hiring a team of workers who were told to try the exact same number of times, no matter what.

If the AI got stuck on a problem that was impossible to solve, it would keep trying until it hit a pre-set limit (say, 64 tries), wasting a huge amount of money and computer power. If the problem was actually easy, it might solve it on the first try, but the system would still force it to keep trying up to the limit just to be safe. This "one-size-fits-all" approach was incredibly expensive.

This paper introduces a smarter, more flexible AI agent that acts like a wise project manager instead of a rigid robot. Here is how it works, broken down into simple concepts:

1. The Problem: The "Blind" Worker

Think of the old AI systems as a worker who is told: "Try to fix this broken engine exactly 50 times. If it's not fixed after 50 tries, give up."

  • The Waste: If the engine is missing a part that doesn't exist (an impossible problem), the worker wastes 50 tries.
  • The Cost: Each "try" costs money (compute power). Doing 50 tries on a broken engine is a massive waste of resources.

2. The Solution: The "Smart" Manager

The new system described in the paper splits the work into two parts: the Worker (who tries to solve the math) and the Manager (who decides when to stop).

The Worker (The Data Plane)

This part breaks the big math problem down into smaller, manageable steps (lemmas). It tries to prove each step. If it fails, it tries again. It's the one actually doing the heavy lifting.

The Manager (The Control Plane)

This is the new invention. Instead of letting the worker blindly try 50 times, the Manager watches the worker's attempts. It looks at the history of failures and asks two questions:

  1. How much is this costing us? (How many computer "tokens" are we burning?)
  2. Is there any hope? (Based on the mistakes made so far, is the worker getting closer to a solution, or are they just spinning their wheels?)

3. The "Traffic Light" System

The Manager uses a simple rule to decide what to do next:

  • Green Light (Keep Going): If the worker is making progress and the cost is low, the Manager says, "Good job, try again!"
  • Red Light (Stop and Restart): If the worker keeps making the same mistakes or the cost is getting too high for the tiny chance of success, the Manager says, "Stop! This path is a dead end. Let's throw away this plan and try a completely different way of breaking down the problem."

4. The Results: Saving Money Without Losing Wins

The researchers tested this "Smart Manager" on 85 difficult math problems.

  • The Old Way: To solve a certain percentage of problems, the old system spent a lot of money.
  • The New Way: The new agent solved almost the same number of problems but spent 25.8% less money on average.
  • The Trade-off: If they wanted to spend the same amount of money as the old system, the new agent actually solved 7.8% more problems.

5. How Does the Manager "Know"?

The Manager isn't magic; it looks for specific clues in the failed attempts, like a detective looking at a crime scene:

  • Repetitive Errors: If the worker keeps making the exact same mistake, it's a sign they are stuck in a loop.
  • Confusion: If the worker is trying completely different, random approaches that don't make sense, it suggests the problem might be too hard for this specific plan.

The Bottom Line

This paper shows that in the world of AI math proving, knowing when to quit is just as important as knowing how to work. By adding a "manager" that watches the cost and the quality of the attempts, we can save a quarter of the computing budget without sacrificing our ability to solve hard problems. It turns a wasteful, brute-force approach into a smart, efficient strategy.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →