LoRA adapter for Qwen/Qwen2.5-3B-Instruct post-trained with QLoRA SFT + GRPO on Spider execution rewards (validity / execution / correctness = 0.2 / 0.3 / 0.5).
From scripts/eval.py on the overnight lean recipe (configs/lean_full_*.yaml in the GitHub repo):
| Checkpoint | Exec accuracy | Exec success | Mean reward | Validity |
|---|---|---|---|---|
Base (Qwen2.5-3B-Instruct) |
60.83% | 88.78% | 0.770 | 99.81% |
| SFT | 61.70% | 81.33% | 0.752 | 99.71% |
| GRPO (this adapter) | 62.67% | 82.40% | 0.761 | 100% |
GRPO +1.8 pp exec accuracy vs base (+1.0 pp vs SFT). Base still leads exec success / mean reward on this harness.
| Stage | Setting |
|---|---|
| Base | Qwen/Qwen2.5-3B-Instruct + QLoRA (r=16, α=32, 4-bit) |
| SFT | Full Spider train (8659 rows), 1 epoch, batch 1 / accum 16 / seq 1024 / grad checkpoint |
| GRPO | 3000 prompts × 4 generations, batch 4 / accum 4, completion 160, prompt 896 |
results/eval/ · MEASURED_RESULTS.mdfrom peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "Qwen/Qwen2.5-3B-Instruct"
tok = AutoTokenizer.from_pretrained(base, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(base, device_map="auto", trust_remote_code=True)
model = PeftModel.from_pretrained(model, "abhisheksutaria/qwen2.5-3b-grpo-text-to-sql")
Or set Space / app env: MODEL_ID=Qwen/Qwen2.5-3B-Instruct and ADAPTER_ID=abhisheksutaria/qwen2.5-3b-grpo-text-to-sql.
Research / demo text-to-SQL on Spider-style schemas. Not a production database agent; always validate generated SQL before execution on real data.
adapter_model.safetensors 120 MBtraining_args.bin 5.8 kBQwen/Qwen2.5-3B-Instruct