All benchmarks

  Paper

A 7B text-to-SQL model beat GPT-4o on average across nine SQL benchmarks

Made by Haoyang Li and 11 co-authors

PVLDB 2025

The result

  • Quality

    Average accuracy over 9 text-to-SQL test sets, greedy decoding (execution accuracy; test-suite accuracy where test suites exist). Small model: OmniSQL-7B. Large model: GPT-4o (gpt-4o-2024-11-20). Best large model on this test: DeepSeek-V3, 59.9%.

    61.2%vs 58.9%

    Ahead of GPT-4o by 2.3 points

    Also ahead of DeepSeek-V3 by 1.3 points

    OmniSQL 7B61.2%
    GPT-4o58.9%
    DeepSeek-V359.9%

    Text-to-SQL, 9-benchmark average · higher is better

The story

Text-to-SQL lets people who don’t write SQL ask a database questions in plain language. The authors point out that the strongest systems usually prompt closed models through APIs, which brings usage costs, privacy concerns and little control, while small fine-tuned models tend to fail on databases unlike the ones they were trained on. Their bet: give a small open model far more, and far more varied, training data.

2.5 million made-up examples

To build that data they sampled about 1.3 million web tables from the TabLib corpus, filtered them down to 19,935, and had language models expand 16,583 of them into complete databases. Open-source models (Llama 3.1, DeepSeek Coder, Qwen2.5 and Qwen2.5-Coder) then wrote SQL queries of graded difficulty, questions in several styles and step-by-step solutions. The result, SynSQL-2.5M, has 2,544,390 examples. When three graduate students checked 1,000 of them, 86% were fully correct and 89% of the SQL queries were judged appropriate.

Data

SynSQL-2.5M, plus the Spider and BIRD training sets

2,544,390 synthetic examples over 16,583 databases

Web tables from TabLib, expanded and annotated by open-source LLMs; Spider and BIRD training sets rewritten with step-by-step solutions

Public on Hugging Face (Apache-2.0). The domain test sets contribute no training data, and Spider’s and BIRD’s test databases don’t overlap their training splits.

Fine-tuning a 7B coder

OmniSQL-7B starts from Qwen2.5-Coder-7B-Instruct. Each training input holds the database schema as CREATE TABLE statements, with column descriptions, sample values and values matching the question, followed by the question; the output is the reasoning and then the SQL. The model was fully fine-tuned for 2 epochs at a peak learning rate of 2e-5, batch size 512 and an 8,192-token context, which took about 6 days on one machine with 8 NVIDIA A800 80GB GPUs.

Small model

OmniSQL-7B

7.6B · Renmin University of China and ByteDance

Full supervised fine-tune on SynSQL-2.5M and step-by-step versions of the Spider and BIRD training sets

Base
Qwen2.5-Coder-7B-Instruct
seeklhy/OmniSQL-7B

Training

Full supervised fine-tune (next-token loss on the reasoning and SQL)

AdamW, peak learning rate 2e-5, batch 512, 2 epochs, 8,192-token context

1 machine with 8x NVIDIA A800-SXM4-80GB
Time
About 6 days

Not reported: cost.

Nine test sets

The models were tested on nine sets: Spider dev (1,034 questions) and test (2,147), BIRD dev (1,534), the SQLite part of Spider2.0 (135), ScienceBenchmark (299), EHRSQL (1,008), and the robustness sets Spider-DK (535), Spider-Syn (1,034) and Spider-Realistic (508). A query counts as right if it returns the same result as the reference query, checked across several databases where test suites exist. Every model answered greedily at temperature 0, and the released prompt spells out the task, the rules and the output format.

Large model

GPT-4o (gpt-4o-2024-11-20)

Size not disclosed · OpenAI

Used as released through OpenAI’s API, zero-shot, greedy decoding at temperature 0

Base
OpenAI’s general model, no task training

Large model

DeepSeek-V3

671B (Mixture of Experts) · DeepSeek

Used as released, zero-shot with the released prompt template, greedy decoding at temperature 0

Base
DeepSeek’s general model, no task training
deepseek-ai/DeepSeek-V3

Evaluation

8,234 questions in 9 sets; the average weights each set equally

Test set
Spider dev and test, BIRD dev, Spider2.0-SQLite, ScienceBenchmark, EHRSQL, Spider-DK, Spider-Syn, Spider-Realistic
Metric
Execution accuracy (test-suite accuracy on Spider dev, Spider-Syn and Spider-Realistic), averaged over the 9 sets
How it was compared
Same questions and scoring scripts for every model, greedy at temperature 0. OmniSQL trained on Spider’s and BIRD’s training sets, so their dev and test sets, and Spider-Syn and Spider-Realistic (rewritten Spider dev questions), are close to its training data; GPT-4o and DeepSeek-V3 are zero-shot.

Ahead on average, behind on the hardest domains

Averaged over the nine sets with greedy decoding, OmniSQL-7B scored 61.2%, against 59.9% for DeepSeek-V3, 59.4% for GPT-4-Turbo and 58.9% for GPT-4o; its base model scored 52.8%. It beat both large models on Spider, BIRD and the three robustness sets, but both stayed ahead on the three domain sets it never trained on: Spider2.0-SQLite (GPT-4o 14.8%, DeepSeek-V3 12.6%, OmniSQL-7B 10.4%), ScienceBenchmark (55.5%, 56.2%, 50.2%) and EHRSQL (44.9%, 43.2%, 34.9%). The paper reports no cost or response times, and it left out o1 and DeepSeek-R1 because running them was too expensive.

All the numbers

Show all numbersHide all numbersEvery model · Cost, latency and energy · 14 more results

Every model on the headline test

Cost, latency and energy, as reported

Cost
Not reported
Latency
Not reported
Energy
Not reported

More from the source

  • Spider test, execution accuracy

    Small model 87.9Large model 83.2 %

    Table 4 (greedy decoding)

  • Spider dev, test-suite accuracy

    Small model 81.2Large model 70.9 %

    Table 4 (greedy decoding)

  • BIRD dev, execution accuracy

    Small model 63.9Large model 61.9 %

    Table 4 (greedy decoding)

  • Spider2.0-SQLite (135 enterprise-style questions)

    Small model 10.4Large model 14.8 %

    GPT-4o ahead.

    Table 4 (greedy decoding)

  • ScienceBenchmark (299 questions; policy, astrophysics, cancer research)

    Small model 50.2Large model 55.5 %

    GPT-4o ahead.

    Table 4 (greedy decoding)

  • EHRSQL (1,008 medical-records questions)

    Small model 34.9Large model 44.9 %

    GPT-4o ahead.

    Table 4 (greedy decoding)

  • Spider-DK

    Small model 76.1Large model 72.9 %

    Table 4 (greedy decoding)

  • Spider-Syn

    Small model 69.7Large model 59.6 %

    Table 4 (greedy decoding)

  • Spider-Realistic

    Small model 76.2Large model 66.5 %

    Table 4 (greedy decoding)

  • Average over 9 benchmarks, majority vote of 8 samples

    Small model 63.1Large model 59.9 %

    Table 4 (majority voting)

  • Average over 9 benchmarks, greedy

    Small model 61.2GPT-4-Turbo 59.4 %

    Table 4 (greedy decoding)

  • Average over 9 benchmarks, greedy

    Small model 61.2DeepSeek-V3 (671B, MoE) 59.9 %

    Table 4 (greedy decoding)

  • Average over 9 benchmarks, greedy

    OmniSQL-14B 62.2DeepSeek-V3 (671B, MoE) 59.9 %

    Table 4 (greedy decoding)

  • Average over 9 benchmarks, greedy

    Small model 61.2Qwen2.5-Coder-7B-Instruct (the base model, before fine-tuning) 52.8 %

    Table 4 (greedy decoding)

Worth knowing

  • GPT-4o beats OmniSQL-7B on the three domain-specific sets (Spider2.0-SQLite 14.8 vs 10.4, ScienceBenchmark 55.5 vs 50.2, EHRSQL 44.9 vs 34.9).
  • OmniSQL trained on the Spider and BIRD training sets, so those benchmarks are in-distribution for it; GPT-4o is zero-shot.
  • Small test sets for some benchmarks (Spider2.0-SQLite 135 questions, ScienceBenchmark 299).
  • No cost, latency or energy measured.
2 more caveats
  • Measured by the model’s authors; closed models are given ‘as a reference’. No confidence intervals.
  • Snowflake’s Arctic-Text2SQL-R1 (separate case file) starts from OmniSQL checkpoints, so the two cases are not independent evidence.

Weights on Hugging Face

Published

Sources

  1. Haoyang Li et al. (Renmin University of China, ByteDance), ‘OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scale’, arXiv:2503.02240 (v2, 13 Jul 2025), PVLDB 18(11), 2025
  2. Same paper, HTML version (Table 4)
  3. Code and data, GitHub
  4. OmniSQL-7B model card, Hugging Face
  5. SynSQL-2.5M dataset, Hugging Face
  6. arXiv v1 04 Mar 2025; figures here from v2 (13 Jul 2025), the version published in PVLDB 18(11), 2025.
9 more sources behind this page
  1. arXiv 2503.02240v2
  2. arXiv 2503.02240v2 (HTML)
  3. arXiv 2503.02240v1 (HTML)
  4. github.com/RUCKBReasoning/OmniSQL/train_and_evaluate/README.md
  5. github.com/RUCKBReasoning/OmniSQL/train_and_evaluate/eval_open_source_models.py
  6. github.com/RUCKBReasoning/OmniSQL/train_and_evaluate/infer.py
  7. github.com/RUCKBReasoning/OmniSQL/train_and_evaluate/train_omnisql_7b.sh
  8. github.com/RUCKBReasoning/OmniSQL/train_and_evaluate/process_dataset.py
  9. github.com/RUCKBReasoning/OmniSQL/train_and_evaluate/auto_evaluation.py
Share this benchmark

Drawing the image…

Post text