Skip to main content
Back

Apple's Hilbert Solves 70% of PutnamBench With 4x Open-Source Gains

An agentic system pairs a reasoning LLM with a Lean 4 prover, hitting 99.2% on miniF2F and 70% on PutnamBench.

Pro

  • Hilbert hits 99.2% on miniF2F and 70% on PutnamBench, a 422% jump over the best open baseline.
  • Orchestrates a Reasoner LLM, Prover LLM, Lean 4 Verifier, and Mathlib semantic Retriever in an agentic loop.
  • Recursively decomposes hard theorems into subgoals until each can be closed by the Prover.
  • Beats proprietary SeedProver (50.4%) on PutnamBench by nearly 20 percentage points.
  • Choice of Reasoner matters more than Prover; retrieval improves both accuracy and compute cost.
  • Code released at github.com/Rose-STL-Lab/ml-hilbert; accepted to MATH-AI at NeurIPS 2025.

A new framework called Hilbert just demolished the gap between general-purpose reasoning LLMs and specialized Lean 4 theorem provers. By orchestrating a reasoner, a prover, a verifier, and a semantic retriever, it solves 462 of 660 PutnamBench problems, an over 4x improvement on the best open-source baseline and roughly 20 points above the proprietary SeedProver.

The work, from UC San Diego and Apple, reframes formal proof generation as an agentic orchestration problem rather than a monolithic model training problem. That framing turns out to be dramatically more effective than throwing more parameters at a specialized prover.

The Reasoner-Prover Divide

Frontier reasoning LLMs like GPT-5 and Gemini 2.5 Pro can solve most competition math problems informally, but they hallucinate, skip steps, and cannot self-verify. Formal systems like Lean 4 fix that by mechanically checking every proof, which is why specialized prover LLMs (DeepSeek-Prover, Goedel-Prover, Kimina-Prover) have been trained on Lean tactics.

The trouble is capability: reasoning LLMs can solve approximately 83% of PutnamBench problems informally, while the best publicly available prover LLMs achieve only 13% with formal proofs. General LLMs write good proof sketches but can't reliably synthesize whole formal programs. Prover LLMs write syntactically clean tactics but are brittle when a proof needs to reach into Mathlib or recover from a compilation error.

Hilbert's insight is to stop picking a side and instead route each subtask to whichever component is best suited.

Four Parts, One Loop

Hilbert system overview flowchart

The system coordinates four components:

  • Reasoner: a general LLM (Gemini 2.5 Flash/Pro, or open-source gpt-oss-120b) that writes informal proofs, sketches, and short formal proofs.
  • Prover: a specialized Lean 4 model (DeepSeek-Prover-V2-7B or Goedel-Prover-V2-32B).
  • Verifier: the Kimina Lean Server with Lean v4.15.0 and Mathlib v4.15.0.
  • Retriever: a semantic search index over Mathlib built with all-mpnet-base-v2 sentence embeddings and FAISS.

Given a target theorem, Hilbert first lets the Prover attempt a direct proof with 4 candidates. If that fails, the system escalates to recursive decomposition, splitting the problem into subgoals it solves with the prover or reasoner LLM, and leveraging verifier feedback to refine incorrect proofs.

How the Decomposition Actually Works

Subgoal decomposition pipeline diagram

The decomposition pipeline runs in four steps:

  1. Theorem retrieval. The Reasoner generates 5 search queries, pulls the top 5 Mathlib results each, then re-ranks them for relevance.
  2. Sketch generation. The Reasoner writes an informal proof, then a Lean 4 sketch where subgoals are have statements with sorry placeholders. The Verifier checks the skeleton compiles.
  3. Subgoal extraction. Each have becomes an independent theorem statement with the right context, verified for syntax.
  4. Assembly. The Reasoner replaces every sorry with a call to the corresponding subgoal theorem, and the whole thing is verified together.

Each open subgoal then runs through a three-tier resolution ladder. First, the cheap Prover gets 4 shots. If it fails, the Reasoner checks whether the subgoal is even mathematically correct (catching bad decompositions early). If it is, the Reasoner attempts a "shallow solve" using retrieved theorems, iterating up to 6 times on Verifier feedback. Only when all of that fails does Hilbert recursively decompose the subgoal, up to depth D=5.

The Numbers

On the 244-problem miniF2F test split, Hilbert reaches 99.2% pass rate on miniF2F (6.6 points above the best public method) and solves 462/660 PutnamBench problems (70.0%), outperforming proprietary systems like SeedProver (50.4%) and achieving over 4x improvement versus the best open-source baseline.

MethodminiF2FPutnamBench
DeepSeek-Prover-V2-671B88.9%47/657 (7.1%)
Goedel-Prover-V2-32B (self-correction)92.6%86/644 (13.4%)
SeedProver (proprietary)99.6%331/657 (50.4%)
Hilbert (Gemini 2.5 Pro + Goedel-V2-32B)99.2%462/660 (70.0%)

Two details make the result more interesting than the top line. First, the choice of Reasoner matters more than the Prover: Gemini 2.5 Pro paired with the weaker 7B DeepSeek prover still hits 98.4% on miniF2F. Second, swapping the closed-source Reasoner for open-source gpt-oss-120b still gets 90.8% on miniF2F, though PutnamBench performance collapses to 13.3% because the smaller reasoner fails at sketch generation 87% of the time.

What the Ablations Reveal

The recursive depth matters. Going from no decomposition (75% pass@4) to depth 2 already yields 98.36%, showing that most gains come from a single or double layer of splitting rather than deep recursion. Retrieval also pays for itself twice: for the DeepSeek model, retrieval decreases reasoner calls from 426 to 420, average prover calls from 290 to 205, and average reasoner tokens from 2.1M to 1.9M, while simultaneously improving pass rates.

Compute is not cheap, though. The Gemini 2.5 Pro + Goedel-V2-32B configuration on PutnamBench averages 24.4M tokens per successful proof, with the hardest problems consuming 22-27M tokens each. Proof lengths tell the same story: Hilbert produces proofs averaging 1,454 lines on PutnamBench, with the longest exceeding 15,000 lines, far beyond what any single-shot model can generate coherently.

Where It Breaks

Failure modes split by model. With gpt-oss-120b, 87% of failures happen at sketch generation, meaning the reasoner cannot even propose a workable decomposition. With Gemini 2.5 Pro, 45% of failures happen at shallow solve, meaning decomposition succeeds but the final formal proofs cannot be closed. The two problems Hilbert misses on miniF2F are AMC 12A 2020 Problem 25 and IMO Shortlist 2007 Problem A6, both notoriously hard.

The framework is also expensive to run relative to a single prover pass, and results depend heavily on frontier closed models for the reasoning role.

Try It Yourself

The code is available at github.com/Rose-STL-Lab/ml-hilbert. If you already use Lean 4 for formalization work, Hilbert is essentially a drop-in orchestrator: you supply API access to a reasoner and host a prover with vLLM, and the framework manages the recursive decomposition, retrieval, and verification loops. The work was accepted at the MATH-AI workshop at NeurIPS.

The broader implication is that agentic scaffolding may be a more productive path forward for formal math than training ever-larger prover models. The authors hint at using Hilbert's traces to bootstrap better provers in a self-improvement loop, which could compound quickly given how much of the pipeline is already automated end to end.