Instructions to use Rauhan/Qwen2.5-3B-GRPO-GSM325 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Rauhan/Qwen2.5-3B-GRPO-GSM325 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Rauhan/Qwen2.5-3B-GRPO-GSM325") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Rauhan/Qwen2.5-3B-GRPO-GSM325") model = AutoModelForMultimodalLM.from_pretrained("Rauhan/Qwen2.5-3B-GRPO-GSM325") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Rauhan/Qwen2.5-3B-GRPO-GSM325 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Rauhan/Qwen2.5-3B-GRPO-GSM325" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rauhan/Qwen2.5-3B-GRPO-GSM325", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Rauhan/Qwen2.5-3B-GRPO-GSM325
- SGLang
How to use Rauhan/Qwen2.5-3B-GRPO-GSM325 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Rauhan/Qwen2.5-3B-GRPO-GSM325" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rauhan/Qwen2.5-3B-GRPO-GSM325", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Rauhan/Qwen2.5-3B-GRPO-GSM325" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rauhan/Qwen2.5-3B-GRPO-GSM325", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Rauhan/Qwen2.5-3B-GRPO-GSM325 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Rauhan/Qwen2.5-3B-GRPO-GSM325 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Rauhan/Qwen2.5-3B-GRPO-GSM325 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Rauhan/Qwen2.5-3B-GRPO-GSM325 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Rauhan/Qwen2.5-3B-GRPO-GSM325", max_seq_length=2048, ) - Docker Model Runner
How to use Rauhan/Qwen2.5-3B-GRPO-GSM325 with Docker Model Runner:
docker model run hf.co/Rauhan/Qwen2.5-3B-GRPO-GSM325
Qwen2.5-3B-GRPO-325
π Qwen2.5-3B-GRPO-325 is a fine-tuned version of Qwen2.5 3B, trained using GRPO (Guided Reinforcement Policy Optimization) and DeepSeek R1βs open-source recipe. This model significantly enhances the base Qwen2.5-3B in mathematical problem-solving, logical reasoning, and structured response generation, pushing it towards GPT-4o1-style advanced reasoning.
π₯ Trained entirely on a Free Google Colab Tesla T4 GPU: Training Notebook
π Try inference using this Google Colab notebook: Inference Notebook
π With more resources and extended training, this model could be pushed even further!
Model Details
- Base Model: unsloth/Qwen2.5-3B-instruct-unsloth-bnb-4bit
- Fine-tuning Method: GRPO with structured reinforcement
- Dataset: 325 curated questions from GSM8K (math reasoning)
- Format Adherence: XML-based structured reasoning
- Notable Improvements:
- Mathematical accuracy β
- Logical consistency β
- Structured XML-format responses β
- GPT-4o1-like step-by-step reasoning β
Usage
Example Input & Output
Input (User Query)
If 2x+5=10. Solve for x.
Output (Model Response)
<reasoning>
To solve for x, we need to isolate x on one side of the equation. This can be done by subtracting 5 from both sides of the equation.
</reasoning>
<answer>
2x + 5 - 5 = 10 - 5,
2x = 5,
2x / 2 = 5 / 2,
x = 2.5
</answer>
Installation & Inference
Hugging Face Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Rauhan/Qwen2.5-3B-GRPO-325"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
Limitations & Future Work
π§ Limitations:
- Limited by small dataset size (325 questions)
- Training done on a single Free Google Colab Tesla T4 GPU
- Some long-form reasoning may need further fine-tuning
π Future Improvements:
- Training on a larger dataset (more GSM8K questions + other logical reasoning datasets)
- Extending fine-tuning using DeepSeek R1βs full training pipeline
- Further quantization for faster and memory-efficient inference
License & Citation
This model is released under Apache 2.0 License. If you use this model in your research, please cite:
@misc{Qwen2.5-3B-GRPO-325,
author = {Rauhan},
title = {Qwen2.5-3B-GRPO-325},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/Rauhan/Qwen2.5-3B-GRPO-325}
}
π This model demonstrates how even small models can achieve great results with the right fine-tuning techniques! π
About the Author
π Portfolio & Contact Information:
- π Website: rauhanahmed.org
- π’ GitHub: github.com/rauhanAhmed
- πΌ LinkedIn: linkedin.com/in/rauhan-ahmed
- π¦ Twitter (X): x.com/ahmed_rauh46040
- π§ Email: rauhaan.siddiqui@gmail.com
Feel free to reach out for collaborations, AI research, or any inquiries! π
- Downloads last month
- 2