用验证数据强化学习,让大模型直接生成精准SQL,无需复杂流水线。
Human-Level Text-to-SQL via Reinforcement Learning on Verified Data, Without Pipeline Engineering
- 基于专家验证数据,用强化学习直接优化大模型生成SQL。
- 在关键数据集上达到92.96%准确率,首次实现人类水平性能。
- 解决奖励误导和外部知识忽略问题,适合追求高精度的开发者。
将自然语言问题转化为SQL查询(Text-to-SQL)是数据库研究中的长期难题。近期工作通过构建复杂的多阶段大模型流水线来提升准确率,但系统与人类专家之间仍存在超过10%的差距。本文表明,仅通过在干净数据上使用RLVR微调大模型即可实现人类级性能,无需复杂流水线。我们发现现有训练数据中普遍存在标注错误,严重干扰优化过程。为此,我们设计了多轮专家验证流程,从BIRD Train中筛选并修正出2500个实例,形成BIRD-Platinum数据集,其中61%的样本经过修正。在该数据集上微调Qwen3-235B,在Arcwise-Plat和Spider2上相比BIRD Train提升11%-16%,超越当前最优开源系统0.6%-16%。我们诊断出标准RLVR在Text-to-SQL中的两类失效模式:(1) 结果奖励存在显著误报率;(2) 模型系统性忽略外部知识。为此提出ReViSQL-BIRD,结合结果奖励、SQL等价验证及过程奖励,激励外部知识利用。用ReViSQL-BIRD微调Kimi-K2.6,在Arcwise-Plat上首次达到人类水平准确率92.96%,领先前五名开源系统10%-22%。
原文摘要 · Abstract (English)
Translating natural language questions to SQL queries (Text-to-SQL) is a long-standing problem in database research. Recent efforts have focused on improving accuracy by building increasingly complex multi-stage large LLM pipelines, layering task decomposition, schema linking, and model-based query selection on top of an LLM. Despite this growing complexity, a substantial gap (>10%) between such systems and human experts persists on benchmarks, suggesting that pipeline engineering alone has hit a ceiling. We show that human-level Text-to-SQL performance is achievable by fine-tuning an LLM using RLVR on clean data, without pipeline components. In this paper, we identified the dominant bottleneck for RLVR on Text-to-SQL: existing training data contains pervasive annotation errors that mislead optimization. To address this, we developed a multi-round, expert-driven verification pipeline and used it to curate BIRD-Platinum, a dataset of 2.5k verified instances sampled from BIRD Train, with errors corrected in 61% of instances. We show that fine-tuning Qwen3-235B on BIRD-Platinum yields consistent improvements (11-16%) over BIRD Train on Arcwise-Plat (an expert-verified version of BIRD) and Spider2, outperforming SOTA open-source systems by 0.6-16%. Furthermore, we diagnosed two failure modes of standard RLVR on Text-to-SQL. We find that (1) result-based rewards have non-trivial false positive rates, and (2) models systematically ignore the external knowledge in BIRD-style problems. To address them, we propose ReViSQL-BIRD, a specialized reward shaping method that combines result-based rewards with SQL equivalence verification and leverages process rewards for incentivizing external-knowledge use. We fine-tuned Kimi-K2.6 with ReViSQL-BIRD. On Arcwise-Plat, ReViSQL-BIRD-K2.6 is the first method to achieve human-level accuracy (92.96%), outperforming top five open-source systems by 10-22%.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。