Text-to-SQL with Large Language Models: A Structured Narrative Review, Reproducible Evaluation Protocol, and Statistical Design Diagnostic
Description
This research paper examines large language models (LLMs) for natural language-to-SQL (Text-to-SQL) generation. It presents a structured narrative review of relevant research and proposes a reproducible evaluation protocol for comparing prompting, retrieval augmentation, few-shot examples, and a bounded SQL correction procedure.
The proposed evaluation design includes five experimental conditions and outlines dataset handling, SQL execution safeguards, evaluation procedures, cost and latency tracking, and statistical analysis considerations. The paper also discusses database-level clustering, reproducibility requirements, and limitations that may affect the interpretation of benchmark results.
Research status: The proposed BIRD benchmark experiment has not been executed, and the reported statistical simulation results have not been independently reproduced. Therefore, this manuscript does not claim experimentally verified improvements in Text-to-SQL accuracy, latency, or cost. The evaluation protocol and research directions are intended to support future reproducible investigation.
Keywords: Text-to-SQL, large language models, natural language-to-SQL, retrieval-augmented generation, few-shot prompting, SQL correction, reproducible research, statistical evaluation.
Files
Text-to-SQL with Large Language Models.pdf
Additional details
References
- Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task (2018)
- BIRD: Can LLM Already Serve as a Database Interface? (2023)
- Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows (2025)
- DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction (2023)
- A Survey on Employing Large Language Models for Text-to-SQL Tasks
- SQL-PaLM: Improved Large Language Model Adaptation for Text-to-SQL (2024)
- MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQL (2025)
- Optimizing Reasoning for Text-to-SQL with Execution Feedback (2025)
- ExeSQL: Self-Taught Text-to-SQL Models with Execution-Driven Bootstrapping for SQL Dialects (2025)
- RetrySQL: Text-to-SQL Training with Retry Data for Self-Correcting Query Generation (2026)
- Pervasive Annotation Errors Break Text-to-SQL Benchmarks and Leaderboards (2026)
- A Practitioner's Guide to Cluster-Robust Inference (2015)