Upload folder using huggingface_hub
Browse files
.gitattributes
CHANGED
|
@@ -35,3 +35,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
DeepSeek-R1-Distill-Qwen-1.5B-baseline.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
DeepSeek-R1-Distill-Qwen-1.5B-pct5.gguf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
DeepSeek-R1-Distill-Qwen-1.5B-baseline.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
DeepSeek-R1-Distill-Qwen-1.5B-pct5.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
benchmark_plots/gpqa_pass1_benchmark.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
benchmark_plots/gsm8k_benchmark.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
benchmark_plots/math500_pass1_benchmark.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -10,4 +10,393 @@ library_name: transformers
|
|
| 10 |
language:
|
| 11 |
- en
|
| 12 |
license: mit
|
| 13 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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quantized Models for DeepSeek-R1-Distill-Qwen-1.5B with Strong Reasoning Accuracy
|
| 15 |
+
|
| 16 |
+
<br>
|
| 17 |
+
|
| 18 |
+
* * *
|
| 19 |
+
|
| 20 |
+
<br>
|
| 21 |
+
|
| 22 |
+
## Introduction
|
| 23 |
+
|
| 24 |
+
The **DeepSeek-R1-Distill-Qwen-1.5B** model is a distilled variant of the Qwen language model, designed to offer efficient inference while preserving strong reasoning capabilities. Quantization is commonly used to compress models by representing their weights and activations in reduced precision formats, improving speed and memory efficiency.
|
| 25 |
+
|
| 26 |
+
This report presents a comparative study of quantized variants of the **DeepSeek-R1-Distill-Qwen-1.5B** language model. Two models developed using quantization-aware training (QAT) are evaluated: **DheyoAI/DeepSeek-R1-Distill-Qwen-1.5B-baseline (Dheyo baseline)** (1.74 GB) and **DheyoAI/DeepSeek-R1-Distill-Qwen-1.5B-pct5 (Dheyo pct5)** (1.57 GB). These models are benchmarked against the original full-precision model **deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B** (3.39 GB) and two quantized baselines from Unsloth: **unsloth/DeepSeek-R1-Distill-Qwen-1.5B-Q8\_0** (1.89 GB) and **unsloth/DeepSeek-R1-Distill-Qwen-1.5B-Q5\_K\_M** (1.29 GB).
|
| 27 |
+
|
| 28 |
+
<br>
|
| 29 |
+
|
| 30 |
+
* * *
|
| 31 |
+
|
| 32 |
+
<br>
|
| 33 |
+
|
| 34 |
+
## TL;DR
|
| 35 |
+
|
| 36 |
+
- **DheyoAI/DeepSeek-R1-Distill-Qwen-1.5B-baseline** (Dheyo baseline) is a quantized 1.74 GB model with the highest GSM8K accuracy (78.92%) among all variants.
|
| 37 |
+
- It outperforms **unsloth/DeepSeek-R1-Distill-Qwen-1.5B-Q8\_0** on GPQA Diamond (31.82% vs 18.19%) despite being smaller.
|
| 38 |
+
- Math500 accuracy (79.8%) is close to the full model and Unsloth Q8\_0, with consistent AIME 2024 performance.
|
| 39 |
+
- **DheyoAI/DeepSeek-R1-Distill-Qwen-1.5B-pct5** (Dheyo pct) compresses further to 1.57 GB with GSM8K accuracy of 77.18%.
|
| 40 |
+
- It scores 28.28% on GPQA Diamond and 80.2% on Math500, maintaining strong accuracy with lower size.
|
| 41 |
+
- Both models lie within the accuracy–size “Sweet Spot” and are efficient for reasoning tasks under memory constraints.
|
| 42 |
+
|
| 43 |
+
<br>
|
| 44 |
+
|
| 45 |
+
* * *
|
| 46 |
+
|
| 47 |
+
<br>
|
| 48 |
+
|
| 49 |
+
## Why These Models Were Compared
|
| 50 |
+
|
| 51 |
+
To assess the effectiveness of Dheyo Quantization, we evaluate two Dheyo models, **DheyoAI/DeepSeek-R1-Distill-Qwen-1.5B-baseline (Dheyo baseline)** (1.74 GB) and **DheyoAI/DeepSeek-R1-Distill-Qwen-1.5B-pct5 (Dheyo pct5)** (1.57 GB) against relevant baselines with similar architecture and comparable size.
|
| 52 |
+
|
| 53 |
+
The original full-precision model (BFloat16), **deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B** (3.39 GB), is included to serve as an upper bound on reasoning accuracy without any compression.
|
| 54 |
+
|
| 55 |
+
For quantized baselines, we use **unsloth/DeepSeek-R1-Distill-Qwen-1.5B-Q8\_0** (1.89 GB) and **unsloth/DeepSeek-R1-Distill-Qwen-1.5B-Q5\_K\_M** (1.29 GB), as their model sizes are similar to the Dheyo quantized model variants.
|
| 56 |
+
|
| 57 |
+
<br>
|
| 58 |
+
|
| 59 |
+
* * *
|
| 60 |
+
|
| 61 |
+
<br>
|
| 62 |
+
|
| 63 |
+
## Hardware Used
|
| 64 |
+
|
| 65 |
+
The quantization-aware training (QAT) of the Dheyo models and the benchmarking of all model variants were conducted on a cluster equipped with **AMD Instinct MI300X GPUs**. Each GPU provides 192 GB of HBM3 memory and high memory bandwidth, making them well-suited for running large quantized models efficiently. All evaluations were performed using the **llama.cpp** backend, optimized for low-precision inference.
|
| 66 |
+
|
| 67 |
+
<br>
|
| 68 |
+
|
| 69 |
+
* * *
|
| 70 |
+
|
| 71 |
+
<br>
|
| 72 |
+
|
| 73 |
+
## Benchmark Results
|
| 74 |
+
|
| 75 |
+
### Math500 Pass@1 and GPQA Diamond Pass@1 Benchmarks
|
| 76 |
+
|
| 77 |
+
Math500 Pass@1 and GPQA Diamond Pass@1evaluations follow the official usage recommendations provided by DeepSeek. Specifically, inference was run with temperature = 0.6, max\_length = 32678, and prompt format as recommended. The benchmark results presented here were obtained using these exact settings.
|
| 78 |
+
|
| 79 |
+
We evaluate model performance on two reasoning benchmarks: **Math500 Pass@1**, which measures symbolic math accuracy, and **GPQA Diamond Pass@1**, which tests factual multiple-choice science questions.
|
| 80 |
+
|
| 81 |
+
<br>
|
| 82 |
+
|
| 83 |
+
| **Model** | **GPQA Diamond Pass@1 (%)** | **Math500 Pass@1 (%)** | **Size (GB)** |
|
| 84 |
+
| --- | --- | --- | --- |
|
| 85 |
+
| deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B | 33.8 | 83.9 | 3.39 |
|
| 86 |
+
| DheyoAI/DeepSeek-R1-Distill-Qwen-1.5B-baseline | **31.82** | 79.8 | 1.74 |
|
| 87 |
+
| DheyoAI/DeepSeek-R1-Distill-Qwen-1.5B-pct5 | 28.28 | 80.2 | 1.57 |
|
| 88 |
+
| unsloth/DeepSeek-R1-Distill-Qwen-1.5B-Q8\_0 | 18.19 | **81.4** | 1.89 |
|
| 89 |
+
| unsloth/DeepSeek-R1-Distill-Qwen-1.5B-Q5\_K\_M | 19.7 | 76.8 | 1.29 |
|
| 90 |
+
|
| 91 |
+
_Note: Bold values indicate the best-performing quantized model; underlined values indicate the second-best._
|
| 92 |
+
|
| 93 |
+
<br>
|
| 94 |
+
|
| 95 |
+
On **GPQA Diamond Pass@1**, both Dheyo models maintain relatively high factual accuracy while reducing model size significantly compared to the full-precision baseline. The **Dheyo baseline model scores 31.82% and the smaller pct5 variant scores 28.28%**, both within a few points of the original’s 33.8%. The Unsloth variants show lower performance in this benchmark.
|
| 96 |
+
|
| 97 |
+
In Figure 1, both Dheyo models fall well within the green “Sweet Spot” which indicates a favorable balance between factual accuracy and model size relative to the Unsloth quantized models. Their positioning reflects efficient performance on factual QA tasks relative to their memory footprint.
|
| 98 |
+
|
| 99 |
+
<br>
|
| 100 |
+
|
| 101 |
+
_Figure 1: Factual Reasoning (GPQA Diamond Pass@1): Accuracy vs Model Size_
|
| 102 |
+
|
| 103 |
+
**<br>
|
| 104 |
+
**
|
| 105 |
+
|
| 106 |
+
In **Math500 Pass@1**, the Dheyo models perform consistently, **scoring 79.8% (Dheyo baseline) and 80.2% (Dheyo pct)** as shown in Figure 2. While unsloth/DeepSeek-R1-Distill-Qwen-1.5B-Q8\_0 achieves slightly higher accuracy at 81.4%, it does so with a larger model size.
|
| 107 |
+

|
| 108 |
+
|
| 109 |
+
_Figure 2: Symbolic Math (Math500): Accuracy vs Model Size_
|
| 110 |
+
|
| 111 |
+
## <br>
|
| 112 |
+
|
| 113 |
+
### GSM8K Benchmark
|
| 114 |
+
|
| 115 |
+
All GSM8K evaluations follow temperature = 0.8, max\_length = 1024, and prompt as recommended. Dheyo baseline and pct5 models were trained using quantization-aware training (QAT) on 95% of the GSM8K training data.
|
| 116 |
+
|
| 117 |
+
<br>
|
| 118 |
+
|
| 119 |
+
| **Model** | **GSM8K Accuracy (%)** | **Model Size (GB)** |
|
| 120 |
+
| --- | --- | --- |
|
| 121 |
+
| deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B | 76.88 | 3.39 |
|
| 122 |
+
| DheyoAI/DeepSeek-R1-Distill-Qwen-1.5B-baseline | 78.92 | 1.74 |
|
| 123 |
+
| DheyoAI/DeepSeek-R1-Distill-Qwen-1.5B-pct5 | 77.18 | 1.57 |
|
| 124 |
+
| unsloth/DeepSeek-R1-Distill-Qwen-1.5B-Q8\_0 | 78.47 | 1.89 |
|
| 125 |
+
| unsloth/DeepSeek-R1-Distill-Qwen-1.5B-Q5\_K\_M | 76.65 | 1.29 |
|
| 126 |
+
|
| 127 |
+
<br>
|
| 128 |
+
|
| 129 |
+
The **Dheyo baseline model achieves the highest GSM8K accuracy at 78.92**%, outperforming all other models in this evaluation, including the original full-precision model and Unsloth Q8\_0. The **Dheyo pct5 model also performs well at 77.18%**, with a further reduction in size to 1.57 GB.
|
| 130 |
+
|
| 131 |
+
In the GSM8K figure, Dheyo baseline model lies inside the green “Sweet Spot”.
|
| 132 |
+
|
| 133 |
+
<br>
|
| 134 |
+
|
| 135 |
+
_Figure 3: Arithmetic Reasoning (GSM8K): Accuracy vs Model Size_
|
| 136 |
+
|
| 137 |
+
<br>
|
| 138 |
+
|
| 139 |
+
### AIME 2024 Benchmarks
|
| 140 |
+
|
| 141 |
+
Cons@64 checks whether the most frequently predicted answer across 64 attempts by the model is correct. It measures if the model consistently converges on the right answer.
|
| 142 |
+
|
| 143 |
+
The **Dheyo baseline model**, marked in red in Figure 4, achieves an accuracy of **53.33%**, which is the highest observed, matching the performance of the Unsloth quantized model and outperforming the original DeepSeek-AI model (52.70%)
|
| 144 |
+
|
| 145 |
+
<br>
|
| 146 |
+
|
| 147 |
+
| **Dataset** | DheyoAI/DeepSeek-R1-Distill-Qwen-1.5B-baseline | unsloth/DeepSeek-R1-Distill-Qwen-1.5B-Q8\_0 | deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B |
|
| 148 |
+
| --- | --- | --- | --- |
|
| 149 |
+
| AIME 2024 Cons@64 | 53.33 | 53.33 | 52.70 |
|
| 150 |
+
|
| 151 |
+
<br>
|
| 152 |
+
|
| 153 |
+
<br>
|
| 154 |
+
|
| 155 |
+
_Figure 4: AIME 2024: Accuracy Comparison on Cons@64_
|
| 156 |
+
|
| 157 |
+
### <br>
|
| 158 |
+
|
| 159 |
+
* * *
|
| 160 |
+
|
| 161 |
+
<br>
|
| 162 |
+
|
| 163 |
+
---
|
| 164 |
+
license: mit
|
| 165 |
+
library_name: transformers
|
| 166 |
+
---
|
| 167 |
+
# DeepSeek-R1
|
| 168 |
+
<!-- markdownlint-disable first-line-h1 -->
|
| 169 |
+
<!-- markdownlint-disable html -->
|
| 170 |
+
<!-- markdownlint-disable no-duplicate-header -->
|
| 171 |
+
|
| 172 |
+
<div align="center">
|
| 173 |
+
<img src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/logo.svg?raw=true" width="60%" alt="DeepSeek-V3" />
|
| 174 |
+
</div>
|
| 175 |
+
<hr>
|
| 176 |
+
<div align="center" style="line-height: 1;">
|
| 177 |
+
<a href="https://www.deepseek.com/" target="_blank" style="margin: 2px;">
|
| 178 |
+
<img alt="Homepage" src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/badge.svg?raw=true" style="display: inline-block; vertical-align: middle;"/>
|
| 179 |
+
</a>
|
| 180 |
+
<a href="https://chat.deepseek.com/" target="_blank" style="margin: 2px;">
|
| 181 |
+
<img alt="Chat" src="https://img.shields.io/badge/🤖%20Chat-DeepSeek%20R1-536af5?color=536af5&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
|
| 182 |
+
</a>
|
| 183 |
+
<a href="https://huggingface.co/deepseek-ai" target="_blank" style="margin: 2px;">
|
| 184 |
+
<img alt="Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-DeepSeek%20AI-ffc107?color=ffc107&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
|
| 185 |
+
</a>
|
| 186 |
+
</div>
|
| 187 |
+
|
| 188 |
+
<div align="center" style="line-height: 1;">
|
| 189 |
+
<a href="https://discord.gg/Tc7c45Zzu5" target="_blank" style="margin: 2px;">
|
| 190 |
+
<img alt="Discord" src="https://img.shields.io/badge/Discord-DeepSeek%20AI-7289da?logo=discord&logoColor=white&color=7289da" style="display: inline-block; vertical-align: middle;"/>
|
| 191 |
+
</a>
|
| 192 |
+
<a href="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/qr.jpeg?raw=true" target="_blank" style="margin: 2px;">
|
| 193 |
+
<img alt="Wechat" src="https://img.shields.io/badge/WeChat-DeepSeek%20AI-brightgreen?logo=wechat&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
|
| 194 |
+
</a>
|
| 195 |
+
<a href="https://twitter.com/deepseek_ai" target="_blank" style="margin: 2px;">
|
| 196 |
+
<img alt="Twitter Follow" src="https://img.shields.io/badge/Twitter-deepseek_ai-white?logo=x&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
|
| 197 |
+
</a>
|
| 198 |
+
</div>
|
| 199 |
+
|
| 200 |
+
<div align="center" style="line-height: 1;">
|
| 201 |
+
<a href="https://github.com/deepseek-ai/DeepSeek-R1/blob/main/LICENSE" style="margin: 2px;">
|
| 202 |
+
<img alt="License" src="https://img.shields.io/badge/License-MIT-f5de53?&color=f5de53" style="display: inline-block; vertical-align: middle;"/>
|
| 203 |
+
</a>
|
| 204 |
+
</div>
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
<p align="center">
|
| 208 |
+
<a href="https://github.com/deepseek-ai/DeepSeek-R1/blob/main/DeepSeek_R1.pdf"><b>Paper Link</b>👁️</a>
|
| 209 |
+
</p>
|
| 210 |
+
|
| 211 |
+
|
| 212 |
+
## 1. Introduction
|
| 213 |
+
|
| 214 |
+
We introduce our first-generation reasoning models, DeepSeek-R1-Zero and DeepSeek-R1.
|
| 215 |
+
DeepSeek-R1-Zero, a model trained via large-scale reinforcement learning (RL) without supervised fine-tuning (SFT) as a preliminary step, demonstrated remarkable performance on reasoning.
|
| 216 |
+
With RL, DeepSeek-R1-Zero naturally emerged with numerous powerful and interesting reasoning behaviors.
|
| 217 |
+
However, DeepSeek-R1-Zero encounters challenges such as endless repetition, poor readability, and language mixing. To address these issues and further enhance reasoning performance,
|
| 218 |
+
we introduce DeepSeek-R1, which incorporates cold-start data before RL.
|
| 219 |
+
DeepSeek-R1 achieves performance comparable to OpenAI-o1 across math, code, and reasoning tasks.
|
| 220 |
+
To support the research community, we have open-sourced DeepSeek-R1-Zero, DeepSeek-R1, and six dense models distilled from DeepSeek-R1 based on Llama and Qwen. DeepSeek-R1-Distill-Qwen-32B outperforms OpenAI-o1-mini across various benchmarks, achieving new state-of-the-art results for dense models.
|
| 221 |
+
|
| 222 |
+
**NOTE: Before running DeepSeek-R1 series models locally, we kindly recommend reviewing the [Usage Recommendation](#usage-recommendations) section.**
|
| 223 |
+
|
| 224 |
+
<p align="center">
|
| 225 |
+
<img width="80%" src="figures/benchmark.jpg">
|
| 226 |
+
</p>
|
| 227 |
+
|
| 228 |
+
## 2. Model Summary
|
| 229 |
+
|
| 230 |
+
---
|
| 231 |
+
|
| 232 |
+
**Post-Training: Large-Scale Reinforcement Learning on the Base Model**
|
| 233 |
+
|
| 234 |
+
- We directly apply reinforcement learning (RL) to the base model without relying on supervised fine-tuning (SFT) as a preliminary step. This approach allows the model to explore chain-of-thought (CoT) for solving complex problems, resulting in the development of DeepSeek-R1-Zero. DeepSeek-R1-Zero demonstrates capabilities such as self-verification, reflection, and generating long CoTs, marking a significant milestone for the research community. Notably, it is the first open research to validate that reasoning capabilities of LLMs can be incentivized purely through RL, without the need for SFT. This breakthrough paves the way for future advancements in this area.
|
| 235 |
+
|
| 236 |
+
- We introduce our pipeline to develop DeepSeek-R1. The pipeline incorporates two RL stages aimed at discovering improved reasoning patterns and aligning with human preferences, as well as two SFT stages that serve as the seed for the model's reasoning and non-reasoning capabilities.
|
| 237 |
+
We believe the pipeline will benefit the industry by creating better models.
|
| 238 |
+
|
| 239 |
+
---
|
| 240 |
+
|
| 241 |
+
**Distillation: Smaller Models Can Be Powerful Too**
|
| 242 |
+
|
| 243 |
+
- We demonstrate that the reasoning patterns of larger models can be distilled into smaller models, resulting in better performance compared to the reasoning patterns discovered through RL on small models. The open source DeepSeek-R1, as well as its API, will benefit the research community to distill better smaller models in the future.
|
| 244 |
+
- Using the reasoning data generated by DeepSeek-R1, we fine-tuned several dense models that are widely used in the research community. The evaluation results demonstrate that the distilled smaller dense models perform exceptionally well on benchmarks. We open-source distilled 1.5B, 7B, 8B, 14B, 32B, and 70B checkpoints based on Qwen2.5 and Llama3 series to the community.
|
| 245 |
+
|
| 246 |
+
## 3. Model Downloads
|
| 247 |
+
|
| 248 |
+
### DeepSeek-R1 Models
|
| 249 |
+
|
| 250 |
+
<div align="center">
|
| 251 |
+
|
| 252 |
+
| **Model** | **#Total Params** | **#Activated Params** | **Context Length** | **Download** |
|
| 253 |
+
| :------------: | :------------: | :------------: | :------------: | :------------: |
|
| 254 |
+
| DeepSeek-R1-Zero | 671B | 37B | 128K | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Zero) |
|
| 255 |
+
| DeepSeek-R1 | 671B | 37B | 128K | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1) |
|
| 256 |
+
|
| 257 |
+
</div>
|
| 258 |
+
|
| 259 |
+
DeepSeek-R1-Zero & DeepSeek-R1 are trained based on DeepSeek-V3-Base.
|
| 260 |
+
For more details regarding the model architecture, please refer to [DeepSeek-V3](https://github.com/deepseek-ai/DeepSeek-V3) repository.
|
| 261 |
+
|
| 262 |
+
### DeepSeek-R1-Distill Models
|
| 263 |
+
|
| 264 |
+
<div align="center">
|
| 265 |
+
|
| 266 |
+
| **Model** | **Base Model** | **Download** |
|
| 267 |
+
| :------------: | :------------: | :------------: |
|
| 268 |
+
| DeepSeek-R1-Distill-Qwen-1.5B | [Qwen2.5-Math-1.5B](https://huggingface.co/Qwen/Qwen2.5-Math-1.5B) | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B) |
|
| 269 |
+
| DeepSeek-R1-Distill-Qwen-7B | [Qwen2.5-Math-7B](https://huggingface.co/Qwen/Qwen2.5-Math-7B) | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B) |
|
| 270 |
+
| DeepSeek-R1-Distill-Llama-8B | [Llama-3.1-8B](https://huggingface.co/meta-llama/Llama-3.1-8B) | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B) |
|
| 271 |
+
| DeepSeek-R1-Distill-Qwen-14B | [Qwen2.5-14B](https://huggingface.co/Qwen/Qwen2.5-14B) | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B) |
|
| 272 |
+
|DeepSeek-R1-Distill-Qwen-32B | [Qwen2.5-32B](https://huggingface.co/Qwen/Qwen2.5-32B) | [��� HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B) |
|
| 273 |
+
| DeepSeek-R1-Distill-Llama-70B | [Llama-3.3-70B-Instruct](https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct) | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-70B) |
|
| 274 |
+
|
| 275 |
+
</div>
|
| 276 |
+
|
| 277 |
+
DeepSeek-R1-Distill models are fine-tuned based on open-source models, using samples generated by DeepSeek-R1.
|
| 278 |
+
We slightly change their configs and tokenizers. Please use our setting to run these models.
|
| 279 |
+
|
| 280 |
+
## 4. Evaluation Results
|
| 281 |
+
|
| 282 |
+
### DeepSeek-R1-Evaluation
|
| 283 |
+
For all our models, the maximum generation length is set to 32,768 tokens. For benchmarks requiring sampling, we use a temperature of $0.6$, a top-p value of $0.95$, and generate 64 responses per query to estimate pass@1.
|
| 284 |
+
<div align="center">
|
| 285 |
+
|
| 286 |
+
|
| 287 |
+
| Category | Benchmark (Metric) | Claude-3.5-Sonnet-1022 | GPT-4o 0513 | DeepSeek V3 | OpenAI o1-mini | OpenAI o1-1217 | DeepSeek R1 |
|
| 288 |
+
|----------|-------------------|----------------------|------------|--------------|----------------|------------|--------------|
|
| 289 |
+
| | Architecture | - | - | MoE | - | - | MoE |
|
| 290 |
+
| | # Activated Params | - | - | 37B | - | - | 37B |
|
| 291 |
+
| | # Total Params | - | - | 671B | - | - | 671B |
|
| 292 |
+
| English | MMLU (Pass@1) | 88.3 | 87.2 | 88.5 | 85.2 | **91.8** | 90.8 |
|
| 293 |
+
| | MMLU-Redux (EM) | 88.9 | 88.0 | 89.1 | 86.7 | - | **92.9** |
|
| 294 |
+
| | MMLU-Pro (EM) | 78.0 | 72.6 | 75.9 | 80.3 | - | **84.0** |
|
| 295 |
+
| | DROP (3-shot F1) | 88.3 | 83.7 | 91.6 | 83.9 | 90.2 | **92.2** |
|
| 296 |
+
| | IF-Eval (Prompt Strict) | **86.5** | 84.3 | 86.1 | 84.8 | - | 83.3 |
|
| 297 |
+
| | GPQA-Diamond (Pass@1) | 65.0 | 49.9 | 59.1 | 60.0 | **75.7** | 71.5 |
|
| 298 |
+
| | SimpleQA (Correct) | 28.4 | 38.2 | 24.9 | 7.0 | **47.0** | 30.1 |
|
| 299 |
+
| | FRAMES (Acc.) | 72.5 | 80.5 | 73.3 | 76.9 | - | **82.5** |
|
| 300 |
+
| | AlpacaEval2.0 (LC-winrate) | 52.0 | 51.1 | 70.0 | 57.8 | - | **87.6** |
|
| 301 |
+
| | ArenaHard (GPT-4-1106) | 85.2 | 80.4 | 85.5 | 92.0 | - | **92.3** |
|
| 302 |
+
| Code | LiveCodeBench (Pass@1-COT) | 33.8 | 34.2 | - | 53.8 | 63.4 | **65.9** |
|
| 303 |
+
| | Codeforces (Percentile) | 20.3 | 23.6 | 58.7 | 93.4 | **96.6** | 96.3 |
|
| 304 |
+
| | Codeforces (Rating) | 717 | 759 | 1134 | 1820 | **2061** | 2029 |
|
| 305 |
+
| | SWE Verified (Resolved) | **50.8** | 38.8 | 42.0 | 41.6 | 48.9 | 49.2 |
|
| 306 |
+
| | Aider-Polyglot (Acc.) | 45.3 | 16.0 | 49.6 | 32.9 | **61.7** | 53.3 |
|
| 307 |
+
| Math | AIME 2024 (Pass@1) | 16.0 | 9.3 | 39.2 | 63.6 | 79.2 | **79.8** |
|
| 308 |
+
| | MATH-500 (Pass@1) | 78.3 | 74.6 | 90.2 | 90.0 | 96.4 | **97.3** |
|
| 309 |
+
| | CNMO 2024 (Pass@1) | 13.1 | 10.8 | 43.2 | 67.6 | - | **78.8** |
|
| 310 |
+
| Chinese | CLUEWSC (EM) | 85.4 | 87.9 | 90.9 | 89.9 | - | **92.8** |
|
| 311 |
+
| | C-Eval (EM) | 76.7 | 76.0 | 86.5 | 68.9 | - | **91.8** |
|
| 312 |
+
| | C-SimpleQA (Correct) | 55.4 | 58.7 | **68.0** | 40.3 | - | 63.7 |
|
| 313 |
+
|
| 314 |
+
</div>
|
| 315 |
+
|
| 316 |
+
|
| 317 |
+
### Distilled Model Evaluation
|
| 318 |
+
|
| 319 |
+
|
| 320 |
+
<div align="center">
|
| 321 |
+
|
| 322 |
+
| Model | AIME 2024 pass@1 | AIME 2024 cons@64 | MATH-500 pass@1 | GPQA Diamond pass@1 | LiveCodeBench pass@1 | CodeForces rating |
|
| 323 |
+
|------------------------------------------|------------------|-------------------|-----------------|----------------------|----------------------|-------------------|
|
| 324 |
+
| GPT-4o-0513 | 9.3 | 13.4 | 74.6 | 49.9 | 32.9 | 759 |
|
| 325 |
+
| Claude-3.5-Sonnet-1022 | 16.0 | 26.7 | 78.3 | 65.0 | 38.9 | 717 |
|
| 326 |
+
| o1-mini | 63.6 | 80.0 | 90.0 | 60.0 | 53.8 | **1820** |
|
| 327 |
+
| QwQ-32B-Preview | 44.0 | 60.0 | 90.6 | 54.5 | 41.9 | 1316 |
|
| 328 |
+
| DeepSeek-R1-Distill-Qwen-1.5B | 28.9 | 52.7 | 83.9 | 33.8 | 16.9 | 954 |
|
| 329 |
+
| DeepSeek-R1-Distill-Qwen-7B | 55.5 | 83.3 | 92.8 | 49.1 | 37.6 | 1189 |
|
| 330 |
+
| DeepSeek-R1-Distill-Qwen-14B | 69.7 | 80.0 | 93.9 | 59.1 | 53.1 | 1481 |
|
| 331 |
+
| DeepSeek-R1-Distill-Qwen-32B | **72.6** | 83.3 | 94.3 | 62.1 | 57.2 | 1691 |
|
| 332 |
+
| DeepSeek-R1-Distill-Llama-8B | 50.4 | 80.0 | 89.1 | 49.0 | 39.6 | 1205 |
|
| 333 |
+
| DeepSeek-R1-Distill-Llama-70B | 70.0 | **86.7** | **94.5** | **65.2** | **57.5** | 1633 |
|
| 334 |
+
|
| 335 |
+
</div>
|
| 336 |
+
|
| 337 |
+
|
| 338 |
+
## 5. Chat Website & API Platform
|
| 339 |
+
You can chat with DeepSeek-R1 on DeepSeek's official website: [chat.deepseek.com](https://chat.deepseek.com), and switch on the button "DeepThink"
|
| 340 |
+
|
| 341 |
+
We also provide OpenAI-Compatible API at DeepSeek Platform: [platform.deepseek.com](https://platform.deepseek.com/)
|
| 342 |
+
|
| 343 |
+
## 6. How to Run Locally
|
| 344 |
+
|
| 345 |
+
### DeepSeek-R1 Models
|
| 346 |
+
|
| 347 |
+
Please visit [DeepSeek-V3](https://github.com/deepseek-ai/DeepSeek-V3) repo for more information about running DeepSeek-R1 locally.
|
| 348 |
+
|
| 349 |
+
**NOTE: Hugging Face's Transformers has not been directly supported yet.**
|
| 350 |
+
|
| 351 |
+
### DeepSeek-R1-Distill Models
|
| 352 |
+
|
| 353 |
+
DeepSeek-R1-Distill models can be utilized in the same manner as Qwen or Llama models.
|
| 354 |
+
|
| 355 |
+
For instance, you can easily start a service using [vLLM](https://github.com/vllm-project/vllm):
|
| 356 |
+
|
| 357 |
+
```shell
|
| 358 |
+
vllm serve deepseek-ai/DeepSeek-R1-Distill-Qwen-32B --tensor-parallel-size 2 --max-model-len 32768 --enforce-eager
|
| 359 |
+
```
|
| 360 |
+
|
| 361 |
+
You can also easily start a service using [SGLang](https://github.com/sgl-project/sglang)
|
| 362 |
+
|
| 363 |
+
```bash
|
| 364 |
+
python3 -m sglang.launch_server --model deepseek-ai/DeepSeek-R1-Distill-Qwen-32B --trust-remote-code --tp 2
|
| 365 |
+
```
|
| 366 |
+
|
| 367 |
+
### Usage Recommendations
|
| 368 |
+
|
| 369 |
+
**We recommend adhering to the following configurations when utilizing the DeepSeek-R1 series models, including benchmarking, to achieve the expected performance:**
|
| 370 |
+
|
| 371 |
+
1. Set the temperature within the range of 0.5-0.7 (0.6 is recommended) to prevent endless repetitions or incoherent outputs.
|
| 372 |
+
2. **Avoid adding a system prompt; all instructions should be contained within the user prompt.**
|
| 373 |
+
3. For mathematical problems, it is advisable to include a directive in your prompt such as: "Please reason step by step, and put your final answer within \boxed{}."
|
| 374 |
+
4. When evaluating model performance, it is recommended to conduct multiple tests and average the results.
|
| 375 |
+
|
| 376 |
+
Additionally, we have observed that the DeepSeek-R1 series models tend to bypass thinking pattern (i.e., outputting "\<think\>\n\n\</think\>") when responding to certain queries, which can adversely affect the model's performance.
|
| 377 |
+
**To ensure that the model engages in thorough reasoning, we recommend enforcing the model to initiate its response with "\<think\>\n" at the beginning of every output.**
|
| 378 |
+
|
| 379 |
+
## 7. License
|
| 380 |
+
This code repository and the model weights are licensed under the [MIT License](https://github.com/deepseek-ai/DeepSeek-R1/blob/main/LICENSE).
|
| 381 |
+
DeepSeek-R1 series support commercial use, allow for any modifications and derivative works, including, but not limited to, distillation for training other LLMs. Please note that:
|
| 382 |
+
- DeepSeek-R1-Distill-Qwen-1.5B, DeepSeek-R1-Distill-Qwen-7B, DeepSeek-R1-Distill-Qwen-14B and DeepSeek-R1-Distill-Qwen-32B are derived from [Qwen-2.5 series](https://github.com/QwenLM/Qwen2.5), which are originally licensed under [Apache 2.0 License](https://huggingface.co/Qwen/Qwen2.5-1.5B/blob/main/LICENSE), and now finetuned with 800k samples curated with DeepSeek-R1.
|
| 383 |
+
- DeepSeek-R1-Distill-Llama-8B is derived from Llama3.1-8B-Base and is originally licensed under [llama3.1 license](https://huggingface.co/meta-llama/Llama-3.1-8B/blob/main/LICENSE).
|
| 384 |
+
- DeepSeek-R1-Distill-Llama-70B is derived from Llama3.3-70B-Instruct and is originally licensed under [llama3.3 license](https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct/blob/main/LICENSE).
|
| 385 |
+
|
| 386 |
+
## 8. Citation
|
| 387 |
+
```
|
| 388 |
+
@misc{deepseekai2025deepseekr1incentivizingreasoningcapability,
|
| 389 |
+
title={DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning},
|
| 390 |
+
author={DeepSeek-AI},
|
| 391 |
+
year={2025},
|
| 392 |
+
eprint={2501.12948},
|
| 393 |
+
archivePrefix={arXiv},
|
| 394 |
+
primaryClass={cs.CL},
|
| 395 |
+
url={https://arxiv.org/abs/2501.12948},
|
| 396 |
+
}
|
| 397 |
+
|
| 398 |
+
```
|
| 399 |
+
|
| 400 |
+
## 9. Contact
|
| 401 |
+
If you have any questions, please raise an issue or contact us at [service@deepseek.com](service@deepseek.com).
|
| 402 |
+
|
benchmark_plots/aime_cons@64_benchmark_plot.png
ADDED
|
benchmark_plots/gpqa_pass1_benchmark.png
ADDED
|
Git LFS Details
|
benchmark_plots/gsm8k_benchmark.png
ADDED
|
Git LFS Details
|
benchmark_plots/math500_pass1_benchmark.png
ADDED
|
Git LFS Details
|