Manuscript Offprint

arXiv:2610.21881

Learning Lean Feedback for Efficient Proof-Candidate Evaluation on GPUs

Lazar Milikic, Etienne Bamas, Emmanuel Abbe, Viktor Kunčak

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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.2× 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%.

1 Introduction

Proof assistants provide automatically checked training signals for language models that generate formal proofs [6, 26]. Lean-based provers use these signals for supervised learning, proof search, and reinforcement learning [4, 11, 17, 18, 23, 30]. Checking candidates at scale creates a substantial computational workload. Existing systems reduce this overhead through parallel workers, reuse of loaded environments, and compiler optimizations [7, 11].

Even with these optimizations, slow checks can delay reward computation for an entire training batch. In our 8B prover's Group Relative Policy Optimization (GRPO) training [24] using the efficient verl framework [25], a 64-worker Lean pool takes about 420 s to score 1,024 candidate proofs with a 60 s timeout per proof, about 40% of a 1,050 s training step. Timeouts also withhold rewards from some correct proofs: in an audit with a larger verification budget, 58.1% of the resolved timeouts are valid (Section 6). A separate comparison with Kimina Lean Server finds similar verification times on 10,000 proofs, providing an external check on our pipeline's efficiency (Appendix A).

We study the trade-off between evaluation speed and verdict accuracy when predicting Lean's response to a candidate proof. We train two validity classifiers and a feedback model that annotates a supplied program with predicted goal states and error messages. Combining a classifier with the feedback model gives a two-stage evaluator, or cascade, that predicts a candidate's validity on the GPU. These predictions can supplement Lean when exact checks are slow.

Our hybrid reward protocol runs Lean and the learned evaluator concurrently on each batch (Figure 1). When the evaluator finishes, after 90 s on average, we retain the Lean verdicts already returned and use model predictions for the remaining candidates. To test whether the learned predictions are useful,

NeurIPS 2026 Workshop on AI for Verifiable Coding.

we also train with Lean alone under a 13 s per-proof timeout. This matches the hybrid protocol's average batch scoring time of 90 s but yields lower miniF2F pass@1 and pass@32 after one epoch of GRPO.

Figure

Figure 1: Hybrid rewards from concurrent Lean and GPU evaluation. Each batch contains 1,024 candidate proofs, checked by 64 Lean workers with a 60 s timeout per proof. Lean-only batch scoring takes approximately 420 s on average. Hybrid scoring ends when GPU evaluation finishes (90 s on average), retaining completed Lean verdicts and using model predictions for unfinished checks, which are cancelled. The Lean curve beyond this point shows the Lean-only reference. The 3.6% timeout share is measured over the 24,359 candidates with extractable code in the replay cohort (Appendix E). Curves and phase durations are schematic; flat neural regions represent loading and warmup.

We make three contributions:

  1. Fast GPU evaluation with a measured accuracy–cost trade-off. Our cascade reaches 87.8% accuracy on 68,932 candidates from three public provers. With speculative decoding, it processes 3.5 candidates per second on one NVIDIA HGX H100-SXM5-80GB GPU, 4.2×4.2\times the throughput of our 64-worker Lean reference.

  2. Hybrid rewards for GRPO training. Hybrid rewards shorten training steps by approximately 31%, retain essentially the same miniF2F pass@1 as standard Lean-only rewards, and largely preserve the initial prover's pass@32. At the same scoring time, the 13 s Lean-only baseline performs worse on both metrics.

  3. A dataset and benchmark for learned proof evaluation. We construct a 4.84M-program compiler-labelled training corpus and a 68,932-program benchmark from three public provers on miniF2F and ProofNet. We release the datasets and model checkpoints on Hugging Face and the project repository on GitHub. 1^{1}

References (33)