ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQL
On the map: LLM reasoning → Knowledge- and tool-augmented reasoning
Abstract (arXiv)
In Text-to-SQL, execution feedback is essential for guiding large language models (LLMs) to reason accurately and generate reliable SQL queries. However, existing methods treat execution feedback solely as a post-hoc signal for correction or selection, failing to integrate it into the generation process. This limitation hinders their ability to address reasoning errors as they occur, ultimately reducing query accuracy and robustness. To address this issue, we propose ReEx-SQL (Reasoning with Execution-Aware Reinforcement Learning), a framework for Text-to-SQL that enables models to interact with the database during decoding and dynamically adjust their reasoning based on execution feedback. ReEx-SQL introduces an execution-aware reasoning paradigm that interleaves intermediate SQL execution into reasoning paths, facilitating context-sensitive revisions. It achieves this through structured prompts with markup tags and a stepwise rollout strategy that integrates execution feedback into each stage of generation. To supervise policy learning, we develop a composite reward function that includes an exploration reward, explicitly encouraging effective database interaction. Additionally, ReEx-SQL adopts a tree-based decoding strategy to support exploratory reasoning, enabling dynamic expansion of alternative reasoning paths. Notably, ReEx-SQL achieves 88.8% on Spider and 64.9% on BIRD at the 7B scale, surpassing the standard reasoning baseline by 2.7% and 2.6%, respectively. It also shows robustness, achieving 85.2% on Spider-Realistic with leading performance. In addition, its tree-structured decoding improves efficiency and performance over linear decoding, reducing inference time by 51.9% on the BIRD development set.
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Placed in Knowledge- and tool-augmented reasoning, one of 17 directions in LLM reasoning. Builds on 53 of its 61 references that are in the map. First posted on arXiv 19 May 2025.
Builds on
53 of 61 references.
Closest ancestors · 6
Same direction, newest first
- 2025ExCoT: Optimizing Reasoning for Text-to-SQL with Execution Feedback25 Mar
- 2025ReSearch: Learning to Reason with Search for LLMs via Reinforcement Learning25 Mar
- 2025Search-R1: Training LLMs to Reason and Leverage Search Engines with Reinforcement Learning12 Mar
- 2025R1-Searcher: Incentivizing the Search Capability in LLMs via Reinforcement Learning7 Mar
- 2024CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQL2 Oct
- 2023ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought26 Oct
Other references · 47
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
- 2023Distilling Step-by-Step! Outperforming Larger Language Models with Less Training Data and Smaller Model Sizescited by 737
- 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 688
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 477
- 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 424
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 385
- 2023RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLcited by 195
35 more
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 187
- 2023Navigate through Enigmatic Labyrinth A Survey of Chain of Thought Reasoning: Advances, Frontiers and Futurecited by 184
- 2024CHESS: Contextual Harnessing for Efficient SQL Synthesiscited by 169
- 2023C3: Zero-shot Text-to-SQL with ChatGPTcited by 164
- 2023MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQLcited by 164
- 2020Semantic Evaluation for Text-to-SQL with Distilled Test Suitescited by 126
- 2020Structure-Grounded Pretraining for Text-to-SQLcited by 126
- 2021Towards Robustness of Text-to-SQL Models against Synonym Substitutioncited by 110
- 2024MCS-SQL: Leveraging Multiple Prompts and Multiple-Choice Selection For Text-to-SQL Generationcited by 105
- 2021Exploring Underexplored Limitations of Cross-Domain Text-to-SQL Generalizationcited by 92
- 2025OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scalecited by 91
- 2023LLMs cannot find reasoning errors, but can correct them given the error locationcited by 85
- 2024The Dawn of Natural Language to SQL: Are We Fully Ready?cited by 79
- 2024A Survey of Text-to-SQL in the Era of LLMs: Where are we, and where are we going?cited by 56
- 2024Synthesizing Text-to-SQL Data from Weak and Strong LLMscited by 54
- 2024Before Generation, Align it! A Novel and Effective Strategy for Mitigating Hallucinations in Text-to-SQL Generationcited by 50
- 2022Recent Advances in Text-to-SQL: A Survey of What We Have and What We Expectcited by 47
- 2024A Preview of XiYan-SQL: A Multi-Generator Ensemble Framework for Text-to-SQLcited by 46
- 2024DTS-SQL: Decomposed Text-to-SQL with Small Large Language Modelscited by 45
- 2024FinSQL: Model-Agnostic LLMs-based Text-to-SQL Framework for Financial Analysiscited by 36
- 2024PURPLE: Making a Large Language Model a Better SQL Writercited by 34
- 2025Alpha-SQL: Zero-Shot Text-to-SQL using Monte Carlo Tree Searchcited by 34
- 2025NL2SQL-BUGs: A Benchmark for Detecting Semantic Errors in NL2SQL Translationcited by 33
- 2023Natural Language Interfaces for Tabular Data Querying and Visualization: A Surveycited by 27
- 2024MAG-SQL: Multi-Agent Generative Approach with Soft Schema Linking and Iterative Sub-SQL Refinement for Text-to-SQLcited by 22
- 2025SQL-o1: A Self-Reward Heuristic Dynamic Search Method for Text-to-SQLcited by 19
- 2024Improving Retrieval-augmented Text-to-SQL with AST-based Ranking and Schema Pruningcited by 16
- 2025Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errorscited by 14
- 2024ROUTE: Robust Multitask Tuning and Collaboration for Text-to-SQLcited by 13
- 2025EllieSQL: Cost-Efficient Text-to-SQL with Complexity-Aware Routingcited by 13
- 2025Uncovering the Impact of Chain-of-Thought Reasoning for Direct Preference Optimization: Lessons from Text-to-SQLcited by 9
- 2025Knapsack Optimization-based Schema Linking for LLM-based Text-to-SQL Generationcited by 9
- 2024Grounding Natural Language to SQL Translation with Data-Based Self-Explanationscited by 8
- 2025DB-Explore: Automated Database Exploration and Instruction Synthesis for Text-to-SQLcited by 5
- 2025MCTS-SQL: Light-Weight LLMs can Master the Text-to-SQL through Monte Carlo Tree Searchcited by 4
Built on by
Citing papers per year: 2025: 4; 2026: 4.
8 papers.
- 2025A Survey of Reinforcement Learning for Large Reasoning Modelscited by 180
- 2025MTIR-SQL: Multi-turn Tool-Integrated Reasoning Reinforcement Learning for Text-to-SQLcited by 10
- 2025SDE-SQL: Enhancing Text-to-SQL Generation in Large Language Models via Self-Driven Exploration with SQL Probescited by 2
- 2025AGRO-SQL: Agentic Group-Relative Optimization with High-Fidelity Data Synthesiscited by 2
- 2026Every Step Counts: Step-Level Credit Assignment for Tool-Integrated Text-to-SQLcited by 1
- 2026BAP-SQL: Budget-Aware Observation Planning for Agentic Text-to-SQLcited by 1
- 2026Causal Episodic Memory for Feedback-Driven Agent Repaircited by 0
- 2026COAL-SQL: Coverage-Guided Augmentation and Failure-Driven Learning for Text-to-SQL Post-Trainingcited by 0
- 2026Causal Episodic Memory for Feedback-Driven Agent Repair6 Aug 2026
- 2026COAL-SQL: Coverage-Guided Augmentation and Failure-Driven Learning for Text-to-SQL Post-Training4 Aug 2026
- 2026BAP-SQL: Budget-Aware Observation Planning for Agentic Text-to-SQL3 Aug 2026
- 2026Every Step Counts: Step-Level Credit Assignment for Tool-Integrated Text-to-SQL6 May 2026
- 2025AGRO-SQL: Agentic Group-Relative Optimization with High-Fidelity Data Synthesis29 Dec 2025
- 2025MTIR-SQL: Multi-turn Tool-Integrated Reasoning Reinforcement Learning for Text-to-SQL29 Oct 2025
- 2025A Survey of Reinforcement Learning for Large Reasoning Models10 Sep 2025
- 2025SDE-SQL: Enhancing Text-to-SQL Generation in Large Language Models via Self-Driven Exploration with SQL Probes8 Jun 2025
Similar, not cited
Close in wording, no citation either way
- 2025Reasoning-SQL: Reinforcement Learning with SQL Tailored Partial Rewards for Reasoning-Enhanced Text-to-SQL
- 2025Reward-SQL: Boosting Text-to-SQL via Stepwise Execution-Aware Reasoning and Process-Supervised Rewards
- 2026ReToolSQL: Agentic Reinforcement Learning for Robust Text-to-SQL
- 2025Arctic-Text2SQL-R1: Simple Rewards, Strong Reasoning in Text-to-SQL
- 2025Sparks of Tabular Reasoning via Text2SQL Reinforcement Learning
- 2026FINER-SQL: Boosting Small Language Models for Text-to-SQL
- 2025Reinforcing Code Generation: Improving Text-to-SQL with Execution-Based Learning
- 2026Progress-SQL: Improving Reinforcement Learning for Text-to-SQL via Progressive Rewards