arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.00872cs.DBcs.AI
收藏

DFIN-SQL:将聚焦模式与 DIN-SQL 集成以在大规模数据库中实现卓越准确率

DFIN-SQL: Integrating Focused Schema with DIN-SQL for Superior Accuracy in Large-Scale Databases

Sygnia(希格尼亚);Safra Bank(萨夫拉银行);Wells Fargo(富国银行)

Shai Volvovsky, Marco Marcassa, Mustafa Panbiharwala

AI总结:

本文提出 DFIN-SQL,通过在提示与 RAG 间自适应切换并预处理检索聚焦模式,降低 GPT-4 的 token 开销,在 BIRD 上以 51.69 分超过 DIN-SQL。

摘要:

将自然语言查询转换为 SQL 查询的任务十分复杂,需要结合精确的技术才能实现准确翻译。DIN-SQL(Decomposed-In-Context SQL,分解式上下文内 SQL)方法代表了该领域的一项重要进展。本文介绍 DFIN(Decomposed Focused-In-Context,分解式聚焦上下文内)方法,这是 DIN-SQL 的创新扩展,通过解决模式链接错误来增强 Text-to-SQL 转换,而模式链接错误是导致不准确的主要来源。DFIN 独特地在提示技术与检索增强生成(RAG)之间交替,以适应数据库模式的规模和复杂性。预处理阶段会嵌入数据库定义,并利用类似于 BIRD 数据集中的标注文件,从而便于在运行时检索相关模式信息。该策略显著减少了模式链接提示的 token 数量,使标准 GPT-4 模型能够替代其更大上下文版本,从而更有效、更经济地处理大规模数据库。我们在具有挑战性的真实世界基准 BIRD 数据集上的评估表明,DFIN 不仅能够高效扩展,还提高了准确率,取得了 51.69 分。这一提升超过了 DIN-SQL 方法(当前第三名)此前 50.72 分的成绩;DIN-SQL 是采用上下文学习而非微调的排名最高模型。DFIN 的进展凸显了上下文学习方法与先进语言模型相结合所不断演进的能力,为未来复杂 Text-to-SQL 转换任务的研究提供了一条有前景的路径。

英文摘要:

The task of converting natural language queries into SQL queries is intricate, necessitating a blend of precise techniques for an accurate translation. The DIN-SQL (Decomposed-In-Context SQL) methodology represents a significant development in this domain. This paper introduces DFIN (Decomposed Focused-In-Context), an innovative extension of DIN-SQL that enhances Text-to-SQL conversion by addressing schema linking errors, which are a major source of inaccuracies. DFIN uniquely alternates between prompting techniques and Retrieval-Augmented Generation (RAG), adapting to the size and complexity of the database schema. A preprocessing phase embeds database definitions and leverages annotated files, akin to those in the BIRD dataset, facilitating the runtime retrieval of pertinent schema information. This strategy significantly reduces the token count for schema linking prompts, enabling the use of a standard GPT-4 model over its larger context variant, thus handling large-scale databases more effectively and economically. Our evaluation on the BIRD dataset, a challenging real-world benchmark, demonstrates that DFIN not only scales efficiently but also improves accuracy, achieving a score of 51.69. This improvement surpasses DIN-SQL method (the current third-place), which is the highest-ranked model employing in-context learning rather than fine-tuning, previously scoring 50.72. The advancement of DFIN underscores the evolving capabilities of in-context learning methodologies combined with advanced language models, offering a promising avenue for future research in complex Text-to-SQL conversion tasks.

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

↑