用形式化证明提升大模型数学推理可信度
FANS -- Formal Answer Selection for Natural Language Math Reasoning Using Lean4
- 将自然语言数学题转为Lean4定理,用形式化证明验证答案
- 在MATH-500和AMC-23上分别提升1.91%和8.33%准确率
- 适合需要可验证推理的数学竞赛与形式化研究者
大语言模型在文本生成、分类、问答等任务中表现卓越,但在推理能力方面仍存争议。自然语言的模糊性限制了模型进行可验证推理,导致答案缺乏一致性和可信支持。为此,我们提出FANS框架:利用Lean4实现自然语言数学推理的答案选择。这是首个使用Lean4增强大模型自然语言数学推理能力的工作。给定自然语言数学题及模型生成的答案,FANS首先将其转化为Lean4定理陈述,再通过Lean4证明器尝试证明,并以形式化验证结果辅助答案选择。该框架为正确答案提供计算机可验证的解法,提出了一种超越奖励模型的全新答案选择方法。大量实验表明其有效性:在强基线奖励模型上,可使MATH-500数据集准确率最高提升1.91%,AMC-23提升最高8.33%;在数论等领域,甚至能全部选出正确解。定性分析显示,该框架能使自然语言结果获得Lean4形式化证明的支持。作为该领域的开创性工作,我们将开源全部模型与数据集,以推动该方向发展。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have displayed astonishing abilities in various tasks, especially in text generation, classification, question answering, etc. However, the reasoning ability of LLMs still faces many debates. The inherent ambiguity of Natural Language (NL) limits LLMs' ability to perform verifiable reasoning, making its answers lack coherence and trustworthy support. To tackle the above problems, we propose a novel framework named FANS: Formal ANswer Selection for Natural Language Math Reasoning Using Lean4. To the best of our knowledge, it is the first framework that utilizes Lean4 to enhance LLMs' NL math reasoning ability. In particular, given an NL math question and LLM-generated answers, FANS first translates it into Lean4 theorem statements. Then it tries to prove it using a Lean4 prover and verify it by Lean4. Finally, it uses the FL result to assist in answer selection. It enhances LLMs' NL math ability in providing a computer-verifiable solution for its correct answer and proposes an alternative method for answer selection beyond the reward model. Extensive experiments indicate the effectiveness of our framework. It can improve the accuracy rate of reward model enhanced LLMs in the MATH-500 dataset by at most 1.91% and AMC-23 by at most 8.33% on strong reward-model baselines. In some particular fields like number theory that Lean4 experts in, we can even select all correct solutions. The qualitative analysis also shows our framework can make NL results formally backed by Lean4 proofs. As a pioneering work in the corresponding field, we will open-source all our models and datasets to further boost the development of the field.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。