基于语言模型(LM)的程序合成已解锁了大量推理能力;经过代码调优的LM已被证明擅长生成可解决各类算法符号操作任务(例如单词拼接)的程序。然而,并非所有推理任务都能轻松转化为代码形式,例如涉及常识推理、道德决策和反讽理解的任务。我们的目标是将LM的程序合成技能拓展到此类任务中,并通过伪程序(即部分叶函数调用未被定义的Python程序)评估结果。为此,我们提出了Code Generation and Emulated EXecution(CoGEX,代码生成与仿真执行)框架。CoGEX的工作流程包括三个步骤:(1)训练LM生成伪程序;(2)教它们仿真所生成程序的执行过程,包括那些叶函数,让LM的知识填补执行空白;(3)用它们在大量程序中搜索,找到最优程序。为使CoGEX模型适配新任务,我们提出了一种程序搜索方法,可找到单个伪程序,当将其应用于给定数据集的所有实例时,伪执行能产生最优性能。我们在一系列任务(包括算法任务和软推理任务)上的实验表明,与标准的上下文学习方法相比,我们的方法带来了大幅提升。这一结果证明,代码合成可应用的问题类别比之前认为的要广泛得多。我们发布的数据集、微调模型和实现代码可在https://github.com/nweir127/CoGEX 获取。
英文摘要:
Program synthesis with language models (LMs) has unlocked a large set of reasoning abilities; code-tuned LMs have proven adept at generating programs that solve a wide variety of algorithmic symbolic manipulation tasks (e.g. word concatenation). However, not all reasoning tasks are easily expressible as code, e.g. tasks involving commonsense reasoning, moral decision-making, and sarcasm understanding. Our goal is to extend an LM's program synthesis skills to such tasks and evaluate the results via pseudo-programs, namely Python programs where some leaf function calls are left undefined. To that end, we propose, Code Generation and Emulated EXecution (CoGEX). CoGEX works by (1) training LMs to generate pseudo-programs, (2) teaching them to emulate their generated program's execution, including those leaf functions, allowing the LM's knowledge to fill in the execution gaps; and (3) using them to search over many programs to find an optimal one. To adapt the CoGEX model to a new task, we introduce a method for performing program search to find a single program whose pseudo-execution yields optimal performance when applied to all the instances of a given dataset. We show that our approach yields large improvements compared to standard in-context learning approaches on a battery of tasks, both algorithmic and soft reasoning. This result thus demonstrates that code synthesis can be applied to a much broader class of problems than previously considered. Our released dataset, fine-tuned models, and implementation can be found at \url{https://github.com/nweir127/CoGEX}.
Fact-Checking Complex Claims with Program-Guided Reasoning
University of California, Santa Barbara(加州大学圣巴巴拉分校);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学);Nanyang Technological University(南洋理工大学);National University of Singapore(新加坡国立大学)
Improved Logical Reasoning of Language Models via Differentiable Symbolic Programming
Carnegie Mellon University(卡内基梅隆大学);University of Pennsylvania(宾夕法尼亚大学);Mohamed Bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学);Petuum Inc.(Petuum公司)
Towards Better Understanding of Program-of-Thought Reasoning in Cross-Lingual and Multilingual Environments
School of Information Science and Technology, VISTEC(信息科学与技术学院,VISTEC);KAIST(韩国科学技术院);Cohere;SCB 10X;AI Singapore(AI新加坡);Department of Computer Engineering, Chulalongkorn University(朱拉隆梭大学计算机工程系)
MultiLingPoT: Enhancing Mathematical Reasoning with Multilingual Program Fine-tuning
Fudan University(复旦大学);MYbank, Ant Group(蚂蚁集团MYbank);School of Computer Science, Fudan University(复旦大学计算机学院);School of Data Science, Fudan University(复旦大学数据科学学院)