用强化学习让大模型学会像人一样推理表格数据,提升跨数据集泛化能力。
Sparks of Tabular Reasoning via Text2SQL Reinforcement Learning
- 通过真实SQL查询生成思维链,指导模型逐步理解表格操作
- 引入GRPO强化学习,使模型在不同数据集上准确率提升33.9%(LLaMA)和14.5%(Qwen)
- 适合想训练可解释、可迁移表格推理能力的研究者和工程师
本文将Text-to-SQL任务重新定义为训练大语言模型(LLMs)处理和操作表格数据的路径,超越传统仅关注查询生成的局限。提出两阶段框架:第一阶段从真实SQL查询中合成详细的思维链(CoT)轨迹,提供逐条语句级监督,教会模型如何遍历、筛选和聚合表格字段;第二阶段引入组相对策略优化(GRPO)的强化学习目标,将SQL执行准确率与可泛化推理能力关联,鼓励模型超越特定任务语法,实现跨数据集迁移。实验证明,该方法在标准Text-to-SQL基准上表现优异,并在推理密集型数据集BIRD和CRT-QA上取得显著提升。其中,微调量化后的LLaMA模型准确率相对提高33.9%,Qwen模型提升14.5%。结果表明,SQL不仅是目标形式化语言,更可作为学习稳健、可迁移结构化数据推理的有效支架。
原文摘要 · Abstract (English)
This work reframes the Text-to-SQL task as a pathway for teaching large language models (LLMs) to reason over and manipulate tabular data--moving beyond the traditional focus on query generation. We propose a two-stage framework that leverages SQL supervision to develop transferable table reasoning capabilities. First, we synthesize detailed chain-of-thought (CoT) traces from real-world SQL queries, providing step-by-step, clause-level supervision that teaches the model how to traverse, filter, and aggregate table fields. Second, we introduce a Group Relative Policy Optimization (GRPO) reinforcement learning objective that connects SQL execution accuracy to generalizable reasoning by encouraging steps that extend beyond task-specific syntax and transfer across datasets. Empirically, our approach improves performance on standard Text-to-SQL benchmarks and achieves substantial gains on reasoning-intensive datasets such as BIRD and CRT-QA, demonstrating enhanced generalization and interpretability. Specifically, the distilled-quantized LLaMA model achieved a relative 33.9\% increase in accuracy when trained on Text-to-SQL tasks, while Qwen achieved a relative 14.5\% increase. These results suggest that SQL can serve not only as a target formalism but also as an effective scaffold for learning robust, transferable reasoning over structured data.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。