multi-head latent attention explained

1 article

MHA vs GQA vs MLA: How Attention Design Sets KV Cache Size

Per-token KV cache bytes for MHA, GQA and MLA from model config.json: Llama 2 7B, Llama 3.1 8B/70B, DeepSeek-V3 at BF16 and FP8, scaled to 128K and batch.

October 28, 2026• 14 min read
kv cache size calculationkv cache memorykv cache calculator