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

SQL-Trail: 多轮强化学习与交错反馈用于文本到SQL

SQL-Trail: Multi-Turn Reinforcement Learning with Interleaved Feedback for Text-to-SQL

Stanford University(斯坦福大学);Amazon Web Services(亚马逊网络服务)

Harper Hua, Zhen Han, Zhengyuan Shen, Jeremy Lee, Patrick Guan, Qi Zhu, Sullam Jeoung, Yueyan Chen, Yunfei Bai, Shuai Wang, Vassilis Ioannidis, Huzefa Rangwala

AI总结:

SQL-Trail通过多轮强化学习与交错反馈提升文本到SQL的生成能力,实现更高效率和准确性。

摘要:

尽管大型语言模型(LLMs)显著提升了文本到SQL生成能力,但在诸如BIRD-SQL等挑战性基准测试中,AI系统与人类专家之间仍存在明显差距。我们认为这种差距主要源于现有的单次通过范式,该范式缺乏人类自然运用的迭代推理、模式探索和错误纠正行为。为解决这一限制,我们引入SQL-Trail,一种用于文本到SQL的多轮强化学习(RL)代理框架。与一次性生成查询不同,SQL-Trail与数据库环境互动,并利用执行反馈逐步优化其预测。我们的方法聚焦于两个关键思想:(i)一个自适应的回合预算分配机制,该机制将代理的交互深度扩展以匹配问题难度;(ii)一个复合奖励面板,共同激励SQL的正确性和高效的探索。在多个基准测试中,SQL-Trail达到了新的状态水平,并实现了强大的数据效率——比先前的单次通过RL最佳方法高18倍。值得注意的是,我们的7B和14B模型在平均上比更大规模的专有系统高出5%,这证明了交互式、代理式工作流程在稳健的文本到SQL生成中的有效性。

英文摘要:

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.

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

↑