Storing a latent instead of full heads
Shared latent features can represent several heads’ content memory. Linear reassociation lets attention use that representation directly. The saving disappears if decoding reconstructs and retains every expanded historical head.
#Section 12Multi-head latent attention
Every generated token adds a key and value per stored KV head. At long context and large batch, reading that cache can limit decoding even when the weights fit. Could the decoder keep a smaller vector per position and still serve several heads?
KV-cache bottleneck and latent KV representations
Multi-head latent attention, or MLA, learns a low-dimensional vector from which keys and values are derived. A latent is an internal feature vector rather than explicit K/V head states. The idea is joint compression: a token’s keys and values both come from the same smaller vector.
MLA is a trained parameterization, not a file compressor applied to an existing Finch GQA cache. Finch-24 stays the baseline; the dimensions below describe an illustrative variant that would need training and evaluation.
Low-dimensional compression and reconstructing attention information
For hidden vector , choose latent rank and down-projection :
The down-projection produces one latent per token; head-specific up-projections derive content keys and values from it. Positional information is handled separately.
Reconstructed keys and values lie in a learned subspace of rank at most 64. That is a representational restriction, and whether it is adequate is a training result, not something the algebra proves.
DeepSeek introduced MLA in DeepSeek-V2 (2024), with learned joint compression and an inference form that keeps compact states. DeepSeek-V2 architecture paper.
#Section 13MLA internals
The cache stores 64 content features, but the equations rebuild 512 key and 512 value features. If inference materializes those full histories, it spends the memory it claimed to save.
Latent projection and compressed KV representation
An input batch [2,8,512] projects to [2,8,64], one latent per item and token. Training can expand keys and values explicitly to check the math. Cached decoding instead stores [B,T,64] per layer.
Query interaction and reconstructed keys/values
Let be a content query for head . Ignoring position for now:
Read this as move the key up-projection onto the query once, then compare that 64-feature query with every cached latent. Folding linear maps into neighboring projections this way is called weight absorption.
Values work the same way. With normalized attention weights for head :
Read this as form the weighted latent sum first, then expand it once. The value up-projection can be merged into the matching output-projection slice. Each head keeps its own attention weights; shared storage does not mean a shared attention pattern.
Cache savings
The cache also needs the decoupled positional key. Compare that complete representation with the actual GQA baseline, rather than counting only the content latent.
Absorbed queries still do head-specific work, and kernel layout, projection cost, rank, and the positional path all affect speed. A Python version that caches reconstructed K/V can verify the math while showing none of the memory saving.