Instructions to use ximosss/ReViSQL-Qwen3-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ximosss/ReViSQL-Qwen3-4B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507") model = PeftModel.from_pretrained(base_model, "ximosss/ReViSQL-Qwen3-4B") - Notebooks
- Google Colab
- Kaggle
File size: 2,402 Bytes
b91c06c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | ---
base_model: Qwen/Qwen3-4B-Instruct-2507
library_name: peft
license: apache-2.0
pipeline_tag: text-generation
tags:
- text-to-sql
- reinforcement-learning
- rlvr
- lora
- bird
---
# ReViSQL-Qwen3-4B
LoRA adapter trained directly from
[`Qwen/Qwen3-4B-Instruct-2507`](https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507)
with RLVR on expert-verified BIRD-Platinum data. This is the validation-selected
step 1,300 adapter from the
[`bird-text2sql-rl`](https://github.com/ximosss/bird-text2sql-rl) project.
## Results
| Dataset / decoding | Exact execution accuracy |
| --- | ---: |
| Arcwise-Plat-SQL, greedy | 376/498 = 75.50% |
| Arcwise-Plat-SQL, SC-16 | 414/498 = 83.13% |
| Arcwise-Plat, greedy | 404/498 = 81.12% |
| BIRD Full Dev, greedy | 961/1,534 = 62.65% |
| BIRD Mini-Dev, greedy | 298/500 = 59.60% |
Greedy uses temperature 0. SC-16 samples 16 candidates at temperature 1 and
selects the majority execution result. The model is evaluated as a SQL agent
with up to five rounds of read-only database interaction; see the source
repository for the exact prompt, environment, and evaluation contract.
## Loading the adapter
```python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model_id = "Qwen/Qwen3-4B-Instruct-2507"
adapter_id = "ximosss/ReViSQL-Qwen3-4B"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype="auto",
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)
```
The adapter alone does not reproduce the benchmark protocol. Use the database
tool environment and prompts in the source repository for evaluation.
## Training details
- Objective: CISPO with execution, VeriEQL, and evidence-process rewards
- LoRA: rank 32, alpha 64; attention and MLP linear layers
- Learning rate: `1e-5`
- Rollout temperature: `0.8`
- Training batch / group size: 64 / 16
## References
- Yuxuan Zhu, Tengjun Jin, Yoojin Choi, and Daniel Kang. 2026.
[Human-Level Text-to-SQL via Reinforcement Learning on Verified Data, Without Pipeline Engineering](https://arxiv.org/abs/2603.20004).
- Yuxuan Zhu, Tengjun Jin, Yoojin Choi, and Daniel Kang. 2026.
[Putting Task Expertise into RL Achieves State-of-the-Art Performance on Text-to-SQL](https://thinkingmachines.ai/news/putting-task-expertise-into-rl/).
|