DeepSeek-V2:一个强大、经济且高效的混合专家语言模型

DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model

梁文锋 Wenfeng Liang · DeepSeek · 2024-05-07 · arXiv:2405.04434 ↗ · 被引 1287

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

我们提出了 DeepSeek-V2,一个以经济训练和高效推理为特点的强大混合专家(MoE)语言模型。它总共有 236B 参数,每个 token 激活 21B,支持 128K token 的上下文长度。DeepSeek-V2 采用了创新架构,包括多头潜在注意力(MLA)和 DeepSeekMoE。MLA 通过将键值(KV)缓存显著压缩为潜在向量来保证高效推理,而 DeepSeekMoE 通过稀疏计算以经济成本训练强大模型。与 DeepSeek 67B 相比,DeepSeek-V2 性能显著更强,同时节省了 42.5%的训练成本,减少了 93.3%的 KV 缓存,并将最大生成吞吐量提升至 5.76 倍。我们在一个由 8.1T token 组成的高质量多源语料库上预训练了 DeepSeek-V2,并进一步进行监督微调(SFT)和强化学习(RL)以充分释放其潜力。评估结果显示,即使只有 21B 激活参数,DeepSeek-V2 及其聊天版本在开源模型中仍达到顶尖性能。

We present 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, and supports a context length of 128K tokens. DeepSeek-V2 adopts innovative architectures including Multi-head Latent Attention (MLA) and DeepSeekMoE. MLA guarantees efficient inference through significantly compressing the Key-Value (KV) cache into a latent vector, while DeepSeekMoE enables training strong models at an economical cost through sparse computation. Compared with DeepSeek 67B, DeepSeek-V2 achieves significantly 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. We pretrain DeepSeek-V2 on a high-quality and multi-source corpus consisting of 8.1T tokens, and further perform Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL) to fully unlock its potential. Evaluation results show that, even with only 21B activated parameters, DeepSeek-V2 and its chat versions still achieve top-tier performance among open-source models.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 12)

阅读逐段中英对照全文 →