The KV Cache Bottleneck
As Large Language Models (LLMs) scale and context windows expand to hundreds of thousands of tokens, the KV cache has emerged as a massive architectural bottleneck. During inference, a Transformer must store the Key and Value vectors for every previous token to generate the next one. This consumes enormous amounts of VRAM, limiting the number of concurrent users a single GPU can handle and making long-context applications prohibitively expensive.
While industry-standard techniques like Grouped-Query Attention (GQA) reduce the number of attention "heads," the fundamental tripartite structure—the assumption that Queries ($Q$), Keys ($K$), and Values ($V$) must each have their own unique linear projection—has remained largely unquestioned. This paper investigates whether this three-projection design is a strict necessity or a persistent redundancy.
Rethinking the Tripartite Structure
The authors systematically evaluate three "Projective Sharing" variants to see if the standard QKV formulation can be compressed:
- $Q=K-V$: Unified Query and Key; separate Value. This creates symmetric attention maps.
- $Q-K=V$: Separate Query; unified Key and Value. This maintains the directional asymmetry essential for language modeling.
- $Q=K=V$: A single projection for all three roles.
To handle the symmetry issues in variants 1 and 3 (which can degrade performance in non-causal tasks), the researchers introduced a variant called $(X)^+$. This injects asymmetry using 2D sinusoidal positional encodings and a $1 \times 1$ convolution.
Crucially, projection sharing is orthogonal to Head Sharing (like GQA and Multi-Query Attention, or MQA). Because projection sharing reduces the size of each head's representation, and head sharing reduces the number of heads, the two strategies can be combined for compound efficiency gains.
Key Insights: Directionality and Hidden Redundancy
The study spanned synthetic reasoning, computer vision, and language modeling (pre-training 300M and 1.2B parameter GPT-style models on 10B tokens). Across these domains, several fascinating insights emerged:
- The "Directionality" Requirement: The most viable variant for language modeling is $Q-K=V$. Language is inherently directional; the model needs to know that token A influences token B differently than B influences A. The $Q=K-V$ variant forces symmetry, breaking this flow. By keeping $Q$ separate, $Q-K=V$ preserves the vital distinction between "addressing" (Query) and "content" (Key/Value).
- Exploiting Hidden Redundancy: Analysis of standard, fully-trained Transformers revealed that $K$ and $V$ projection matrices already exhibit high cosine similarity (0.73). The model naturally pushes them toward similar representational spaces; the authors simply turned this observation into a hard architectural constraint to save memory.
- Linear Attention as a State-Space Model: In a fascinating theoretical aside, the authors provide a mathematical proof showing that when $Q, K,$ and $V$ are collapsed in a linear attention setting, the Transformer effectively becomes a State-Space Model (SSM) with an adaptive observation matrix.
Empirical Results: Massive Memory Savings
The practical implications of projection sharing are substantial, particularly for edge deployment and high-throughput serving:
- Compound Memory Efficiency: Implementing $Q-K=V$ yields an immediate 50% reduction in KV cache. When combined with Multi-Query Attention (Q-MQA), the total cache reduction reaches a staggering 96.9%.
- Doubled Throughput: In a simulated real-world deployment scenario (32k context on an NVIDIA A100), switching from standard QKV to $Q-K=V$ allows a single GPU to serve 30 concurrent users instead of 15, effectively halving serving costs.
- Favorable Scaling Laws: The benefits of projection sharing actually improve with model scale. The perplexity degradation dropped from 3.1% at the 300M parameter scale to just 2.48% at 1.2B parameters. Furthermore, despite the minor perplexity hit, performance on downstream benchmarks (like HellaSwag and ARC) was nearly identical to the baseline.
- Vision Performance: On the TinyImageNet benchmark, the most aggressive variant ($Q=K=V$) actually outperformed the standard QKV baseline. This suggests that for non-sequential data, the extra projections might act as a source of overfitting.
Limitations and Future Directions
While the results establish projection sharing as a powerful new optimization axis, a few limitations remain. The largest model tested was 1.2B parameters; it remains to be seen if the quality holds at the 7B, 70B, or 400B scales typical of state-of-the-art LLMs. Additionally, the study focused on sequences up to 2048 tokens, leaving the behavior of shared projections in extreme long-context scenarios (100k+ tokens) unexplored. Finally, while the empirical evidence is strong, a more formal theoretical framework explaining representational redundancy in attention would further solidify these findings.
Summary updated