← Back to LLMs Mind Map
⚡Flashcard Drill➔
⚡ LLMsID: mla-attention

Multi-head Latent Attention

MLA 低秩 KV 压缩
🎯Core Definition
MLA (Multi-head Latent Attention) is the low-rank KV compression introduced by DeepSeek-V2: the layer's K/V are first compressed into a low-dimensional latent vector ctKV∈Rdcc_t^{KV} \in \mathbb{R}^{d_c} (dc=512d_c = 512 in DeepSeek-V2), and per-head K/V are reconstructed by up-projection at attention time; a small position-only rotary K (ktRk_t^R) is kept separately for RoPE compatibility (decoupled RoPE).
💡Use Cases
standard in DeepSeek-V2/V3/R1, most beneficial for long context and large batch serving; by 2026 it is the reference design for long-context deployment at big companies, and "why MLA saves memory" is a must-know interview question.
⚡Key Problems Solved
GQA only shares KV heads, still caching 2Hd2 H d values per token; MLA cuts per-token cache to dcd_c, with dc=512≪2Hdd_c = 512 \ll 2 H d — DeepSeek-V2 drops its KV cache from about 41.5GB (GQA variant) to about 5.1GB (MLA), a reduction of 80%+; during training, recomputing K/V from ctKVc_t^{KV} at prefill also saves substantial activation memory.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Multi-head Latent Attention.
Use Cases
In production engineering, what are the primary use cases for Multi-head Latent Attention and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
How does MLA compress KV? Dimensionality of ctKVc_t^{KV} and the reconstruction process?
2
Why does MLA need decoupled RoPE? What role does ktRk_t^R play?
3
How much memory does MLA save vs GQA? Concrete numbers (41.5GB → 5.1GB)?
4
How does MLA cut activation memory in training (recomputing K/V at prefill)?
5
Essential difference between MLA and MQA/GQA (sharing vs low-rank projection)?
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Multi-head Latent Attention"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
← Previous CardAttention Variants MHA/MQA/GQANext Card →SSM & Hybrid Architectures

🔗 More LLMs Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/LLM/card/mla-attention