Structure-Guided Large Language Models for Text-to-SQL Generation
Qinggang Zhang, Hao Chen, Junnan Dong, Shengyuan Chen, Feiran Huang, Xiao Huang
Abstract
Recent advancements in large language models (LLMs) have shown promise in bridging the gap between natural language queries and database management systems, enabling users to interact with databases without the background of SQL. However, LLMs often struggle to comprehend complex database structures and accurately interpret user intentions. Decomposition-based methods have been proposed to enhance the performance of LLMs on complex tasks, but decomposing SQL generation into subtasks is non-trivial due to the declarative structure of SQL syntax and the intricate connections between query concepts and database elements. In this paper, we propose a novel Structure GUided text-to-SQL framework (SGU-SQL) that incorporates syntax-based prompting to enhance the SQL generation capabilities of LLMs. Specifically, SGU-SQL establishes structure-aware links between user queries and database schema and decomposes the complex generation task using syntax-based prompting to enable more accurate LLM-based SQL generation. Extensive experiments on two benchmark datasets demonstrate that SGU-SQL consistently outperforms state-of-the-art text-to-SQL models.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
4 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction cites Language Models are Few-Shot Learners
- DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Teaching Large Language Models to Self-Debug cites Language Models are Few-Shot Learners
- Teaching Large Language Models to Self-Debug cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
- Reinforced Lifelong Editing for Language Models cites Language Models are Few-Shot Learners
- Reinforced Lifelong Editing for Language Models cites Neuron-Level Sequential Editing for Large Language Models
- AnyEdit: Edit Any Knowledge Encoded in Language Models cites Language Models are Few-Shot Learners
- AnyEdit: Edit Any Knowledge Encoded in Language Models cites Reinforced Lifelong Editing for Language Models
- AnyEdit: Edit Any Knowledge Encoded in Language Models cites Neuron-Level Sequential Editing for Large Language Models
- Neuron-Level Sequential Editing for Large Language Models cites AnyEdit: Edit Any Knowledge Encoded in Language Models
- Neuron-Level Sequential Editing for Large Language Models cites Language Models are Few-Shot Learners
Cited by top-tier papers4
- NeuSymEA: Neuro-symbolic Entity Alignment via Variational InferenceShengyuan Chen, Zheng Yuan, Qinggang Zhang, Wen Hua et al.NeurIPS 2025 · 2 citations
- Reinforced Lifelong Editing for Language ModelsZherui Li, Houcheng Jiang, Hao Chen, Baolong Bi et al.ICML 2025
- AnyEdit: Edit Any Knowledge Encoded in Language ModelsHoucheng Jiang, Junfeng Fang, Ningyu Zhang, Mingyang Wan et al.ICML 2025
- Neuron-Level Sequential Editing for Large Language ModelsHoucheng Jiang, Junfeng Fang, Tianyu Zhang, Baolong Bi et al.ACL 2025
Builds on23
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations
- DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-CorrectionMohammadreza Pourreza, Davood RafieiNeurIPS 2023 · 909 citations
- Text-to-SQL Empowered by Large Language Models: A Benchmark EvaluationDawei Gao, Haibin Wang, Yaliang Li, Xiuyu Sun et al.VLDB 2024 · 609 citations
Related papers
- SchemaRAG: A Schema-aware Retrieval-Augmented Generation Framework for Text-to-SQLDi Wu, Zetong Tang, Yi He, Xin LuoSIGMOD 2026 · 9 citations
- CogSQL: A Cognitive Framework for Enhancing Large Language Models in Text-to-SQL TranslationHongwei Yuan, Xiu Tang, Ke Chen, Lidan Shou et al.AAAI 2025 · 12 citations
- UCS-SQL: Uniting Content and Structure for Enhanced Semantic Bridging In Text-to-SQLZhenhe Wu, Zhongqiu Li, Jie Zhang, Zhongjiang He et al.ACL Findings 2025 · 4 citations
- SQLPrompt: In-Context Text-to-SQL with Minimal Labeled DataRuoxi Sun, Sercan Ö. Arik, Rajarishi Sinha, Hootan Nakhost et al.EMNLP Findings 2023 · 18 citations
- SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQLYue Gong, Chuan Lei, Xiao Qin, Kapil Vaidya et al.NeurIPS 2025 · 21 citations
