ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQL
Yaxun Dai, Wenxuan Xie, Xialie Zhuang, Tianyu Yang, Ziyi Liu, Haiqin Yang, Yiying Yang, Yuhang Zhao, Pingfu Chao, Wenhao Jiang
Abstract
Current Text-to-SQL reasoning models often lack integrated execution feedback during generation, and most existing approaches utilize feedback only for post-hoc correction. This separation not only limits real-time error correction, but may also introduce mistakes by altering otherwise correct SQL queries. To address these challenges, we present **ReEx-SQL** (Reasoning with Execution-Aware Reinforcement Learning), a Text-to-SQL framework that interacts with the SQL execution engine during decoding and dynamically adjusts reasoning based on execution feedback, thereby enabling context-sensitive query refinement and improved accuracy. ReEx-SQL achieves this through structured prompts with markup tags and a stepwise rollout strategy that incorporates execution feedback at each generation stage. For policy supervision, we design a composite reward function—featuring an exploration reward—to explicitly encourage effective interaction with the database. Furthermore, ReEx-SQL adopts a tree-based decoding strategy to facilitate exploratory reasoning and primarily aims to enhance parallel decoding efficiency. Notably, ReEx-SQL achieves 89.1% accuracy on Spider and 65.3% on BIRD at the 7B scale, surpassing baseline models by 2.7% and 2.6%, respectively. In addition, its tree-based decoding accelerates inference by 51.9% compared to linear decoding during sampling.- Anthology ID:
- 2026.acl-long.35
- Volume:
- Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
- Month:
- July
- Year:
- 2026
- Address:
- San Diego, California, United States
- Editors:
- Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
- Venue:
- ACL
- SIG:
- Publisher:
- Association for Computational Linguistics
- Note:
- Pages:
- 824–847
- Language:
- URL:
- https://preview.aclanthology.org/ingest-acl/2026.acl-long.35/
- DOI:
- Cite (ACL):
- Yaxun Dai, Wenxuan Xie, Xialie Zhuang, Tianyu Yang, Ziyi Liu, Haiqin Yang, Yiying Yang, Yuhang Zhao, Pingfu Chao, and Wenhao Jiang. 2026. ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQL. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 824–847, San Diego, California, United States. Association for Computational Linguistics.
- Cite (Informal):
- ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQL (Dai et al., ACL 2026)
- PDF:
- https://preview.aclanthology.org/ingest-acl/2026.acl-long.35.pdf