Abstract:
Traditional Text-to-SQL tasks typically require large scale annotated data for model training, which incurs significant time and labor costs. Consequently, data scarcity remains a critical bottleneck, particularly in domain specific applications. While data augmentation based on Large Language Model (LLM) has emerged as a promising solution to this issue, most existing methods heavily rely on the distribution of original datasets and often generate synthetic data that lacks reliability and interpretability. Addressing these challenges, this study proposes SCoT-SQL, a novel Chain-of-Thought guided data synthesis framework. This method effectively integrates natural language instructions with symbolic knowledge, specifically detailed database schema and table content, to guide LLM, thereby significantly reducing semantic errors during the generation process. To guarantee the high quality of synthetic data, SCoT-SQL incorporates a rigorous filtering mechanism that leverages both model self consistency voting and verification based on execution. Additionally, the framework employs a self feedback mechanism driven by Chain-of-Thought reasoning to calibrate synthetic data. This process not only rectifies logical inconsistencies in SQL queries but also generates explicit step by step reasoning trajectories, enhancing the interpretability of the dataset. Comprehensive experiments on the KaggleDBQA and ScienceBenchmark datasets demonstrate the efficacy of the proposed method. SCoT-SQL achieved execution accuracy improvements of 6.5% and 3% respectively, significantly outperforming previous state of the art data synthesis baselines and proving its effectiveness in low resource and complex scenarios.