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

TRUST-SQL:基于工具的多轮强化学习用于未知模式下的文本到SQL

TRUST-SQL: Tool-Integrated Multi-Turn Reinforcement Learning for Text-to-SQL over Unknown Schemas

Beijing University of Posts and Telecommunications(北京邮电大学);State Key Lab of Processors, Institute of Computing Technology, CAS(中国科学院计算技术研究所处理器国家重点实验室);University of Chinese Academy of Sciences(中国科学院大学);Meituan(美团)

Ai Jian, Xiaoyun Zhang, Eryu Guo, Wanrou Du, Jingqing Ruan, Jiangbo Pei, Weipeng Zhang, Ke Zeng, Xunliang Cai

AI总结:

本文提出TRUST-SQL,通过工具集成的多轮强化学习解决文本到SQL在未知模式下的问题,通过结构化四阶段协议和Dual-Track GRPO策略提升性能,实验表明在多个基准上取得显著改进。

摘要:

文本到SQL解析在完整模式假设下取得了显著进展,但现实企业环境中数据库包含数百张表且元数据嘈杂,无法提前注入完整模式。为此,本文提出TRUST-SQL(通过工具的未知模式真实推理),将任务建模为部分可观测马尔可夫决策过程,自主代理采用结构化四阶段协议以验证元数据为基础进行推理。关键在于该协议为新颖的Dual-Track GRPO策略提供了结构边界。通过应用令牌级掩码优势,该策略将探索奖励与执行结果分离以解决信用分配,相比标准GRPO提升了9.9%。在五个基准上的广泛实验表明,TRUST-SQL在4B和8B变体上分别比基线模型平均提高了30.6%和16.6%。值得注意的是,尽管完全不依赖预加载元数据,框架仍能一致匹配或超越依赖模式预填充的强大基线。

英文摘要:

Text-to-SQL parsing has achieved remarkable progress under the Full Schema Assumption. However, this premise fails in real-world enterprise environments where databases contain hundreds of tables with massive noisy metadata. Rather than injecting the full schema upfront, an agent must actively identify and verify only the relevant subset, giving rise to the Unknown Schema scenario we study in this work. To address this, we propose TRUST-SQL (Truthful Reasoning with Unknown Schema via Tools). We formulate the task as a Partially Observable Markov Decision Process where our autonomous agent employs a structured four-phase protocol to ground reasoning in verified metadata. Crucially, this protocol provides a structural boundary for our novel Dual-Track GRPO strategy. By applying token-level masked advantages, this strategy isolates exploration rewards from execution outcomes to resolve credit assignment, yielding a 9.9% relative improvement over standard GRPO. Extensive experiments across five benchmarks demonstrate that TRUST-SQL achieves an average absolute improvement of 30.6% and 16.6% for the 4B and 8B variants respectively over their base models. Remarkably, despite operating entirely without pre-loaded metadata, our framework consistently matches or surpasses strong baselines that rely on schema prefilling. Data, code, and checkpoints are available at https://huggingface.co/collections/AIJian/trustsql.

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

↑