arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.16751cs.CL
收藏

E-SQL:在Text-to-SQL中通过问题增强实现直接模式链接

E-SQL: Direct Schema Linking via Question Enrichment in Text-to-SQL

Bilkent University(毕尔肯大学)

Hasan Alp Caferoğlu, Özgür Ulusoy

AI总结:

本文提出E-SQL流水线,通过直接模式链接和候选谓词增强,将数据库项及条件直接纳入自然语言问题以弥合查询与数据库结构的差距,在BIRD基准上取得66.29%的执行准确率。

摘要:

将自然语言查询转换为结构化查询语言(Text-to-SQL或NLQ-to-SQL)是一项关键任务,已被自然语言处理和数据库社区广泛研究,旨在提供数据库自然语言接口(NLIDB)并降低非专家的使用门槛。尽管通过使用大型语言模型(LLMs)取得了近期进展,但仍存在重大挑战。这些挑战包括处理复杂的数据库模式、解决用户查询中的歧义,以及生成准确反映用户意图的复杂结构SQL查询。在这项工作中,我们介绍了E-SQL,这是一种新颖的流水线,专门设计用于通过直接模式链接和候选谓词增强来应对这些挑战。E-SQL通过将相关数据库项(即表、列和值)及条件直接纳入问题和SQL构建计划,从而增强自然语言查询,弥合了查询与数据库结构之间的差距。该流水线利用候选谓词增强来减轻生成SQL中错误或不完整谓词的问题。在BIRD基准上的综合评估表明,E-SQL取得了具有竞争力的性能,特别擅长复杂查询,在测试集上达到66.29%的执行准确率。我们实验的进一步观察显示,当使用最先进的专有LLMs时,将模式过滤纳入翻译流水线对性能没有积极影响。此外,我们对小型LLMs的实验突显了增强问题对其性能的重要性和积极影响。在不进行微调的情况下,使用DeepSeek Coder 7B Instruct 1.5v通过增强问题进行单提示SQL生成,在BIRD开发集上达到56.45%的执行准确率。

英文摘要:

Translating Natural Language Queries into Structured Query Language (Text-to-SQL or NLQ-to-SQL) is a critical task extensively studied by both the natural language processing and database communities, aimed at providing a natural language interface to databases (NLIDB) and lowering the barrier for non-experts. Despite recent advancements made through the use of Large Language Models (LLMs), significant challenges remain. These include handling complex database schemas, resolving ambiguity in user queries, and generating SQL queries with intricate structures that accurately reflect the user's intent. In this work, we introduce E-SQL, a novel pipeline specifically designed to address these challenges through direct schema linking and candidate predicate augmentation. E-SQL enhances the natural language query by incorporating relevant database items (i.e., tables, columns, and values) and conditions directly into the question and SQL construction plan, bridging the gap between the query and the database structure. The pipeline leverages candidate predicate augmentation to mitigate erroneous or incomplete predicates in generated SQLs. Comprehensive evaluations on the BIRD benchmark illustrate that E-SQL achieves competitive performance, particularly excelling in complex queries with a 66.29% execution accuracy on the test set. A further observation from our experiments reveals that incorporating schema filtering into the translation pipeline does not have a positive impact on performance when the most advanced proprietary LLMs are used. Additionally, our experiments with small LLMs highlight the importance and positive impact of enriched questions on their performance. Without fine-tuning, single-prompt SQL generation using enriched questions with DeepSeek Coder 7B Instruct 1.5v achieves 56.45% execution accuracy on the BIRD development set.

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

↑