Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen2.5-Coder-7B-Instruct
|
| 4 |
+
tags:
|
| 5 |
+
- reinforcement-learning
|
| 6 |
+
- grpo
|
| 7 |
+
- text-to-sql
|
| 8 |
+
- multi-turn
|
| 9 |
+
- agent
|
| 10 |
+
- skyrl
|
| 11 |
+
language:
|
| 12 |
+
- en
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Qwen2.5-Coder-7B-SkyRL-SQL
|
| 17 |
+
|
| 18 |
+
Qwen2.5-Coder-7B-Instruct trained as a **multi-turn SQL agent** with GRPO using [SkyRL](https://github.com/NovaSky-AI/SkyRL)'s SkyRL-SQL recipe. The model interacts with a real SQLite database over up to 6 turns: it probes the schema with exploratory queries, observes actual execution results (or errors), refines its understanding, and then commits a final answer.
|
| 19 |
+
|
| 20 |
+
## Method
|
| 21 |
+
|
| 22 |
+
- **Recipe**: [SkyRL-SQL](https://novasky-ai.notion.site/skyrl-sql) (`examples/train/text_to_sql`), GRPO with dual-clip policy loss, no KL
|
| 23 |
+
- **Training data**: [SkyRL-SQL-653](https://huggingface.co/datasets/NovaSky-AI/SkyRL-SQL-653-data-newfmt) — only 653 examples, executed against [OmniSQL](https://huggingface.co/datasets/seeklhy/OmniSQL-datasets) databases
|
| 24 |
+
- **Reward**: execution-result match against the gold query on the final answer (sparse, outcome-only)
|
| 25 |
+
- **Training**: 10 optimizer steps (2 epochs), batch 128 prompts × 5 samples, max 16k context
|
| 26 |
+
- **Hardware**: 4× NVIDIA L40 (48GB), FSDP + vLLM via SkyRL
|
| 27 |
+
|
| 28 |
+
## Results (held-out Spider, execution accuracy pass@1)
|
| 29 |
+
|
| 30 |
+
| step 0 (base model) | step 5 | **step 10 (this model)** |
|
| 31 |
+
|---|---|---|
|
| 32 |
+
| 38.4% | 57.9% | **69.8%** |
|
| 33 |
+
|
| 34 |
+
Average response length also dropped 528 → 364 tokens — the model learned to probe the database decisively rather than ramble.
|
| 35 |
+
|
| 36 |
+
## Prompt format
|
| 37 |
+
|
| 38 |
+
The model expects the SkyRL-SQL interaction format: a system/user prompt containing the database schema and question, with `<sql>...</sql>` blocks for exploratory queries (results are returned in `<observation>` messages) and a final `<solution>...</solution>` block. See the [SkyRL-SQL recipe](https://github.com/NovaSky-AI/SkyRL/tree/main/examples/train/text_to_sql) for the exact template and a runnable environment.
|