Downloads · 30 days
22
100% of all-time downloads
Cyrax321/QwerySmith-2.0-dev-seed2
QwerySmith-2.0-dev-seed2 is a machine learning model from Cyrax321. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
A behaviour-tuned text-to-SQL adapter: it answers questions about a relational database from retrieved evidence, with machine-verifiable citations, and refuses when the evidence does not contain the answer. Facts come…
Downloads · 30 days
22
100% of all-time downloads
All-time downloads
22
Public
Repo size
186 MB
Likes
0
Public
Click a slice to open those files.
.safetensors175 MB · 94%
From the Hugging Face model README
A behaviour-tuned text-to-SQL adapter: it answers questions about a relational database from retrieved evidence, with machine-verifiable citations, and refuses when the evidence does not contain the answer. Facts come from retrieval - this adapter stores no data.
See the results table below.
Qwen/Qwen3-8B teaching the output
contract (SQL: / ANSWER: with [table:row_id] citations, or
REFUSAL:), schema terminology, and calibrated refusal.Qwen/Qwen3-8B + the same
retrieval achieves the fact-bearing part; per the v1.1 finding,
fine-tuning taught style, not facts - this release is built on that
constraint.| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen3-8B |
| Method | QLoRA, 4-bit NF4, double quantization |
| LoRA | r=16, alpha=32, dropout=0.05, targets=['q_proj', 'k_proj', 'v_proj', 'o_proj', 'gate_proj', 'up_proj', 'down_proj'] |
| Optimizer | lr=0.0001, cosine schedule, warmup 0.03, 3 epochs |
| Batch | 1 per device x 16 grad accum, max_len 4096 |
| Decoding (pinned) | non-thinking mode, T=0.7, top_p=0.8, top_k=20 |
| Training data | RAFT-style triples from 30 questions (10 train_ok; held-out questions never trained) |
| Mix | ~70% grounded / ~15% refusal / ~15% schema-only, hard-negative distractors |
| Seed | 2 |
Training data construction, distractor sampling, and the refusal mix are
produced by the harness (triples stage) and are reproducible from the repo.
All numbers below come from captured run artifacts
(report.md, failures/), produced by the same harness on identical
questions with byte-identical frozen evidence packs for every system.
(Evaluation pending - this card is generated from the training run only. The results table lands here after the eval matrix runs.)
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-8B", device_map="auto")
model = PeftModel.from_pretrained(base, "QwerySmith-2.0-dev-seed2")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-8B")
# The model expects the harness prompt contract:
# SYSTEM contract + SCHEMA (CREATE TABLE text)
# + QUESTION + RETRIEVED EVIDENCE rows as [table:row_id] lines
# and emits either:
# SQL: <one SELECT> / ANSWER: <text with [table:row_id] citations>
# or REFUSAL: <what is missing>
Execute generated SQL read-only, with a statement timeout and an AST SELECT-only guard (the harness ships one).
figures/loss_curve_seed2.png | training loss + LR schedule |
figures/results_table.png | the evaluation table, as measured |
figures/ + card diagram | pipeline & inference contract (below) |
QWERYSMITH 2.0 - ARCHITECTURE & PIPELINE
================================================================================
RAW CSVs PREPARE (CPU, local) TRAIN (T4, Colab)
============ ========================= ==================
9 Olist tables -> ingest -> Postgres/SQLite RAFT triples jsonl -> QLoRA
profile -> cutoff frozen TRIPLE |
validate -> leak checks BUILDER v
retrieve -> evidence packs ~70/15/15 Qwen3-8B 4-bit
triples -> training data grounded/ + LoRA r16 a32
(train_ok only) refusal/ lr 1e-4 cosine
schema 3 seeds
================================================================================
EVAL MATRIX (L4, Colab) - identical questions + identical frozen packs
===============================================================================
row 1 Qwen3-8B base + packs --> scorer --> EX / flip / refusal
row 2 Qwen3-8B + adapter + packs --> scorer --> mean of 3 seeds
row 3 Qwen3-30B-A3B AWQ + packs --> scorer --> on-prem alternative
row 4 frontier (API) + packs --> scorer --> reference
|
McNemar + GATE (pre-registered) <- report.md + failures/
================================================================================
INFERENCE CONTRACT (what the fine-tune teaches - behaviour only)
===============================================================================
prompt = SYSTEM contract + SCHEMA (CREATE TABLE text)
+ QUESTION + RETRIEVED EVIDENCE [table:row_id] rows
|
v
SQL: <one SELECT statement>
ANSWER: <text with [table:row_id] citations> or REFUSAL: <why>
|
v
sandboxed execution (read-only role, 30s timeout, sqlglot AST guard)
facts ALWAYS come from retrieval - the adapter never stores data
Trained by the QwerySmith v3 harness (one-command reproducible): see repository
Hardware: Tesla T4, 14912 MB VRAM; packages: {"torch": "2.11.0+cu128", "transformers": "5.5.0", "trl": "0.24.0", "peft": "0.20.0", "unsloth": "2026.9.11", "datasets": "4.3.0", "bitsandbytes": "0.50.2"}
v1.x lineage (1.0/1.1 fine-tuning pipeline and its evaluation):
see the repository's legacy/ directory.
Apache-2.0 (base model license). Dataset retains CC BY 4.0 (UCI Machine Learning Repository).