Downloads · 30 days
28
31% of all-time downloads
PursuitOfDataScience/Llama-3.2-1B-GRPO
Llama-3.2-1B-GRPO is a text generation model from PursuitOfDataScience. Use it when you need the model to write or continue text. The card lists the license as llama3.2.
A Llama-3.2-1B model fine-tuned with Chain-of-Thought reasoning and GRPO (Group Relative Policy Optimization) for mathematical problem solving.
Downloads · 30 days
28
31% of all-time downloads
All-time downloads
89
Public
Parameters
1.2B
2.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.5 GB · 99%
From the Hugging Face model README
A Llama-3.2-1B model fine-tuned with Chain-of-Thought reasoning and GRPO (Group Relative Policy Optimization) for mathematical problem solving.
This model is a two-stage fine-tuned version of meta-llama/Llama-3.2-1B:
Stage 1: Chain-of-Thought (CoT) Supervised Fine-Tuning
<think> reasoning tags for step-by-step problem solving/project/rcc/youzhi/Llama-3.2-1B-reasoning/final_modelStage 2: GRPO Reinforcement Learning
Base Model: meta-llama/Llama-3.2-1B
Dataset: PursuitOfDataScience/MiniMax-M2.1-Mixture-of-Thoughts
Training Configuration:
Format: The model was trained with a simple chat format:
user: {question}
assistant: <think>{reasoning}</think>{answer}
Starting Model: CoT fine-tuned model from Stage 1 (/project/rcc/youzhi/Llama-3.2-1B-reasoning/final_model)
Dataset: openai/gsm8k (train split)
GRPO Configuration:
Reward Function:
The reward function checks if the ground truth numerical answer appears in the generated text using word boundary matching to avoid partial number matches.
The model uses a simple prompt format:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "PursuitOfDataScience/Llama-3.2-1B-GRPO"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Format the prompt
question = "Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?"
prompt = f"""user: Solve this math problem step by step. Show your reasoning inside <think></think> tags, then give the final answer after ####.
Question: {question}
assistant:"""
# Generate
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
do_sample=True,
pad_token_id=tokenizer.pad_token_id
)
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(response)
Expected output format:
<think>
[Step-by-step reasoning here]
</think>
#### [final answer]
The model was trained and evaluated on GSM8K mathematical reasoning tasks. The GRPO training used a verifiable reward function that checks for correct numerical answers, with higher rewards for answers appearing in the expected location (end of response).
If you use this model, please cite:
@misc{llama32-1b-grpo,
author = {PursuitOfDataScience},
title = {Llama-3.2-1B-GRPO: Chain-of-Thought Reasoning with GRPO},
year = {2026},
publisher = {HuggingFace},
url = {https://huggingface.co/PursuitOfDataScience/Llama-3.2-1B-GRPO}
}