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

Tao Liu, Tao Feng, Xiangheng Li, Jinwang Song, Yifan Li +7 more
8/1/2026
cs.CL
rldistillation

No confident code implementation found for this paper.

Abstract

Recent Text-to-SQL systems increasingly rely on multi-turn interaction, execution feedback, and reinforcement learning. However, most existing methods use execution correctness only as a trajectory-level reward, which provides limited guidance for identifying the SQL decisions responsible for success or failure.

Show full abstract

We propose SERL-SQL, a selective execution-grounded reinforcement learning framework for multi-turn Text-to-SQL agents. SERL-SQL samples on-policy SQL interaction trajectories and uses a training-only teacher to re-score student actions with execution feedback. The resulting teacher--student likelihood gap is converted into bounded, masked weights that reweight GRPO advantages only on SQL and tool-action tokens. In this way, task rewards preserve the optimization direction, while execution hindsight provides localized credit assignment. Experiments on BIRD, Spider, and cross-domain benchmarks show that SERL-SQL achieves competitive performance, reaching 76.56% execution accuracy on BIRD-Dev and 89.92% on Spider-Test. Moreover, our reward-based selection strategy closely approaches the oracle Best-of-N upper bound and consistently outperforms consistency-based selection, showing that SERL-SQL produces high-quality candidates that can be reliably identified by lightweight execution-grounded rewards. Our code will be released at https://github.com/Ffunkytao/SERL-SQL.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{liu2026serlsql,
  title  = {SERL-SQL: Selective Hindsight Distillation for Text-to-SQL Reinforcement Agentic Learning},
  author = {Tao Liu and Tao Feng and Xiangheng Li and Jinwang Song and Yifan Li and Xiaoqing Cheng and Dixuan Zhang and Siquan Li and Lin Lan and Hongying Zan and Kunli Zhang and Chao Wu},
  year   = {2026},
  eprint = {2608.00485},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.00485v4}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.00485.svg)](https://codeofpaper.com/paper/2608.00485)

Discussion