Downloads · 30 days
0
Balasandhya/llm-tool-call-grpo-lora-Qwen1.5B
llm-tool-call-grpo-lora-Qwen1.5B is a machine learning model from Balasandhya. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Fine-tuning Qwen 2.5-1.5B to make structured JSON tool calls using SFT and Reinforcement Learning (GRPO).
Downloads · 30 days
0
Access
Public
Updated Mar 12, 2026
Repo size
358 MB
Likes
0
Public
Click a slice to open those files.
.safetensors222 MB · 52%
From the Hugging Face model README
Fine-tuning Qwen 2.5-1.5B to make structured JSON tool calls using SFT and Reinforcement Learning (GRPO).
Train a small LLM to respond with structured tool calls instead of plain text:
{"name": "get_weather", "arguments": {"location": "Paris"}}
Three steps:
| 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.
!pip install -q transformers datasets peft trl accelerate bitsandbytes
!python EXP_STEP1_sft.py # ~20 min
!python EXP_STEP2_grpo.py # ~30 min
!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