Paper: arXiv 2611.31190
Authors: Avinash Kumar Singh, Bhaskarjit Sarmah, Stefano Pasquali
Abstract
Text-to-SQL systems often return queries that execute successfully but answer the wrong question. Detecting these errors at deployment is hard because execution correctness is defined against a gold query, which exists only in labeled data. We formulate confidence estimation for Text-to-SQL as probabilistic query validation under a latent correctness variable that is observable at calibration time through gold-SQL execution and latent at deployment. Our estimator separates generation from validation. A generator LLM writes and executes the query, and a different critic LLM judges the query and its execution result. The critic’s validation and execution-grounded alignment scores are fused with the generator’s verbalized confidence, token-level uncertainty, and SQL-structural features in a Random Forest, using two sequential LLM calls. Two calibration steps give finite-sample guarantees. A Learn-then-Test threshold ensures, with probability \(1-δ\), that the error rate among accepted queries stays below a user-chosen budget. A conformal p-value bounds the false abstention rate. On Spider we use GPT-OSS-120B as generator and Gemma-4-31B as critic. The estimator obtains an AUARC of 0.899. Without abstention, 22.6% of queries are wrong. With a 15% risk budget (\(δ=0.1\)), a threshold is certified on all 10 resampled splits, and the system accepts 52.4% of queries on average with 9.1% observed error. Five different critic models give similar results. In a controlled comparison on Spider with Olmo-3-32B as generator, the estimator obtains an AUARC of 89.5, compared with 81.2 for the strongest logit-based baseline. Applied to BIRD without retraining, the confidence scores remain informative (AUROC 0.72, against 0.79 on Spider), but the risk guarantee does not transfer, as expected without exchangeability.
Complexity vs Empirical Score
- Math Complexity: 7.0/10
- Empirical Rigor: 8.0/10
- Quadrant: Holy Grail — high math complexity, high empirical rigor
Why this score: The paper presents a novel approach to confidence estimation in Text-to-SQL systems, combining LLM-based generation and criticism with conformal prediction for robust risk control. The empirical evaluation is thorough, demonstrating strong performance across multiple models and datasets, with clear statistical guarantees.
Research Flowchart
flowchart TD
A["Research Goal: Confident Text-to-SQL without Gold SQL at Deployment"] --> B{"Methodology: Probabilistic Query Validation"};
B --> C{"Generator LLM: Write & Execute SQL"};
C --> D{"Critic LLM: Judge Query & Execution Result"};
D --> E["Feature Fusion (Random Forest): Critic Validation, Execution Alignment, Generator Confidence, Token Uncertainty, SQL Features"];
E --> F{"Calibration: Learn-then-Test Threshold for Risk Guarantee, Conformal P-value for False Abstention"};
F --> G["Key Findings: AUARC 0.899 (Spider), Risk Budget Certified, Reduced Error Rate, Stronger than Baselines"];
Evidence Card
What the authors claim, on what data, and who has checked it. Read from the paper's own text by a language model: every quote is verbatim, nothing was re-run. How to read this card
Proposes
We propose a generator–critic estimator where a separate critic model validates the generator’s query and its execution result, and a Random Forest fuses the critic’s judgments with generator-side signals.
Source sentence
A separate critic model validates the generator’s query and its execution result, and a Random Forest fuses the critic’s judg-ments with generator-side signals.
Assumes 6
- Both propositions assume that deployment queries follow the calibration distribution; guarantees do not hold under distribution shift. statistical
Source sentence
(1) Scope of the guarantees. Coverage is not guar-anteed, and with 636 calibration queries a 10% risk budget is often not certifiable.
- The execution‑correctness variable Z is latent at deployment because the gold query is unavailable, but observable on labeled data via execution matching. model
Source sentence
Z is latent because s∗is unavailable at deployment, not because execution is infeasible. On labeled data, Z is computed exactly by execution matching, which is how we obtain training and calibration labels.
- The execution result r = Exec(ˆs, D) is always obtainable for read‑only SELECT queries. execution
Source sentence
(1) The result r = Exec(ˆs, D) is always obtainable for read-only SELECT queries.
- Calibration and training use gold SQL to compute Z, while deployment uses only generator, critic, local features, frozen forest, and stored calibration scores. data
Source sentence
Training and calibration use gold SQL to compute Z. Deploy-ment uses only the generator, the critic, the local Stage 3 features, the frozen forest, and the stored calibration scores.
Show 2 more
- The estimator relies on LLM‑derived signals (verbalized confidence, token probabilities, critic judgments) as the main information source. model
Source sentence
An ablation shows that the LLM-derived signals carry most of the information, so a variant without logit access retains most of the performance (Sections 4, 5.4). • Calibrated abstention. The largest feature families come from LLM judgments.
- Exchangeability of calibration and deployment queries is required for the conformal p‑value guarantee. statistical
Source sentence
Under exchangeability, conditional on the trained estimator p, the rank of ηm1+1 among the m1 + 1 scores is uniform on {1, . . . , m1 + 1}. Taking t = 1 −α gives FAR(1 −α) = P(ˆc < 1 −α | Z = 1) ≤1 −α (Angelopoulos & Bates, 2023, Prop. 3). Proposition 2. Fix λ ∈Λ.
Data
- Spider benchmark public
Source sentence
We use 3,181 question–SQL pairs from the Spider dev and test sets (Yu et al., 2018), covering 200 databases.
- BIRD benchmark public
Source sentence
For zero-shot transfer we use the BIRD dev set (Li et al., 2023) (1,534 samples) and NL2SQL-BUGs (Liu et al., 2025b) (1,019 correct and 999 semantically erroneous queries).
- NL2SQL-BUGs benchmark public
Source sentence
For zero-shot transfer we use the BIRD dev set (Li et al., 2023) (1,534 samples) and NL2SQL-BUGs (Liu et al., 2025b) (1,019 correct and 999 semantically erroneous queries).
Costs
Not applicable
Finds 5
- The estimator obtains an AUARC of 0.899 on the Spider test split. predictive-accuracy
Source sentence
The estimator obtains an AUARC of 0.899.
- With a 15% risk budget (δ=0.1), a threshold is certified on all 10 resampled splits, the system accepts 52.4% of queries with 9.1% observed error (versus 22.6% error without abstention). performance figure from elsewhere in the paper
Source sentence
With a 15% risk budget ($δ=0.1$), a threshold is certified on all 10 resampled splits, and the system accepts 52.4% of queries on average with 9.1% observed error. Five different critic models give similar results.
- In a controlled comparison on Spider with Olmo‑3‑32B as generator, the estimator achieves AUARC 89.5, compared with 81.2 for the strongest logit‑based baseline. predictive-accuracy
Source sentence
In a controlled comparison on Spider with Olmo-3-32B as generator, the estimator obtains an AUARC of 89.5, compared with 81.2 for the strongest logit-based baseline.
- Applied to BIRD without retraining, confidence scores remain informative (AUROC 0.72) but the risk guarantee does not transfer. predictive-accuracy
Source sentence
Applied to BIRD without retraining, the confidence scores remain informative (AUROC 0.72, against 0.79 on Spider), but the risk guarantee does not transfer, as expected without exchangeability.
- Five different critic models give similar results; AUARC ranges from 0.899 to 0.922 across critics. predictive-accuracy
Source sentence
Five different critic models give similar results. AUARC ranges from 0.899 (Gemma-4-31B) to 0.922 (Qwen3.8-27B), and self-critique obtains 0.913.
Checked by others
No other paper in the archive has been found to support or contradict these findings (compared with 20 related papers). Coverage is partial, so this is neither replication nor refutation.
Code
No repository by the authors found in the paper.
Extracted 2026-11-24 · same card as JSON · A language model chose these items: check the source sentence before relying on one.
Cited References (51)
- Confidence estimation for error detection in text-to-sql systems (2025)
- Confidence Estimation for Text-to- SQL in Large Language Models (2026)
- Calibrating llms for text-to-sql parsing by leveraging sub-clause frequencies (2025)
- Calibrated Interpretation: Confidence Estimation in Semantic Parsing (2023)
- Text-to-SQL Calibration: No Need to Ask–Just Rescale Model Probabilities (2024) — link
- Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer (2020)
- BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension (2020)
- Language Models are Few-Shot Learners (2020)
and 43 more
- Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (2022)
- RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers (2020)
- PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models (2021)
- Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task (2018)
- Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning (2017)
- SParC: Cross-Domain Semantic Parsing in Context (2019)
- CoSQL: A Conversational Text-to-SQL Challenge Towards Cross-Domain Natural Language Interfaces to Databases (2019)
- Can llm already serve as a database interface? a big bench for large-scale database grounded text-to-sqls (2023)
- Evaluating the data model robustness of text-to-sql systems based on real user queries (2024) — link
- Semantic Uncertainty: Linguistic Invariances for Uncertainty Estimation in Natural Language Generation (2023)
- Just Ask for Calibration: Strategies for Eliciting Calibrated Confidence Scores from Language Models Fine-Tuned with Human Feedback (2023)
- Can LLMs Express Their Uncertainty? An Empirical Evaluation of Confidence Elicitation in LLMs (2024)
- SQLens : An End-to-End Framework for Error Detection and Correction in Text-to- SQL (2025)
- A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks (2017)
- Uncertainty Estimation in Autoregressive Structured Prediction (2021)
- Conformal Prediction: A Gentle Introduction (2023)
- Algorithmic Learning in a Random World (2005)
- LGESQL: line graph enhanced text-to-SQL model with mixed local and non-local relations (2021) — link
- API Is Enough: Conformal Prediction for Large Language Models Without Logit-Access (2024)
- Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning (2017)
- Compositional generalization and natural language variation: Can a semantic parsing approach handle both? (2021)
- Sead: End-to-end text-to-sql generation with schema-aware denoising (2022)
- A comprehensive evaluation of ChatGPT’s zero-shot Text-to-SQL capability (2023) — link
- Exploring chain-of-thought style prompting for text-to-sql (2023) — link
- Generative adversarial networks (2020)
- The Consistency Hypothesis in Uncertainty Quantification for Large Language Models (2025)
- Language models (mostly) know what they know (2022) — link
- Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to- SQL Workflows (2025)
- BEAVER : An Enterprise Benchmark for Text-to- SQL (2025)
- Reliable Text-to-SQL with Adaptive Abstention (2025)
- Algorithms for Hyper-Parameter Optimization (2011)
- Semantic Captioning: Benchmark Dataset and Graph-Aware Few-Shot In-Context Learning for SQL 2 T ext (2025) — link
- TrustSQL: Benchmarking Text-to-SQL Reliability with Penalty-Based Scoring (2024) — link
- Detecting hallucinations in large language models using semantic entropy (2024)
- Self-Consistency Improves Chain of Thought Reasoning in Language Models (2023)
- Selective classification for deep neural networks (2017)
- Calibration of pre-trained transformers (2020)
- Conformal Language Modeling (2024)
- Know Your Limits: A Survey of Abstention in Large Language Models (2025)
- Nl2sql-bugs: A benchmark for detecting semantic errors in nl2sql translation (2025)
- Sqlfixagent: Towards semantic-accurate text-to-sql parsing via consistency-enhanced multi-agent collaboration (2025)
- Testing for Outliers with Conformal p-values (2023)
- Learn then Test: Calibrating Predictive Algorithms to Achieve Risk Control (2025)
0 of 51 cited works are in the corpus; resolved via arXiv source bundles, Semantic Scholar and OpenAlex. Corpus-wide: 2627 linked papers.