arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2210.07128cs.CLcs.LG
收藏

代码的语言模型是Few-Shot常识学习者

Language Models of Code are Few-Shot Commonsense Learners

Carnegie Mellon University(卡内基梅隆大学);Inspired Cognition

Aman Madaan, Shuyan Zhou, Uri Alon, Yiming Yang, Graham Neubig

摘要:

我们解决结构化常识推理的一般任务:给定一个自然语言输入,目标是生成一个图,如事件-或推理图。为了使用大语言模型(LM)来完成这个任务,现有的方法将输出图"串行化"为节点和边的平面列表。虽然可行,但这些序列化的图强烈偏离了LM预先训练的自然语言语料库,阻碍了LM正确地生成它们。在本文中,我们表明,当我们而不是框架结构化的常识推理任务的代码生成任务,预训练的LM的代码是更好的结构化常识推理比LM的自然语言,即使下游任务不涉及源代码。我们展示了我们的方法在三个不同的结构化常识推理任务。在所有这些自然语言任务中,我们表明,使用我们的方法,代码生成LM(CODEX)优于在目标任务上微调的自然LM(例如,T5)和其他强LM,如Few-Shot设置中的GPT-3。

英文摘要:

We address the general task of structured commonsense reasoning: given a natural language input, the goal is to generate a graph such as an event -- or a reasoning-graph. To employ large language models (LMs) for this task, existing approaches ``serialize'' the output graph as a flat list of nodes and edges. Although feasible, these serialized graphs strongly deviate from the natural language corpora that LMs were pre-trained on, hindering LMs from generating them correctly. In this paper, we show that when we instead frame structured commonsense reasoning tasks as code generation tasks, pre-trained LMs of code are better structured commonsense reasoners than LMs of natural language, even when the downstream task does not involve source code at all. We demonstrate our approach across three diverse structured commonsense reasoning tasks. In all these natural language tasks, we show that using our approach, a code generation LM (CODEX) outperforms natural-LMs that are fine-tuned on the target task (e.g., T5) and other strong LMs such as GPT-3 in the few-shot setting.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑