Datasets:
The dataset viewer is not available for this split.
Error code: ResponseNotFound
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
SREB: SQL Rewrite Evidence Benchmark
A dataset of executable evidence for SQL query rewrites proposed by language models.
Most SQL benchmarks ask "write a query for this question". Most rewrite papers report a success rate. SREB publishes something different: for every rewrite, the database state on which the result changes and the rows that prove it.
reference [1,1,1,1] candidate [1,1,1] -> multiplicities lost
Why it is different
| Existing work | What it gives | Missing |
|---|---|---|
| Spider, BIRD | text-to-SQL evaluation | no rewrite validation |
| GenRewrite, R-Bot, LLM-R2 | success rates on benchmarks | no per-rewrite witness |
| Cosette, VeriEQL | formal proofs for supported SQL | coverage, and no run-level evidence |
SREB keeps the evidence, not the score. Every record is reproducible: database version, model digest, sampling parameters, state profile, and the rows that differ.
What is inside
| Config | Content |
|---|---|
corpus |
query families: schema DDL, constraints, reference SQL, breaking profile |
states |
frozen state banks generated under the real schema constraints |
runs |
model responses with digest, quantization and sampling parameters |
evidence |
outcome per (family, model): status, refuting states, row witness |
Outcome values: refuted, preserved, no_rewrite, unsupported, error.
preserved means no refuting state was found on the finite bank. It is not a proof of
equivalence, and the dataset never claims otherwise.
Reproduce
git clone https://github.com/ykvlev/sql-rewrite-evidence-bench
pip install -r scripts/requirements.txt
python scripts/check_corpus.py --repo-root . # hashes, pins, integrity
python scripts/recompute_tables.py --repo-root . # rebuild summary tables
Every published number is recomputable from data/ without rerunning a model.
Scale (v0.3.0)
- query families: 204 across three schemas (library, online shop, university)
- frozen states: 5 712 (28 profiles per family)
- model runs: 1 224 (6 models × 204 evaluated families)
- evidence: 204 families, evaluated on MySQL 8.4.11
- total checks: 34 272 (model × family × state)
- models: Qwen2.5-Coder-7B, Qwen2.5-7B, Qwen2.5-3B, Phi-3.5-mini-3.8B, DeepSeek-Coder-V2, Llama-3.2-3B
Cross-DBMS check: the schemas and the 136 library/shop reference queries execute on PostgreSQL 16.15 without modification; on the 12 seed families the reference results and candidate classifications match MySQL exactly (0 divergences over 336 state pairs). The university schema has not been ported yet.
Limitations
- Synthetic schemas: coverage of real workloads is partial.
- A finite state bank cannot prove equivalence.
- Witnesses are not minimised: the recorded state is the first one that refuted the candidate, not the smallest possible.
- Model behaviour changes across engine versions; the engine version is part of the record. The six models span Ollama 0.40.4–0.40.6.
- Small models can return invalid SQL: 23 answers are
unsupportedand 33 areerrorof 1 224 (recorded, not retried).
Licence
Data and documentation: CC BY 4.0. Code: MIT.
Citation
@dataset{yakovlev_sreb,
title = {SREB: SQL Rewrite Evidence Benchmark},
author = {Yakovlev, Artem},
year = {2026},
note = {ORCID 0009-0006-8617-7895},
url = {https://github.com/ykvlev/sql-rewrite-evidence-bench}
}
- Downloads last month
- 98