mlsanityData to 7 Oct 2026

Enhancing Few-shot Text-to-SQL Capabilities of Large Language Models: A Study on Prompt Design Strategies

arXiv 2305.12586 ↗First posted 21 May 2023cs.CLcited by 44

Not on the map. Why?

Abstract (arXiv)

In-context learning (ICL) has emerged as a new approach to various natural language processing tasks, utilizing large language models (LLMs) to make predictions based on context that has been supplemented with a few examples or task-specific instructions. In this paper, we aim to extend this method to question answering tasks that utilize structured knowledge sources, and improve Text-to-SQL systems by exploring various prompt design strategies for employing LLMs. We conduct a systematic investigation into different demonstration selection methods and optimal instruction formats for prompting LLMs in the Text-to-SQL task. Our approach involves leveraging the syntactic structure of an example's SQL query to retrieve demonstrations, and we demonstrate that pursuing both diversity and similarity in demonstration selection leads to enhanced performance. Furthermore, we show that LLMs benefit from database-related knowledge augmentations. Our most effective strategy outperforms the state-of-the-art system by 2.5 points (Execution Accuracy) and the best fine-tuned system by 5.1 points on the Spider dataset. These results highlight the effectiveness of our approach in adapting LLMs to the Text-to-SQL task, and we present an analysis of the factors contributing to the success of our strategy.

Key facts. Cited by 44 papers in the map (data through 7 Oct 2026). Builds on 44 of its 55 references that are in the map. First posted on arXiv 21 May 2023.

Builds on

44 of 55 references.

References · 44

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  4. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  5. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  6. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
  7. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  8. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
  9. 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
  10. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  11. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
  12. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
32 more
  1. 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,120
  2. 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
  3. 2022Measuring and Narrowing the Compositionality Gap in Language Modelscited by 1,054
  4. 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,020
  5. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  6. 2022Out of One, Many: Using Language Models to Simulate Human Samplescited by 737
  7. 2022A Survey on In-context Learningcited by 717
  8. 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 679
  9. 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
  10. 2020TAPAS: Weakly Supervised Table Parsing via Pre-trainingcited by 432
  11. 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 420
  12. 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 402
  13. 2020TaBERT: Pretraining for Joint Understanding of Textual and Tabular Datacited by 395
  14. 2022Complexity-Based Prompting for Multi-Step Reasoningcited by 387
  15. 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 242
  16. 2021TAPEX: Table Pre-training via Learning a Neural SQL Executorcited by 233
  17. 2022UnifiedSKG: Unifying and Multi-Tasking Structured Knowledge Grounding with Text-to-Text Language Modelscited by 231
  18. 2023LEVER: Learning to Verify Language-to-Code Generation with Executioncited by 228
  19. 2022Binding Language Models in Symbolic Languagescited by 224
  20. 2022Demystifying Prompts in Language Models via Perplexity Estimationcited by 215
  21. 2022Active Example Selection for In-Context Learningcited by 195
  22. 2019CoSQL: A Conversational Text-to-SQL Challenge Towards Cross-Domain Natural Language Interfaces to Databasescited by 180
  23. 2020Structure-Grounded Pretraining for Text-to-SQLcited by 126
  24. 2023A comprehensive evaluation of ChatGPT's zero-shot Text-to-SQL capabilitycited by 118
  25. 2022Large Language Models are few(1)-shot Table Reasonerscited by 116
  26. 2021Towards Robustness of Text-to-SQL Models against Synonym Substitutioncited by 110
  27. 2016Neural Symbolic Machines: Learning Semantic Parsers on Freebase with Weak Supervisioncited by 101
  28. 2022Evaluating the Text-to-SQL Capabilities of Large Language Modelscited by 101
  29. 2021Exploring Underexplored Limitations of Cross-Domain Text-to-SQL Generalizationcited by 92
  30. 2018TRANX: A Transition-based Neural Abstract Syntax Parser for Semantic Parsing and Code Generationcited by 88
  31. 2022OmniTab: Pretraining with Natural and Synthetic Data for Few-shot Table-based Question Answeringcited by 29
  32. 2022ReasTAP: Injecting Table Reasoning Skills During Pre-training via Synthetic Reasoning Examplescited by 29

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 15; 2024: 20; 2025: 7; 2026: 2.

44 papers.

Sort:

By area:

  1. 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 378
  2. 2024CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQLcited by 132
  3. 2024Next-Generation Database Interfaces: A Survey of LLM-based Text-to-SQLcited by 118
  4. 2023ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thoughtcited by 65
  5. 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
  6. 2025Reasoning-SQL: Reinforcement Learning with SQL Tailored Partial Rewards for Reasoning-Enhanced Text-to-SQLcited by 59
  7. 2024PURPLE: Making a Large Language Model a Better SQL Writercited by 34
  8. 2025Is Long Context All You Need? Leveraging LLM's Extended Context for NL2SQLcited by 30
  9. 2023Natural Language Interfaces for Tabular Data Querying and Visualization: A Surveycited by 27
  10. 2024Is Table Retrieval a Solved Problem? Exploring Join-Aware Multi-Table Retrievalcited by 27
  11. 2023Effective Distillation of Table-based Reasoning Ability from LLMscited by 23
  12. 2023Selective Demonstrations for Cross-domain Text-to-SQLcited by 21
32 more
  1. 2023Semantic Decomposition of Question and SQL for Text-to-SQL Parsingcited by 13
  2. 2023SUQL: Conversational Search over Structured and Unstructured Data with Large Language Modelscited by 13
  3. 2024CoE-SQL: In-Context Learning for Multi-Turn Text-to-SQL with Chain-of-Editionscited by 13
  4. 2023Investigating Table-to-Text Generation Capabilities of LLMs in Real-World Information Seeking Scenarioscited by 12
  5. 2025Text2SQL-Flow: A Robust SQL-Aware Data Augmentation Framework for Text-to-SQLcited by 11
  6. 2023On Evaluating the Integration of Reasoning and Action in LLM Agents with Database Question Answeringcited by 10
  7. 2024Improving Demonstration Diversity by Human-Free Fusing for Text-to-SQLcited by 10
  8. 2023Reboost Large Language Model-based Text-to-SQL, Text-to-Python, and Text-to-Function -- with Real Applications in Traffic Domaincited by 9
  9. 2024Structure Guided Large Language Model for SQL Generationcited by 9
  10. 2023Adapt and Decompose: Efficient Generalization of Text-to-SQL via Domain Adapted Least-To-Most Promptingcited by 8
  11. 2024EPI-SQL: Enhancing Text-to-SQL Translation with Error-Prevention Instructionscited by 8
  12. 2024LG AI Research & KAIST at EHRSQL 2024: Self-Training Large Language Models with Pseudo-Labeled Unanswerable Questions for a Reliable Text-to-SQL System on EHRscited by 7
  13. 2024SQLfuse: Enhancing Text-to-SQL Performance through Comprehensive LLM Synergycited by 7
  14. 2023Battle of the Large Language Models: Dolly vs LLaMA vs Vicuna vs Guanaco vs Bard vs ChatGPT -- A Text-to-SQL Parsing Comparisoncited by 6
  15. 2024SGSH: Stimulate Large Language Models with Skeleton Heuristics for Knowledge Base Question Generationcited by 6
  16. 2024A Survey on Neural Question Generation: Methods, Applications, and Prospectscited by 5
  17. 2024Open-SQL Framework: Enhancing Text-to-SQL on Open-source Large Language Modelscited by 5
  18. 2024Assessing Generalization for Subpopulation Representative Modeling via In-Context Learningcited by 4
  19. 2024SQL-Encoder: Improving NL2SQL In-Context Learning Through a Context-Aware Encodercited by 4
  20. 2024Dynamic Few-Shot Learning for Knowledge Graph Question Answeringcited by 4
  21. 2024SelECT-SQL: Self-correcting ensemble Chain-of-Thought for Text-to-SQLcited by 4
  22. 2023Fine-tuned LLMs Know More, Hallucinate Less with Few-Shot Sequence-to-Sequence Semantic Parsing over Wikidatacited by 2
  23. 2024DeTriever: Decoder-representation-based Retriever for Improving NL2SQL In-Context Learningcited by 2
  24. 2024Learning Metadata-Agnostic Representations for Text-to-SQL In-Context Example Selectioncited by 2
  25. 2025RetrySQL: text-to-SQL training with retry data for self-correcting query generationcited by 2
  26. 2026TableCache: Primary Foreign Key Guided KV Cache Precomputation for Low Latency Text-to-SQLcited by 2
  27. 2024Towards More Effective Table-to-Text Generation: Assessing In-Context Learning and Self-Evaluation with Open-Source Modelscited by 1
  28. 2025ORANGE: An Online Reflection ANd GEneration framework with Domain Knowledge for Text-to-SQLcited by 1
  29. 2023dIR -- Discrete Information Retrieval: Conversational Search over Unstructured (and Structured) Data with Large Language Modelscited by 0
  30. 2025Summarize-Exemplify-Reflect: Data-driven Insight Distillation Empowers LLMs for Few-shot Tabular Classificationcited by 0
  31. 2025GEMMA-SQL: A Novel Text-to-SQL Model Based on Large Language Modelscited by 0
  32. 2026Knowledge Distillation for Low-Resource Open-source Text-to-SQL Modelcited by 0