Text-to-SQL benchmark

Train a model to query your database

Fine-tuning a 1.5B model on Ground’s question and SQL pairs raised strict execution accuracy by 6.9 percentage points on the Spider test set. It matched fine-tuning on human-written data.

Strict execution accuracy

2,147 questions across 40 Spider test databases

  • No training52.63%
  • Ground59.56%
  • Human-written59.70%

Difference in percentage points · 95% paired interval

Ground vs. no training
+6.9 [+5.0, +8.9]
Ground vs. human-written
−0.1 [−1.5, +1.3]
Verified pairs
3,098
Model calls
$0.32
About $0.0001 per verified pair
Training per run
About 15 min · about $0.20 on a cloud L4 GPU

From SQLite to training data

  1. Bring your database

    Upload a SQLite file. Add a few example questions with their SQL and a sealed evaluation set if you have them.

  2. Generate pairs that run

    Ground writes question and SQL pairs and keeps queries that run on your database in read-only mode.

  3. Download your splits

    Download the training, validation and test splits as JSONL files in a ZIP, ready for your fine-tuning pipeline.

How we tested it

Read the full method

Frozen before generation. We fixed the design and selected databases outside Spider train and dev. The production worker saw schemas, sample rows and 30 style examples from Spider train. We requested 79 pairs per database.

Sealed until scoring. We fine-tuned the same BF16 Qwen2.5-1.5B-Instruct with the full Ground export and with human-written Spider training data. Each run used 1 epoch of completion-only LoRA. We ran both settings with seeds 77, 78, 79 and decoded greedily up to 256 new tokens in every arm. The final scorer read the sealed test questions and reference SQL once, after training. Strict execution accuracy counts predictions that return the same results as the reference SQL.

Paired by question. We averaged scores across training seeds within each question and used 10,000 paired bootstrap draws over questions to calculate the intervals.

Checked for overlap. With the 131 test questions that shared a SQL template with Ground’s training data removed, Ground still gained +6.1 points over no training (paired 95% interval [+4.0, +8.1]). The overlap check ignored literal values when matching templates.

What the result covers. We tested one task, text-to-SQL, with one 1.5B model on the Spider benchmark family. Verification checks that each query runs on its database. Correctness also requires checking that its answer matches the question. The paired interval against human-written training data includes zero.

Try it on your own SQLite database

Train on your database