Papers

Conformal 置信估计用于 Text-to-SQL:让系统学会在没把握时拒答

Know When to Abstain: Conformal Confidence Estimation for Text-to-SQL

Why we picked it

Text-to-SQL 最烦的就是 SQL 能跑但答错问题。这篇用两个 LLM 分工加 conformal 校准,能在 15% 风险预算下把错误率压到 9.1%,还有有限样本保证。做数据库问答产品的开发者该看看这套拒答机制怎么搭。

一篇 arXiv 论文提出将 Text-to-SQL 的置信估计建模为概率化查询校验:生成器 LLM 负责写并执行 SQL,另一个 critic LLM 基于执行结果进行验证,两方的验证分、执行一致性分、verbalized confidence、token 级不确定性和 SQL 结构特征被融合进 Random Forest,仅需两次 LLM 调用。

Body

方法包含两步校准以提供有限样本保证:Learn-then-Test 阈值以概率 1-δ 保证被接受查询的错误率低于用户设定的预算,conformal p-value 则约束误拒率。在 Spider 上用 GPT-OSS-120B 作生成器、Gemma-4-31B 作 critic,AUARC 达到 0.899。不拒答时 22.6% 的查询是错的;设定 15% 风险预算(δ=0.1)后,系统在 10 次重采样切分上均通过认证,平均接受 52.4% 的查询且观测错误率仅 9.1%。

对照实验中,Olmo-3-32B 作生成器时该方法 AUARC 为 89.5,最强的 logit 基线为 81.2。换用 5 个不同 critic 模型结果相近。直接迁移到 BIRD 不再训练时,置信分仍有信息量(AUROC 0.72,Spider 上为 0.79),但风险保证因不满足可交换性而失效。

Original · arXiv cs.AI

Know When to Abstain: Conformal Confidence Estimation for Text-to-SQL

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.

Industry Coordinates & Source Verification

This report is categorized under AITOP's "Papers" desk. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include Text-to-SQL, Spider, BIRD, conformal prediction.

Source attribution: curated from arXiv cs.AI (@Avinash Kumar Singh, Bhaskarjit Sarmah, Stefano Pasquali).