AgentTune: Qwen2.5-3B ReAct Agent LoRA
agent mode for a compact model
2 min readupdated
This QLoRA adapter (a lightweight add-on for fine-tuning quantized models) teaches the compact Qwen2.5-3B-Instruct language model multi-step agentic reasoning. The model follows the ReAct framework (the "thought — action — observation — answer" loop), letting it deliberately choose external tools and see tasks through to completion. Compared to the base model without fine-tuning, the adapter dramatically improves tool selection accuracy and scenario completion rates. It is a solid fit for developers building local AI agents and automations who need reliable tool use on modest hardware.
Key features
- Higher tool selection accuracy: Tool Selection Accuracy and Exact Tool Match jumped from 30% in zero-shot mode to 100% on the test set.
- Reliable task completion: overall Task Success Rate rose from 93.3% to 100%.
- Compact base: built on the lightweight Qwen2.5-3B-Instruct model via the PEFT library, so you can run it without expensive server-grade GPUs.
What you can do
- Build a local AI agent: wire the model into a pipeline with external APIs or functions so it can plan actions step by step and call the right tools.
- Optimize tool-use pipelines: swap out heavier models for query routing and function calling with a lightweight Qwen2.5-3B + LoRA setup.
Example
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct")
model = PeftModel.from_pretrained(base_model, "mrehmanbee22/agenttune-qwen2.5-3b-react-lora")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-3B-Instruct")Read more
DetailsMetrics (Zero-Shot → Fine-Tuned): Task Success Rate 93.3% → 100%, Tool Selection Accuracy 30.0% → 100%, Exact Tool Match 30.0% → 100%.
Training details: QLoRA (4-bit NF4, double quantization), rank 16 / alpha 32, all attention and MLP projections.
Dataset and time: 500 ReAct trajectories, 3 epochs, learning rate 2e-4 (cosine), ~10 minutes on an L4 GPU, final loss 0.419.










Comments