Skip to content

ReToolSQL: Agentic Reinforcement Learning for Robust Text-to-SQL

Aug 2026 · 0 citations · 21 references
Computer Science

TL;DR

ReToolSQL is presented, a two-stage training framework for text-to-SQL that combines a supervised warm-start on rejection-sampled reasoning traces with agentic reinforcement fine-tuning (RFT) over multi-turn tool-use trajectories and shows that a properly designed SFT$\to-RFT pipeline over tool-use trajectories is a practical path toward robust enterprise-grade text-to-SQL.

Abstract

Recent work has shown that reinforcement learning from execution feedback can substantially improve text-to-SQL performance, often enabling smaller models to match or exceed much larger systems. However, most existing approaches treat SQL generation as a single-turn task, limiting the model's ability to recover from errors through iterative refinement. We present ReToolSQL, a two-stage training framework for text-to-SQL that combines (i) a supervised warm-start on rejection-sampled reasoning traces with (ii) agentic reinforcement fine-tuning (RFT) over multi-turn tool-use trajectories. The key insight is that the two stages act on complementary axes, the supervised fine-tuning (SFT) on verified privileged-teacher traces expands the set of solvable questions (raising pass@k coverage on the hardest cases), while RFT converts that expanded capability into higher single-pass accuracy by teaching the model when to verify, what evidence to retrieve, and how to repair faulty SQL from execution feedback. Applied to Gemma 4 instruction-tuned (31B), RFT alone achieves 73.66% execution accuracy (EX) on the BIRD-SQL development benchmark (74.12% EX with self-consistency). Initializing RFT from the SFT checkpoint (SFT$\to$RFT) yields our strongest model at 74.32% EX single-pass and 74.77% EX with self-consistency. At the time of writing, this ranked first on the BIRD single-model development-set leaderboard. The approach uses composite rewards anchored on execution correctness, requires no human annotation beyond the benchmark itself, and operates within a single dense 31B model, showing that a properly designed SFT$\to$RFT pipeline over tool-use trajectories is a practical path toward robust enterprise-grade text-to-SQL.

View source

Similar papers

#artificial intelligence Preprint Sep 2026

DualSQL: Text-to-SQL with Multi-Agent Reinforcement Learning

This work proposes DualSQL, a new Text-to-SQL system consisting of two agents powered by a single model backbone, enabling joint optimization through a robust multi-agent reinforcement learning (RL) framework, and introduces a new SQL correctness metric, robust execution match (REX), to more accurately judge SQL correc...

Shi-Jie Chen, Yu Gan, Yeounoh Chung et al. · 0 citations
Preprint Aug 2026

SERL-SQL: Selective Hindsight Distillation for Text-to-SQL Reinforcement Agentic Learning

This work proposes SERL-SQL, a selective execution-grounded reinforcement learning framework for multi-turn Text-to-SQL agents, showing that SERL-SQL produces high-quality candidates that can be reliably identified by lightweight execution-grounded rewards.

Tao Liu, Tao Feng, Xiangheng Li et al. · 0 citations
#natural language process... Preprint Sep 2026

Unlocking the Unsolvable: Teacher-Guided Curriculum for Data-Efficient RLVR

Reinforcement Learning with Verifiable Rewards (RLVR) has shown remarkable success in improving the mathematical reasoning of large language models. Yet problems beyond the model's current capability, where rollouts uniformly fail and no learning signal is produced, are structurally wasted despite marking the most info...

Yu-Kang Zhu, Zhen-Mao Han · 0 citations
#artificial intelligence Preprint Sep 2026

Rethinking On-Policy Distillation of Large Language Models II: One Training Example

On-policy distillation (OPD) combines student-generated rollouts with dense token-level supervision from a teacher. Existing work has mainly studied its algorithmic behavior, leaving the role of training data unclear. We examine this role at the data-minimal limit by training on a single query. One-shot OPD keeps impro...

Zi-Xuan Fu, Bing-Xiang He, Yu-Xin Zuo et al. · 21 citations · ⚡1
#machine learning Preprint Aug 2026

Learning Generalizable Behaviors for Terminal Agents

River, a simple training recipe that improves reward quality by filtering low-quality environments and augmenting outcome rewards with process-level behavior regularization is proposed, which achieves the best performance among evaluated open-source RL-trained 8B models across four terminal-agent benchmarks.

Yi-Fan Yao, Bo Pang, Xuan-Phi Nguyen et al. · 2 citations
#small language model Preprint Aug 2026

OPDSearch+: On-Policy Distillation with RL Refinement for Search-Augmented Reasoning

The role of a frozen off-the-shelf instruct model as the teacher in on-policy distillation is investigated, and a key insight is revealed: the teacher reshapes the student's policy distribution so that subsequent RL converges to a superior solution that RL alone cannot reach.

Qi Ye, Zhi-Yuan Gu, Jingjie Xia et al. · 3 citations

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.