Lune

ICDE2026Top-tier venue

Text2sql-Flow: a Robust Sql-Aware Data Augmentation Framework for Text-To-Sql

Qifeng Cai, Hao Liang, Chang Xu, Tao Xie, Wentao Zhang, Bin Cui

2026Year
1Citations

Abstract

The data-centric paradigm has emerged as a pivotal direction in artificial intelligence (AI), relying on 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 SQLaware data augmentation framework that systematically generates large-scale, semantically valid, and structurally diverse Textto-SQL pairs from limited seed data. Our framework operates along six augmentation dimensions and integrates an end-to-end pipeline featuring 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 finetuning and prompt-based settings: (1) For open-source large language models (LLMs), fine-tuning with SQLFLOW enhances the problem-solving capabilities. Under the same data budget, models trained on SQLFLOW achieve competitive performance gains across multiple benchmarks. (2) For closed-source LLMs, we propose a masked alignment retrieval method that leverages SQLFLOW as both a knowledge base and the training data for the retrieval model. This approach enables structure-aware example matching by modeling fine-grained alignments between NL questions and SQL queries. Experimental results show that our retrieval strategy outperforms existing example retrieval methods, highlighting the dual importance of SQLFLOW's highquality data and our novel retrieval technique. Our work establishes a scalable, data-centric foundation for advancing Textto-SQL systems and underscores the indispensable role of structured, high-fidelity data in modern AI development. Our code is available at https://github.com/TechNomad-ds/Text2SQL-Flow.

Ask about this paper

Your agent reads all of it.

Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

lune papers fulltext 641758ff-e991-438c-a73f-aceb357e04cb

Builds on19

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines