SQLConsensus scores Text-to-SQL confidence using query structure and execution together
Researchers propose a method that estimates how likely a generated SQL query is correct by combining clause agreement with execution results, aiming to flag uncertain outputs for review.
In plain words
Language models can turn plain questions into database queries, but a wrong query often runs cleanly and returns results that look correct. SQLConsensus assigns each generated query a confidence score by checking both how similar candidate queries are in structure and whether they return the same results. Higher-scoring queries can then be trusted, while low-scoring ones go to human review.
What was announced
The authors argue that existing estimators measure agreement on only one side, either the recurrence of query clauses or their execution results. Each approach has a blind spot: clauses that recur across queries returning different results can still support an incorrect prediction, and identical results on one database do not show that two queries reach them the same way. SQLConsensus instead compares the clause forms of generated queries only among those that return the same result as the prediction, so structure and execution are judged together.
In tests across four large language models, the method was evaluated on two general-domain benchmarks and one clinical-domain benchmark covering two databases. The paper reports that SQLConsensus raises the area under the receiver operating characteristic curve, a standard measure of how well a score separates correct from incorrect outputs, by 7.0 points on average over the strongest baseline. Its 10% most confident queries contained the fewest errors in fourteen of sixteen settings, and removing either the structure or execution component lowered mean AUROC.
What it does not show
- The evidence is the paper's abstract only; the full article, including experimental details and code availability, is not covered.
- Reported AUROC gains and error counts come from the authors' own benchmarks and have not been independently confirmed.
For security and IT teams
- Scope
- The method targets confidence estimation for Text-to-SQL, scoring generated queries so uncertain ones can be flagged for review rather than replacing query generation itself.
Sources
Source-support review completed 4 Dec 2026. This story was drafted with AI assistance and checked against retained source passages. Automated checking is not independent verification.
Coverage: arXiv: abstract.
Updates and corrections
No corrections so far.
First published 4 Dec 2026
New to the subject? AI from the Ground Up starts from the beginning.