๐ค AI Summary
This work addresses the high computational cost of independently formalizing each candidate answer in Lean-based mathematical reasoning for answer selection. To overcome this inefficiency, the authors propose the BASE framework, which introduces a novel โformalize once, edit the restโ paradigm: one base candidate is first formally verified in Lean, and then a custom-designed LEANSCRIBE rewriting model identifies its answer expression and generates reusable editing functions to efficiently produce the remaining Kโ1 formalized statements. Evaluated across four benchmark datasets and three solvers under 12 configurations, the approach consistently achieves significant gains in both efficiency and accuracy. Notably, when K=8, it reduces the number of formalization calls by approximately fivefold, yielding a Pareto improvement that simultaneously lowers formalization cost and enhances selection performance.
๐ Abstract
With large language models (LLMs) increasingly applied to mathematical reasoning, formal proof assistants such as Lean can be leveraged to verify reasoning outputs with machine-checkable rigor, enabling use cases such as answer selection in test-time scaling with K sampled candidate answers. However, employing Lean requires that LLM outputs, originally in natural language, first be formalized. Existing Lean-based answer-selection work uses an autoformalization model to generate a formal statement in Lean for each candidate answer independently, incurring a significant computational cost. We propose BASE, a base-and-edit pipeline that formalizes a single base candidate per problem and derives the remaining K-1 statements by editing the answer expression in place. To facilitate this, we train a rewriter model LEANSCRIBE to localize the answer in the base formalization and generate a reusable edit function for the other K-1 candidates. BASE simultaneously improves selection accuracy and reduces formalization cost - a Pareto improvement that holds on all 12 (dataset, solver) configurations across four benchmarks and three solvers, cutting autoformalizer calls by about 5x at K=8, with the reduction expected to become larger as K grows. Code is available at https://github.com/ucr-rai/base-and-edit.