SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQL
Not on the map. Why?
Abstract (arXiv)
Text-to-SQL systems translate natural language (NL) questions into SQL queries, enabling non-technical users to interact with structured data. While large language models (LLMs) have shown promising results on the text-to-SQL task, they often produce semantically incorrect yet syntactically valid queries, with limited insight into their reliability. We propose SQLens, an end-to-end framework for fine-grained detection and correction of semantic errors in LLM-generated SQL. SQLens integrates error signals from both the underlying database and the LLM to identify potential semantic errors within SQL clauses. It further leverages these signals to guide query correction. Empirical results on two public benchmarks show that SQLens outperforms the best LLM-based self-evaluation method by 25.78% in F1 for error detection, and improves execution accuracy of out-of-the-box text-to-SQL systems by up to 20%.
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 38 of its 52 references that are in the map. First posted on arXiv 4 Jun 2025.
Builds on
38 of 52 references.
References · 38
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023A Survey on Large Language Model based Autonomous Agentscited by 2,203
- 2023Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflectioncited by 1,800
- 2022Language Models (Mostly) Know What They Knowcited by 1,783
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,120
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2023Just Ask for Calibration: Strategies for Eliciting Calibrated Confidence Scores from Language Models Fine-Tuned with Human Feedbackcited by 788
- 2021Retrieval Augmentation Reduces Hallucination in Conversationcited by 691
- 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 667
- 2022Decomposed Prompting: A Modular Approach for Solving Complex Taskscited by 554
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 465
26 more
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 378
- 2020AutoGluon-Tabular: Robust and Accurate AutoML for Structured Datacited by 368
- 2023Is ChatGPT Good at Search? Investigating Large Language Models as Re-Ranking Agentscited by 356
- 2023A Survey of Confidence Estimation and Calibration in Large Language Modelscited by 253
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 183
- 2024CHESS: Contextual Harnessing for Efficient SQL Synthesiscited by 164
- 2023MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQLcited by 158
- 2024CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQLcited by 132
- 2024Pride and Prejudice: LLM Amplifies Self-Bias in Self-Refinementcited by 111
- 2024MCS-SQL: Leveraging Multiple Prompts and Multiple-Choice Selection For Text-to-SQL Generationcited by 103
- 2020Fast and Three-rious: Speeding Up Weak Supervision with Triplet Methodscited by 98
- 2023Zero-Shot Listwise Document Reranking with a Large Language Modelcited by 81
- 2023RankVicuna: Zero-Shot Listwise Document Reranking with Open-Source Large Language Modelscited by 69
- 2024The Death of Schema Linking? Text-to-SQL in the Age of Well-Reasoned Language Modelscited by 67
- 2025SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement Learningcited by 67
- 2025Reasoning-SQL: Reinforcement Learning with SQL Tailored Partial Rewards for Reasoning-Enhanced Text-to-SQLcited by 59
- 2024Calibration and Correctness of Language Models for Codecited by 49
- 2024MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQLcited by 34
- 2020Photon: A Robust Cross-Domain Text-to-SQL Systemcited by 26
- 2020An Imitation Game for Learning Semantic Parsers from User Interactioncited by 23
- 2023Text-to-SQL Error Correction with Language Models of Codecited by 21
- 2024Divide-or-Conquer? Which Part Should You Distill Your LLM?cited by 17
- 2023Error Detection for Text-to-SQL Semantic Parsingcited by 11
- 2023Data Ambiguity Strikes Back: How Documentation Improves GPT's Text-to-SQLcited by 11
- 2024SQLFixAgent: Towards Semantic-Accurate Text-to-SQL Parsing via Consistency-Enhanced Multi-Agent Collaborationcited by 10
- 2024Enhancing Trust in LLMs: Algorithms for Comparing and Interpreting LLMscited by 9
Built on by
Citing papers per year: 2025: 4; 2026: 6.
10 papers.
- 2025AmbiSQL: Interactive Ambiguity Detection and Resolution for Text-to-SQLcited by 10
- 2026PV-SQL: Synergizing Database Probing and Rule-based Verification for Text-to-SQL Agentscited by 5
- 2025Access Paths for Efficient Ordering with Large Language Modelscited by 1
- 2025SCARE: A Benchmark for SQL Correction and Question Answerability Classification for Reliable EHR Question Answeringcited by 0
- 2025Bridging Global Intent with Local Details: A Hierarchical Representation Approach for Semantic Validation in Text-to-SQLcited by 0
- 2026Beyond Text-to-SQL: Can LLMs Really Debug Enterprise ETL SQL?cited by 0
- 2026SOMA-SQL: Resolving Multi-Source Ambiguity in NL-to-SQL via Synthetic Log and Execution Probingcited by 0
- 2026Beyond Static Rules: Automated Discovery of Latent Vulnerabilities in Text-to-SQLcited by 0
- 2026Causal Episodic Memory for Feedback-Driven Agent Repaircited by 0
- 2026ACTS-SQL: Agentic and Critic-Oriented Tree-Structured SQL Correctness with Large Language Modelscited by 0
- 2026ACTS-SQL: Agentic and Critic-Oriented Tree-Structured SQL Correctness with Large Language Models15 Aug 2026
- 2026Causal Episodic Memory for Feedback-Driven Agent Repair6 Aug 2026
- 2026Beyond Static Rules: Automated Discovery of Latent Vulnerabilities in Text-to-SQL4 Jul 2026
- 2026SOMA-SQL: Resolving Multi-Source Ambiguity in NL-to-SQL via Synthetic Log and Execution Probing9 Jun 2026
- 2026PV-SQL: Synergizing Database Probing and Rule-based Verification for Text-to-SQL Agents19 Apr 2026
- 2026Beyond Text-to-SQL: Can LLMs Really Debug Enterprise ETL SQL?26 Jan 2026
- 2025Bridging Global Intent with Local Details: A Hierarchical Representation Approach for Semantic Validation in Text-to-SQL28 Dec 2025
- 2025SCARE: A Benchmark for SQL Correction and Question Answerability Classification for Reliable EHR Question Answering13 Nov 2025
- 2025Access Paths for Efficient Ordering with Large Language Models30 Aug 2025
- 2025AmbiSQL: Interactive Ambiguity Detection and Resolution for Text-to-SQL21 Aug 2025