Build1 publisher3 min readPublished
MLA's 512-Scalar KV Latent Cuts Cache 98%, Enabling 512 Concurrent 128k Streams
Decode is memory-bandwidth bound. Eight concurrent 128k Llama 3 70B streams need 97.8 ms of HBM transfer for every token generated, and DeepSeek's 512-scalar latent is aimed squarely at those bytes.
The Engineer · Build desk

What happened
- Decode generates one token at a time and each token re-reads the keys and values of every preceding token, dropping arithmetic intensity to about 1 FLOP per byte streamed and making the phase bandwidth bound.
- At batch size 8 that is 327.68 GB moved per token step, 97.8 ms of transfer at 3.35 TB/s, capping output near 10.2 tokens per second with over 90% of Tensor Core FLOPS idle.
- MLA stores a 512-scalar latent per token against 32,768 scalars for 128-head attention, which the article puts at a 1.56% content ratio, or a 98.44% reduction.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- constraint Compressing the cache does nothing for prefill, which is compute-bound on dense GEMM, so time-to-first-token on a 128k prompt stays where it was.
- decision A team already serving grouped KV heads has to recompute its own ratio from the KV-head term in the cache formula before any 64x figure can enter a capacity plan.
- contradiction The headline reduction and the computed one leave 7% and 1.56% of the baseline resident, a 4.5x difference in what still has to be streamed per token.
Divide the 97.8 ms by the eight streams and each concurrent user costs 12.2 ms of every token step [15]. Add a ninth and all nine get slower. The 12.2 ms is independent of the model's FLOPS: it is the time to pull one user's history out of HBM3, once, per generated token.
The weights compete for the same bandwidth and they scale differently. Llama 3 70B in FP16 is about 140 GB across tensor-parallel ranks [5], and that read happens once per step whatever the batch size. KV traffic scales with the batch. Four concurrent 128k streams come to 163.84 GB, more than the weights [16]. Serve one user with a short prompt and the cache is a rounding error against 140 GB, so compressing it 64-fold lands below what you can measure.
The two figures invite a multiplication: one sixty-fourth of the bytes inside the same 97.8 ms budget would be 512 concurrent streams [17]. For that to transfer to your deployment, your model would have to be the one MLA is described on. That means a 5120-dimensional hidden state, 128 heads of dimension 128, and a latent of 512 [8]. The 40.96 GB per stream belongs to Llama 3 70B [5]. MLA's baseline of 32,768 scalars per token is full multi-head attention, one key and one value for each of 128 heads [9]. The cache formula keeps the number of KV heads as its own term [3]. A model already sharing KV heads across query heads sits well below that baseline before MLA enters, and has proportionally less to gain.
Multi-query attention is the cheap version of the same idea, one KV head for every query head, and the article reports score drops of 3.8% to 6.2% on GSM8k and multi-document recall [7]. MLA keeps 128 distinct up-projection slices reading one shared latent, so each head still expresses its own pattern over the 512-dimensional space [11].
The RoPE handling is the good engineering here. Rotary embeddings multiply each key by a position-dependent rotation, and that rotation does not commute with the up-projection [12]. Store only the latent and the runtime has to up-project and re-rotate every earlier token's key at every decoding step. That is the recompute the cache exists to avoid, and its cost grows with context length [12]. DeepSeek's answer is to split keys and queries into a content stream at 128 dimensions per head and a separate positional stream [13]. The 1.56% figure counts the content latent alone [10]. A positional key is cached too, and the excerpt breaks off before naming its size. The 93% in the headline and the 98.44% in the body describe different caches [14].
What to watch
- Measured decode numbers from the interactive benchmarks and hardware telemetry the article says it was originally published with.
- The dimension of the decoupled positional key stream, which sets whether the real cache cut is nearer 93% or 98.44%.
- Whether the reported 3.8% to 6.2% MQA quality drops reproduce on a named model and a published eval harness.