arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.02240cs.CLcs.DB
收藏

OmniSQL:大规模合成高质量 Text-to-SQL 数据

OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scale

Renmin University of China(中国人民大学)

Haoyang Li, Shang Wu, Xiaokang Zhang, Xinmei Huang, Jing Zhang, Fuxin Jiang, Shuai Wang, Tieying Zhang, Jianjun Chen, Rui Shi, Hong Chen, Cuiping Li

AI总结:

针对现有Text-to-SQL方法成本高、泛化差的问题,提出可扩展数据合成框架构建百万级数据集SynSQL-2.5M,并训练出7B/14B/32B规模的开源模型OmniSQL,在九个数据集上达到SOTA性能。

摘要:

Text-to-SQL(将自然语言问题翻译为SQL查询的任务)在使非专家能够与数据库交互方面发挥着关键作用。尽管大型语言模型(LLMs)的最新进展显著提升了Text-to-SQL的性能,但现有方法在实际应用中仍面临明显局限。基于提示的方法通常依赖闭源LLMs,成本高昂、引发隐私担忧且缺乏定制性。而基于微调的方法则因公开训练数据覆盖范围有限,导致泛化能力较差。为克服这些挑战,我们提出了一种新颖且可扩展的Text-to-SQL数据合成框架,能够在无需大量人工干预的情况下自动合成大规模、高质量且多样化的数据集。利用该框架,我们推出了SynSQL-2.5M,这是首个百万规模的Text-to-SQL数据集,包含250万个样本,涵盖超过16,000个合成数据库。每个样本包含一个数据库、SQL查询、自然语言问题和思维链(CoT)解答。基于SynSQL-2.5M,我们开发了OmniSQL,这是一个强大的开源Text-to-SQL模型,提供7B、14B和32B三种规模。在九个数据集上的广泛评估表明,尽管规模较小,OmniSQL实现了最先进的性能,匹配或超越了包括GPT-4o和DeepSeek-V3在内的领先闭源与开源LLMs。我们发布了所有代码、数据集和模型以支持进一步研究。

英文摘要:

Text-to-SQL, the task of translating natural language questions into SQL queries, plays a crucial role in enabling non-experts to interact with databases. While recent advancements in large language models (LLMs) have significantly enhanced text-to-SQL performance, existing approaches face notable limitations in real-world text-to-SQL applications. Prompting-based methods often depend on closed-source LLMs, which are expensive, raise privacy concerns, and lack customization. Fine-tuning-based methods, on the other hand, suffer from poor generalizability due to the limited coverage of publicly available training data. To overcome these challenges, we propose a novel and scalable text-to-SQL data synthesis framework for automatically synthesizing large-scale, high-quality, and diverse datasets without extensive human intervention. Using this framework, we introduce SynSQL-2.5M, the first million-scale text-to-SQL dataset, containing 2.5 million samples spanning over 16,000 synthetic databases. Each sample includes a database, SQL query, natural language question, and chain-of-thought (CoT) solution. Leveraging SynSQL-2.5M, we develop OmniSQL, a powerful open-source text-to-SQL model available in three sizes: 7B, 14B, and 32B. Extensive evaluations across nine datasets demonstrate that OmniSQL achieves state-of-the-art performance, matching or surpassing leading closed-source and open-source LLMs, including GPT-4o and DeepSeek-V3, despite its smaller size. We release all code, datasets, and models to support further research.

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

↑