arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.12733cs.AIcs.CLcs.DBcs.LG
收藏

SQL-GEN:通过合成数据与模型合并弥合文本到SQL的方言差距

SQL-GEN: Bridging the Dialect Gap for Text-to-SQL Via Synthetic Data And Model Merging

Google Cloud AI(谷歌云人工智能部门)

Mohammadreza Pourreza, Ruoxi Sun, Hailong Li, Lesly Miculicich, Tomas Pfister, Sercan O. Arik

AI总结:

SQL-GEN利用方言教程生成合成数据并采用专家混合初始化合并多方言模型,显著提升跨方言文本到SQL的执行准确率。

摘要:

近年来文本到SQL的进展主要集中在SQLite方言上,忽视了BigQuery和PostgreSQL等多种SQL方言的多样性。这一局限源于SQL语法和函数的多样性,以及收集和整理SQL特定训练数据的高昂成本。为解决这一问题,我们提出了SQL-GEN,一个能够为任意SQL方言生成高质量合成训练数据的框架,并以易于获取的方言特定教程为指导。SQL-GEN显著提升了跨方言文本到SQL的性能,与现有方法相比,执行准确率最高提升了20%。这一性能提升缩小了与在大规模人工标注数据上训练的模型之间的差距。此外,将SQL-GEN生成的合成数据与人工标注数据相结合,可进一步带来最高5.6%的提升。为了在单一模型中统一多方言能力,我们提出了一种新颖的专家混合(MoE)初始化方法,利用跨方言的共享知识。我们的方法合并了方言特定模型的自注意力层,并使用方言特定关键词初始化专家门控。由此得到一个针对多种SQL方言优化的通用模型,其性能优于单一方言模型,并显著提升了整体表现。

英文摘要:

Recent advances in Text-to-SQL have largely focused on the SQLite dialect, neglecting the diverse landscape of SQL dialects like BigQuery and PostgreSQL. This limitation is due to the diversity in SQL syntaxes and functions, along with the high cost of collecting and curating SQL-specific training data. To address this, we introduce SQL-GEN, a framework for generating high-quality synthetic training data for any SQL dialect, guided by readily available dialect-specific tutorials. SQL-GEN significantly improves cross-dialect Text-to-SQL performance, boosting execution accuracy by up to 20\% over existing methods. This performance gain narrows the gap with models trained on large-scale human-annotated data. Furthermore, combining synthetic data from SQL-GEN with human-annotated data yields additional improvements of up to 5.6\%. To unify multi-dialect capabilities within a single model, we propose a novel Mixture-of-Experts (MoE) initialization that leverages the shared knowledge across dialects. Our approach merges self-attention layers from dialect-specific models and initializes expert gates using dialect-specific keywords. This leads to a versatile model optimized for multiple SQL dialects, outperforming single-dialect models and significantly enhancing overall performance.

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

↑