Enterprise Text-to-SQL — fine-tuning, measured

A QLoRA-fine-tuned Qwen3-8B turns business questions into PostgreSQL. Fine-tuning took strict execution accuracy from 43.71 % to 68.43 %, and 70.86 % with a self-correction loop — measured on 453 held-out questions by executing every query against a real database, never by string similarity.

This is the project's second iteration. The first scored 52.10 %, and analysing its failures showed most of that gain was the model learning which columns the benchmark wanted. Scoring both pipelines on this identical test set: strict accuracy 40.18 % → 70.86 %, while genuinely wrong row sets went 85 → 84. The headline moved 30 points; the SQL barely improved. That is the honest read, and it is only visible because the harness separates the two.

Ask the fine-tuned model yourself

The QLoRA adapter — 70.86 % strict execution accuracy — answering in real time on a free GPU. Same weights, same prompt and the same 4-bit configuration every number below was measured with.

Open the live demo →

First question takes ~20 s while the model loads; after that it is a few seconds. Or explore all 453 recorded answers in the Explorer.