Downloads · 30 days
19
63% of all-time downloads
jasmine313112031/deepseek_grpo
deepseek_grpo is a text generation model from jasmine313112031. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This model is a fine-tuned version of unsloth/DeepSeek-R1-Distill-Llama-8B using Group Relative Policy Optimization (GRPO) for enhanced reasoning capabilities on multiple-choice questions.
Downloads · 30 days
19
63% of all-time downloads
All-time downloads
30
Public
Repo size
524 MB
Likes
0
Public
Click a slice to open those files.
.safetensors671 MB · 77%
From the Hugging Face model README
This model is a fine-tuned version of unsloth/DeepSeek-R1-Distill-Llama-8B using Group Relative Policy Optimization (GRPO) for enhanced reasoning capabilities on multiple-choice questions.
This model has been specifically trained to handle reasoning tasks with a structured format, particularly excelling at Chinese multiple-choice questions. The model generates responses with explicit reasoning steps followed by clear solutions.
Key Features:
<start_working_out> and <end_working_out> tags for reasoning process<SOLUTION>answer</SOLUTION> formatThis model is designed for structured reasoning tasks, particularly multiple-choice questions that require step-by-step analysis.
Input Format:
Question: [Your question here]
Options:
A. [Option A]
B. [Option B]
C. [Option C]
D. [Option D]
Output Format:
<start_working_out>
[Reasoning process]
<end_working_out>
<SOLUTION>A</SOLUTION>
from unsloth import FastLanguageModel
import torch
# Load model
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="your-username/deepseek-r1-8b-grpo-reasoning",
max_seq_length=1024,
dtype=None,
load_in_4bit=True,
)
# Format your question
messages = [
{"role": "system", "content": "You are given a problem. Think about the problem and provide your working out. Place it between <start_working_out> and <end_working_out>. Then, provide your solution between <SOLUTION></SOLUTION>"},
{"role": "user", "content": """Question: Which is the capital of France?
Options:
A. London
B. Paris
C. Berlin
D. Madrid"""}
]
# Generate response
text = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=256,
repetition_penalty=1.2,
do_sample=False,
pad_token_id=tokenizer.eos_token_id,
eos_token_id=tokenizer.eos_token_id,
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Pre-fine-tuning (SFT):
GRPO Training:
The GRPO training used multiple reward functions:
# Install required packages
pip install unsloth transformers torch
# Load and use the model (see example above)
If you use this model, please cite:
@misc{deepseek-r1-grpo-reasoning,
title={DeepSeek-R1-8B-GRPO-Reasoning: A Fine-tuned Model for Structured Reasoning},
author={[Your Name]},
year={2025},
howpublished={\url{https://huggingface.co/your-username/deepseek-r1-8b-grpo-reasoning}}
}