arXiv:2509.25672cs.AIcs.DB2025-09被引 5

自动生成高质量文本转SQL数据,专用于企业数据库场景。

SING-SQL: A Synthetic Data Generation Framework for In-Domain Text-to-SQL Translation

  • 分层划分数据库模式,多层级合成SQL查询并自动修复优化
  • 在BIRD基准上达82.87%软F1,3B模型优于基线16.21点
  • 无需日志或人工标注,适合企业自建Text-to-SQL系统评估

将自然语言问题转化为SQL已成为非技术人员查询数据库的核心挑战。尽管近期研究通过大规模合成数据生成提升模型性能,但多数工作聚焦跨域泛化,忽视了企业级单一数据库场景的需求。为此,我们提出SING-SQL——一种全自动两阶段框架,可为任意目标数据库生成高质量、高覆盖率的合成文本转SQL数据,无需依赖SQL日志或人工标注。该方法分层划分数据库模式,跨多复杂度层级生成SQL,并采用质量感知流水线,包含大模型判别、可执行性检查、自动修复与列平衡机制。我们进一步发布SingSQL-LM系列轻量级语言模型,经合成数据微调后实现强领域内泛化。在BIRD基准子集上,SingSQL-LM-3B-R64达到82.87% Soft F1和73.03% EX上界(32候选),较最优3B基线提升+16.21(Soft F1)和+12.36(EX);1.5B版本则提升+9.30(Soft F1)和+4.49(EX)。在合成评估集上,SingSQL-LMs显著超越现有系统,成为同规模开源模型中的新标杆。对上下文管理策略的研究表明,无模式微调结合仅模式推理最具鲁棒性。本研究确立SING-SQL为可扩展、数据库无关的企业级文本转SQL系统构建与评估范式。

原文摘要 · Abstract (English)

Translating natural language questions into SQL has become a core challenge in enabling non-technical users to query databases. While recent work has explored large-scale synthetic data generation to improve model performance through post-training, most efforts emphasize cross-domain generalization. This leaves a gap for real-world enterprise scenarios, where models need to specialize to a single database schema and organizations require to be able to evaluate their Text-to-SQL systems on their own databases. To address this, we introduce SING-SQL, a fully automated two-stage framework for generating high-quality, high-coverage synthetic Text-to-SQL data for any target database, without relying on SQL logs or manual annotations. Our approach hierarchically partitions a database schema into sub-schemas, synthesizes SQL queries across multiple complexity levels, and applies a quality-aware pipeline that includes LLM-as-a-judge validation, executability checks, automatic repair, and column balancing. We further release SingSQL-LM, a family of compact language models fine-tuned on the synthetic data, achieving strong in-domain generalization. On the subset of the BIRD benchmark, SingSQL-LM-3B-R64 reaches 82.87% Soft F1 and 73.03% EX upper bound with 32 candidates, outperforming the best 3B-scale baseline by +16.21 in Soft F1 and +12.36 in EX. At the 1.5B scale, SingSQL-LM-1.5B-R64 improves over prior systems by +9.30 in Soft F1 and +4.49 in EX. On synthetic evaluation sets, SingSQL-LMs exceed prior systems by wide margins, establishing state-of-the-art performance among open models at comparable scales. Our study of context management strategies reveals that schema-free fine-tuning combined with schema-only inference provides the most robust results. These findings establish SING-SQL as a scalable, database-agnostic paradigm for producing and evaluating enterprise-grade Text-to-SQL systems.

文本转SQL合成数据企业应用大模型

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