arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2506.04494cs.CL
收藏

SQLens:一个面向Text-to-SQL错误检测与纠正的端到端框架

SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQL

Amazon Web Services(亚马逊网络服务);The University of Chicago(芝加哥大学);Massachusetts Institute of Technology(麻省理工学院)

Yue Gong, Chuan Lei, Xiao Qin, Kapil Vaidya, Balakrishnan Narayanaswamy, Tim Kraska

AI总结:

SQLens提出端到端框架,融合数据库与LLM错误信号对生成SQL进行细粒度语义错误检测与纠正,在F1上提升25.78%并将执行准确率提高最多20%。

摘要:

Text-to-SQL系统将自然语言(NL)问题翻译为SQL查询,使非技术用户能够与结构化数据进行交互。尽管大语言模型(LLMs)在text-to-SQL任务上已展现出有前景的结果,但它们常常生成语义错误但语法有效的查询,且对其可靠性缺乏深入了解。我们提出SQLens,一个用于对LLM生成的SQL中的语义错误进行细粒度检测与纠正的端到端框架。SQLens整合来自底层数据库和LLM的错误信号,以识别SQL子句中潜在的语义错误。它进一步利用这些信号来指导查询纠正。在两个公开基准上的实验结果表明,SQLens在错误检测的F1指标上比最佳的基于LLM的自评估方法高出25.78%,并将开箱即用的text-to-SQL系统的执行准确率提升了最多20%。

英文摘要:

Text-to-SQL systems translate natural language (NL) questions into SQL queries, enabling non-technical users to interact with structured data. While large language models (LLMs) have shown promising results on the text-to-SQL task, they often produce semantically incorrect yet syntactically valid queries, with limited insight into their reliability. We propose SQLens, an end-to-end framework for fine-grained detection and correction of semantic errors in LLM-generated SQL. SQLens integrates error signals from both the underlying database and the LLM to identify potential semantic errors within SQL clauses. It further leverages these signals to guide query correction. Empirical results on two public benchmarks show that SQLens outperforms the best LLM-based self-evaluation method by 25.78% in F1 for error detection, and improves execution accuracy of out-of-the-box text-to-SQL systems by up to 20%.

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

↑