Research map / Large language models / Language, safety and interpretability
Structure-Guided Large Language Models for Text-to-SQL Generation
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes SGU-SQL, a text-to-SQL framework that builds query and schema graphs, links them with an RGAT-based structure learner, and decomposes SQL generation via syntax-tree prompting for GPT-4.
Problem
LLM-based text-to-SQL struggles with ambiguous user intent, complex database schemas, and the syntax structure of SQL; existing decomposition methods are ineffective for SQL generation.
Approach
Combine dual query-schema graph construction and RGAT-based structure linking with syntax-tree-based decomposition of SQL generation into subtasks that an LLM (GPT-4) solves incrementally.
Key results
- SGU-SQL with GPT-4 reaches 87.95% execution accuracy on Spider-dev, above the strongest listed baseline SuperSQL (86.82%).
- On BIRD dev, SGU-SQL with GPT-4 reaches 61.80% execution accuracy versus 58.60% for SuperSQL.
- Ablation shows removing syntax-based decomposition causes the largest drop (-5.60 on Spider-dev, -8.02 on BIRD-dev).
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| add query graph representation (ablation) | SGU-SQL · Spider-dev | execution accuracy: 84.50 (-3.45) -> 87.95 | Helped |
| add database graph representation (ablation) | SGU-SQL · Spider-dev | execution accuracy: 85.81 (-2.14) -> 87.95 | Helped |
| add structure-aware linking (ablation) | SGU-SQL · Spider-dev | execution accuracy: 82.62 (-5.33) -> 87.95 | Helped |
| add syntax-based decomposition (ablation) | SGU-SQL · Spider-dev | execution accuracy: 82.35 (-5.60) -> 87.95 | Helped |
| add query graph representation (ablation) | SGU-SQL · BIRD-dev | execution accuracy: 58.93 (-2.87) -> 61.80 | Helped |
| add database graph representation (ablation) | SGU-SQL · BIRD-dev | execution accuracy: 58.26 (-3.54) -> 61.80 | Helped |
| add structure-aware linking (ablation) | SGU-SQL · BIRD-dev | execution accuracy: 55.31 (-6.49) -> 61.80 | Helped |
| add syntax-based decomposition (ablation) | SGU-SQL · BIRD-dev | execution accuracy: 53.78 (-8.02) -> 61.80 | Helped |
| use SGU-SQL prompting instead of few-shot prompting (ablation) | GPT-4 · Spider-dev | execution accuracy: 0.7665 -> 0.8795 | Helped |
| use SGU-SQL prompting instead of CoT prompting (ablation) | GPT-4 · Spider-dev | execution accuracy: 0.7834 -> 0.8795 | Helped |
| use CoT prompting instead of few-shot prompting (ablation) | PaLM-2 · Spider-dev | execution accuracy: 0.6985 -> 0.6873 | Hurt |
| use SGU-SQL prompting instead of few-shot prompting (ablation) | PaLM-2 · Spider-dev | execution accuracy: 0.6985 -> 0.7395 | Helped |
Surprising findings
- Chain-of-thought prompting reduced PaLM-2 accuracy relative to few-shot prompting, according to the paper.
- Table results show inconsistency: the main Spider table reports SGU-SQL EM 78.26 whereas the Spider-dev ablation reports 87.95 execution accuracy.
Limitations
- Relies on closed-source GPT-4, making reproducibility and cost difficult.
- Reported results contain inconsistencies across tables and text (e.g., differing numbers for the same configuration), and the paper provides limited methodological detail on the graph learner and decomposition.
Experimental setup
Datasets: Spider BIRD
Benchmarks: Spider BIRD Spider 2.0-Snow Spider 2.0-Lite
Metrics: execution accuracy exact match accuracy valid efficiency score
Baselines: RAT-SQL LGESQL RESDSQL Graphix-T5 DIN-SQL DAIL-SQL SuperSQL MAC-SQL C3-GPT PURPLE CHESS CHASE-SQL
Builds on: RAT-SQL DIN-SQL DAIL-SQL MAC-SQL RGAT
Closest papers by meaning
- ROUTE: Robust Multitask Tuning and Collaboration for Text-to-SQL (ICLR 2025 · similarity 0.91)
- CogSQL: A Cognitive Framework for Enhancing Large Language Models in Text-to-SQL Translation (AAAI 2025 · similarity 0.90)
- SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQL (NeurIPS 2025 · similarity 0.89)
- Alpha-SQL: Zero-Shot Text-to-SQL using Monte Carlo Tree Search (ICML 2025 · similarity 0.89)
- Enhancing SQL Query Generation with Neurosymbolic Reasoning (AAAI 2025 · similarity 0.88)
- PARROT: A Benchmark for Evaluating LLMs in Cross-System SQL Translation (NeurIPS 2025 · similarity 0.87)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
