SQL-Factory: A Multi-Agent Framework for High-Quality and Large-Scale SQL Generation
Not on the map. Why?
Abstract (arXiv)
High quality SQL corpus is essential for intelligent database. For example, Text-to-SQL requires SQL queries and correspond natural language questions as training samples. However, collecting such query corpus remains challenging in practice due to the high cost of manual annotation, which highlights the importance of automatic SQL generation. Despite recent advances, existing generation methods still face limitations in achieving both diversity and cost-effectiveness. Besides, many methods also treat all tables equally, which overlooks schema complexity and leads to under-utilization of structurally rich tables. To address these issues, this paper proposes a multi-agent framework for high-quality and large-scale SQL generation, dubbed SQL-Factory. It decomposes the generation process into three collaborative teams: the Generation Team explores diverse query structures using a powerful language model, the Expansion Team scales promising patterns via a lightweight language model, and the Management Team adaptively schedules the workflow and evaluates the quality of synthesized queries. This modular framework ensures a balanced trade-off between diversity, scalability, and generation cost. We apply SQL-Factory to four widely used benchmarks and generate over 300,000 SQL queries with less than 200 API cost. Our generated queries achieve higher diversity compared to other methods, and extensive experiments demonstrate that the generated queries significantly improve the model performance in various downstream tasks.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). First posted on arXiv 21 Apr 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 2; 2026: 3.
5 papers.
- 2025MARS-SQL: A multi-agent reinforcement learning framework for Text-to-SQLcited by 15
- 2025Toward Real-World Table Agents: Capabilities, Workflows, and Design Principles for LLM-based Table Intelligencecited by 2
- 2026Business Logic-Driven Text-to-SQL Data Synthesis for Business Intelligencecited by 0
- 2026Natural Language Interfaces for Spatial and Temporal Databases: A Comprehensive Overview of Methods, Taxonomy, and Future Directionscited by 0
- 2026SemanticAgent: A Semantics-Aware Framework for Text-to-SQL Data Synthesiscited by 0
- 2026SemanticAgent: A Semantics-Aware Framework for Text-to-SQL Data Synthesis23 Apr 2026
- 2026Natural Language Interfaces for Spatial and Temporal Databases: A Comprehensive Overview of Methods, Taxonomy, and Future Directions24 Mar 2026
- 2026Business Logic-Driven Text-to-SQL Data Synthesis for Business Intelligence20 Jan 2026
- 2025MARS-SQL: A multi-agent reinforcement learning framework for Text-to-SQL2 Nov 2025
- 2025Toward Real-World Table Agents: Capabilities, Workflows, and Design Principles for LLM-based Table Intelligence14 Jul 2025