Downloads · 30 days
8
25% of all-time downloads
mhmdelbadry1/qwen-reasoning-grpo-4bit
qwen-reasoning-grpo-4bit is a reinforcement learning model from mhmdelbadry1. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This is a 4-bit quantized version of Qwen2.5-1.5B fine-tuned with GRPO (Generative Reward Policy Optimization) for enhanced mathematical and logical reasoning.
Downloads · 30 days
8
25% of all-time downloads
All-time downloads
32
Public
Parameters
1.5B
3.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.1 GB · 99%
From the Hugging Face model README
This is a 4-bit quantized version of Qwen2.5-1.5B fine-tuned with GRPO (Generative Reward Policy Optimization) for enhanced mathematical and logical reasoning.
<reasoning> tags for chain-of-thoughtfrom transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "mhmdelbadry1/qwen-reasoning-grpo-4bit"
# Load model (4-bit quantized)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
trust_remote_code=True,
load_in_4bit=True
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
# Inference
prompt = "Solve the equation: 2x + 5 = 15. Show your steps."
messages = [{
"role": "user",
"content": prompt + "\nPlease reason step-by-step. You must use <reasoning> tags (not <think>) for your thought process and <answer> tags for the final result."
}]
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=1024,
temperature=0.7,
top_p=0.9
)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
<reasoning> and <answer> tagsIf you use this model, please cite:
@misc{qwen-reasoning-grpo-2024,
title={Qwen 2.5 GRPO Reasoning Model},
author={Mohamed Elbadry},
year={2025},
howpublished={\url{https://huggingface.co/mhmdelbadry1/qwen-reasoning-grpo-4bit}}
}
Apache 2.0 (inherited from base model)