---
title: DeepSeek-R1-Distill-Qwen-14B-Math
canonical_url: "https://www.modelscope.cn/models/Rentuiteam/DeepSeek-R1-Distill-Qwen-14B-Math"
md_url: "https://www.modelscope.cn/models/Rentuiteam/DeepSeek-R1-Distill-Qwen-14B-Math.md"
repository: Rentuiteam/DeepSeek-R1-Distill-Qwen-14B-Math
chinese_name: DeepSeek-R1-Distill-Qwen-14B-Math
last_updated: 2026-06-06
license: "Apache License 2.0"
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - qwen2
architectures:
  - Qwen2ForCausalLM
base_model:
  - deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
base_model_relation: finetune
parameters: 14.8B
tensor_type:
  - BF16
library_name:
  - pytorch
  - transformer
  - safetensors
frameworks:
  - Pytorch
downloads: 44
stars: 0
---

# DeepSeek-R1-Distill-Qwen-14B-Math

> DeepSeek-R1-Distill-Qwen-14B-Math - Rentuiteam 在 ModelScope 开源的模型。本模型基于 DeepSeek-R1-Distill-Qwen-14B，使用 MathR 数学推理数据集进行了微调，模型专注于数学问题求解，擅长进行分步骤推理，并使用 LaTeX 格式输出答案。

Rentuiteam/DeepSeek-R1-Distill-Qwen-14B-Math 是 ModelScope 魔搭社区上的 14.8B 参数text-generation模型，采用 Apache License 2.0 许可，基于 deepseek-ai/DeepSeek-R1-Distill-Qwen-14B 构建。

- **Repository**: Rentuiteam/DeepSeek-R1-Distill-Qwen-14B-Math
- **License**: Apache License 2.0
- **Tasks**: text-generation
- **Parameters**: 14.8B
- **Base model**: deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
- **Downloads**: 44
- **Stars**: 0
- **Last updated**: 2026-06-06

Source: https://www.modelscope.cn/models/Rentuiteam/DeepSeek-R1-Distill-Qwen-14B-Math

---

```markdown
# DeepSeek-R1-Distill-Qwen-14B-Math

## 📌 模型描述
本模型是基于 **[DeepSeek-R1-Distill-Qwen-14B](https://modelscope.cn/models/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B)** 进行微调的数学推理模型。它专门用于解决数学问题，擅长生成分步骤、带有LaTeX公式的解题过程，并输出 `\boxed{}` 格式的最终答案。

## 🚀 快速使用

### 环境准备
```python
pip install modelscope transformers torch
```

### Python推理示例
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from modelscope import snapshot_download

# 下载模型
model_dir = snapshot_download('Rentuiteam/DeepSeek-R1-Distill-Qwen-14B-Math')

# 加载模型和分词器
model = AutoModelForCausalLM.from_pretrained(
    model_dir,
    device_map="auto",
    torch_dtype=torch.bfloat16,
    trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(model_dir, trust_remote_code=True)

# 测试用例
prompt = "问题: 一个长方形的长是15米，宽是8米，它的面积是多少？\n\n解答:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

# 生成回答
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response[len(prompt):])
```

## ⚙️ 训练与优化细节
- **基座模型**: `deepseek-ai/DeepSeek-R1-Distill-Qwen-14B`
- **微调数据**: 使用 MathR 数学推理数据集（约500条高质量数据）
- **微调方法**: QLoRA (4-bit) + LoRA (秩=16)
- **上下文长度**: 通过RoPE线性缩放扩展至 **8192 tokens**
- **主要优化**:
  - 增强了分步骤推理能力
  - 规范了LaTeX公式和答案格式(`\boxed{}`)
  - 支持更长数学题的上下文理解

## 📊 模型表现 (人工评测)
| 任务类型 | 示例问题 | 模型表现 |
| :--- | :--- | :--- |
| 小学算术 | 小明有15个苹果，给了小红5个，又买了8个，现在有多少？ | 正确分步计算，答案18 |
| 一元一次方程 | 解方程 3x+5=20 | 完整步骤，答案x=5 |
| 几何面积 | 半径5cm的圆面积(π=3.14) | 正确使用公式，答案78.5 |
| 整数性质 | 求所有正整数n使 n²+2n+3是质数 | 正确推理n=1,3，有待完成 |

## 🙏 致谢
- 感谢 **ModelScope** 和 **阿里云PAI-DSW** 提供的计算资源与平台支持。
- 感谢开源社区贡献的 DeepSeek-R1 和 Qwen 系列模型。
```

<p style="color: lightgrey;">如果您是本模型的贡献者，我们邀请您根据<a href="https://modelscope.cn/docs/ModelScope%E6%A8%A1%E5%9E%8B%E6%8E%A5%E5%85%A5%E6%B5%81%E7%A8%8B%E6%A6%82%E8%A7%88" style="color: lightgrey; text-decoration: underline;">模型贡献文档</a>，及时完善模型卡片内容。</p>
