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.
  • The SQL-specialised SLM-SQL models trail both 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
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 SLM-SQL-1.5B SLM-SQL-0.5B Qwen3.5-0.8B
Chinook 70.6 63.1 61.2 46.2 21.2
HR 50.0 55.6 39.4 39.4 19.4
AdventureWorks 54.4 45.0 38.1 14.4 n/a
Northwind 65.6 60.6 50.6 36.2 20.6
NYC Flights 53.8 48.1 42.5 32.5 25.0
Pagila 56.9 48.1 38.1 30.0 13.8
Synthea 54.4 39.4 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 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, max_tokens 1024 and one sample per prompt for every model. 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.

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
60