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