What Predicts Correctness in Text-to-SQL? A Selective-Prediction Study

· Source: Machine Learning · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Data Science & Analytics · Depth: Expert, quick

Summary

A study on predicting correctness in AI-generated SQL queries, specifically for hard multi-table text-to-SQL tasks, evaluates various signals using AUROC. On BIRD and Spider benchmarks, black-box signals like string, structural, and execution self-consistency, schema-relevance, and query executability achieve AUROC scores between 0.61 and 0.68, with string self-consistency at 0.675. White-box log-probability is similar at 0.67. Verification-based signals, particularly LLM judges, significantly outperform these, with GPT-4o-mini scoring 0.72 and Claude reaching 0.78 AUROC. An ensemble of two different LLM judge providers achieves 0.82 AUROC with a well-calibrated probability (0.03 ECE), enabling useful abstention frontiers, such as answering 27% of questions at 24% selective risk. While fine-tuned verifiers show strong in-distribution performance (0.77-0.79 AUROC), they struggle with unseen schemas (0.66 AUROC), a gap that scaling, schema diversity, or distillation fails to close. Generalization across schemas currently requires large, frozen reasoning models.

Key takeaway

For Machine Learning Engineers deploying Text-to-SQL solutions, you should integrate reasoning-based LLM verifiers to significantly improve query correctness prediction. An ensemble of judges from different providers, like Claude and GPT-4o-mini, achieves 0.82 AUROC, enabling you to confidently abstain from 27% of questions at 24% risk. This approach offers a robust method for managing uncertainty and enhancing system reliability.

Key insights

Verification-based LLM judges significantly improve Text-to-SQL correctness prediction over black-box methods, especially when ensembled.

Principles

Method

Combine LLM judges from different providers to create an ensemble verifier, achieving higher AUROC and better calibration for Text-to-SQL correctness prediction.

In practice

Topics

Best for: Research Scientist, AI Engineer, AI Scientist, Machine Learning Engineer, NLP Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Machine Learning.