[论文解读] Don't Trust: Verify -- Grounding LLM Quantitative Reasoning with Autoformalization
本文提出 Don't Trust: Verify (DTV) 方法,通过将非形式化的数学问题及解答自动形式化为 Isabelle 语言,并利用自动化定理证明进行验证,从而提升大语言模型(LLM)在定量推理方面的能力。DTV 在 GSM8K 上相较于原始多数投票方法性能提升超过 12%,且在不进行额外训练的前提下,对不同模型尺寸和数据集均保持一致的准确率提升。
Large language models (LLM), such as Google's Minerva and OpenAI's GPT families, are becoming increasingly capable of solving mathematical quantitative reasoning problems. However, they still make unjustified logical and computational errors in their reasoning steps and answers. In this paper, we leverage the fact that if the training corpus of LLMs contained sufficiently many examples of formal mathematics (e.g. in Isabelle, a formal theorem proving environment), they can be prompted to translate i.e. autoformalize informal mathematical statements into formal Isabelle code -- which can be verified automatically for internal consistency. This provides a mechanism to automatically reject solutions whose formalized versions are inconsistent within themselves or with the formalized problem statement. We evaluate our method on GSM8K, MATH and MultiArith datasets and demonstrate that our approach provides a consistently better heuristic than vanilla majority voting -- the previously best method to identify correct answers, by more than 12% on GSM8K. In our experiments it improves results consistently across all datasets and LLM model sizes. The code can be found at https://github.com/jinpz/dtv.
研究动机与目标
- 为解决 LLM 在定量推理中持续存在的无根据逻辑与计算错误问题。
- 开发一种轻量级、无需训练的方法,从多个 LLM 生成的解答中识别出正确答案。
- 利用自动形式化与自动化定理证明,验证解答的一致性与正确性。
- 通过仅筛选可通过形式化验证的解答,超越原始多数投票法——此前的最先进启发式方法。
提出的方法
- 使用少样本提示(few-shot prompting)结合 LLM,将非形式化的数学问题与解答自动转化为 Isabelle 形式语言。
- 应用符号与神经过滤器,提升形式化陈述翻译的可靠性。
- 生成形式化解答概要,而非直接翻译,以填补低层级推理步骤的空白。
- 使用自动化定理证明器(ATP)填补缺失步骤并验证形式化证明。
- 通过多数投票选择最终答案,但仅限于通过形式化验证的解答。
- 在 GSM8K、MATH(三个子集)和 MultiArith 上评估该方法,并与原始多数投票法进行对比。

实验结果
研究问题
- RQ1将 LLM 生成的解答自动形式化为形式逻辑,能否提升定量推理的准确性?
- RQ2通过自动化定理证明进行形式化验证,能否减少 LLM 推理中对有缺陷的多数投票的依赖?
- RQ3该方法能否在不同 LLM 尺寸与推理数据集上保持一致的性能提升?
- RQ4自动形式化与 ATP 的结合,在从多个候选解答中识别正确答案方面,效果如何?
主要发现
- 与原始多数投票相比,DTV 在 GSM8K 数据集上的性能提升超过 12%。
- 该方法在所有评估的 LLM 尺寸(包括 8B、64B 和 540B 参数模型)上均一致提升了准确率。
- DTV 在 GSM8K、MATH(三个子集)和 MultiArith 上均达到最先进水平,且无需模型微调。
- 案例研究显示,DTV 成功识别出正确答案,并过滤掉错误或无根据的解答。
- 该方法与仅在非形式化推理领域运行的现有提示方法具有互补性。
- 局限性包括形式化定理证明器在几何与概率等领域的支持有限,以及 LLM 导致的自动形式化错误。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。