arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2311.09519cs.CL
收藏

利用代码改进语义解析的上下文学习

Leveraging Code to Improve In-context Learning for Semantic Parsing

Allen Institute for AI(艾伦人工智能研究所);University of California Irvine(加州大学欧文分校)

Ben Bogin, Shivanshu Gupta, Peter Clark, Ashish Sabharwal

AI总结:

本文提出用Python等通用编程语言替代领域特定语言,并在提示中加入结构化领域描述,显著提升了语义解析的上下文学习性能,缩小了组合划分与i.i.d.划分的差距。

摘要:

上下文学习(ICL)因其少样本特性和更强的泛化能力,成为语义解析中一种颇具吸引力的方法。然而,仅凭少量演示来学习解析到罕见的领域特定语言(DSL)极具挑战性,这限制了即使是最强大的大语言模型(LLM)的性能。在本工作中,我们通过以下方式提升语义解析中上下文学习的有效性:(1)使用诸如Python之类的通用编程语言而非DSL,以及(2)利用结构化的领域描述来增强提示,该描述包括例如可用的类和函数。我们表明,这两项改变在三个流行数据集上均显著提高了准确率。二者结合带来了显著的改进(例如在SMCalFlow组合划分上从7.9%提升到66.5%),在使用强大模型时几乎弥合了较简单的独立同分布(i.i.d.)划分与更困难的组合划分之间的性能差距,并减少了对大量演示的需求。我们发现,目标解析语言与通用代码的相似性比该语言在预训练语料库中的流行度更为重要。我们的发现为在现代大语言模型上下文学习背景下构建语义解析器提供了一种改进的方法论。

英文摘要:

In-context learning (ICL) is an appealing approach for semantic parsing due to its few-shot nature and improved generalization. However, learning to parse to rare domain-specific languages (DSLs) from just a few demonstrations is challenging, limiting the performance of even the most capable LLMs. In this work, we improve the effectiveness of ICL for semantic parsing by (1) using general-purpose programming languages such as Python instead of DSLs, and (2) augmenting prompts with a structured domain description that includes, e.g., the available classes and functions. We show that both these changes significantly improve accuracy across three popular datasets. Combined, they lead to dramatic improvements (e.g. 7.9% to 66.5% on SMCalFlow compositional split), nearly closing the performance gap between easier i.i.d.\ and harder compositional splits when used with a strong model, and reducing the need for a large number of demonstrations. We find that the resemblance of the target parse language to general-purpose code is a more important factor than the language's popularity in pre-training corpora. Our findings provide an improved methodology for building semantic parsers in the modern context of ICL with LLMs.

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

↑