English

Graph-Reward-SQL: Execution-Free Reinforcement Learning for Text-to-SQL via Graph Matching and Stepwise Reward

Machine Learning 2025-10-06 v3 Databases Programming Languages

Abstract

Reinforcement learning (RL) has been widely adopted to enhance the performance of large language models (LLMs) on Text-to-SQL tasks. However, existing methods often rely on execution-based or LLM-based Bradley-Terry reward models. The former suffers from high execution latency caused by repeated database calls, whereas the latter imposes substantial GPU memory overhead, both of which significantly hinder the efficiency and scalability of RL pipelines. To this end, we propose a novel reward model framework for RL-based Text-to-SQL named Graph-Reward-SQL, which employs the GMNScore outcome reward model. We leverage SQL graph representations to provide accurate reward signals while significantly reducing time cost and GPU memory usage. Building on this foundation, we further introduce StepRTM, a stepwise reward model that provides intermediate supervision over Common Table Expression (CTE) subqueries. This encourages both functional correctness and readability of SQL. Extensive comparative and ablation experiments on standard benchmarks, including Spider and BIRD, demonstrate that our method consistently outperforms existing reward models.

Keywords

Cite

@article{arxiv.2505.12380,
  title  = {Graph-Reward-SQL: Execution-Free Reinforcement Learning for Text-to-SQL via Graph Matching and Stepwise Reward},
  author = {Han Weng and Puzhen Wu and Longjie Cui and Yi Zhan and Boyi Liu and Yuanfeng Song and Dun Zeng and Yingxiang Yang and Qianru Zhang and Dong Huang and Xiaoming Yin and Yang Sun and Xing Chen},
  journal= {arXiv preprint arXiv:2505.12380},
  year   = {2025}
}
R2 v1 2026-07-01T02:19:38.920Z