arXiv:2511.10192cs.CLcs.DB2025-11被引 16

用结构化数据增强提升Text-to-SQL模型性能,生成7.5万条高质量语料。

Text2SQL-Flow: A Robust SQL-Aware Data Augmentation Framework for Text-to-SQL

  • 基于种子数据生成多样语义对,涵盖六维增强与可执行SQL验证。
  • 构建75,386条标注语料库,使开源模型在相同数据量下表现更优。
  • 适合需提升结构化查询能力的NLP研究者与工业级系统开发者。

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

原文摘要 · Abstract (English)

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.

Text-to-SQL数据增强大模型语义对齐

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。