Downloads · 30 days
13
9% of all-time downloads
quangdung/Qwen2.5-7B-Math-Distill-Sens
Qwen2.5-7B-Math-Distill-Sens is a text generation model from quangdung. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
A 7B merged model created by applying Sensitivity-aware Model Merging (Sens Merging) to:
Downloads · 30 days
13
9% of all-time downloads
All-time downloads
145
Public
Parameters
7.6B
15.2 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors15.2 GB · 100%
From the Hugging Face model README
A 7B merged model created by applying Sensitivity-aware Model Merging (Sens Merging) to:
The goal of this model is to preserve the strong mathematical reasoning ability of DeepSeek-R1-Distill while significantly reducing reasoning verbosity and output token length.
This model provides an attractive trade-off between reasoning quality and inference cost.
| Model | Avg Accuracy | Avg Tokens |
|---|---|---|
| DeepSeek-R1-Distill-Qwen-7B | 69.4 | 2826 |
| Qwen2.5-Math-7B | 45.3 | 755 |
| Sens Merge (λ=0.4) | 66.9 | 701 |
| Benchmark | Distill | Qwen2.5-Math | Sens Merge (λ=0.4) |
|---|---|---|---|
| College Math | 66.0 | 37.9 | 70.4 |
| GSM8K | 90.2 | 84.5 | 90.6 |
| MATH | 94.4 | 73.3 | 90.2 |
| Minerva Math | 41.5 | 13.6 | 36.0 |
| OlympiadBench | 55.0 | 17.3 | 47.2 |
| Avg Accuracy | 69.4 | 45.3 | 66.9 |
| Avg Tokens | 2826 | 755 | 701 |
Large reasoning models such as DeepSeek-R1-Distill often produce long chains of thought, which increases inference cost.
This model explores whether model merging can reduce reasoning verbosity without requiring additional training.
By merging a reasoning model (DeepSeek-R1-Distill-Qwen-7B) with a compact mathematical model (Qwen2.5-Math-7B) using Sensitivity-aware Model Merging, the merged model:
We additionally compared Sens Merging with a DPO-trained model:
| Model | Avg Accuracy | Avg Tokens |
|---|---|---|
| DeepSeek-R1-Distill-Qwen-7B | 69.4 | 2826 |
| DPO | 68.55 | 2402 |
| Sens Merge (λ=0.4) | 66.9 | 701 |
Sens Merging achieves a much larger reduction in output length while remaining competitive in accuracy.
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "quangdung/Qwen2.5-Math-DeepSeekR1-Sens-7B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
prompt = "Solve: If x^2 + 5x + 6 = 0, find x."
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))