Graph-Reward-SQL: Execution-Free Reinforcement Learning for Text-to-SQL via Graph Matching and Stepwise Reward
Han Weng, Boyi Liu, Yuanfeng Song, Dun Zeng, Yingxiang Yang, Yi Zhan, Longjie Cui, Xiaoming Yin, Yang Sun
强化学习(RL)已被广泛采用,以提高大型语言模型(LLM)在Text-to-SQL任务上的性能。 然而,现有方法通常依赖于基于执行或基于LLM的Bradley-Terry奖励模型。 前者遭受重复数据库调用造成的高执行延迟,而后者则施加了大量的GPU内存开销,这两者都显着阻碍了RL管道的效率和可扩展性。 为此,我们提出了一个名为Graph-Reward-SQL的新型Text-to-SQL RL微调框架,它采用了GMNScore结果奖励模型。 我们利用 SQL 图形表示提供准确的奖励信号,同时显著减少推理时间和 GPU 内存使用情况。 在这一基础上,我们进一步引入了StepRTM,这是一种逐步奖励模型,为Common Table Expression(CTE)子查询提供中间监督。 这鼓励了 SQL 的功能正确性和结构清晰度。 包括Spider和BIRD在内的标准基准的广泛比较和消融实验证明,我们的方法始终优于现有的奖励模型。
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 Text-to-SQL ...