Research

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

← All research
Preprint Third-party arXiv·May 7, 2024

This is third-party work — not authored by or affiliated with DarcStar Technologies.

By DeepSeek-AI

Research

Abstract

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.

DarcStar commentary

Our perspective on this work and how it informs our research — not part of the original paper.

We're shelving this one for MLA — Multi-head Latent Attention — which is the third distinct way to attack the KV-cache wall, alongside the quantization work elsewhere on this shelf. Quantization shrinks the cache by spending fewer bits per number; ring and distributed methods shrink it per device by sharding; MLA shrinks it by storing fewer numbers — compressing the keys and values into a low-rank latent vector that's what actually gets cached. A 93% KV reduction is not a tweak; it's a different axis on the same problem.

The move we like is that the compression is folded into the attention itself, not bolted on afterward — the latent projection is trained in, so at inference the compressed form is the native form, not a lossy afterthought applied to a full cache. That's the same “trained-in beats post-hoc” pattern that keeps showing up in the work we respect. Three different levers — bits, shards, rank — on one memory wall, and MLA is the cleanest statement of the low-rank one.

The honest asterisks are two. First, because it's architectural, it's not a drop-in: you get MLA by training a model around it, not by compressing an existing one, which is a different cost than a post-hoc quantizer. Second, it arrives inside a very large model report, bundled with a Mixture-of-Experts design and a big training pipeline, so isolating how much of the win is MLA versus everything else takes reading past the headline. Neither is a knock — they're the difference between “here's a compression trick” and “here's a model built to need less cache from the ground up,” and the second is the more interesting claim.