While large language models (LLMs) have substantially improved Text-to-SQL generation, a pronounced gap remains between AI systems and human experts on challenging benchmarks such as BIRD-SQL. We argue this gap stems largely from the prevailing single-pass paradigm, which lacks the iterative reasoning, schema exploration, and error-correction behaviors that humans naturally employ. To address this limitation, we introduce SQL-Trail, a multi-turn reinforcement learning (RL) agentic framework for Text-to-SQL. Rather than producing a query in one shot, SQL-Trail interacts with the database environment and uses execution feedback to iteratively refine its predictions. Our approach centers on two key ideas: (i) an adaptive turn-budget allocation mechanism that scales the agent's interaction depth to match question difficulty, and (ii) a composite reward panel that jointly incentivizes SQL correctness and efficient exploration. Across benchmarks, SQL-Trail sets a new state of the art and delivers strong data efficiency--up to 18x higher than prior single-pass RL state-of-the-art methods. Notably, our 7B and 14B models outperform substantially larger proprietary systems by 5% on average, underscoring the effectiveness of interactive, agentic workflows for robust Text-to-SQL generation.


翻译:尽管大型语言模型(LLMs)显著提升了文本到SQL的生成能力,但在BIRD-SQL等具有挑战性的基准测试中,人工智能系统与人类专家之间仍存在明显差距。我们认为这一差距主要源于当前主流的单次生成范式,其缺乏人类自然运用的迭代推理、模式探索和错误修正行为。为突破这一局限,我们提出了SQL-Trail——一个面向文本到SQL的多轮强化学习智能体框架。该方法并非一次性生成查询,而是通过与数据库环境交互并利用执行反馈迭代优化预测结果。我们的核心创新在于:(1)自适应轮次预算分配机制,可根据问题难度动态调整智能体交互深度;(2)复合奖励面板,协同激励SQL正确性与探索效率。在多项基准测试中,SQL-Trail实现了新的最优性能,并展现出卓越的数据效率——较先前单轮强化学习最优方法提升高达18倍。值得注意的是,我们的7B和14B模型平均性能超越规模大得多的商用系统5%,这凸显了交互式智能体工作流对构建鲁棒文本到SQL生成系统的有效性。

0
下载
关闭预览

相关内容

SQL 全名是结构化查询语言,是用于数据库中的标准数据查询语言,IBM 公司最早使用在其开发的数据库系统中。
大语言模型中的检索与结构化增强生成综述
专知会员服务
32+阅读 · 2025年9月17日
什么是后训练?大语言模型训练后优化方法综述,87页pdf
【AAAI2024】基于对比上下文学习的自定义语言模型响应
专知会员服务
26+阅读 · 2024年2月1日
强化学习与文本生成
微信AI
41+阅读 · 2019年4月4日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
干货|当深度学习遇见自动文本摘要,seq2seq+attention
机器学习算法与Python学习
10+阅读 · 2018年5月28日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
42+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
VIP会员
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
42+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员