Compile to Compress: Boosting Formal Theorem Provers by Compiler Outputs
Abstract
Lay Summary
Large language models are becoming increasingly capable at formal mathematical reasoning, but current systems often require enormous amounts of computation by repeatedly sampling proof attempts from scratch. In this work, we show that Lean compiler error messages provide a much more efficient way to guide theorem proving. We observe that many different failed proofs produce similar error patterns, allowing the model to learn reusable correction strategies. With this notion of "compression", we train Lean provers to iteratively refine failed proofs using compiler feedback, and introduce a value-guided search strategy that prioritizes the most promising corrections. This approach substantially improves performance across multiple mathematical benchmarks while using computation more efficiently. Our results suggest that strong verifier feedback, such as Lean compiler's semantic checks, can play an important role in building more scalable AI reasoning systems.