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

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


Abstract
Text-to-SQL parsing has achieved remarkable progress under the Full Schema Assumption, where the complete database structure is pre-loaded into the model’s context. Yet this assumption overlooks a more fundamental capability question of whether an LLM agent can resolve a query without explicit access to the underlying tables and relations. Moreover, full-schema injection may exceed the effective context window, introduce irrelevant metadata into the reasoning process, and become less reliable as databases evolve. We therefore study the Unknown Schema setting, in which an agent must actively explore the database and commit to only the relevant subset of metadata. 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 in which our autonomous agent follows a structured four-phase protocol to ground reasoning in verified metadata. This protocol provides a structural boundary for our novel Phase-Aware GRPO strategy, which applies token-level masked advantages to isolate exploration rewards from execution outcomes and resolve credit assignment, yielding a 9.9% relative improvement over standard GRPO. Extensive experiments across five benchmarks demonstrate that TRUST-SQL is effective at multiple scales (4B/ 8B/14B). Despite operating entirely without pre-loaded metadata, our agent matches or surpasses prior baselines on most benchmarks that rely on schema prefilling.
Anthology ID:
2026.emnlp-main.2560
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
58177–58200
Language:
URL:
https://aclanthology.org/2026.emnlp-main.2560/
DOI:
Bibkey:
Cite (ACL):
Ai Jian, Xiaoyun Zhang, Eryu Guo, Wanrou Du, Jingqing Ruan, Haojin Yang, Jiangbo Pei, Weipeng Zhang, Ke Zeng, and Xunliang Cai. 2026. TRUST-SQL: Tool-Integrated Multi-Turn Reinforcement Learning for Text-to-SQL over Unknown Schemas. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 58177–58200, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
TRUST-SQL: Tool-Integrated Multi-Turn Reinforcement Learning for Text-to-SQL over Unknown Schemas (Jian et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.2560.pdf