Downloads · 30 days
50
4% of all-time downloads
emre/Qwen-0.5B-GRPO
Qwen-0.5B-GRPO is a text generation model from emre. Use it when you need the model to write or continue text. It is set up for transformers.
This model is a fine-tuned version of the Qwen 0.5B model (based on Qwen/Qwen2.5-0.5B-Instruct) using GRPO (Generative Reward Policy Optimization). It has been trained on the GSM8K math dataset to improve its ability…
Downloads · 30 days
50
4% of all-time downloads
All-time downloads
1.2K
Public
Parameters
494M
1000 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors988 MB · 98%
From the Hugging Face model README
This model is a fine-tuned version of the Qwen 0.5B model (based on Qwen/Qwen2.5-0.5B-Instruct) using GRPO (Generative Reward Policy Optimization). It has been trained on the GSM8K math dataset to improve its ability to generate step-by-step reasoning for math problems, following a structured output format with explicit <reasoning> and <answer> sections.
Qwen-0.5B-GRPO is designed to serve as a lightweight math reasoning assistant. By fine-tuning with reinforcement learning using GRPO, the model learns to produce responses that include both intermediate reasoning and final answers. Key adaptations include:
Base Model: Qwen/Qwen2.5-0.5B-Instruct
Fine-Tuning Method: GRPO (reinforcement learning with custom reward functions)
Dataset: GSM8K – a collection of challenging grade-school math problems
Generation Engine: Utilizes vLLM for faster inference on a single GPU setup
Precision: BF16 training for efficiency on Colab GPUs
Developed by: Davut Emre Taşar
License: Please refer to the license of the base model on its Hugging Face Hub page
This model is intended for educational and research purposes, particularly to demonstrate and support math problem solving with clear, step-by-step reasoning. It is well-suited for:
<reasoning> and <answer> tags) is enforced during training and may require adaptation for other use cases.Users should:
Below is an example code snippet to load and use the model:
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_name = "emre/Qwen-0.5B-GRPO"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16).to("cuda")
# Example prompt: structured with <reasoning> and <answer> tags.
prompt = """<reasoning>
Step-by-step reasoning:
</reasoning>
<answer>
"""
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_length=300)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))