arXiv:2601.04875cs.CL2026-01

用结构演化生成高质量文本转SQL数据,提升模型性能。

EvolSQL: Structure-Aware Evolution for Scalable Text-to-SQL Data Synthesis

  • 基于语法树设计六种原子变换,逐步增强SQL复杂度。
  • 7B模型用1/18数据量超越在SynSQL上训练的模型。
  • 适合需要高效构建复杂文本转SQL数据的研究者。

训练高效的文本转SQL模型仍面临高质量、多样化且结构复杂的语料匮乏问题。现有方法或依赖有限的人工标注数据,或直接通过大模型提示生成数据,缺乏对SQL结构的显式控制,导致结构多样性与复杂性不足。为此,我们提出EvolSQL,一种结构感知的数据合成框架,通过种子数据演化出更丰富、语义更多样的查询形式。EvolSQL首先进行探索性查询-结构扩展以提升问题多样性并增强模式覆盖,随后采用自适应定向演化策略,利用来自SQL抽象语法树的六种原子变换算子,在关系、谓词、聚合和嵌套维度上逐步增加查询复杂度。执行验证驱动的SQL优化模块与模式感知去重机制进一步保障生成数据对的质量与结构多样性。实验表明,仅使用1/18数据量的7B模型在我们的数据上微调后,性能优于在更大规模的SynSQL数据集上训练的模型。

原文摘要 · Abstract (English)

Training effective Text-to-SQL models remains challenging due to the scarcity of high-quality, diverse, and structurally complex datasets. Existing methods either rely on limited human-annotated corpora, or synthesize datasets directly by simply prompting LLMs without explicit control over SQL structures, often resulting in limited structural diversity and complexity. To address this, we introduce EvolSQL, a structure-aware data synthesis framework that evolves SQL queries from seed data into richer and more semantically diverse forms. EvolSQL starts with an exploratory Query-SQL expansion to broaden question diversity and improve schema coverage, and then applies an adaptive directional evolution strategy using six atomic transformation operators derived from the SQL Abstract Syntax Tree to progressively increase query complexity across relational, predicate, aggregation, and nesting dimensions. An execution-grounded SQL refinement module and schema-aware deduplication further ensure the creation of high-quality, structurally diverse mapping pairs. Experimental results show that a 7B model fine-tuned on our data outperforms one trained on the much larger SynSQL dataset using only 1/18 of the data.

文本转SQL数据合成结构演化

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