FANS——基于Lean4的自然语言数学推理形式化答案选择
FANS -- Formal Answer Selection for Natural Language Math Reasoning Using Lean4
AI总结:
针对大语言模型自然语言数学推理答案缺乏可验证性的问题,提出基于Lean4的FANS框架,通过形式化证明验证辅助答案选择,有效提升推理准确率,将开源相关资源。
摘要:
大语言模型(LLM)在各类任务中展现出惊人能力,尤其是文本生成、分类、问答等领域。然而,LLM的推理能力仍存在诸多争议,自然语言(NL)固有的模糊性限制了LLM开展可验证推理的能力,使其答案缺乏连贯性与可信支撑。为解决上述问题,我们提出了名为FANS(基于Lean4的自然语言数学推理形式化答案选择,Formal ANswer Selection for Natural Language Math Reasoning Using Lean4)的新型框架。据我们所知,这是首个利用Lean4提升LLM自然语言数学推理能力的框架。具体而言,给定一个自然语言数学问题和LLM生成的答案,FANS首先将其翻译为Lean4定理陈述,随后使用Lean4证明器尝试证明并通过Lean4完成验证,最后利用形式化验证(FL)结果辅助答案选择。该框架通过为正确答案提供计算机可验证的解决方案提升了LLM的自然语言数学能力,并提出了一种超越奖励模型的答案选择替代方法。大量实验验证了框架的有效性:在强奖励模型基线上,它可将奖励模型增强的LLM在MATH-500数据集上的准确率最高提升1.91%,在AMC-23数据集上最高提升8.33%。在数论等Lean4擅长的特定领域,我们甚至能选出所有正确解答。定性分析也表明,该框架能让自然语言结果得到Lean4证明的形式化支撑。作为该领域的开创性工作,我们将开源所有模型与数据集,以进一步推动领域发展。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。