explains the behavior of the incorrect query,
identifies the root cause of the error, and
proposes how the query should be corrected.

Image 1. The Three-Stage Iterative Loop of the ReSQL Framework [1]
ReSQL in Action: Enabling 7B–9B Models to Surpass GPT-4

Image 2. Remaining Execution Errors After the Second Refinement Stage on the SPIDER and BIRD Benchmarks, Broken Down by Difficulty [2]
36.5% fewer ambiguous column reference errors
39.4% fewer multi-statement SQL errors
73.1% fewer ORDER BY-before-UNION errors
100% elimination of aggregation function errors within GROUP BY clauses
What’s Next
[1] Park, Minjun, et al. "ReSQL: Self-Improving Framework for Reasoning-Aware Text-to-SQL Dataset Generation." Findings of the Association for Computational Linguistics: ACL 2026. 2026.
[2] Yu, Tao, et al. "Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task." Proceedings of the 2018 conference on empirical methods in natural language processing. 2018.
[3] Li, Jinyang, et al. "Can llm already serve as a database interface." A big bench for large-scale database grounded text-to-SQLs 2305 (2023).
[4] Askari, Arian, Christian Poelitz, and Xinye Tang. "Magic: Generating self-correction guideline for in-context text-to-sql." Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 39. No. 22. 2025.
[5] Chen, Xinyun, et al. "Teaching large language models to self-debug." International Conference on Learning Representations. Vol. 2024. 2024.
[6]. Wang, Xuezhi, et al. "Self-consistency improves chain of thought reasoning in language models." arXiv preprint arXiv:2203.11171 (2022).
[7] Hu, Edward J., et al. "Lora: Low-rank adaptation of large language models." Iclr 1.2 (2022): 3.
[8] Liu, Yang, et al. "G-eval: Nlg evaluation using gpt-4 with better human alignment, 2023." arXiv preprint arXiv:2303.16634 12 (2023): 1.