Skip to main content
QUICK REVIEW

[论文解读] Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Tasks

Wenhu Chen, Xueguang Ma|arXiv (Cornell University)|Nov 22, 2022
Topic Modeling被引用 110
一句话总结

PoT 提示让大型语言模型生成类似 Python 的程序,这些程序在外部执行以进行计算,将计算与推理解耦,从而在数值推理基准上显著优于 Chain-of-Thought。

ABSTRACT

Recently, there has been significant progress in teaching language models to perform step-by-step reasoning to solve complex numerical reasoning tasks. Chain-of-thoughts prompting (CoT) is by far the state-of-art method for these tasks. CoT uses language models to perform both reasoning and computation in the multi-step `thought' process. To disentangle computation from reasoning, we propose `Program of Thoughts' (PoT), which uses language models (mainly Codex) to express the reasoning process as a program. The computation is relegated to an external computer, which executes the generated programs to derive the answer. We evaluate PoT on five math word problem datasets (GSM, AQuA, SVAMP, TabMWP, MultiArith) and three financial-QA datasets (FinQA, ConvFinQA, TATQA) for both few-shot and zero-shot setups. Under both few-shot and zero-shot settings, PoT can show an average performance gain over CoT by around 12\% across all the evaluated datasets. By combining PoT with self-consistency decoding, we can achieve SoTA performance on all math problem datasets and near-SoTA performance on financial datasets. All of our data and code are released in Github https://github.com/wenhuchen/Program-of-Thoughts

研究动机与目标

  • 激发在数值推理任务中将计算与推理解耦的需求。
  • 提出 Program of Thoughts (PoT),让计算委托给外部解释器同时在代码中进行推理。
  • 在广泛的数学文字题和金融问答数据集上评估 PoT,以评估相对于 chain-of-thought 提示的提升。
  • 研究零-shot 与少量-shot 的 PoT,以及自一致解码,并进行消融研究以理解各组成部分。

提出的方法

  • 提出 PoT,将思维过程表达为 Python 代码而非自然语言推理。
  • 使用外部 Python 解释器(SymPy)执行生成的程序并获得答案。
  • 以少量示例或零-shot 模式对大语言模型(主要是 Codex)进行提示,以生成程序。
  • 可选地将 PoT 与自一致解码(PoT+SC)结合以提升鲁棒性。
  • 在零-shot PoT 中,抑制以 # 开头的注释以减少在代码注释中的推理。
  • 将异构输入(文本、表格、对话)线性化为对 LLM 的提示。
  • 在覆盖 Math Word Problems 与金融问答的九个数据集上进行评估(GSM8K、AQuA、SVAMP、TabMWP、MultiArith、FinQA、ConvFinQA、TATQA)。

实验结果

研究问题

  • RQ1PoT(Program of Thoughts)是否在多样化数据集上提升数值推理准确性,相对于 CoT(Chain-of-Thought)提示?
  • RQ2少-shot 与零-shot PoT 的效果有何不同,自一致解码如何与 PoT 互动?
  • RQ3后端模型与提示设计如何影响 PoT 的性能与稳定性?
  • RQ4在 PoT 中,语义绑定与多步推理相对于直接生成方程式的影响有多大?
  • RQ5PoT 能否与 CoT 有效结合用于多阶段推理任务?

主要发现

  • 在零-shot和少-shot设置下,PoT 相对于 CoT 在所评估的数据集上平均提升约 12%。
  • PoT+SC(PoT 与自一致)在数学数据集上取得近似最先进的结果,在金融数据集上接近最佳结果(不含 GPT-4)。
  • 零-shot PoT 在数学数据集上的表现平均比零-shot CoT 高出约 12%;在 TabMWP 上甚至超过少-shot CoT。
  • 在若干基准测试(如 SVAMP、ASDIV)上,PoT 相对于 PaL 取得显著的优势。
  • 语义绑定与多步推理对 PoT 的优势至关重要;移除绑定或尝试直接生成方程式会降低性能,尤其在复杂问题上。
  • 错误分析显示数值绑定错误占失败的相当一部分,逻辑生成错误也存在;PoT 通过将计算委托给精确的解释器通常能减少算术错误。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。