Retrieval-augmented GPT-3.5-based Text-to-SQL Framework with Sample-aware Prompting and Dynamic Revision Chain

计算机科学 SQL语言 可执行文件 语法 杠杆(统计) 按示例查询 数据定义语言 存储过程 SQL注入 程序设计语言 情报检索 数据库 自然语言处理 人工智能 搜索引擎 Web搜索查询
作者
Chunxi Guo,Zhiliang Tian,Jintao Tang,Shasha Li,Zhi‐Hong Wen,Kaixuan Wang,Ting Wang
出处
期刊:Cornell University - arXiv
标识
DOI:10.48550/arxiv.2307.05074
摘要

Text-to-SQL aims at generating SQL queries for the given natural language questions and thus helping users to query databases. Prompt learning with large language models (LLMs) has emerged as a recent approach, which designs prompts to lead LLMs to understand the input question and generate the corresponding SQL. However, it faces challenges with strict SQL syntax requirements. Existing work prompts the LLMs with a list of demonstration examples (i.e. question-SQL pairs) to generate SQL, but the fixed prompts can hardly handle the scenario where the semantic gap between the retrieved demonstration and the input question is large. In this paper, we propose a retrieval-augmented prompting method for a LLM-based Text-to-SQL framework, involving sample-aware prompting and a dynamic revision chain. Our approach incorporates sample-aware demonstrations, which include the composition of SQL operators and fine-grained information related to the given question. To retrieve questions sharing similar intents with input questions, we propose two strategies for assisting retrieval. Firstly, we leverage LLMs to simplify the original questions, unifying the syntax and thereby clarifying the users' intentions. To generate executable and accurate SQLs without human intervention, we design a dynamic revision chain which iteratively adapts fine-grained feedback from the previously generated SQL. Experimental results on three Text-to-SQL benchmarks demonstrate the superiority of our method over strong baseline models.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
更新
大幅提高文件上传限制,最高150M (2024-4-1)

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
2秒前
yang发布了新的文献求助10
2秒前
思源应助自然的方盒采纳,获得10
2秒前
可靠笑翠发布了新的文献求助10
3秒前
是木易呀发布了新的文献求助10
3秒前
sheep发布了新的文献求助10
4秒前
汛钥发布了新的文献求助10
5秒前
所所应助偶吼吼采纳,获得10
6秒前
orixero应助超帅pzc采纳,获得10
6秒前
9秒前
12秒前
优雅的纸鹤完成签到,获得积分10
13秒前
天才小能喵应助海绵宝宝采纳,获得10
13秒前
15秒前
16秒前
16秒前
汛钥完成签到,获得积分10
17秒前
偶吼吼发布了新的文献求助10
19秒前
林夕发布了新的文献求助10
20秒前
yy发布了新的文献求助10
22秒前
852应助健忘的梨愁采纳,获得10
24秒前
26秒前
醍醐不醒完成签到,获得积分10
26秒前
852应助如果大雨没有海棠采纳,获得10
33秒前
Orange应助shulan采纳,获得10
35秒前
苏素肃发布了新的文献求助10
36秒前
yy完成签到,获得积分10
36秒前
38秒前
aaaaaa发布了新的文献求助20
38秒前
39秒前
jy完成签到,获得积分10
40秒前
40秒前
十七完成签到,获得积分10
40秒前
41秒前
42秒前
42秒前
元始天尊发布了新的文献求助10
43秒前
45秒前
45秒前
爆米花应助aaaaaa采纳,获得10
46秒前
高分求助中
Sustainable Land Management: Strategies to Cope with the Marginalisation of Agriculture 1000
Corrosion and Oxygen Control 600
Yaws' Handbook of Antoine coefficients for vapor pressure 500
Python Programming for Linguistics and Digital Humanities: Applications for Text-Focused Fields 500
行動データの計算論モデリング 強化学習モデルを例として 500
Johann Gottlieb Fichte: Die späten wissenschaftlichen Vorlesungen / IV,1: ›Transzendentale Logik I (1812)‹ 400
The role of families in providing long term care to the frail and chronically ill elderly living in the community 380
热门求助领域 (近24小时)
化学 材料科学 医学 生物 有机化学 工程类 生物化学 纳米技术 物理 内科学 计算机科学 化学工程 复合材料 遗传学 基因 物理化学 催化作用 电极 光电子学 量子力学
热门帖子
关注 科研通微信公众号,转发送积分 2555320
求助须知:如何正确求助?哪些是违规求助? 2179647
关于积分的说明 5620295
捐赠科研通 1900847
什么是DOI,文献DOI怎么找? 949449
版权声明 565579
科研通“疑难数据库(出版商)”最低求助积分说明 504725