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\footnote{\url{https://github.com/wenhuchen/Program-of-Thoughts}}.
翻译:最近,在教授语言模型以逐步推理解决复杂数字推理任务方面已经取得了显著进展。 思维链催化( COT) 是这些任务的最新方法。 COT 使用语言模型在多步“ 思考” 过程中进行推理和计算。 为了分解推理, 我们提议“ 思想方案 ” (PoT), 它使用语言模型( 主要是 代码x) 表达推理过程作为程序。 计算被降为外部计算机, 该计算机执行生成的程序来获取答案。 我们评估五个数学词数据集( GSM、 AQuA、 SVAMP、 TabMWP、 MultiArith) 和三个财务QA 数据集( FinQA、 ConFinQA、 TATQA) 。 在微分和零分立的设置下, PoT 可以显示通过所有被评估的 Proubus- commissional 获得的 CoTO 平均成绩。 通过将所有数据运行情况与我们所发布的数据合并, 可以实现所有数据库的自动数据。