arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.15972cs.CLcs.AIcs.LG
收藏

一次形式化,其余编辑:基于Lean的高效数学推理答案选择

Formalize Once, Edit the Rest: Efficient Lean-Based Answer Selection for Math Reasoning

University of California, Riverside(加州大学河滨分校)

Ji Feng, Zhouxing Shi

AI总结:

提出BASE流水线,通过形式化一个候选答案并编辑其余答案,减少自动形式化调用约5倍,同时提升选择准确性。

摘要:

随着大型语言模型(LLMs)越来越多地应用于数学推理,形式化证明助手(如Lean)可用于以机器可检查的严谨性验证推理输出,从而支持在测试时扩展中从K个采样候选答案中进行答案选择等用例。然而,使用Lean要求LLM的输出(最初为自然语言)首先被形式化。现有的基于Lean的答案选择工作使用自动形式化模型为每个候选答案独立生成一个Lean形式化语句,这带来了显著的计算成本。我们提出BASE,一个基础-编辑流水线,它为每个问题形式化一个基础候选答案,并通过就地编辑答案表达式来推导出其余K-1个语句。为此,我们训练了一个重写器模型LEANSCRIBE,用于定位基础形式化中的答案,并为其他K-1个候选答案生成可重用的编辑函数。BASE同时提高了选择准确性并降低了形式化成本——这是一个帕累托改进,在四个基准测试和三个求解器上的所有12个(数据集,求解器)配置中均成立,在K=8时自动形式化器调用减少约5倍,且随着K增长,减少幅度预计会更大。代码可在https://github.com/ucr-rai/base-and-edit获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑