mlsanityData to 14 Oct 2026

SAFE-SQL: Self-Augmented In-Context Learning with Fine-grained Example Selection for Text-to-SQL

arXiv 2502.11438 ↗First posted 17 Feb 2025cs.CLcited by 4

Not on the map. Why?

Abstract (arXiv)

Text-to-SQL aims to convert natural language questions into executable SQL queries. While previous approaches, such as skeleton-masked selection, have demonstrated strong performance by retrieving similar training examples to guide large language models (LLMs), they struggle in real-world scenarios where such examples are unavailable. To overcome this limitation, we propose Self-Augmentation in-context learning with Fine-grained Example selection for Text-to-SQL (SAFE-SQL), a novel framework that improves SQL generation by generating and filtering self-augmented examples. SAFE-SQL first prompts an LLM to generate multiple Text-to-SQL examples relevant to the test input. Then SAFE-SQL filters these examples through three relevance assessments, constructing high-quality in-context learning examples. Using self-generated examples, SAFE-SQL surpasses the previous zero-shot, and few-shot Text-to-SQL frameworks, achieving higher execution accuracy. Notably, our approach provides additional performance gains in extra hard and unseen scenarios, where conventional methods often fail.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 31 of its 40 references that are in the map. First posted on arXiv 17 Feb 2025.

Builds on

31 of 40 references.

References · 31

  1. 2023GPT-4 Technical Reportcited by 18,396
  2. 2024The Llama 3 Herd of Modelscited by 14,715
  3. 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,724
  4. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  5. 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
  6. 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 688
  7. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
  8. 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 477
  9. 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 424
  10. 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 411
  11. 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 385
  12. 2023C3: Zero-shot Text-to-SQL with ChatGPTcited by 164
19 more
  1. 2024Next-Generation Database Interfaces: A Survey of LLM-based Text-to-SQLcited by 120
  2. 2023Automatic Prompt Augmentation and Selection with Chain-of-Thought from Labeled Datacited by 119
  3. 2021Exploring Underexplored Limitations of Cross-Domain Text-to-SQL Generalizationcited by 92
  4. 2023ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thoughtcited by 65
  5. 2024Synthesizing Text-to-SQL Data from Weak and Strong LLMscited by 54
  6. 2024RSL-SQL: Robust Schema Linking in Text-to-SQL Generationcited by 52
  7. 2023SQL-PaLM: Improved Large Language Model Adaptation for Text-to-SQL (extended)cited by 42
  8. 2024MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQLcited by 35
  9. 2024Understanding the Effects of Noise in Text-to-SQL: An Examination of the BIRD-Bench Benchmarkcited by 34
  10. 2022Importance of Synthesizing High-quality Data for Text-to-SQL Parsingcited by 28
  11. 2023Text-to-SQL Error Correction with Language Models of Codecited by 21
  12. 2024Improving Retrieval-augmented Text-to-SQL with AST-based Ranking and Schema Pruningcited by 16
  13. 2024SQL-GEN: Bridging the Dialect Gap for Text-to-SQL Via Synthetic Data And Model Mergingcited by 16
  14. 2024From Natural Language to SQL: Review of LLM-based Text-to-SQL Systemscited by 16
  15. 2024SQL-to-Schema Enhances Schema Linking in Text-to-SQLcited by 12
  16. 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
  17. 2024PTD-SQL: Partitioning and Targeted Drilling with LLMs in Text-to-SQLcited by 7
  18. 2024SelECT-SQL: Self-correcting ensemble Chain-of-Thought for Text-to-SQLcited by 4
  19. 2024Enhancing LLM Fine-tuning for Text-to-SQLs by SQL Quality Measurementcited by 3

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 2; 2026: 2.

4 papers.