Lune

ACL Findings2026

ReSQL: Self-Improving Framework for Reasoning-Aware Text-to-SQL Dataset Generation

Minjun Park, Yongju Seong, Myoseop Sim, Kyungkoo Min, Stanley Jungkyu Choi

Abstract

Recent advances in Text-to-SQL have greatly benefited from large language models, yet small and medium-sized models still suffer from frequent execution errors and limited self-correction ability.We present ReSQL (Retrieval-augmented error reasoning for Textto-SQL), a self-improving framework that generates and learns from its own error-reasoning dataset, enabling models to autonomously refine their SQL generation and correction capabilities.ReSQL combines feedback-driven fine-tuning with retrieval-based inference: it gathers model-generated errors, analyzes them through structured feedback prompts, and retrieves relevant correction examples during inference.This unified approach allows models to internalize robust error-reasoning patterns and dynamically apply them to unseen queries.Experimental results on the SPIDER and BIRD benchmarks show that ReSQL substantially improves execution accuracy and self-correction ability over strong baselines, achieving competitive performance with much larger proprietary models such as GPT-4.Our findings highlight ReSQL as a promising step toward self-improving, reasoning-aware Text-to-SQL systems that can continually enhance their reliability and interpretability without external supervision.All code and generated reasoning datasets are available to facilitate application to open-source LLMs and reproducible baseline training.Model SPIDER (%) BIRD (%) Llama-3.2 1B 49.60 70.85 Llama-3.2 3B 20.91 45.16 Llama-3.1 8B 7.07 28.69 Qwen-2.5 1.5B 28.31 58.15 Qwen-2.5 3B 17.73 43.63 Qwen-2.5 7B 5.14 28.59 Gemma-2 2B 37.60 67.04 Gemma-2 9B 8.41 27.49Mistral-v0.3 7B 18.03 45.85

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.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Teaching Large Language Models to Self-Debug cites Self-Consistency Improves Chain of Thought Reasoning in Language Models
  • Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation cites LoRA: Low-Rank Adaptation of Large Language Models
  • Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation cites Self-Consistency Improves Chain of Thought Reasoning in Language Models
  • Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation cites Bridging Textual and Tabular Data for Cross-Domain Text-to-SQL Semantic Parsing
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on12

  1. LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
  2. Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations
  3. Self-Consistency Improves Chain of Thought Reasoning in Language ModelsXuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V. Le et al.ICLR 2023 · 681 citations
  4. Text-to-SQL Empowered by Large Language Models: A Benchmark EvaluationDawei Gao, Haibin Wang, Yaliang Li, Xiuyu Sun et al.VLDB 2024 · 609 citations
  5. Bridging Textual and Tabular Data for Cross-Domain Text-to-SQL Semantic ParsingXi Victoria Lin, Richard Socher, Caiming XiongEMNLP Findings 2020 · 186 citations

Related papers

  1. STaR-SQL: Self-Taught Reasoner for Text-to-SQLMingqian He, Yongliang Shen, Wenqi Zhang, Qiuying Peng et al.ACL 2025
  2. ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQLYaxun Dai, Wenxuan Xie, Xialie Zhuang, Tianyu Yang et al.ACL 2026 · 8 citations
  3. RetrySQL: Text-to-SQL Training with Retry Data for Self-Correcting Query GenerationAlicja Raczkowska, Riccardo Belluzzo, Piotr Zielinski, Joanna Baran et al.AAAI 2026
  4. DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-CorrectionMohammadreza Pourreza, Davood RafieiNeurIPS 2023 · 909 citations
  5. MARS-SQL: A Multi-Agent Reinforcement Learning Framework For Text-To-SQLHaolin Yang, Jipeng Zhang, Zhitao He, Alexander Zhou et al.ICML 2026 · 12 citations
Dusk over the sea between two cliffs drawn in fine vertical lines