Views
No views yet
{"name": "get_weather", "arguments": {"location": "Paris"}}| Metric | SFT | GRPO | Winner |
|---|---|---|---|
| JSON Valid | 0% | 92% | GRPO ✅ |
| Correct Tool | 0% | 50% | GRPO ✅ |
| Has Arguments | 0% | 42% | GRPO ✅ |
| Clean Output | 0% | 92% | GRPO ✅ |
| Avg Quality Score | 0.0 | 0.59 | GRPO ✅ |
Key finding: SFT model answered questions directly in plain text (never used tools). GRPO model learned to always respond with structured JSON tool calls. Tested on 12 queries across weather, calculator, search, stocks, translation and unit conversion.
1!pip install -q transformers datasets peft trl accelerate bitsandbytes
2!python EXP_STEP1_sft.py # ~20 min
3!python EXP_STEP2_grpo.py # ~30 min
4!python EXP_STEP3_compare.py| File | Description |
|---|---|
EXP_STEP1_sft.py | SFT training (Colab) |
EXP_STEP2_grpo.py | GRPO RL training (Colab) |
EXP_STEP3_compare.py | Evaluation + comparison |
Qwen2.5-1.5B • QLoRA • GRPO • glaive-function-calling-v2 • trl • peft