The Dataset Viewer has been disabled on this dataset.

Small LLM Text-to-SQL Benchmark (PostgreSQL)

A text-to-SQL benchmark for small language models under 10B parameters, scored by executing the generated SQL on PostgreSQL. Qwen3.5-9B currently leads on lookups and Nemotron 3.5 Bolt E4B on refusing unanswerable questions. The questions are the kind a user asks an analytics app: lookups that return an aggregate or a list of records and questions the database cannot answer, where the right reply is a refusal. All models were scored with one execution scorer on the same 1,680 questions over seven databases.

This repository holds results only. The questions, gold SQL and databases are kept private so the set stays usable as a held-out test, which also means the numbers cannot be reproduced from this repository alone.

Key results

  • Qwen3.5-9B with thinking off answers 57.9% of lookups correctly. It is ahead of Nemotron 3.5 Bolt E4B at 51.4% on six of the seven databases, HR being the exception. On the 1,120 paired questions 119 are right only for Qwen and 46 only for Nemotron (exact McNemar p < 1e-7).
  • Nemotron handles unanswerable questions best, returning no runnable SQL on 86.8% of them against 72.7% for Qwen3.5-9B (97 against 18 questions handled by only one of the two, p < 1e-13). It emits the explicit -- UNSUPPORTED marker on 387 of 560 and Qwen on 287.
  • LFM3-1.7B with thinking on matches Nemotron on aggregate questions (61.4% against 60.5%, 52 against 47 questions right for only one of the two, p = 0.69) and handles 83.6% of unanswerable questions. It falls behind on record lists at 35.9% against 42.3% (33 against 69, p < 0.001), which leaves it at 48.7% on lookups. It reasons before every answer, with a median of 1,220 output tokens per question where Qwen3.5-9B with thinking off needs about 40. With thinking off it replied -- UNSUPPORTED to almost every question.
  • The SQL-specialised SLM-SQL models trail all three general models on lookups, at 41.9% for 1.5B and 30.4% for 0.5B.

Results

Each database contributes 240 prompts in three categories of 80. A select question asks for one aggregate measure, either as an overall number (with or without filters) or as a breakdown or top-k ranking by up to two columns. A detail question asks for a list of individual records with named columns and a filter or ordering that keeps it to at most 100 rows. An unanswerable question asks for something the database cannot provide: a data change, a cause, a prediction or data it does not hold.

Execution accuracy by question type

Model Parameters Select + detail Select Detail Unanswerable handled
Qwen3.5-9B, thinking off 9B 57.9 69.1 46.8 72.7
Nemotron 3.5 Bolt E4B 8B (4B effective) 51.4 60.5 42.3 86.8
LFM3-1.7B, thinking on 1.7B 48.7 61.4 35.9 83.6
SLM-SQL-1.5B 1.5B 41.9 50.4 33.4 57.7
SLM-SQL-0.5B 0.5B 30.4 37.5 23.4 59.5

Percentages. Select + detail covers 1,120 questions and each other column 560. Qwen3.5-0.8B is reported per database below; its hosted endpoint failed on AdventureWorks and Synthea, so it has no seven-database total.

Select + detail by database

Select + detail accuracy by database

Database Qwen3.5-9B Nemotron 3.5 Bolt E4B LFM3-1.7B SLM-SQL-1.5B SLM-SQL-0.5B Qwen3.5-0.8B
Chinook 70.6 63.1 55.0 61.2 46.2 21.2
HR 50.0 55.6 51.2 39.4 39.4 19.4
AdventureWorks 54.4 45.0 41.9 38.1 14.4 n/a
Northwind 65.6 60.6 55.6 50.6 36.2 20.6
NYC Flights 53.8 48.1 46.2 42.5 32.5 25.0
Pagila 56.9 48.1 55.6 38.1 30.0 13.8
Synthea 54.4 39.4 35.0 23.1 14.4 n/a

Each cell covers 160 questions. Training data for these models is not known to us. Chinook, Northwind and Pagila are widely published sample databases, so prior exposure to their schemas cannot be ruled out.

Method

Prompt. One user message containing the engine name, the full CREATE TABLE schema with column comments and up to three example values per column, the question and the instruction Write one PostgreSQL query that answers the question. Reply with the SQL only. If the schema cannot answer the question, reply with -- UNSUPPORTED. Qwen3.5-9B, Nemotron, LFM3-1.7B and Qwen3.5-0.8B received this exact text. SLM-SQL received the same schema and question inside its own published prompt template, which asks for step-by-step reasoning and a fenced SQL block and has no instruction for unanswerable questions; its unanswerable column therefore measures only how often its output failed to run.

Inference. Temperature 0 and one sample per prompt for every model, with max_tokens 1024 for all but LFM3-1.7B. Qwen3.5-9B ran on a self-hosted OpenAI-compatible endpoint on 2026-10-29 with chat_template_kwargs.enable_thinking set to false; with thinking on it spent the whole token budget reasoning and returned no SQL. Its serving precision was not recorded. Nemotron ran on the NVIDIA API catalog as nvidia/nemotron-3.5-bolt-e4b on 2026-10-27 with no reasoning tokens returned; its precision and serving stack are NVIDIA's. Every request for both models succeeded, some after retrying a dropped connection. LFM3-1.7B ran on the same self-hosted endpoint on 2026-10-29 and 2026-10-30 with its default chat template, which reasons before answering; only the final answer is scored. Its max_tokens was 32,768 because an earlier pass with a 4,096 cap cut off some answers before any SQL. At 32,768 no answer reached the cap and the longest used 12,341 tokens. Output tokens per question have a median of 1,220 and a 90th percentile of 3,477. results.json lists them per category. This setting gives LFM3-1.7B far more compute per question than the other models, so its row is not a like-for-like comparison.

Scoring. Each output is executed on PostgreSQL and its result table is compared with the gold query's result. Columns are matched by their values, so column names and order do not matter, but the column count, row count and every value must agree; row order counts only for gold queries marked as ordered. An unanswerable prompt counts as handled when the output does not run as SQL, so a broken query on an unanswerable question also counts.

Sample. Each database has a 2,000-question held-out set. The prompts per database are the first 80 per category after ordering question indices by SHA-256 of database|index, a rule that does not look at any model output. SLM-SQL was run on the full sets earlier and is scored here on the same indices. SHA-256 of the seven sample files concatenated in the order Chinook, HR, AdventureWorks, Northwind, NYC Flights, Pagila, Synthea: b87f4fbcc2c63425c75030d50e8b92d7cfdc9a6516bc50afc6ce0c3c18cb6354. Those files also hold prompts of two further categories that this release does not score.

Full counts per database and category are in results.json.

License

These results are released under CC BY 4.0. Each model is distributed under its own license by its authors.

Downloads last month
134