SafeQL: Search-based Refinement for Safe and Efficient LLM-based Text-to-SQL
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have advanced Text-to-SQL by enabling natural language interfaces to databases without task-specific fine-tuning. However, existing LLM-based systems remain unreliable, often generating SQL queries that are invalid under the database schema, referencing non-existent tables, attributes, functions, or values. Such errors persist because interactions with the database management system (DBMS) are typically limited to error messages, leaving it in a largely passive role during query refinement. This paper proposes SafeQL, textita search-based refinement paradigm that redefines the role of the DBMS as an active guide in the refinement process. Instead of regenerating entire queries after execution failure, SafeQL interprets DBMS feedback to incrementally repair only the erroneous components. Each refinement step is formulated as a guided search within a textitsafe query space, where candidate queries are progressively validated through DBMS execution, thereby converging to an executable query and preventing repeated regeneration of errors. Experiments on the Bird and Spider benchmarks show that SafeQL significantly improves execution accuracy and efficiency compared to regeneration-based methods.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 29 of its 58 references that are in the map. First posted on arXiv 10 Aug 2026.
Builds on
29 of 58 references.
References · 29
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
- 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 688
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 477
- 2021ColBERTv2: Effective and Efficient Retrieval via Lightweight Late Interactioncited by 476
- 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 424
- 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 411
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 385
- 2021SPLADE: Sparse Lexical and Expansion Model for First Stage Rankingcited by 286
- 2023C3: Zero-shot Text-to-SQL with ChatGPTcited by 164
17 more
- 2024CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQLcited by 138
- 2017SQLNet: Generating Structured Queries From Natural Language Without Reinforcement Learningcited by 135
- 2020Bridging Textual and Tabular Data for Cross-Domain Text-to-SQL Semantic Parsingcited by 133
- 2024MCS-SQL: Leveraging Multiple Prompts and Multiple-Choice Selection For Text-to-SQL Generationcited by 105
- 2020SmBoP: Semi-autoregressive Bottom-up Semantic Parsingcited by 97
- 2019Editing-Based SQL Query Generation for Cross-Domain Context-Dependent Questionscited by 80
- 2023Exploring Chain-of-Thought Style Prompting for Text-to-SQLcited by 69
- 2023ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thoughtcited by 65
- 2025OpenSearch-SQL: Enhancing Text-to-SQL with Dynamic Few-shot and Consistency Alignmentcited by 53
- 2024DTS-SQL: Decomposed Text-to-SQL with Small Large Language Modelscited by 45
- 2025Type-Constrained Code Generation with Language Modelscited by 35
- 2025Alpha-SQL: Zero-Shot Text-to-SQL using Monte Carlo Tree Searchcited by 34
- 2024SPFresh: Incremental In-Place Update for Billion-Scale Vector Searchcited by 28
- 2023Interleaving Pre-Trained Language Models and Large Language Models for Zero-Shot NL2SQL Generationcited by 24
- 2025ChopChop: a Programmable Framework for Semantically Constraining the Output of Language Modelscited by 15
- 2024Insights into Natural Language Database Query Errors: From Attention Misalignment to User Handling Strategiescited by 12
- 2025A Topology-Aware Localized Update Strategy for Graph-Based ANN Indexcited by 4
Built on by
Not cited yet.