Fix, Not Just Resample: Bounded Compiler-Guided Repair in Lean 4
Haotian Deng, Chris Farber, Sonal Narasimha, Samskrithi Sivakumar, Yexiang Xue
Abstract
Automated theorem provers often rely on sampling language models, but proof assistants like Lean reject each failed step with a precise error message --- information that pure sampling discards. To overcome this, we introduce a bounded, online step-level repair module. Our search samples candidate tactics at each step and repairs a failed tactic at most times. Instead of discarding failed tactics, we feed the compiler's error message to a pretrained repair model to fix individual rejected steps in place. This approach improves the solve rate over a sampling-only baseline across all tested candidate budgets (), achieving up to a relative gain and solving additional theorems on a -theorem subset of the LeanDojo benchmark. Repair is not free: it trades extra runtime for reachable proofs. But the trade is predictable: repair pays most when sampling is constrained; its return is front-loaded, with the first repair attempt capturing of the total gain; and the gain comes almost entirely from shallow tactic-execution failures rather than structural errors such as type mismatches. This targeted repair successfully replicates on a second benchmark (Lean Workbook), nearly doubling the solve rate with zero regressions.
Create a lesson
Related papers
Wactorz: Self-Writing LLM Agents That Discover, Repair, and Migrate at the Edge
Shared title terminologycs.AIPanagiotis Kasnesis, Lazaros Toumanidis, Amalia Contiero Syropoulou et al.
Neural Agent Compiler: Learning to Schedule Soft Dependencies
Shared title terminologycs.AIBo Yan, Peng Wang, Zihan Chen et al.
NoeVera: Can Knowledge Guide Experiments and Experiments Refine Knowledge?
Shared title terminologycs.AIPinaki Prasad Guha Neogi, Spyros Mastorakis, Ankur Mallick et al.
STRIDE: Strategy-to-Tactics Retrieval-Guided Skill Disclosure and Evolution for Agentic Reinforcement Learning
Shared title terminologycs.AIShixin Hong, Wanqing Cui, Yibo Hu et al.
FormaFin: Verifiable Financial Analysis with Solver-Guided Reinforcement Learning
Shared title terminologycs.AIBethel Hall, William Eiers
Beyond Unit Tests: Path-Aware Rubric-Guided LLM Autograding of Notebooks
Shared title terminologycs.AISalman Hajizada, Mohammed Yusuf Ansari, Gianni Di Caro