Compile to Compress: Boosting Formal Theorem Provers by Compiler Outputs
Guchan Li, Rui Tian, Hongning Wang · 2026
Read Compile to Compress: Boosting Formal Theorem Provers by Compiler Outputs by Guchan Li, Rui Tian, Hongning Wang (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-18587.txt.
Introduction
Li, Tian, and Wang address the scaling snag in formal proving, where top performance needs huge compute. They exploit a structure in formal checking: checkers map diverse attempts to a compact set of tidy failure modes. They offer a learning-to-refine method using this squeeze, with tree search fixing errors locally from feedback, dodging long histories. Tests show the method boosts base provers' thinking skills across varying scales. It hits top PutnamBench scores among listed 8B and 32B models under similar budgets.
Catalog record
| CREATOR | Guchan Li, Rui Tian, Hongning Wang |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 66115 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2604.18587
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Compile to Compress: Boosting Formal Theorem Provers by Compiler Outputs Guchan Li, Rui Tian, Hongning Wang Abstract Large language models (LLMs) have demonstrated significant potential in formal theorem proving, yet state-of-the-art performance often necessitates prohibitive test-time compute via massive roll-outs or extended context windows. In this work, we address this scalability bottleneck by exploiting an informative structure in formal verification: the observation that compilers map a vast space of diverse proof attempts to a compact set of structured failure modes. We introduce a learning-to-refine framework that leverages this compression to perform efficient learning and proof exploration. We perform tree search that corrects errors locally conditioned on explicit verifier feedback, thereby circumventing the costs associated with accumulating a long history of proof attempts. Extensive evaluations show that our method consistently amplifies the reasoning capabilities of base provers across varying scales. Notably, our approach achieves state-of-the-art performance on PutnamBench among publicly reported ∼ \sim 8B and ∼ \sim 32B parameter models under comparable test-time budgets, offering a scalable paradigm for next-generation verifier-guided reasoning. 1 Introduction At the intersection of mathematical rigor and computational precision, formal theorem proving has become a cornerstone of humanity’s pursuit of reliable and scalable reasoning. Within the unified framework of the Curry–Howard correspondence ( 10 ) , mathematical proofs can be casted as programs, and proof verification reduces to type checking. This paradigm enables mathematical correctness to be enforced with machine-level certainty. In recent years, modern proof assistants—most notably the Lean programming language ( 17 ) —have successfully bridged human mathematical intuition with mechanically verifiable programs, unlocking new possibilities for large-scale formalization. The rapid integration of large language models (LLMs) into theorem proving has further accelerated progress in this domain. Contemporary Lean provers span a broad methodological spectrum, including: (1) supervised fine-tuning (SFT) on synthetic proof data ( 27 ) , (2) reinforcement learning (RL) to enhance chain-of-thought (CoT) reasoning in formal proofs ( 25 ; 20 ) , (3) self-correction driven by compiler feedback ( 14 ) , and (4) large-scale pipelines ( 4 ) or agentic systems ( 2 ) . While compiler feedback consistently drives performance, existing approaches often oversimplify these signals into binary success indicators ( 13 ) or plain-text ( 29 ) error messages. This neglects the rich structural information embedded in compiler outputs, forcing a reliance on cumulative, multi-round self-correction. Consequently, the model remains tethered to long interaction histories, causing context windows to expand rapidly and severely constraining the depth of exploration within fixed computational budgets. By analyzing the failure modes of existing provers (see Section 3 and Appendix A ), we identify that Lean compiler acts as an effective dimension compressor. As illustrated in Figure 1 (a), while the combinatorics of Lean programs render the input space effectively unbounded, the compiler projects these inputs into a compact, structured output space. This projection reveals an informative latent structure: many syntactically distinct incorrect proofs induce invariant error signatures. This suggests that compiler feedback can filter out syntactic noise to expose the underlying semantic defects. Leveraging this compressed signal allows us to shift the learning objective from blind generation to targeted correction, exploiting the structured feedback to navigate the proof space more efficiently. Figure 1 : Overview of the proposed Learning-to-Refine framework. Compiler messages map the space of diverse proof attempts to a compact set of structured failure modes, which enable efficient learning and search for the correct proofs. We trained a neural value model to efficiently guide test-time proof generation and refinement process. Building on this insight, we introduce a novel learning-to-refine framework that internalizes error-correction trajectories into an LLM via supervised fine-tuning and expert iteration based training. This effectively distills complex formal reasoning capability into a generalizable form of policy that can both generate and refine proofs. Recurrently applying this refinement skill during multi-round self-correction, a chain of distributions (CoD) emerges in program space. Combined with a learned search strategy, this adaptive exploration mechanism achieves strong performance across multiple benchmarks. Moreover, our framework is generally model-agnostic and scales consistently with model sizes and test-time budget, offering a scalable paradigm for next-generation verifier-guided reasoning. 2 Related Work Lean 4 programming language ( 17 ) represents a new practical paradigm for mathematics. It transfers step-by-step human-judged math deductions into a structured, human-machine interaction process. Its ultimate value include enhanced rigor, high reusability of mathematical knowledge, and the potential to open new pathways for mathematical discovery. Along with the development of deep learning, initial attempts on automated theorem proving (ATP) focus on efficient tree search algorithms ( 11 ; 12 ; 19 ) and proof-step generation ( 9 ; 29 ) . Due to the lack of effective semantic representations, these methods suffer from huge search space and intensive computation cost. Recent efforts utilize LLMs to facilitate the process ( 7 ) . Early work mostly focuses on synthesizing large-scale Lean 4 proof data to fine-tune LLMs ( 27 ; 26 ; 13 ; 6 ) . Later, following the success of reinforcement learning (RL) in natural language reasoning ( 22 ; 8 ) , similar approaches have been applied to formal reasoning ( 28 ; 20 ; 25 ; 14 ) , where Lean compiler serves as the reward signal and environment feedback. Prior to our work, compiler messages have been incorporated into LLM input ( 7 ; 14 ) for improved ATP. But existing approaches are constrained by growing context complexity and roll-out cost, thus failing to fully leverage the potential of compiler feedback. Our work focuses on exploiting compiler feedback for complete proof generation. By viewing the Lean compiler as a dimension compressor, we demonstrate how this perspective significantly enhances the efficiency of self-correction in formal theorem proving. In parallel, researchers also looked into building large theorem proving systems ( 4 ; 3 ; 15 ) or agent systems ( 2 ; 24 ) . Currently, these systems achieve state-of-the-art performance on various benchmarks, but they depend on massive models and intense inference cost, hence not directly comparable to ours. 3 Lean Compiler as a Dimension Compressor Table 1 reports the most frequent compilation error messages produced by the proofs generated by Kimina-Prover-Preview-7B ( 25 ) on MiniF2F-test ( 30 ) (244 problems) and PutnamBench ( 23 ) (660 problems). To make the structure of the messages more visible, variable names, tactic states, and other context-dependent information are masked or removed. We can clearly observe that a small number of distinct compiler messages account for a majority of failures across both benchmarks, and the errors are shared across benchmarks as well. This concentration indicates that compilation errors occupy a highly structured space with limited diversity. Consequently, the space of compiler messages can be viewed as a substantially lower-dimensional spanned space than the space of formal proofs, motivating the use of compiler feedback as a compact representation for refinement generation. Table 1 : Top 50% error messages associated with proofs produced by Kimina-Prover-Distill-8B on standard benchmarks. Identifiers are masked by ‘id’. Appendix A reports the full table. MiniF2F-test Ratio linarith failed to find a contradiction 22.60% unknown identifier ‘id’ 16.31% unsolved goals 13.58% Putnam Bench tactic ‘id’ failed, nested error 16.78% omega could not prove the goal 13.50% unsolved goals 11.31% linarith failed