RSTAR: Relational and Semantic Topology-Aware Refinement for Text-to-SQL
Abstract
Text-to-SQL aims to translate natural language questions into executable Structured Query Language (SQL) statements, allowing users to access relational databases through plain language instead of formal query syntax. Recent advances in Large Language Models (LLMs) have established prompt-based reasoning and retrieval-augmented generation as dominant paradigms for Text-to-SQL. However, these approaches often treat schema linking, example retrieval, and result verification as isolated stages guided primarily by surface-level semantics, leading to schema topology ambiguity, retrieval mismatch, and execution-level semantic blind spots when handling complex and heterogeneous schemas of enterprise databases. To address these issues, this paper proposes a Relational and Semantic Topology-Aware Refinement (RSTAR) framework for Text-to-SQL. First, a relational topology-aware schema linker is designed to constrain LLM reasoning to valid foreign-key navigation paths for eliminating hallucinated intermediate-table joins under schema topology ambiguity. Second, a semantic topology graph retriever is proposed to disentangle structural topologies from domain entities for resolving retrieval mismatch via structurally isomorphic few-shot retrieval across heterogeneous databases. Third, an execution-feedback refinement agent is built to convert sandbox execution signals into localized value-aware feedback for repairing execution-level semantic errors. Extensive experiments on five benchmark datasets across several mainstream LLMs demonstrate that RSTAR significantly outperforms state-of-the-art Text-to-SQL competitors, attaining 95.4% execution accuracy on Spider and 79.2% on BIRD and surpassing the strongest baseline by 6.9 points on UniSQL. The source code and datasets are submitted as Supplementary Materials for Reproducibility.
est. 32% chance this paper gets accepted at ICLR 2027.
What do you think this paper will get?
All positions stay anonymous.