首页 > AI前沿 > SQLConsensus: Confidence Estimation in Text-to-SQL from Structural and Execution Agreement

SQLConsensus: Confidence Estimation in Text-to-SQL from Structural and Execution Agreement

arXiv自然语言 2026-12-04 13:00 17 阅读 查看原文
用户现在需要把给定的新闻正文排版成语义化的HTML片段,规则要求只输出HTML,每个自然段落用p,有需要可以加h2h3?不对,先看原文的内容,原文是一段学术相关的新闻,对吧?首先,原文的内容就是一段?不对,仔细看原文的正文,是一个连贯的段落?不对,等下,先理清楚:首先,原文的信息,首先第一句到后面,有没有可以划分的?不对,先看要求,保留所有信息,不能增删改。首先,原文是一个段落?不对,等下,仔细看原文: 首先,开头讲的是LLM转SQL的问题,然后说现有估计器的问题,然后提出SQLConsensus,然后是实验结果,然后分析。那要不要分小节?不对,用户说长文用h2/h3划分小节,那这个如果是一段的话?不对,不对,先看原文的内容,有没有自然的小节?等下,原文的正文就是一段吗?不对,我再读一遍: 原文是:While large language models (LLMs) translate natural language questions into Structured Query Language (SQL) with strong accuracy, an incorrect query often executes without error and returns results that users cannot distinguish from correct ones. Reliable deployment thus requires flagging uncertain outputs for review. We address confidence estimation for Text-to-SQL, the task of assigning each generated query a score that reflects how likely it is to answer the question. Existing estimators derive the score from agreement among generated queries but measure it on a single side, either the recurrence of their clauses or their execution results. Clauses that recur in queries returning different results can still raise confidence in an incorrect prediction, and identical results on one database do not show that two queries reach them in the same way. To overcome these limitations, we propose SQLConsensus, which estimates the confidence from both structure and execution, comparing the clause forms of the generated queries only among those that return the result of the prediction. Across four LLMs on two general-domain benchmarks and one clinical-domain benchmark with two databases, SQLConsensus improves the area under the receiver operating characteristic curve (AUROC) over the strongest baseline by 7.0 points on average and makes the fewest errors among its 10% most confident queries in fourteen of the sixteen settings. Analyses show that removing either structure or execution lowers the mean AUROC. 哦,这是一段连贯的内容?不对,那要不要划分小节?比如,是不是可以分:背景与问题、现有方法局限、提出方法、实验结果、分析?不对,但是用户说不能增删改内容,哦,不对,h2/h3是小节标题,但是用户说保留原文所有信息,不得增删改内容,那是不是不能自己加标题?哦!哦对哦,规则4是保留原文所有信息,不得增删改内容,所以不能自己加原文没有的小节标题对吧?哦,对,我刚才差点搞错,不能自己加内容,包括小节标题,只有原文有的才能加。那原文就是一个完整的段落?不对,等下,有没有需要用strong的?比如重要的句子,比如提出SQLConsensus的那句,还有实验结果的那句?不对,先看规则:重要句子可用strong。那首先,整个原文是一段,所以用

包裹?不对,等下,再仔细看,有没有列表?没有,有没有引用?没有,有没有代码?没有。那不对,等下,有没有可以划分的?不对,不能自己加标题,因为原文没有小标题,所以不能加h2/h3对吧?对,因为规则4是不得增删改内容,所以不能自己创建原文没有的小节标题。那现在,把这段里的重要部分加strong?比如,核心的方法是SQLConsensus,还有关键的性能结果?不对,先看: 首先,第一部分讲问题,然后讲任务,然后现有方法的局限,然后提出的方法,然后实验结果,然后分析。那重要的句子,比如“We address confidence estimation for Text-to-SQL, the task of assigning each generated query a score that reflects how likely it is to answer the question.”?不对,或者关键的:“To overcome these limitations, we propose SQLConsensus, which estimates the confidence from both structure and execution, comparing the clause forms of the generated queries only among those that return the result of the prediction.”还有“SQLConsensus improves the area under the receiver operating characteristic curve (AUROC) over the strongest baseline by 7.0 points on average and makes the fewest errors among its 10% most confident queries in fourteen of the sixteen settings.”这些是重要的?不对,但是要准确,不能瞎加。等下,再看规则,重要句子可用strong,那是不是可以给关键的结论、方法的部分加? 等下,先理清楚,不能加任何原文没有的内容,所以h2/h3不用,因为没有原文没有小标题,所以不用。那整个段落就是一个

?不对,等下,原文是不是就是一个完整的自然段?对,那就是

开头,然后里面的内容,重要的加strong。比如: 首先,第一句到第二句是背景问题,然后第三句是任务定义,然后第四五句是现有方法的局限,第六句是提出的方法,第七句是实验结果,第八句是分析。 那可以给第三句(任务)、第六句(提出方法)、第七句(性能结果)加strong?不对,或者更准确的,比如:

While large language models (LLMs) translate natural language questions into Structured Query Language (SQL) with strong accuracy, an incorrect query often executes without error and returns results that users cannot distinguish from correct ones. Reliable deployment thus requires flagging uncertain outputs for review. We address confidence estimation for Text-to-SQL, the task of assigning each generated query a score that reflects how likely it is to answer the question. Existing estimators derive the score from agreement among generated queries but measure it on a single side, either the recurrence of their clauses or their execution results. Clauses that recur in queries returning different results can still raise confidence in an incorrect prediction, and identical results on one database do not show that two queries reach them in the same way. To overcome these limitations, we propose SQLConsensus, which estimates the confidence from both structure and execution, comparing the clause forms of the generated queries only among those that return the result of the prediction. Across four LLMs on two general-domain benchmarks and one clinical-domain benchmark with two databases, SQLConsensus improves the area under the receiver operating characteristic curve (AUROC) over the strongest baseline by 7.0 points on average and makes the fewest errors among its 10% most confident queries in fourteen of the sixteen settings. Analyses show that removing either structure or execution lowers the mean AUROC.

不对?等下,有没有问题?检查有没有增删改内容?没有,所有内容都保留了,strong只是标记重要句子,没有改内容。那是不是这样就可以?不对,等下,有没有需要划分小节的?哦,不对,原文没有小标题,所以不能自己加h2/h3,因为加了就是新增内容了,违反规则4。对,规则4是保留原文所有信息,不得增删改内容,所以不能自己创建小节标题,因为原文没有。那列表、引用、代码都没有,所以不需要那些标签。那这样就是正确?等下,再仔细看用户的规则:2.每个自然段落用

包裹,长文用

/

划分小节。哦,长文用h2/h3划分,但是前提是有原文的内容里的小节吗?还是可以自己划分?不对,不能自己加内容,所以如果原文没有小节标题,就不能加,否则就是新增内容了。对,因为如果加h2,比如

背景与挑战

,这是原文没有的,属于新增内容,违反规则4。所以不需要加h2/h3。那现在的内容就是一段,用p包裹,重要的部分用strong,对吗? 等下,再检查原文的每一句都在里面: 1. While large language models (LLMs) translate natural language questions into Structured Query Language (SQL) with strong accuracy, an incorrect query often executes without error and returns results that users cannot distinguish from correct ones. 有 2. Reliable deployment thus requires flagging uncertain outputs for review. 有 3. We address confidence estimation for Text-to-SQL, the task of assigning each generated query a score that reflects how likely it is to answer the question. 加了strong,内容没变 4. Existing estimators derive the score from agreement among generated queries but measure it on a single side, either the recurrence of their clauses or their execution results. 有 5. Clauses that recur in queries returning different results can still raise confidence in an incorrect prediction, and identical results on one database do not show that two queries reach them in the same way. 有 6. To overcome these limitations, we propose SQLConsensus, which estimates the confidence from both structure and execution, comparing the clause forms of the generated queries only among those that return the result of the prediction. 加了strong,内容没变 7. A