Downloads · 30 days
11
52% of all-time downloads
oliverkinch/qwen3.5-9b-text2sql-grpo
qwen3.5-9b-text2sql-grpo is a text generation model from oliverkinch. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
An agentic text-to-SQL model: given a natural-language question and a SQLite database, it explores the schema with tools, runs candidate queries, observes real execution feedback, and submits a final SQL query.
Downloads · 30 days
11
52% of all-time downloads
All-time downloads
21
Public
Parameters
9.7B
19.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors19.3 GB · 100%
How the weights are stored.
BF169.7B · 100%
From the Hugging Face model README
An agentic text-to-SQL model: given a natural-language question and a SQLite database, it explores the schema with tools, runs candidate queries, observes real execution feedback, and submits a final SQL query.
Trained with agentic GRPO directly from vanilla Qwen/Qwen3.5-9B — no
supervised finetuning stage, no teacher traces. 200 GRPO steps in an
execution-grounded environment (verifiers
/ prime-rl): the reward
executes the submitted query against the real database and compares result
sets to gold (1.0 match / 0.1 runs-but-wrong / 0.0 error / −1.0 write
attempt). Training prompts come from the BIRD train split, filtered to those
the base policy solves 1–7 times out of 8 (prompts with no gradient signal
are dropped).
| setting | EX |
|---|---|
| agentic, greedy | 63.4% |
| agentic, exec-consistency voting @ k=8 / k=32 (temp 1.0) | 67.0% / 67.4% |
| single-turn (no tools), greedy | 58.2% |
base Qwen/Qwen3.5-9B zero-shot agentic, for reference | 49.7% |
Exec-consistency voting: sample k rollouts, group the submitted queries by the result set they return, exclude empty results, take the largest group (majority over result sets — never over SQL text, and without de-duplicating verbatim repeats).
The model calls tools in Qwen3.5's XML dialect — serve with vLLM using
--enable-auto-tool-choice --tool-call-parser qwen3_xml (the hermes
parser silently parses nothing).
It expects the agentic environment's tool set: inspect_schema,
sample_rows, run_sql (read-only), submit. The training/eval harness,
environment definition, and a ready-to-use CLI (scripts/ask.py, agentic
and single-turn modes, works against any SQLite file) live in the training
repository: https://github.com/oliverkinch/text2sql-env
It also works as a plain single-turn SQL generator (schema in the prompt, SQL out) at the lower accuracy listed above.