Reinforcing Code Generation: Improving Text-to-SQL with Execution-Based Learning
Not on the map. Why?
Abstract (arXiv)
In this work, we study the problem of code generation with a large language model (LLM), with a focus on generating SQL queries from natural language questions. We ask: Instead of using supervised fine tuning with text-code pairs, can we tune a model by having it interact with a database engine? We frame this problem as a reinforcement learning problem where the model receives execution-based feedback from the environment in the form of scalar rewards. These rewards penalize execution failures and assign positive values when a query returns a correct answer. We use the rewards within the Group Relative Policy Optimization (GRPO) framework. We use a tabular reasoning benchmark to test and evaluate our findings. We find that with only weak supervision in the form of question-answer pairs, RL-tuning improves the accuracy of model generated SQL code from 31.49 to 49.83 while reducing error percentage from 25.43% to 14.71%. This improvement allowed the model nearly match the performance performance to the larger SQLCoder-70B model. Our work demonstrates the potential of using execution-based feedback to improve symbolic reasoning capabilities of LLMs.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 8 of its 17 references that are in the map. First posted on arXiv 6 Jun 2025.
Builds on
8 of 17 references.
References · 8
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2017Proximal Policy Optimization Algorithmscited by 15,215
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,418
Built on by
Citing papers per year: 2025: 2; 2026: 3.
5 papers.
- 2026Generate, Filter, Control, Replay: A Comprehensive Survey of Rollout Strategies for LLM Reinforcement Learningcited by 9
- 2025SPORTSQL: An Interactive System for Real-Time Sports Reasoning and Visualizationcited by 0
- 2025Evidence-Guided Schema Normalization for Temporal Tabular Reasoningcited by 0
- 2026DMCD: Semantic-Statistical Framework for Causal Discoverycited by 0
- 2026COAL-SQL: Coverage-Guided Augmentation and Failure-Driven Learning for Text-to-SQL Post-Trainingcited by 0
- 2026COAL-SQL: Coverage-Guided Augmentation and Failure-Driven Learning for Text-to-SQL Post-Training4 Aug 2026
- 2026Generate, Filter, Control, Replay: A Comprehensive Survey of Rollout Strategies for LLM Reinforcement Learning8 Apr 2026
- 2026DMCD: Semantic-Statistical Framework for Causal Discovery23 Feb 2026
- 2025Evidence-Guided Schema Normalization for Temporal Tabular Reasoning29 Nov 2025
- 2025SPORTSQL: An Interactive System for Real-Time Sports Reasoning and Visualization23 Aug 2025
Similar, not cited
Close in wording, no citation either way
- 2026FINER-SQL: Boosting Small Language Models for Text-to-SQL
- 2025Arctic-Text2SQL-R1: Simple Rewards, Strong Reasoning in Text-to-SQL
- 2026EvoSQL: Memory-Augmented Critic-Generator Co-Evolution for Text-to-SQL
- 2025CogniSQL-R1-Zero: Lightweight Reinforced Reasoning for Efficient SQL Generation
- 2026ACE-SQL: Adaptive Co-Optimization via Empirical Credit Assignment for Text-to-SQL
- 2025ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQL
- 2026Integrating Reasoning and Generalization in Text-to-SQL via Self-Enhanced Fine-Tuning
- 2025Query and Conquer: Execution-Guided SQL Generation