atlas

Research map / Large language models / Agents, code and math

SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement Learning

NeurIPS 2025 · Large language models › Agents, code and math · approach: Reasoning benchmarks and platforms · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Trains NL2SQL reasoning models (SQL-R1) with GRPO-based reinforcement learning on Qwen2.5-Coder models, using a composite format/execution/result/length reward, with optional SFT cold start on synthetic SynSQL data.

Problem

Complex NL2SQL reasoning (multi-table joins, nested queries) and interpretability/generalization limits of SFT-trained text-to-SQL models.

Approach

Apply GRPO with a progressive reward (format, execution, execution-accuracy result, and length rewards) directly to NL2SQL generation with explicit think/answer reasoning, and study whether SFT cold start and synthetic data help, selecting final SQL by self-consistency over execution results.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Apply SQL-R1 reinforcement learning to Qwen2.5-Coder-3BQwen2.5-Coder-3B · Spider Devexecution accuracy: 77.0 -> 78.1Helped
Apply SQL-R1 reinforcement learning to Qwen2.5-Coder-3BQwen2.5-Coder-3B · Spider Testexecution accuracy: 77.2 -> 78.9Helped
Apply SQL-R1 reinforcement learning to Qwen2.5-Coder-3BQwen2.5-Coder-3B · BIRD Devexecution accuracy: 50.5 -> 54.6Helped
Apply SQL-R1 reinforcement learning to Qwen2.5-Coder-7BQwen2.5-Coder-7B · Spider Devexecution accuracy: 77.4 -> 87.6Helped
Apply SQL-R1 reinforcement learning to Qwen2.5-Coder-7BQwen2.5-Coder-7B · Spider Testexecution accuracy: 79.4 -> 88.7Helped
Apply SQL-R1 reinforcement learning to Qwen2.5-Coder-7BQwen2.5-Coder-7B · BIRD Devexecution accuracy: 58.2 -> 63.1Helped
Apply SQL-R1 reinforcement learning to Qwen2.5-Coder-14BQwen2.5-Coder-14B · Spider Devexecution accuracy: 87.0 -> 86.7No clear effect
Apply SQL-R1 reinforcement learning to Qwen2.5-Coder-14BQwen2.5-Coder-14B · Spider Testexecution accuracy: 88.0 -> 88.1Helped
Apply SQL-R1 reinforcement learning to Qwen2.5-Coder-14BQwen2.5-Coder-14B · BIRD Devexecution accuracy: 66.1 -> 67.1Helped
Add the full reward function, including format reward (ablation)SQL-R1 with Qwen2.5-Coder-7B · BIRD Devaccuracy: 60.4 -> 63.1Helped
Add the full reward function, including execution reward (ablation)SQL-R1 with Qwen2.5-Coder-7B · BIRD Devaccuracy: 60.7 -> 63.1Helped
Add the full reward function, including result reward (ablation)SQL-R1 with Qwen2.5-Coder-7B · BIRD Devaccuracy: 62.4 -> 63.1Helped

Surprising findings

Limitations

Experimental setup

Datasets: SynSQL-2.5M SynSQL-200K SynSQL-Complex-5K Spider BIRD Spider-DK Spider-Syn Spider-Realistic Spider2.0

Benchmarks: Spider BIRD Spider-DK Spider-Syn Spider-Realistic Spider2.0

Metrics: execution accuracy

Baselines: CodeS DTS-SQL CHESS Alpha-SQL SQL-o1 OmniSQL DeepRetrieval Reasoning-SQL DIN-SQL DAIL-SQL MCTS-SQL CHASE-SQL

Builds on: GRPO DeepSeek-R1 SynSQL-2.5M OmniSQL

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy