arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.15077cs.LGcs.DB
收藏

Think2SQL: 通过可验证奖励强化学习增强大语言模型的推理能力以实现文本到SQL

Think2SQL: Reinforce LLM Reasoning Capabilities for Text2SQL

Politecnico di Torino(托斯卡纳理工学院);EURECOM

Simone Papicchio, Simone Rossi, Luca Cagliero, Paolo Papotti

AI总结:

本文提出Think2SQL方法,通过可验证奖励强化学习增强大语言模型的推理能力,提升文本到SQL任务的性能。

摘要:

尽管大语言模型(LLMs)在文本到SQL任务中推动了最先进的水平,但在复杂、多表环境中实现稳健的推理仍然是参数高效模型的瓶颈。本文通过可验证奖励强化学习(RLVR)的视角,系统地研究了如何通过注入推理能力来改进文本到SQL。我们揭示了奖励密度、优势缩放和模型容量之间的关键相互作用。我们的分析得出四个主要见解。首先,我们提出了一种新颖的执行引导密集奖励函数,该函数在实例级别提供细粒度反馈,显著优于二进制信号和现有最先进的奖励。其次,我们分析了优势计算的机制,证明尽管大模型在稀疏信号和激进的优势缩放下表现优异,但小模型需要密集奖励和保守的缩放来提高文本到SQL性能。第三,我们评估了冷启动的影响,表明知识蒸馏不总是能提升RLVR性能,且监督微调模型容易陷入分布模仿。第四,我们绘制了训练效率的帕累托前沿,为在计算约束下优化文本到SQL推理提供了见解。我们的发现最终形成了Think2SQL家族:我们的400亿参数模型在推理能力上与最先进的模型如o3相当。我们发布了我们的模型、数据集和代码,以创建一个RLVR优化在文本到SQL中的蓝图,网址为https://anonymous.4open.science/r/Think2SQL-3B7F。

英文摘要:

While Large Language Models (LLMs) have advanced the state-of-the-art in Text-to-SQL, robust reasoning in complex, multi-table environments remains a bottleneck for parameter-efficient models. This paper presents a systematic empirical study on injecting reasoning capabilities into Text-to-SQL through the lens of Reinforcement Learning with Verifiable Rewards (RLVR). We uncover a critical interplay between reward density, advantage scaling, and model capacity. Our analysis yields four primary insights. First, we propose a novel execution-guided dense reward function that significantly outperforms binary signals and existing state-of-the-art rewards by providing granular feedback at the instance level. Second, we analyze the mechanics of advantage calculation, demonstrating that while large models thrive on sparse signals with aggressive advantage scaling, smaller models require dense rewards and conservative scaling to improve Text-to-SQL performance. Third, we evaluate the impact of cold start, showing that distillation does not always improve RLVR performance and that supervised, fine-tuned models are prone to distributional mimicry. Fourth, we map the Pareto frontier of training efficiency, providing insights for optimizing Text-to-SQL reasoning under computational constraints. Our findings culminate in the Think2SQL family: our 4B-parameter model demonstrates reasoning capabilities competitive with state-of-the-art models such as o3. We release our models, datasets, and code to create a blueprint for RLVR optimization in Text-to-SQL at https://anonymous.4open.science/r/Think2SQL-3B7F.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑