[Paper Review] A Survey of Text-to-SQL in the Era of LLMs: Where are we, and where are we going?
This survey provides a comprehensive, lifecycle-based analysis of text-to-SQL (NL2SQL) systems powered by large language models (LLMs), covering model architectures, data synthesis, evaluation strategies, and error analysis. It introduces a modular framework for LLM-based NL2SQL, a two-level error taxonomy, and practical roadmaps for deployment, highlighting key challenges and open problems in generalization, trustworthiness, and real-world robustness in the LLM era.
Translating users' natural language queries (NL) into SQL queries (i.e., Text-to-SQL, a.k.a. NL2SQL) can significantly reduce barriers to accessing relational databases and support various commercial applications. The performance of Text-to-SQL has been greatly enhanced with the emergence of Large Language Models (LLMs). In this survey, we provide a comprehensive review of Text-to-SQL techniques powered by LLMs, covering its entire lifecycle from the following four aspects: (1) Model: Text-to-SQL translation techniques that tackle not only NL ambiguity and under-specification, but also properly map NL with database schema and instances; (2) Data: From the collection of training data, data synthesis due to training data scarcity, to Text-to-SQL benchmarks; (3) Evaluation: Evaluating Text-to-SQL methods from multiple angles using different metrics and granularities; and (4) Error Analysis: analyzing Text-to-SQL errors to find the root cause and guiding Text-to-SQL models to evolve. Moreover, we offer a rule of thumb for developing Text-to-SQL solutions. Finally, we discuss the research challenges and open problems of Text-to-SQL in the LLMs era. Text-to-SQL Handbook: https://github.com/HKUSTDial/NL2SQL Handbook
Motivation & Objective
- To provide a systematic, lifecycle-oriented review of NL2SQL techniques in the era of large language models (LLMs).
- To identify and analyze core challenges in NL2SQL, including ambiguity, under-specification, and schema linking, particularly in real-world deployment contexts.
- To propose a modular framework for LLM-based NL2SQL systems, including key components like database content retrieval and post-processing.
- To develop a two-level error taxonomy for diagnosing and improving NL2SQL model failures.
- To guide practitioners with a roadmap for optimizing LLMs for NL2SQL and a decision flow for selecting appropriate modules based on use-case scenarios.
Proposed method
- Categorizing NL2SQL methods into four pillars: model architectures, data collection and synthesis, multi-angle evaluation, and error analysis.
- Proposing a modular framework for LLM-based NL2SQL, with components for pre-processing, translation, and post-processing, including database content retrieval and schema linking.
- Introducing a two-level error taxonomy to classify NL2SQL output errors by root cause and impact, enabling targeted model improvement.
- Designing a practical roadmap for fine-tuning and adapting LLMs to NL2SQL, emphasizing iterative optimization and module selection.
- Developing a decision flowchart to guide module selection based on deployment context, such as domain specificity, accuracy requirements, and latency constraints.
- Proposing adaptive training data synthesis using model feedback to dynamically generate diverse, low-resource (nl, sql) pairs, improving generalization across domains.
Experimental results
Research questions
- RQ1How do LLM-based NL2SQL models handle ambiguity and under-specification in natural language queries, and what techniques improve schema and instance grounding?
- RQ2What are the key components and design patterns in effective LLM-powered NL2SQL systems, and how do they contribute to performance and robustness?
- RQ3How can NL2SQL evaluation be conducted beyond standard accuracy metrics, and what role do scenario-based and granular evaluations play in model selection?
- RQ4What are the dominant error patterns in NL2SQL outputs, and how can a systematic taxonomy guide model debugging and improvement?
- RQ5What open challenges remain in deploying NL2SQL in real-world settings, particularly regarding trust, cost, and adaptability to unseen domains?
Key findings
- The survey identifies that current LLM-based NL2SQL models still struggle with semantic mismatches and schema linking, especially when queries are ambiguous or under-specified.
- A two-level error taxonomy was developed to classify errors by root cause (e.g., schema misalignment, logical error) and impact (e.g., syntax vs. semantic), enabling targeted model refinement.
- Adaptive training data synthesis using LLM feedback shows promise for improving model generalization in low-resource and unseen domains.
- Multi-angle evaluation—based on SQL complexity, NL variation, and domain specificity—is critical for identifying model weaknesses and guiding deployment decisions.
- The proposed roadmap and decision flow for module selection significantly reduce the design burden for practitioners and improve system reliability in real-world scenarios.
- Open problems include building trustworthy, cost-effective, and open-world NL2SQL systems, especially with tools like visual debuggers and interactive query rewriters.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.