[论文解读] Track-SQL: Enhancing Generative Language Models with Dual-Extractive Modules for Schema and Context Tracking in Multi-turn Text-to-SQL
Track-SQL 引入双提取模块,在多轮文本到 SQL 的场景中动态链接模式与提取上下文,在 SparC 和 CoSQL 数据集上达到最新的最优结果。它在多轮执行准确性方面显示出显著改进,并提供消融研究以确认各组件的贡献。
Generative language models have shown significant potential in single-turn Text-to-SQL. However, their performance does not extend equivalently to multi-turn Text-to-SQL. This is primarily due to generative language models' inadequacy in handling the complexities of context information and dynamic schema linking in multi-turn interactions. In this paper, we propose a framework named Track-SQL, which enhances generative language models with dual-extractive modules designed to track schema and contextual changes in multi-turn Text-to-SQL. Specifically, Track-SQL incorporates a \emph{Semantic-enhanced Schema Extractor} and a \emph{Schema-aware Context Extractor}. Experimental results demonstrate that Track-SQL achieves state-of-the-art performance on the SparC and CoSQL datasets. Furthermore, detailed ablation studies reveal that Track-SQL significantly improves execution accuracy in multi-turn interactions by 7.1\% and 9.55\% on these datasets, respectively. Our implementation will be open-sourced at https://github.com/DMIRLAB-Group/Track-SQL.
研究动机与目标
- Address the decline of single-turn Text-to-SQL performance when moving to multi-turn dialogues.
- Develop a dynamic schema linking mechanism to handle evolving dialogue contexts.
- Design a context extraction module to select relevant historical queries for current SQL generation.
- Improve explainability by making extractor outputs transparent to the SQL generator.
- Demonstrate state-of-the-art performance on SparC and CoSQL with ablation studies.
提出的方法
- Propose Track-SQL framework with two extractors: Semantic-enhanced Schema Extractor (SESE) and Schema-aware Context Extractor (SACE).
- SESE enriches schema semantics with open-domain knowledge and a gating mechanism to produce enhanced table and column embeddings.
- SACE retrieves and scores relevant past SQL queries using semantic similarity (SentenceBERT) and Jensen-Shannon divergence on schema usage, to select a base prompt for generation.
- Combine extracted schemas and base SQL with past questions to form prompt information for supervised fine-tuning of a SQL generator.
- Transform multi-turn data into a single-turn-like training instance by concatenating questions and supplying E(S) and SQL_base as prompt context.
- Fine-tune 7B-scale models (CodeLlama, DeepSeek, Mistral) with LoRA, evaluating on SparC and CoSQL datasets.

实验结果
研究问题
- RQ1How can dynamic schema linking be effectively updated across turns to reduce redundancy and mis-linking?
- RQ2Can a context-aware retrieval mechanism improve multi-turn SQL generation by leveraging relevant past queries?
- RQ3What is the impact of semantic enhancement of schema items on schema-item extraction and downstream SQL accuracy?
- RQ4Does the Track-SQL approach achieve state-of-the-art results on SparC and CoSQL benchmarks in both single-turn and multi-turn settings?
主要发现
- Track-SQL achieves leading results on SparC and CoSQL validation sets compared to prior in-context learning and fine-tuning methods.
- Ablation studies show that removing SESE or SACE degrades QM/IM and EX/TS metrics, confirming their individual contributions.
- SESE substantially reduces redundancy in schema extraction, especially on CoSQL, improving localization accuracy.
- SACE provides robust historical-context usage with syntactic error checks to prevent propagation, improving multi-turn SQL generation stability.
- Overall, Track-SQL improves multi-turn execution accuracy by around 7% on SparC and 9.6% on CoSQL in ablations, and yields end-to-end latency suitable for real-time systems.

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。