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

CoE-SQL:基于编辑链的多轮文本到SQL的上下文学习

CoE-SQL: In-Context Learning for Multi-Turn Text-to-SQL with Chain-of-Editions

Shanghai Jiao Tong University(上海交通大学);Suzhou Laboratory(苏州实验室)

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

AI总结:

本文提出CoE-SQL方法,通过编辑链提示LLMs基于前一轮SQL查询生成当前查询,在多轮文本到SQL任务中稳定超越上下文学习基线,并在SParC和CoSQL上达到最先进性能。

摘要:

近年来,大型语言模型(LLMs)已被证明在多种领域和任务中具有出色的能力。我们研究了多轮文本到SQL任务中的提示设计问题,并尝试在生成SQL查询时增强LLMs的推理能力。在对话上下文中,由于上下文依赖性,当前SQL查询可以通过仅少量操作从前一个SQL查询修改而来。我们提出了名为CoE-SQL的方法,该方法可以提示LLMs基于先前生成的SQL查询,通过编辑链生成SQL查询。我们还进行了广泛的消融研究,以确定我们方法的最优配置。我们的方法稳定地优于不同的上下文学习基线,并在使用LLMs时在SParC和CoSQL两个基准上取得了最先进的性能,同时与最先进的微调模型相比也具有竞争力。

英文摘要:

Recently, Large Language Models (LLMs) have been demonstrated to possess impressive capabilities in a variety of domains and tasks. We investigate the issue of prompt design in the multi-turn text-to-SQL task and attempt to enhance the LLMs' reasoning capacity when generating SQL queries. In the conversational context, the current SQL query can be modified from the preceding SQL query with only a few operations due to the context dependency. We introduce our method called CoE-SQL which can prompt LLMs to generate the SQL query based on the previously generated SQL query with an edition chain. We also conduct extensive ablation studies to determine the optimal configuration of our approach. Our approach outperforms different in-context learning baselines stably and achieves state-of-the-art performances on two benchmarks SParC and CoSQL using LLMs, which is also competitive to the SOTA fine-tuned models.

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

↑