The data-centric paradigm has emerged as a pivotal direction in artificial intelligence (AI), emphasizing the role of high-quality training data. This shift is especially critical in the Text-to-SQL task, where the scarcity, limited diversity, and structural simplicity of existing datasets constrain model performance. To address these challenges, we propose Text2SQL-Flow, a SQL-aware data augmentation framework that systematically generates large-scale, semantically valid, and structurally diverse Text-to-SQL pairs from limited seed data. Our framework spans six augmentation dimensions and integrates an end-to-end pipeline with auxiliary database selection, SQL executability verification, natural language (NL) question generation, NL-SQL correspondence verification, and chain-of-thought (CoT) reasoning trace generation. Leveraging this framework, we construct SQLFlow, a high-quality dataset comprising 75,386 annotated examples. We demonstrate the utility of SQLFlow in both fine-tuning and prompt-based settings. (1) For open-source large language models (LLMs), fine-tuning with SQLFlow improves problem-solving ability, delivering competitive gains across multiple benchmarks under the same data budget. (2) For closed-source LLMs, we propose a masked alignment retrieval method that uses SQLFlow as both a knowledge base and training data for the retrieval model, enabling structure-aware example matching via fine-grained NL-SQL alignments. Experiments show that our retrieval strategy outperforms existing example retrieval methods, highlighting the combined value of SQLFlow's data quality and our retrieval technique. Overall, our work provides a scalable, data-centric foundation for advancing Text-to-SQL systems and underscores the importance of structured, high-fidelity data in modern AI development. Our code is available at https://github.com/TechNomad-ds/Text2SQL-Flow.


翻译:以数据为中心的范式已成为人工智能(AI)发展的关键方向,其强调高质量训练数据的重要作用。这一转变在文本到SQL任务中尤为关键,因为现有数据集的稀缺性、有限多样性及结构简单性制约了模型性能。为应对这些挑战,我们提出了Text2SQL-Flow,一种SQL感知的数据增强框架,能够从有限的种子数据中系统性地生成大规模、语义有效且结构多样的文本到SQL对。我们的框架涵盖六个增强维度,并集成了一个端到端流程,包括辅助数据库选择、SQL可执行性验证、自然语言问题生成、自然语言-SQL对应性验证以及思维链推理轨迹生成。利用该框架,我们构建了SQLFlow,一个包含75,386个标注示例的高质量数据集。我们展示了SQLFlow在微调和基于提示的设置中的实用性。(1)对于开源大语言模型,使用SQLFlow进行微调提升了问题解决能力,在相同数据预算下于多个基准测试中实现了有竞争力的性能增益。(2)对于闭源大语言模型,我们提出了一种掩码对齐检索方法,该方法将SQLFlow同时用作知识库和检索模型的训练数据,通过细粒度的自然语言-SQL对齐实现结构感知的示例匹配。实验表明,我们的检索策略优于现有的示例检索方法,凸显了SQLFlow的数据质量与我们的检索技术相结合的价值。总体而言,我们的工作为推进文本到SQL系统提供了一个可扩展的、以数据为中心的基础,并强调了结构化、高保真数据在现代AI开发中的重要性。我们的代码发布于https://github.com/TechNomad-ds/Text2SQL-Flow。

0
下载
关闭预览

相关内容

SQL 全名是结构化查询语言,是用于数据库中的标准数据查询语言,IBM 公司最早使用在其开发的数据库系统中。
ChatAug: 利用ChatGPT进行文本数据增强
专知会员服务
81+阅读 · 2023年3月4日
高效的文本生成方法 — LaserTagger 现已开源
TensorFlow
30+阅读 · 2020年2月27日
干货|当深度学习遇见自动文本摘要,seq2seq+attention
机器学习算法与Python学习
10+阅读 · 2018年5月28日
情感分析的新方法,使用word2vec对微博文本进行情感分析和分类
数据挖掘入门与实战
22+阅读 · 2018年1月6日
Tensorflow 文本分类-Python深度学习
Python程序员
12+阅读 · 2017年11月22日
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
VIP会员
相关VIP内容
ChatAug: 利用ChatGPT进行文本数据增强
专知会员服务
81+阅读 · 2023年3月4日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员