Low-Rank Key Value Attention
James O'Neill, Robert Clancy, Mariia Matskevichus, Fergal Reid
TL;DR
LRKV introduces a memory-efficient attention mechanism for Transformer pretraining by decomposing each head's key/value projections into a shared full-rank base plus head-specific low-rank residuals. This additive factorization reduces KV-cache memory by approximately 40-50% (up to 52.6% of the standard cache at 2.5B) while preserving near-full head diversity and representational capacity, enabling faster convergence and better downstream performance. Through gauge-invariant analyses (bilinear forms and kernel PCA), the authors show LRKV maintains functional head diversity comparable to full MHA, while also revealing compensation mechanisms in KV-sharing baselines like MQA. Empirically, LRKV delivers state-of-the-art pretraining results on FineWeb-Edu across 128M and 2.5B scale, and achieves superior downstream scores after midtraining, with notable improvements in memory/compute efficiency. The work demonstrates that structured low-rank factorization of KV projections is a principled route to scaling Transformer training under memory constraints without sacrificing quality, and outlines concrete directions for extending this approach to broader model classes and tasks.
Abstract
Transformer pretraining is increasingly constrained by memory and compute requirements, with the key-value (KV) cache emerging as a dominant bottleneck during training and autoregressive decoding. We propose \textit{low-rank KV adaptation} (LRKV), a simple modification of multi-head attention that reduces KV cache memory by exploiting redundancy across attention heads while preserving full token-level resolution. Each layer uses a shared full-rank KV projection augmented with low-rank, head-specific residuals, yielding a continuous trade-off between complete sharing and fully independent attention. LRKV is a drop-in replacement for standard multi-head attention and directly subsumes query-sharing approaches such as multi-query and grouped-query attention, while remaining distinct from latent-compression methods such as multi-latent attention (MLA). Across large-scale pretraining experiments, LRKV consistently achieves faster loss reduction, lower validation perplexity, and stronger downstream task performance than standard attention, MQA/GQA, and MLA. At the 2.5B scale, LRKV outperforms standard attention while using roughly half the KV cache, and reaches equivalent model quality with up to \textbf{20-25\% less training compute} when measured in cumulative FLOPs. To explain these gains, we analyze attention head structure in operator space and show that LRKV preserves nearly all functional head diversity relative to standard attention, whereas more aggressive KV-sharing mechanisms rely on compensatory query specialization. Together, these results establish LRKV as a practical and effective attention mechanism for scaling Transformer pretraining under memory- and compute-constrained regimes.
