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:
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_name = "emre/Qwen-0.5B-GRPO"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16).to("cuda")
7
8# Example prompt: structured with <reasoning> and <answer> tags.
9prompt = """<reasoning>
10Step-by-step reasoning:
11</reasoning>
12<answer>
13"""
14inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
15outputs = model.generate(**inputs, max_length=300)
16print(tokenizer.decode(outputs[0], skip_special_tokens=True))