Learning Lean Feedback for Efficient Proof-Candidate Evaluation on GPUs
Organizations: EPFL, Lausanne, Switzerland
Abstract
Training language models for formal theorem proving requires large numbers of verifier calls. Slow checks and timeouts often leave GPUs waiting and withhold rewards from potentially correct proofs. We train neural evaluators to predict Lean 4 verdicts and compiler feedback on GPUs using 4.84M labelled programs. We compare two validity classifiers with a feedback model that annotates proof attempts with predicted goal states and error messages. A two-stage evaluator that screens candidates with a classifier and scores its positive predictions with the feedback model reaches 87.8% accuracy in predicting whether Lean accepts a candidate proof, evaluated on a 68,932-program benchmark collected from public provers. The combined evaluator processes 3.5 candidates per second on one H100, 4.2x the throughput of our 64-worker Lean baseline with environment reuse. Finally, we combine our evaluator with Lean verdicts to obtain a hybrid reward system that shortens GRPO training steps by approximately 31%. After one GRPO epoch with hybrid rewards, the prover achieves nearly the same miniF2F pass@1 as with Lean-only rewards (62.2% versus 62.4%) and a pass@32 of 72.4% versus 71.3%.
Figures & tables
| Data | Programs | Valid fraction |
|---|---|---|
| Training corpus | 4.84M | 44.8% |
| In-house validation (miniF2F and ProofNet) | 27,210 | 38.9% |
| miniF2F benchmark candidates | 41,638 | 61.7% |
| ProofNet benchmark candidates | 27,294 | 9.0% |
| Combined benchmark (deduplicated) | 68,932 | 40.8% |
| Encoder | One-token | Feedback | |
|---|---|---|---|
| Backbone | ModernBERT-large (395M) | Qwen3-8B | Qwen3-4B |
| Pretraining task | Predict masked tokens (30% masking) | Predict next token | Predict next token |
| Supervised target | Binary validity label | One true / false token | Source annotated with feedback |
| Context (tokens) | 8,192 | 32,768 | 32,768 |
| Learning rate | |||
| Batch size | 64 | 8 | 8 |
| Evaluator | Accuracy | Macro F1 | MCC | AUROC |
|---|---|---|---|---|
| Cascade, SC feedback stage @4/5 | 0.888 | 0.887 | 0.783 | — |
| Cascade, calibrated gate (0.82) † | 0.887 | 0.885 | 0.778 | — |
| Cascade: one-token feedback | 0.878 | 0.877 | 0.772 | — |
| Cascade, FP8 feedback stage | 0.877 | 0.876 | 0.770 | — |
| Feedback 4B, 5-sample SC @4/5 | 0.874 | 0.873 | 0.762 | 0.919 |
| Feedback 4B | 0.851 | 0.851 | 0.733 | — |
| Prover | Valid fraction | Feedback | One-token | Cascade |
|---|---|---|---|---|
| Goedel-Prover-V2-8B | 0.530 | 0.867 | 0.819 | 0.893 |
| DeepSeek-Prover-V2-7B | 0.408 | 0.843 | 0.765 | 0.878 |
| Pythagoras-Prover-4B | 0.328 | 0.848 | 0.688 | 0.865 |
| Metric | Overall | Valid | Invalid |
|---|---|---|---|
| Block F1, exact | 0.796 | 0.969 | 0.623 |
| Anchored block F1 | 0.795 | 0.969 | 0.621 |
| Token F1 | 0.852 | 0.983 | 0.721 |
| Error-presence agreement | 0.840 | 0.974 | 0.707 |
| Evaluator | Candidates/s | Seconds/candidate |
|---|---|---|
| ModernBERT | 264 | 0.0038 |
| One-token 8B | 4.9 | 0.204 |
| Feedback 4B, no speculation | 0.73 | 1.37 |
| Feedback 4B speculation | 3.27 | 0.306 |
| Cascade | 3.48 | 0.287 |
| Cascade, FP8 feedback stage | 3.59 | 0.279 |
| Checkpoint / reward source | Pass@1 (%) | Pass@32 (%) | Step time (s) |
|---|---|---|---|
| Initial checkpoint (shared) | — | ||
| GRPO, Lean-only, 60 s timeout | 1,050 | ||
| GRPO, hybrid rewards | 720 | ||
| GRPO, Lean-only, 13 s timeout | 720 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Prover | Benchmark | Lean | Rows | Valid |
|---|---|---|---|---|
| Pythagoras-Prover-4B | miniF2F | v4.15.0 | 14,903 | 0.574 |
| Pythagoras-Prover-4B | ProofNet | v4.15.0 | 10,335 | 0.039 |
| Goedel-Prover-V2-8B | miniF2F | v4.15.0 | 13,706 | 0.715 |
| Goedel-Prover-V2-8B | ProofNet | v4.15.0 | 6,205 | 0.155 |
| DeepSeek-Prover-V2-7B | miniF2F | v4.15.0 | 15,408 | 0.620 |
| DeepSeek-Prover-V2-7B | ProofNet | v4.15.0 | 11,182 | 0.124 |
| Setting | Value |
|---|---|
| Training prompts / rollouts per prompt | 128 / 8 |
| PPO minibatch / actor microbatch | 128 prompts / 1 sequence per GPU |
| PPO clip ratio / update epochs per rollout batch | 0.2 / 1 |
| Optimizer / | AdamW / |
| Weight decay / gradient clipping | 0.01 / 1.0 |
| Learning rate / warmup | / 25 updates |
| Checkpoint / reward source | Pass@1 (%) | Pass@32 (%) |
|---|---|---|
| Initial checkpoint (shared) | ||
| GRPO, hybrid rewards (cascade) | ||
| GRPO, hybrid rewards (cascade), second seed | ||
| GRPO, hybrid rewards (one-token, threshold 0.86) | ||
| GRPO, hybrid rewards (ModernBERT, threshold 0.5) | ||
| GRPO, cascade predictions only, no Lean |
| Evaluator in hybrid run | Step | Accuracy | FPR | Lean share |
|---|---|---|---|---|
| Cascade | 25 | 87.9 | 17.8 | 42.8 |
| 125 | 81.9 | 25.7 | 42.8 | |
| 250 | 81.7 | 28.9 | 43.7 | |
| One-token 8B (threshold 0.86) | 25 | 81.1 | 37.0 | 41.9 |
| 125 | 68.0 | 56.9 | 40.2 | |
| 250 | 59.6 | 74.1 | 40.1 |
Automated Theorem Proving
Automated theorem proving develops algorithms and AI systems that construct or check formal proofs in mathematics, logic, and software.
See all 160 papers