A 14B SQL model trained with RL beat Gemini 1.5 Pro and o3-mini head to head on BIRD dev
Made by Mohammadreza Pourreza and seven co-authors
The result
The story
Text-to-SQL systems at the top of the BIRD benchmark are usually pipelines built around a large proprietary model; CHASE-SQL uses Gemini 1.5 Pro for all its LLM calls. Researchers at Google Cloud, Google DeepMind and Stanford asked whether a small open model, trained to reason before it writes SQL, could do that job.

The task is narrow: given a question, a hint and a trimmed database schema, write one SQLite query whose result rows exactly match those of the reference query.
Training with partial credit
They trained Qwen2.5-Coder models of 3B, 7B and 14B parameters with reinforcement learning (GRPO). For each question the model writes six candidates, each a reasoning section followed by a query. A candidate earns full credit when its results match, and partial credit for valid syntax, overlap with the right tables and columns, overlap with the reference query’s word pairs and the requested format; wrong queries also get a grade from an LLM judge.
Data
BIRD training set
8,026 question-SQL pairs (9,428 before filtering) over 70 databases
BIRD (Li et al., 2024), databases from domains such as airlines, movies and sales
Pairs that both Gemini-2.0-flash and GPT-4o flagged as incorrect were removed
Small model
Reasoning-SQL 14B
14B · Qwen (Alibaba); trained by the Google and Stanford authors
Trained with GRPO and all six rewards; writes its reasoning, then the SQL
- Base
- Qwen2.5-Coder-14B (base or instruct checkpoint not stated)
Training
GRPO reinforcement learning, 6 completions per question
Reward weights: execution 3, LLM judge 2, others 1
- Time
- 3 epochs at learning rate 1e-6, effective batch 32; wall time not reported
Not reported: cost.
A large model still trims the schema
Before any model sees a question, Gemini 1.5 Pro trims the database schema to the tables and columns that look relevant. Every model in the main comparison got that same trimmed schema; the paper also reports accuracy with the correct schema given.
Large model
Gemini-1.5-pro-002
Size not disclosed · Google
Used as released, with the same trimmed schema; prompt and temperature not stated
- Base
- Google’s Gemini 1.5 Pro, version 002
Evaluation
- Test set
- BIRD dev
- Metric
- Execution accuracy (result rows must match the reference query’s)
- Items
- Not stated in the paper (BIRD’s site lists 1,534 dev questions)
- How it was compared
- Same questions, scorer and Gemini 1.5 Pro schema step for every model; the API models’ prompt and temperature are not given. Gemini-2.0-flash scored higher than the 14B model.
On BIRD dev, the 14B model reached 65.31% against 62.25% for Gemini-1.5-pro-002, 61.34% for o3-mini and 60.82% for GPT-4o-mini. Gemini-2.0-flash scored 66.49%, which the paper calls on par. With the correct schema given, the 14B model scored 72.03%.
Inside the full CHASE-SQL pipeline the 14B model scored lower than Gemini 1.5 Pro: 72.29% against 74.46% on BIRD dev and 72.78% against 74.79% on BIRD test. By the authors’ token-price estimate, it cost about 93% less per question there, measured on BIRD dev.
All the numbers
Show all numbersHide all numbersEvery model · Cost, latency and energy · 12 more results
Every model on the headline test
Cost, latency and energy, as reported
- Cost · average cost per question for SQL generation inside the CHASE-SQL pipeline, BIRD dev
- Reasoning-SQL 14B93% lower than Gemini 1.5 Pro
- 14B model: trained on 8x
NVIDIA H100; serving hardware behind the $0.08/$0.18 estimate not disclosed. Gemini-1.5-pro: Google API, not disclosed.
- Token-price estimate: Gemini-1.5-pro at about $1.25 per 1M input and $5.00 per 1M output tokens; the 14B model at about $0.08 per 1M input and $0.18 per 1M output tokens. Per-question amounts are shown only in Figure 8, by database.
- Latency
- Not reported
- Energy
- Not reported
More from the source
BIRD dev execution accuracy, with schema linking
Small model 65.31o3-mini 61.34 %
Table 2
BIRD dev execution accuracy, with schema linking
Small model 65.31GPT-4o-mini 60.82 %
Table 2
BIRD dev execution accuracy, with schema linking
Small model 65.31Gemini-2.0-flash 66.49 %
Gemini-2.0-flash ahead; the paper calls it ‘on par’.
Table 2
BIRD dev execution accuracy, correct schema given
Small model 72.03Large model 67.47 %
Table 2
BIRD dev execution accuracy, correct schema given
Small model 72.03o3-mini 69.88 %
Table 2
BIRD dev execution accuracy, correct schema given
Small model 72.03Gemini-2.0-flash 71.9 %
Table 2
Inside the CHASE-SQL pipeline, BIRD dev
Small model 72.29CHASE-SQL with Gemini-1.5-pro 74.46 %
Small model lower.
Table 3
Inside the CHASE-SQL pipeline, BIRD test
Small model 72.78CHASE-SQL with Gemini-1.5-pro 74.79 %
Small model lower.
Table 3
Spider, execution accuracy
Small model 81.43Large model 80.46 %
Table 5
Spider-DK
Small model 73.03Large model 67.66 %
Table 5
Spider-Syn
Small model 72.63Large model 71.56 %
Table 5
Spider-Syn
Small model 72.63o3-mini 73.01 %
o3-mini ahead, although §5.4 says the model beats o3-mini on all three Spider sets.
Table 5
Worth knowing
- Gemini-2.0-flash beats the 14B model on the headline metric (66.49% vs 65.31%); the paper calls it ‘on par’.
- A large model is still in the loop: Gemini-1.5-Pro trims the schema before the 14B model writes SQL.
- The 93% cost saving is reported only inside the CHASE-SQL pipeline, where the 14B model scores below Gemini-1.5-pro (72.78% vs 74.79% on test); the text says ‘1% lower’.
- §5.4 says the model beats o3-mini on all three Spider sets, but Table 5 shows o3-mini ahead on Spider-Syn (73.01 vs 72.63).
2 more caveats
- Authors are from Google, which makes two of the comparison models. Preprint; no confidence intervals.
- Weights not published; training data filtered with Gemini-2.0-flash and GPT-4o.
Weights on Hugging Face
No official weights found on Hugging Face (search on 03 Oct 2026); the Arctic-Text2SQL-R1 paper also lists Reasoning-SQL-14B as not open-source. Base family: https://huggingface.co/Qwen/Qwen2.5-Coder-14B-Instruct (verified to exist; the paper does not say whether the base or instruct checkpoint was used).
Sources
- Mohammadreza Pourreza, Shayan Talaei et al. (Google Cloud, Google DeepMind, Stanford), ‘Reasoning-SQL: Reinforcement Learning with SQL Tailored Partial Rewards for Reasoning-Enhanced Text-to-SQL’, arXiv:2503.23157 (v2, 01 Apr 2025)
- Same paper, HTML version (Tables 2, 3, 5; Appendix A.5.1)
- arXiv v1 29 Mar 2025; figures here from v2 (01 Apr 2025).