arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2501.10858cs.DBcs.AI
收藏

可靠的自适应弃权文本到SQL转换

Reliable Text-to-SQL with Adaptive Abstention

University Of Toronto(多伦多大学);Seattle University(西雅图大学);York University(约克大学)

Kaiwen Chen, Yueting Chen, Xiaohui Yu, Nick Koudas

AI总结:

提出RTS框架,通过自适应弃权与人在回路机制增强文本到SQL的可靠性,利用分支点预测实现近乎完美的架构链接,在BIRD基准上以小型模型接近SOTA性能。

摘要:

大型语言模型(LLMs)彻底改变了数据库的自然语言接口,特别是在文本到SQL转换方面。然而,当前方法在面对歧义或上下文不足时,往往会产生不可靠的输出。我们提出了可靠文本到SQL(RTS),这是一个新颖的框架,通过引入弃权(不执行)和人在回路机制来增强查询生成的可靠性。RTS聚焦于关键的架构链接阶段,该阶段旨在识别生成SQL查询所需的关键数据库元素。它能在答案生成过程中自主检测潜在错误,并通过弃权(不执行)或与用户交互来响应。RTS的一个关键组件是分支点预测(BPP),它利用统计共形技术对LLM模型的隐藏层进行架构链接,为架构链接准确性提供概率性保证。我们通过在BIRD基准上的全面实验验证了我们的方法,展示了在鲁棒性和可靠性方面的显著改进。我们的发现强调了将透明盒LLM与人在回路过程相结合,以创建更鲁棒的数据库自然语言接口的潜力。对于BIRD基准,我们的方法实现了近乎完美的架构链接准确性,并在需要时自主地引入人类参与。结合查询生成,我们证明了近乎完美的架构链接和一个小型查询生成模型几乎可以匹配使用比我们所用模型大数个数量级的模型所达到的最先进(SOTA)准确性。

英文摘要:

Large language models (LLMs) have revolutionized natural language interfaces for databases, particularly in text-to-SQL conversion. However, current approaches often generate unreliable outputs when faced with ambiguity or insufficient context. We present Reliable Text-to-SQL (RTS), a novel framework that enhances query generation reliability by incorporating abstention and human-in-the-loop mechanisms. RTS focuses on the critical schema linking phase, which aims to identify the key database elements needed for generating SQL queries. It autonomously detects potential errors during the answer generation process and responds by either abstaining or engaging in user interaction. A vital component of RTS is the Branching Point Prediction (BPP) which utilizes statistical conformal techniques on the hidden layers of the LLM model for schema linking, providing probabilistic guarantees on schema linking accuracy. We validate our approach through comprehensive experiments on the BIRD benchmark, demonstrating significant improvements in robustness and reliability. Our findings highlight the potential of combining transparent-box LLMs with human-in-the-loop processes to create more robust natural language interfaces for databases. For the BIRD benchmark, our approach achieves near-perfect schema linking accuracy, autonomously involving a human when needed. Combined with query generation, we demonstrate that near-perfect schema linking and a small query generation model can almost match SOTA accuracy achieved with a model orders of magnitude larger than the one we use.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑