ChatPaper.aiChatPaper

TRUST-SQL: 알려지지 않은 스키마에 대한 텍스트-to-SQL을 위한 도구 통합 다중 턴 강화 학습

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

March 17, 2026
저자: Ai Jian, Xiaoyun Zhang, Wanrou Du, Jingqing Ruan, Jiangbo Pei, Weipeng Zhang, Ke Zeng, Xunliang Cai
cs.AI

초록

Text-to-SQL 파싱은 전체 스키마 가정 하에 놀라운 발전을 이루었습니다. 그러나 실제 기업 환경에서는 데이터베이스에 방대한 노이즈 메타데이터를 포함한 수백 개의 테이블이 존재하여 이러한 전제가 성립되지 않습니다. 전체 스키마를 사전에 주입하는 대신, 에이전트는 관련된 부분집합만을 능동적으로 식별하고 검증해야 하며, 이는 본 연구에서 다루는 알려지지 않은 스키마 시나리오를 야기합니다. 이를 해결하기 위해 우리는 TRUST-SQL(Truthful Reasoning with Unknown Schema via Tools)을 제안합니다. 우리는 이 작업을 부분 관측 마르코프 결정 과정으로 공식화하며, 우리의 자율 에이전트는 검증된 메타데이터에 기반한 추론을 위해 구조화된 4단계 프로토콜을 사용합니다. 중요한 것은, 이 프로토콜이 우리의 새로운 이중 트랙 GRPO 전략을 위한 구조적 경계를 제공한다는 점입니다. 토큰 수준 마스크 장점을 적용함으로써 이 전략은 신용 할당 문제를 해결하기 위해 탐사 보상을 실행 결과로부터 분리하며, 표준 GRPO 대비 9.9%의 상대적 성능 향상을 달성했습니다. 5개 벤치마크에 대한 폭넓은 실험을 통해 TRUST-SQL이 4B 및 8B 변형 각각에 대해 기본 모델 대비 평균 30.6%, 16.6%의 절대적 성능 향상을 달성함을 입증했습니다. 주목할 점은, 사전 로드된 메타데이터 없이 전적으로 운영됨에도 불구하고, 우리의 프레임워크가 스키마 사전 채우기에 의존하는 강력한 베이스라인을 지속적으로 따라잡거나 능가한다는 것입니다.
English
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.
PDF442March 19, 2026