ReSQL: Retrieval-augmented Error Reasoning for Text-to-SQL Generation

ACL ARR 2025 February Submission3417 Authors

15 Feb 2025 (modified: 09 May 2025)ACL ARR 2025 February SubmissionEveryoneRevisionsBibTeXCC BY 4.0
Abstract: Text-to-SQL systems enable users to query databases using natural language, bridging the gap between non-expert users and structured data retrieval. A key challenge for these models is the high frequency of execution errors, particularly in small language models. In this paper, we present ReSQL (Retrieval-augmented error reasoning for Text-to-SQL), a framework that enhances the self-debugging capabilities of Text-to-SQL models. ReSQL employs direct fine-tuning on a self-generated error reasoning dataset to improve a model’s ability to debug and correct SQL execution errors. We demonstrate that a 7–9B parameter model fine-tuned with ReSQL surpasses GPT-4 on the BIRD and SPIDER benchmarks and outperforms state-of-the-art self-correction methods, achieving more than double the error correction rate compared to standard fine-tuning approaches. Additionally, we show the Retrieval-Augmented SQL Generation further enhances correction capabilities for rare execution error types. We believe ReSQL provides a robust and efficient self-debugging framework for Text-to-SQL models, making it especially valuable for resource-constrained small models.
Paper Type: Long
Research Area: Language Modeling
Research Area Keywords: fine-tuning, prompting, applications, robustness
Contribution Types: Model analysis & interpretability, Approaches to low-resource settings, Data resources
Languages Studied: English
Submission Number: 3417
Loading