TRUST-SQL: Tool-Integrated Multi-Turn Reinforcement Learning for Text-to-SQL over Unknown Schemas
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.
69ba17355d2b9c28ea09f11c
Ai Jian
69ba17355d2b9c28ea09f11d
Xiaoyun Zhang
claimed_verified
2026-03-18T08:36:12.430Z
67f33b43ccb05db5f0190cf6
https://cdn-avatars.huggingface.co/v1/production/uploads/no-auth/c-UeSyHfO7QchwNXW9mgu.png
ZhangXiaoyun
DadaCloud01
user
DadaCloud01
69ba17355d2b9c28ea09f11e
Wanrou Du
admin_assigned
2026-03-18T09:59:28.577Z
6626933d1d8f82a471666cf5
/avatars/97e82a3828f143922e377075b9069753.svg
Wanrou Du
Roverr
user
Roverr
69ba17355d2b9c28ea09f11f
Jingqing Ruan
admin_assigned
2026-03-18T09:59:34.896Z
64872abb3fb9bc8f4994e014
/avatars/9743b5a2b6f9b9990aa1cb06bd6eb5c6.svg
Jingqing Ruan
Amanda2023
user
Amanda2023
69ba17355d2b9c28ea09f120
Jiangbo Pei
69ba17355d2b9c28ea09f121
Weipeng Zhang
69ba17355d2b9c28ea09f122
Ke Zeng
69ba17355d2b9c28ea09f123
Xunliang Cai
TRUST-SQL: Tool-Integrated Multi-Turn Reinforcement Learning for Text-to-SQL over Unknown Schemas
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.
TRUST-SQL addresses unknown schema text-to-SQL parsing through a four-phase protocol and dual-track GRPO strategy that improves credit assignment and outperforms baselines without pre-loaded metadata.
Partially Observable Markov Decision Process Dual-Track GRPO token-level masked advantages credit assignment text-to-SQL parsing schema prefilling autonomous agent structured four-phase protocol