Before you start: words you need#
| Word | Plain meaning |
|---|---|
| MLA | Multi-head latent attention: instead of caching full keys and values, cache one small latent vector per token from which every head’s K and V can be rebuilt (12.g). |
| Low-rank compression | Squeezing a big vector through a small one (here 7,168 or 5,120 dimensions down to 512) with a learned matrix, and expanding it again with another. |
| Weight absorption | Multiplying two weight matrices together ahead of time so the expansion step never has to run at inference. |
| Decoupled RoPE | A small extra key part (64 dimensions) that carries the rotary position information separately, because RoPE would otherwise block weight absorption. |
| Fine-grained / shared experts | Many small routed experts plus one or two experts that every token always uses (DeepSeekMoE; 14.g). |
| Auxiliary-loss-free balancing | Balancing load across experts by adjusting a per-expert bias on the routing scores, instead of adding a balancing loss to training. |
| MTP | Multi-token prediction: extra modules trained to predict tokens further ahead; at inference they can serve as a speculative draft (30.l, 30.s). |
| FP8 training | Doing most of training’s matrix multiplies in 8-bit floating point, with fine-grained scales (13.e). |
1. The paper#
Two technical reports from DeepSeek-AI (published on arXiv, not peer-reviewed venues):
- DeepSeek-V2: “DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model”, May 2024. arXiv:2405.04434
- DeepSeek-V3: “DeepSeek-V3 Technical Report”, December 2024. arXiv:2412.19437
V2 introduced the architecture (MLA + DeepSeekMoE). V3 scaled it and added training and serving methods. In early 2025, DeepSeek-R1 (a reasoning model built on V3) made these models famous, and DeepSeek’s “Open Infra” week released the kernels behind them (FlashMLA, DeepEP, DeepGEMM).
2. The problem#
Two costs dominate a large model’s inference bill:
- KV cache size. It limits batch size and context length. GQA (30.d) shrinks it by sharing heads, but costs some quality; DeepSeek’s ablations found MHA better than GQA and MQA.
- Compute per token. A dense 67B model does 134 GFLOPs per token. MoE (30.e) helps, but coarse experts specialise poorly and load imbalance wastes GPUs.
DeepSeek also had limited and export-restricted hardware (H800 GPUs, with cut-down NVLink bandwidth), which pushed every design toward efficiency.
3. The idea#
V2 (May 2024): 236 B parameters, 21 B active per token, 128K context.
- MLA. Compress each token’s hidden state into a 512-dimensional latent c_KV, and cache that (plus a 64-dimensional decoupled RoPE key) instead of full K and V for 128 heads. The up-projections that turn c_KV back into per-head K and V are absorbed into the query and output projections, so attention can run directly on the latent. The cache equals that of GQA with only 2.25 groups, while quality matched or beat MHA in their ablations.
- DeepSeekMoE. 160 small routed experts (6 chosen per token) plus 2 shared experts; device-limited routing to cap communication.
V3 (December 2024): 671 B parameters, 37 B active, 14.8 T training tokens.
- Same MLA; MoE with 256 routed experts (8 chosen) + 1 shared, each token sent to at most 4 nodes.
- Auxiliary-loss-free load balancing: a bias per expert, nudged up or down after each step according to its load, steers routing without a loss term that hurts quality.
- Multi-token prediction (depth 1) as an extra training objective; reused as a draft at inference.
- FP8 mixed-precision training with fine-grained (tile- and block-wise) scaling, the first at this scale, and the DualPipe pipeline schedule that overlaps computation with all-to-all communication.
flowchart LR H["Hidden state (7,168 dims)"] --> C["Down-project: latent c_KV (512) + RoPE key (64)"] C --> KV["KV cache stores only 576 numbers per token per layer"] KV --> A["Attention on latent (up-projections absorbed into Q and output)"] A --> M["MoE: 1 shared + 8 of 256 routed experts"] M --> O["Next layer"] class H io class C neutral class KV memory class A,M compute
4. How it works#
MLA in numbers. Per token per layer, MLA caches 512 + 64 = 576 values. V3 has 61 layers, so in BF16 that is 576 × 61 × 2 bytes ≈ 69 KiB per token. An MHA model of the same shape (128 heads, 128-dim heads, K and V) would cache 2 × 128 × 128 = 32,768 values per layer, about 57× more. The KV cache arithmetic is taught in 12.f and 12.g.
Why decoupled RoPE. RoPE rotates keys by position. A position-dependent rotation sitting between the up-projection and the query blocks absorbing one into the other. So MLA puts position into a separate small key (shared across heads) and keeps the compressed part position-free.
MLA at decode vs prefill. In decode, absorbing weights makes attention work on the 512-dim latent: every head shares one “KV head”, like MQA, so decode attention becomes compute-heavier and much less memory-bound (high arithmetic intensity). In prefill, engines usually expand K and V and run normal attention. Specialised kernels (FlashMLA, FlashInfer MLA, cuDNN) handle both.
How DeepSeek served V3 (section 3.4 of the V3 report):
- Prefill: a minimum unit of 4 nodes (32 GPUs); attention with TP4 plus sequence parallelism and data parallelism; MoE with EP32; 32 redundant copies of the busiest experts.
- Decode: a minimum unit of 40 nodes (320 GPUs); attention with TP4 + DP80; MoE with EP320, one expert per GPU, 64 GPUs holding redundant and shared experts; all-to-all over InfiniBand with IBGDA.
- That is disaggregated prefill/decode (30.q) with wide expert parallelism, the template for large MoE serving since.
5. Results#
DeepSeek-V2 (compared with DeepSeek 67B dense, their earlier model):
| Claim | Value |
|---|---|
| Training cost | 42.5% lower |
| KV cache | 93.3% smaller (MLA, plus KV quantized to about 6 bits on average in deployment) |
| Maximum generation throughput on one 8 × H800 node | over 50K tokens/s, 5.76× DeepSeek 67B |
| Prompt (prefill) throughput | over 100K tokens/s |
DeepSeek-V3:
| Claim | Value |
|---|---|
| Full training | 2.788 M H800 GPU-hours (2.664 M for pre-training) |
| Cost at an assumed $2 per GPU-hour | $5.576 M — the report notes this excludes research, ablations, data and earlier runs |
| MTP draft acceptance for the second token | 85%–90%, giving about 1.8× tokens per second |
| Quality | strongest open model at release, competitive with leading closed models on many benchmarks |
The $5.576 M figure was widely quoted without its caveat. It is the rental-equivalent cost of the final training run only.
6. What held up and what did not#
Held up
- MLA spread. Kimi, GLM and Mistral models adopted MLA or close variants; DeepSeek’s own V3.2 added sparse attention on top (30.y), and DeepSeek-V4 (April 2026) compresses the cache further (24.b).
- Fine-grained MoE with shared experts and wide EP is the dominant large-model design of 2025–26 (14.g, 14.h).
- Auxiliary-loss-free balancing and MTP were adopted by other labs; MTP heads ship with many open models as built-in drafts (13.o).
- FP8 training at scale became normal; low-precision releases followed (FP8, then FP4 weights; 13.g).
- Disaggregated, wide-EP serving as DeepSeek described is now offered by SGLang, vLLM, Dynamo and llm-d on NVL72 racks (19.a, 21.j).
- Open kernels (FlashMLA, DeepEP, DeepGEMM) set the bar for MoE and MLA kernels (25.f, 25.h, 25.i).
Did not, or changed
- MLA is not free to serve. Absorbed decode attention is compute-heavy, the latent shares one “head” so tensor parallelism cannot split the cache by head (engines use data-parallel attention instead; 14.h), and MLA needed new kernels everywhere.
- The cost story was misread — see above.
- Benchmarks age. V3’s quality lead among open models lasted months; later DeepSeek models and other labs moved past it. The architecture lasted longer than the model.
7. Where it lives in 2026#
- Taught in depth: MLA in 12.g, MoE in 14.g, MoE serving and wide EP in 14.h, disaggregation in 14.j, MTP and speculative variants in 13.o, MLA and MoE kernels in 25.f and 25.h, DeepEP in 25.i.
- vLLM v0.32.0 and SGLang serve the V3 lineage with MLA backends (FlashMLA, FlashInfer, cuDNN), FP8 or FP4 weights, EP with DeepEP-style all-to-all, and MTP drafting.
Checked on 13 November 2026.
8. Questions#
- What does MLA cache per token per layer, and how many bytes is that for V3 in BF16?
- Why can the up-projection be absorbed into the query projection, and why does RoPE prevent it?
- MLA decode attention behaves like MQA. What does that do to arithmetic intensity?
- Why can’t you shard an MLA cache across GPUs by head? What do engines do instead?
- Explain auxiliary-loss-free load balancing in two sentences.
- DeepSeek’s decode deployment used EP320. Why such wide expert parallelism for decode but EP32 for prefill?
- What exactly does the $5.576 M figure cover, and what does it leave out?
9. Further reading#
- DeepSeek-V2, arXiv:2405.04434 — section 2.1 (MLA) and Table 1.
- DeepSeek-V3, arXiv:2412.19437 — sections 2 and 3 (infrastructure and deployment).
- deepseek-ai/FlashMLA · deepseek-ai/DeepEP.
- 12.g and 14.h in this material.
- Next: Mooncake (30.w).