# Multi-Head Latent Attention

> Multi-head latent attention (MLA) is an attention mechanism that compresses each token's keys and values into a low-dimensional latent vector and caches only that vector, greatly shrinking the key-value cache needed during generation.

- Identifier: PTL-0271
- Category: Foundations
- Canonical URL: https://protologue.com/t/multi-head-latent-attention/
- Also known as: MLA, latent attention
- Introduced: 2024

## Description

DeepSeek-AI introduced MLA in the DeepSeek-V2 model in 2024. A down-projection maps each token to a compressed latent from which keys and values are reconstructed by up-projections, and a separate, decoupled rotary position embedding carries position information. The authors reported that MLA achieves better performance than standard multi-head attention, and that DeepSeek-V2 reduces the KV cache by 93.3% compared with DeepSeek 67B. Grouped-query attention shrinks the cache by sharing key-value heads; MLA instead compresses keys and values jointly.

## Broader terms

- [Transformer](https://protologue.com/t/transformer/)

## Related terms

- [KV Cache](https://protologue.com/t/kv-cache/)
- [Grouped-Query Attention](https://protologue.com/t/grouped-query-attention/)
- [Rotary Position Embedding](https://protologue.com/t/rotary-position-embedding/)
- [Mixture of Experts](https://protologue.com/t/mixture-of-experts/)
- [PagedAttention](https://protologue.com/t/pagedattention/)

## Comparisons

- [Multi-Head Latent Attention vs Grouped-Query Attention](https://protologue.com/compare/multi-head-latent-attention-vs-grouped-query-attention/)

## Sources

- DeepSeek-AI (2024). DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model. https://arxiv.org/abs/2405.04434

## Cite this entry

Protologue. (2026). Multi-Head Latent Attention. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.9.1, PTL-0271). https://protologue.com/t/multi-head-latent-attention/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
