EMNLP Findings2025
SPFT-SQL: Enhancing Large Language Model for Text-to-SQL Parsing by Self-Play Fine-Tuning
Yuhao Zhang, Shaoming Duan, Jinhang Su, Chuanyi Liu, Peiyi Han
Abstract
Despite the significant advancements of selfplay fine-tuning (SPIN), which can transform a weak large language model (LLM) into a strong one through competitive interactions between models of varying capabilities, it still faces challenges in the Text-to-SQL task. SPIN does not generate new information, and the large number of correct SQL queries produced by the opponent model during self-play reduces the main model's ability to generate accurate SQL queries. To address this challenge, we propose a new self-play fine-tuning method tailored for the Text-to-SQL task, called SPFT-SQL. Prior to self-play, we introduce a verification-based iterative fine-tuning approach, which synthesizes high-quality fine-tuning data iteratively based on the database schema and validation feedback to enhance model performance, while building a model base with varying capabilities. During the self-play fine-tuning phase, we propose an error-driven loss method that incentivizes incorrect outputs from the opponent model, enabling the main model to distinguish between correct SQL and erroneous SQL generated by the opponent model, thereby improving its ability to generate correct SQL. Extensive experiments and in-depth analyses on six opensource LLMs and five widely used benchmarks demonstrate that our approach outperforms existing state-of-the-art (SOTA) methods.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
1 top-tier paper has cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- FormulaSPIN: Self-Play Fine-Tuning for Natural Language to Spreadsheet Formula Generation cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Self-playing Adversarial Language Game Enhances LLM Reasoning cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Self-playing Adversarial Language Game Enhances LLM Reasoning cites Self-Play Fine-Tuning Converts Weak Language Models to Strong Language Models
- Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation cites LoRA: Low-Rank Adaptation of Large Language Models
- Self-Play Fine-Tuning Converts Weak Language Models to Strong Language Models cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
Cited by top-tier papers1
Builds on15
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
- Text-to-SQL Empowered by Large Language Models: A Benchmark EvaluationDawei Gao, Haibin Wang, Yaliang Li, Xiuyu Sun et al.VLDB 2024 · 609 citations
- Self-Play Fine-Tuning Converts Weak Language Models to Strong Language ModelsZixiang Chen, Yihe Deng, Huizhuo Yuan, Kaixuan Ji et al.ICML 2024 · 527 citations
- Self-playing Adversarial Language Game Enhances LLM ReasoningPengyu Cheng, Tianhao Hu, Han Xu, Zhisong Zhang et al.NeurIPS 2024 · 120 citations
Related papers
- SQLForge: Synthesizing Reliable and Diverse Data to Enhance Text-to-SQL Reasoning in LLMsYu Guo, Dong Jin, Shenghao Ye, Shuangwu Chen et al.ACL Findings 2025 · 3 citations
- SDE-SQL: Enhancing Text-to-SQL Generation in Large Language Models via Self-Driven Exploration with SQL ProbesWenxuan Xie, Yaxun Dai, Wenhao JiangACL 2026 · 4 citations
- ReSQL: Self-Improving Framework for Reasoning-Aware Text-to-SQL Dataset GenerationMinjun Park, Yongju Seong, Myoseop Sim, Kyungkoo Min et al.ACL Findings 2026
- ROUTE: Robust Multitask Tuning and Collaboration for Text-to-SQLYang Qin, Chao Chen, Zhihang Fu, Ze Chen et al.ICLR 2025
- TS-SQL: Test-driven Self-refinement for Text-to-SQLWenbo Xu, Haifeng Zhu, Liang Yan, Chuanyi Liu et al.EMNLP Findings 2025 · 2 citations
