How does DeepSeek's Multi-Latent Attention (MLA) compress the KV cache below GQA?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Explain how MLA works: what it caches, how K and V are reconstructed at attention time, and why it can compress 5-10× more than GQA while matching or exceeding GQA quality. What is the runtime cost?
MLA caches one shared low-rank latent per token instead of full per-head K and V, reconstructs heads via absorbed up-projections, and shrinks the cache about 10x versus MHA.
Imagine each token's keys and values are a long shopping list you must keep on a sticky note for later. GQA saves space by letting several shoppers share one list. MLA does something smarter: it notices the lists are all variations on a few common themes, so it stores just a short recipe code that captures the gist. Later, when a shopper needs their full list, they expand that recipe code back into the detailed list on the spot. The sticky note holds a tiny code instead of a long list, so you keep far less paper around. Expanding the code costs a little extra work, but fetching tiny notes from memory is so much faster that you come out ahead overall.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: what MLA caches (latent) + reconstruction via absorbed up-projections + compression ratios vs MHA and GQA + why quality holds + decoupled RoPE + the kernel-fusion caveat.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Saying MLA just shares K and V heads like GQA does. MLA caches a learned low-rank latent and reconstructs per-head K and V from it, a fundamentally different mechanism.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.