arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2310.17342cs.CL
收藏

ACT-SQL:基于自动生成思维链的文本到SQL上下文学习方法

ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought

Shanghai Jiao Tong University(上海交通大学);X-LANCE Lab(X-LANCE实验室);MoE Key Lab of Artificial Intelligence(教育部人工智能重点实验室)

Hanchong Zhang, Ruisheng Cao, Lu Chen, Hongshen Xu, Kai Yu

AI总结:

本文提出ACT-SQL方法,通过自动生成思维链示例提升大语言模型在文本到SQL任务中的推理能力,无需人工标注且仅需一次API调用,并在Spider开发集上取得SOTA性能。

摘要:

近年来,大语言模型(LLMs)已被证明在多个领域和任务中具有强大能力。我们研究文本到SQL任务中的提示设计问题,并尝试提升LLMs在生成SQL查询时的推理能力。除了简单的少样本上下文学习设置外,我们采用与模式链接(schema linking)类似的方法设计了思维链(CoT)提示。我们提出了一种名为ACT-SQL的方法,用于自动生成auto-CoT示例,因此整个过程无需人工标注。我们的方法具有成本节约优势,因为在生成一条SQL查询时仅调用一次LLMs的API。此外,我们将上下文学习方法扩展到多轮文本到SQL任务中。实验结果表明,LLMs的性能可以从我们的ACT-SQL方法中受益。在现有上下文学习方法中,我们的方法在Spider开发集上取得了SOTA性能。

英文摘要:

Recently Large Language Models (LLMs) have been proven to have strong abilities in various domains and tasks. We study the problem of prompt designing in the text-to-SQL task and attempt to improve the LLMs' reasoning ability when generating SQL queries. Besides the trivial few-shot in-context learning setting, we design our chain-of-thought (CoT) prompt with a similar method to schema linking. We provide a method named ACT-SQL to automatically generate auto-CoT exemplars and thus the whole process doesn't need manual labeling. Our approach is cost-saving since we only use the LLMs' API call once when generating one SQL query. Furthermore, we extend our in-context learning method to the multi-turn text-to-SQL task. The experiment results show that the LLMs' performance can benefit from our ACT-SQL approach. Our approach achieves SOTA performance on the Spider dev set among existing in-context learning approaches.

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

↑