Qwen2.5-0.5B-Instruct-linearexpression
Introduction
We have done GRPO fine tunning on Qwen/Qwen2.5-0.5B-Instruct for solving Linear Equations.
Quickstart
Here is code snippet to how to run the model:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Bhooyas/Qwen2.5-0.5B-Instruct-linearexpression"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
SYSTEM_PROMPT = """
You are an AI assistant.
Solve the user's question and produce your output in exactly this format:
<think>
Reasoning process.
</think>
<answer>
Final answer only.
</answer>
Do not explain your reasoning inside the answer tags, provide only the final answer. When an example is provided, you should strictly follow the format of the output/answer in that example.
"""
prompt = "Find x.\n3x + 7 = 12"
tokenizer = AutoTokenizer.from_pretrained(model_name)
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=128
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
Evaluation & Performance

Training
Full training script and guide can be found in this repo