Update README.md
Browse files
README.md
CHANGED
@@ -55,33 +55,37 @@
|
|
55 |
Today, we’re introducing DeepSeek-V2, a strong Mixture-of-Experts (MoE) language model characterized by economical training and efficient inference. It comprises 236B total parameters, of which 21B are activated for each token. Compared with DeepSeek 67B, DeepSeek-V2 achieves stronger performance, and meanwhile saves 42.5% of training costs, reduces the KV cache by 93.3%, and boosts the maximum generation throughput to 5.76 times.
|
56 |
|
57 |
<p align="center">
|
58 |
-
|
59 |
<div style="display: flex; justify-content: center;">
|
60 |
-
<img src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/activationparameters.png?raw=true" style="height:
|
61 |
-
<img src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/trainingcost.png?raw=true" style="height:
|
62 |
</div>
|
63 |
</p>
|
|
|
64 |
We pretrained DeepSeek-V2 on a diverse and high-quality corpus comprising 8.1 trillion tokens. This comprehensive pretraining was followed by a process of Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL) to fully unleash the model's capabilities. The evaluation results validate the effectiveness of our approach as DeepSeek-V2 achieves remarkable performance on both standard benchmarks and open-ended generation evaluation.
|
65 |
|
66 |
-
## 2.
|
67 |
|
68 |
-
|
|
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
| DeepSeek-V2-Lite-Chat (SFT) | 128k | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-V2-Lite-Chat) |
|
74 |
-
| DeepSeek-V2 | 128k | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-V2) |
|
75 |
-
| DeepSeek-V2-Chat (RL) | 128k | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-V2-Chat) |
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
</div>
|
79 |
|
80 |
Due to the constraints of HuggingFace, the open-source code currently experiences slower performance than our internal codebase when running on GPUs with Huggingface. To facilitate the efficient execution of our model, we offer a dedicated vllm solution that optimizes performance for running our model effectively.
|
81 |
|
82 |
-
##
|
83 |
### Base Model
|
84 |
-
#### Standard Benchmark
|
85 |
|
86 |
<div align="center">
|
87 |
|
@@ -91,11 +95,28 @@ Due to the constraints of HuggingFace, the open-source code currently experience
|
|
91 |
| **BBH** | English | 81.0 | 78.9 | 68.7 | 78.9 |
|
92 |
| **C-Eval** | Chinese | 67.5 | 58.6 | 66.1 | 81.7 |
|
93 |
| **CMMLU** | Chinese | 69.3 | 60.0 | 70.8 | 84.0 |
|
94 |
-
| **HumanEval** | Code | 48.2
|
95 |
| **MBPP** | Code | 68.6 | 64.2 | 57.4 | 66.6 |
|
96 |
| **GSM8K** | Math | 83.0 | 80.3 | 63.4 | 79.2 |
|
97 |
| **Math** | Math | 42.2 | 42.5 | 18.7 | 43.6 |
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
</div>
|
100 |
For more evaluation details, such as few-shot settings and prompts, please check our paper.
|
101 |
|
@@ -107,7 +128,7 @@ For more evaluation details, such as few-shot settings and prompts, please check
|
|
107 |
Evaluation results on the ``Needle In A Haystack`` (NIAH) tests. DeepSeek-V2 performs well across all context window lengths up to **128K**.
|
108 |
|
109 |
### Chat Model
|
110 |
-
#### Standard Benchmark
|
111 |
<div align="center">
|
112 |
|
113 |
| Benchmark | Domain | QWen1.5 72B Chat | Mixtral 8x22B | LLaMA3 70B Instruct | DeepSeek-V1 Chat (SFT) | DeepSeek-V2 Chat (SFT) | DeepSeek-V2 Chat (RL) |
|
@@ -124,6 +145,23 @@ Evaluation results on the ``Needle In A Haystack`` (NIAH) tests. DeepSeek-V2 pe
|
|
124 |
|
125 |
</div>
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
#### English Open Ended Generation Evaluation
|
128 |
We evaluate our model on AlpacaEval 2.0 and MTBench, showing the competitive performance of DeepSeek-V2-Chat-RL on English conversation generation.
|
129 |
<p align="center">
|
@@ -137,7 +175,7 @@ We evaluate our model on AlpacaEval 2.0 and MTBench, showing the competitive per
|
|
137 |
| **模型** | **开源/闭源** | **总分** | **中文推理** | **中文语言** |
|
138 |
| :---: | :---: | :---: | :---: | :---: |
|
139 |
| gpt-4-1106-preview | 闭源 | 8.01 | 7.73 | 8.29 |
|
140 |
-
| DeepSeek-V2 Chat (RL) | 开源 | 7.91 | 7.45 | 8.
|
141 |
| erniebot-4.0-202404 (文心一言) | 闭源 | 7.89 | 7.61 | 8.17 |
|
142 |
| DeepSeek-V2 Chat (SFT) | 开源 | 7.74 | 7.30 | 8.17 |
|
143 |
| gpt-4-0613 | 闭源 | 7.53 | 7.47 | 7.59 |
|
@@ -147,6 +185,7 @@ We evaluate our model on AlpacaEval 2.0 and MTBench, showing the competitive per
|
|
147 |
| DeepSeek-67B-Chat | 开源 | 6.43 | 5.75 | 7.11 |
|
148 |
| Yi-34B-Chat (零一万物) | 开源 | 6.12 | 4.86 | 7.38 |
|
149 |
| gpt-3.5-turbo-0613 | 闭源 | 6.08 | 5.35 | 6.71 |
|
|
|
150 |
|
151 |
</div>
|
152 |
|
@@ -157,7 +196,7 @@ We evaluate our model on LiveCodeBench (0901-0401), a benchmark designed for liv
|
|
157 |
<img width="50%" src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/code_benchmarks.png?raw=true">
|
158 |
</p>
|
159 |
|
160 |
-
##
|
161 |
DeepSeek-V2 adopts innovative architectures to guarantee economical training and efficient inference:
|
162 |
- For attention, we design MLA (Multi-head Latent Attention), which utilizes low-rank key-value union compression to eliminate the bottleneck of inference-time key-value cache, thus supporting efficient inference.
|
163 |
- For Feed-Forward Networks (FFNs), we adopt DeepSeekMoE architecture, a high-performance MoE architecture that enables training stronger models at lower costs.
|
@@ -165,11 +204,10 @@ DeepSeek-V2 adopts innovative architectures to guarantee economical training and
|
|
165 |
<p align="center">
|
166 |
<img width="90%" src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/architecture.png?raw=true" />
|
167 |
</p>
|
168 |
-
|
169 |
-
## 5. Chat Website
|
170 |
You can chat with the DeepSeek-V2 on DeepSeek's official website: [chat.deepseek.com](https://chat.deepseek.com/sign_in)
|
171 |
|
172 |
-
##
|
173 |
We also provide OpenAI-Compatible API at DeepSeek Platform: [platform.deepseek.com](https://platform.deepseek.com/). Sign up for over millions of free tokens. And you can also pay-as-you-go at an unbeatable price.
|
174 |
|
175 |
|
@@ -177,8 +215,7 @@ We also provide OpenAI-Compatible API at DeepSeek Platform: [platform.deepseek.c
|
|
177 |
<img width="40%" src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/model_price.png?raw=true">
|
178 |
</p>
|
179 |
|
180 |
-
|
181 |
-
## 7. How to run locally
|
182 |
**To utilize DeepSeek-V2 in BF16 format for inference, 80GB*8 GPUs are required.**
|
183 |
### Inference with Huggingface's Transformers
|
184 |
You can directly employ [Huggingface's Transformers](https://github.com/huggingface/transformers) for model inference.
|
@@ -280,10 +317,23 @@ generated_text = [output.outputs[0].text for output in outputs]
|
|
280 |
print(generated_text)
|
281 |
```
|
282 |
|
283 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
This code repository is licensed under [the MIT License](LICENSE-CODE). The use of DeepSeek-V2 Base/Chat models is subject to [the Model License](LICENSE-MODEL). DeepSeek-V2 series (including Base and Chat) supports commercial use.
|
285 |
|
286 |
-
##
|
287 |
```
|
288 |
@misc{deepseekv2,
|
289 |
title={DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model},
|
@@ -295,5 +345,5 @@ This code repository is licensed under [the MIT License](LICENSE-CODE). The use
|
|
295 |
}
|
296 |
```
|
297 |
|
298 |
-
##
|
299 |
If you have any questions, please raise an issue or contact us at [[email protected]]([email protected]).
|
|
|
55 |
Today, we’re introducing DeepSeek-V2, a strong Mixture-of-Experts (MoE) language model characterized by economical training and efficient inference. It comprises 236B total parameters, of which 21B are activated for each token. Compared with DeepSeek 67B, DeepSeek-V2 achieves stronger performance, and meanwhile saves 42.5% of training costs, reduces the KV cache by 93.3%, and boosts the maximum generation throughput to 5.76 times.
|
56 |
|
57 |
<p align="center">
|
|
|
58 |
<div style="display: flex; justify-content: center;">
|
59 |
+
<img src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/activationparameters.png?raw=true" style="height:400px; width:auto; margin-right:10px">
|
60 |
+
<img src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/trainingcost.png?raw=true" style="height:400px; width:auto; margin-left:10px">
|
61 |
</div>
|
62 |
</p>
|
63 |
+
|
64 |
We pretrained DeepSeek-V2 on a diverse and high-quality corpus comprising 8.1 trillion tokens. This comprehensive pretraining was followed by a process of Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL) to fully unleash the model's capabilities. The evaluation results validate the effectiveness of our approach as DeepSeek-V2 achieves remarkable performance on both standard benchmarks and open-ended generation evaluation.
|
65 |
|
66 |
+
## 2. News
|
67 |
|
68 |
+
- 2024.05.16: We released DeepSeek-V2-Lite, a lite version of DeepSeek-V2.
|
69 |
+
- 2024.05.06: We released the DeepSeek-V2.
|
70 |
|
71 |
+
## 3. Model Downloads
|
72 |
+
|
73 |
+
<div align="center">
|
|
|
|
|
|
|
74 |
|
75 |
+
| **Model** | **#Total Params** | **#Activated Params** | **Context Length** | **Download** |
|
76 |
+
| :------------: | :------------: | :------------: | :------------: | :------------: |
|
77 |
+
| DeepSeek-V2-Lite | 16B | 2.4B | 32k | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-V2-Lite) |
|
78 |
+
| DeepSeek-V2-Lite-Chat (SFT) | 16B | 2.4B | 32k | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-V2-Lite-Chat) |
|
79 |
+
| DeepSeek-V2 | 236B | 21B | 128k | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-V2) |
|
80 |
+
| DeepSeek-V2-Chat (RL) | 236B | 21B | 128k | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-V2-Chat) |
|
81 |
|
82 |
</div>
|
83 |
|
84 |
Due to the constraints of HuggingFace, the open-source code currently experiences slower performance than our internal codebase when running on GPUs with Huggingface. To facilitate the efficient execution of our model, we offer a dedicated vllm solution that optimizes performance for running our model effectively.
|
85 |
|
86 |
+
## 4. Evaluation Results
|
87 |
### Base Model
|
88 |
+
#### Standard Benchmark (Models larger than 67B)
|
89 |
|
90 |
<div align="center">
|
91 |
|
|
|
95 |
| **BBH** | English | 81.0 | 78.9 | 68.7 | 78.9 |
|
96 |
| **C-Eval** | Chinese | 67.5 | 58.6 | 66.1 | 81.7 |
|
97 |
| **CMMLU** | Chinese | 69.3 | 60.0 | 70.8 | 84.0 |
|
98 |
+
| **HumanEval** | Code | 48.2 | 53.1 | 45.1 | 48.8 |
|
99 |
| **MBPP** | Code | 68.6 | 64.2 | 57.4 | 66.6 |
|
100 |
| **GSM8K** | Math | 83.0 | 80.3 | 63.4 | 79.2 |
|
101 |
| **Math** | Math | 42.2 | 42.5 | 18.7 | 43.6 |
|
102 |
|
103 |
+
</div>
|
104 |
+
|
105 |
+
#### Standard Benchmark (Models smaller than 16B)
|
106 |
+
<div align="center">
|
107 |
+
|
108 |
+
| **Benchmark** | **Domain** | **DeepSeek 7B (Dense)** | **DeepSeekMoE 16B** | **DeepSeek-V2-Lite (MoE-16B)** |
|
109 |
+
|:-------------:|:----------:|:--------------:|:-----------------:|:--------------------------:|
|
110 |
+
| **Architecture** | - | MHA+Dense | MHA+MoE | MLA+MoE |
|
111 |
+
| **MMLU** | English | 48.2 | 45.0 | 58.3 |
|
112 |
+
| **BBH** | English | xxxx | xxxx | 44.1 |
|
113 |
+
| **C-Eval** | Chinese | 45.0 | 40.6 | 60.3 |
|
114 |
+
| **CMMLU** | Chinese | 47.2 | 42.5 | 64.3 |
|
115 |
+
| **HumanEval** | Code | 26.2 | 26.8 | 29.9 |
|
116 |
+
| **MBPP** | Code | 39.0 | 39.2 | 43.2 |
|
117 |
+
| **GSM8K** | Math | 17.4 | 18.8 | 41.1 |
|
118 |
+
| **Math** | Math | 3.3 | 4.3 | 17.1 |
|
119 |
+
|
120 |
</div>
|
121 |
For more evaluation details, such as few-shot settings and prompts, please check our paper.
|
122 |
|
|
|
128 |
Evaluation results on the ``Needle In A Haystack`` (NIAH) tests. DeepSeek-V2 performs well across all context window lengths up to **128K**.
|
129 |
|
130 |
### Chat Model
|
131 |
+
#### Standard Benchmark (Models larger than 67B)
|
132 |
<div align="center">
|
133 |
|
134 |
| Benchmark | Domain | QWen1.5 72B Chat | Mixtral 8x22B | LLaMA3 70B Instruct | DeepSeek-V1 Chat (SFT) | DeepSeek-V2 Chat (SFT) | DeepSeek-V2 Chat (RL) |
|
|
|
145 |
|
146 |
</div>
|
147 |
|
148 |
+
#### Standard Benchmark (Models smaller than 16B)
|
149 |
+
|
150 |
+
<div align="center">
|
151 |
+
|
152 |
+
| Benchmark | Domain | DeepSeek 7B Chat (SFT) | DeepSeekMoE 16B Chat (SFT) | DeepSeek-V2-Lite 16B Chat (SFT) |
|
153 |
+
|:-----------:|:----------------:|:------------------:|:---------------:|:---------------------:|
|
154 |
+
| **MMLU** | English | 49.7 | 47.2 | 55.7 |
|
155 |
+
| **BBH** | English | 43.1 | 42.2 | 48.1 |
|
156 |
+
| **C-Eval** | Chinese | 44.7 | 40.0 | 60.1 |
|
157 |
+
| **CMMLU** | Chinese | 51.2 | 49.3 | 62.5 |
|
158 |
+
| **HumanEval** | Code | 45.1 | 45.7 | 57.3 |
|
159 |
+
| **MBPP** | Code | 39.0 | 46.2 | 45.8 |
|
160 |
+
| **GSM8K** | Math | 62.6 | 62.2 | 72.0 |
|
161 |
+
| **Math** | Math | 14.7 | 15.2 | 27.9 |
|
162 |
+
|
163 |
+
</div>
|
164 |
+
|
165 |
#### English Open Ended Generation Evaluation
|
166 |
We evaluate our model on AlpacaEval 2.0 and MTBench, showing the competitive performance of DeepSeek-V2-Chat-RL on English conversation generation.
|
167 |
<p align="center">
|
|
|
175 |
| **模型** | **开源/闭源** | **总分** | **中文推理** | **中文语言** |
|
176 |
| :---: | :---: | :---: | :---: | :---: |
|
177 |
| gpt-4-1106-preview | 闭源 | 8.01 | 7.73 | 8.29 |
|
178 |
+
| DeepSeek-V2 Chat (RL) | 开源 | 7.91 | 7.45 | 8.36 |
|
179 |
| erniebot-4.0-202404 (文心一言) | 闭源 | 7.89 | 7.61 | 8.17 |
|
180 |
| DeepSeek-V2 Chat (SFT) | 开源 | 7.74 | 7.30 | 8.17 |
|
181 |
| gpt-4-0613 | 闭源 | 7.53 | 7.47 | 7.59 |
|
|
|
185 |
| DeepSeek-67B-Chat | 开源 | 6.43 | 5.75 | 7.11 |
|
186 |
| Yi-34B-Chat (零一万物) | 开源 | 6.12 | 4.86 | 7.38 |
|
187 |
| gpt-3.5-turbo-0613 | 闭源 | 6.08 | 5.35 | 6.71 |
|
188 |
+
| DeepSeek-V2-Lite 16B Chat | 开源 | 6.01 | 4.71 | 7.32 |
|
189 |
|
190 |
</div>
|
191 |
|
|
|
196 |
<img width="50%" src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/code_benchmarks.png?raw=true">
|
197 |
</p>
|
198 |
|
199 |
+
## 5. Model Architecture
|
200 |
DeepSeek-V2 adopts innovative architectures to guarantee economical training and efficient inference:
|
201 |
- For attention, we design MLA (Multi-head Latent Attention), which utilizes low-rank key-value union compression to eliminate the bottleneck of inference-time key-value cache, thus supporting efficient inference.
|
202 |
- For Feed-Forward Networks (FFNs), we adopt DeepSeekMoE architecture, a high-performance MoE architecture that enables training stronger models at lower costs.
|
|
|
204 |
<p align="center">
|
205 |
<img width="90%" src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/architecture.png?raw=true" />
|
206 |
</p>
|
207 |
+
## 6. Chat Website
|
|
|
208 |
You can chat with the DeepSeek-V2 on DeepSeek's official website: [chat.deepseek.com](https://chat.deepseek.com/sign_in)
|
209 |
|
210 |
+
## 7. API Platform
|
211 |
We also provide OpenAI-Compatible API at DeepSeek Platform: [platform.deepseek.com](https://platform.deepseek.com/). Sign up for over millions of free tokens. And you can also pay-as-you-go at an unbeatable price.
|
212 |
|
213 |
|
|
|
215 |
<img width="40%" src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/model_price.png?raw=true">
|
216 |
</p>
|
217 |
|
218 |
+
## 8. How to run locally
|
|
|
219 |
**To utilize DeepSeek-V2 in BF16 format for inference, 80GB*8 GPUs are required.**
|
220 |
### Inference with Huggingface's Transformers
|
221 |
You can directly employ [Huggingface's Transformers](https://github.com/huggingface/transformers) for model inference.
|
|
|
317 |
print(generated_text)
|
318 |
```
|
319 |
|
320 |
+
### LangChain Support
|
321 |
+
Since our API is compatible with OpenAI, you can easily use it in [langchain](https://www.langchain.com/).
|
322 |
+
Here is an example:
|
323 |
+
|
324 |
+
```
|
325 |
+
from langchain_openai import ChatOpenAI
|
326 |
+
llm = ChatOpenAI(
|
327 |
+
model='deepseek-chat',
|
328 |
+
openai_api_key=<your-deepseek-api-key>,
|
329 |
+
openai_api_base='https://api.deepseek.com/v1',
|
330 |
+
temperature=0.85,
|
331 |
+
max_tokens=8000)
|
332 |
+
```
|
333 |
+
## 9. License
|
334 |
This code repository is licensed under [the MIT License](LICENSE-CODE). The use of DeepSeek-V2 Base/Chat models is subject to [the Model License](LICENSE-MODEL). DeepSeek-V2 series (including Base and Chat) supports commercial use.
|
335 |
|
336 |
+
## 10. Citation
|
337 |
```
|
338 |
@misc{deepseekv2,
|
339 |
title={DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model},
|
|
|
345 |
}
|
346 |
```
|
347 |
|
348 |
+
## 11. Contact
|
349 |
If you have any questions, please raise an issue or contact us at [[email protected]]([email protected]).
|