Grouped-head latenT Attention

Luoyang Sun, Jiwen Jiang, Cheng Deng, Xinjian Wu, Haifeng Zhang, Lei Chen, Lionel Ni, Jun Wang · Submission to ICLR 2026 · Withdrawn

TL;DR

Grouped-Head Latent Attention (GTA) is a new attention mechanism designed to slash both key-value (KV) cache memory and computational overhead in Transformers. By combining shared attention maps across heads with a nonlinear, gated value decoder, GTA cuts KV cache storage by up to 70% and attention FLOPs by up to 62.5% compared to Grouped-Query Attention (GQA)—doubling inference throughput while matching or exceeding model quality.

What Problem Does This Paper Address?

In standard Multi-Head Attention (MHA), the memory consumed by the key-value (KV) cache during autoregressive generation scales linearly with sequence length and batch size, quickly exhausting GPU memory during long-context inference. Meanwhile, prefill FLOPs scale quadratically with sequence length.

Prior remedies come with steep compromises:

  • Multi-Query Attention (MQA) and Grouped-Query Attention (GQA) share keys and values across heads to save memory, but restrict attention granularity and model expressivity.
  • Multi-Head Latent Attention (MLA) compresses the KV cache into latent vectors, but introduces significant decompression and computational overhead.

The authors observe two structural redundancies in standard models: attention maps across heads are remarkably similar, and values can be compressed without losing expressive power. GTA aims to fix both the memory bottleneck (decoding) and compute bottleneck (prefill) simultaneously.

Methods

GTA introduces two synergistic architectural components:

  1. Shared Attention Maps: GTA partitions queries and keys into a smaller number of groups ($n_q$ and $n_k$, where $n_k \ll n_h$). Multiple heads reuse the exact same attention score distribution ($\mathrm{Softmax}(Q K^\top / \sqrt{d_h})$). This reduces quadratic attention FLOPs and dramatically shrinks the cached key states.
  2. Nonlinear Latent Value Decoder: Rather than caching full, separate value vectors per head, values are projected into a low-dimensional latent space $C \in \mathbb{R}^{N \times n_c d_l}$ and cached. During generation, head-specific values are dynamically decoded on the fly: $$V_i = C_{c(i)} W_{P,i} \odot \mathrm{Sigmoid}(x_t W_{G,i})$$ Here, $W_{P,i}$ is a head-specific projection matrix, and $\mathrm{Sigmoid}(x_t W_{G,i})$ serves as a context-dependent gating mechanism. This dynamic gating injects rank diversity and expressivity back into the grouped values without storing uncompressed vectors in memory.

During inference, GTA only caches keys $K$ and latent representations $C$, resulting in a cache footprint of $\mathcal{O}((n_k d_h + n_c d_l) N)$.

Datasets

The authors trained and evaluated models across several standard public corpora:

  • Pretraining: The C4 dataset was used for 160M and 500M parameter configurations; the SmolLM-corpus (220B tokens) was used for scaling up to 1B parameter models.
  • Supervised Fine-Tuning (SFT): The Tulu 3 SFT mixture dataset (tulu-3-sft-mixture).
  • Downstream Benchmarks: Evaluated via lm-evaluation-harness across common QA, reasoning, coding, and instruction-following benchmarks: WikiText (perplexity), PIQA, HellaSwag, ARC-Easy, ARC-Challenge, BoolQ, MathQA, TruthfulQA, SIQA, MBPP, IFEval, LogiQA, and BBH.

No new benchmarks were created in this work.

Key Insights and Ideas

  • Attention maps are over-parameterized: Reusing attention weight matrices across multiple heads does not harm performance; in fact, the ablations show it provides a mild regularization benefit while drastically reducing compute.
  • Nonlinearity replaces cache size: Simple linear latent compression can bottleneck expressivity, but introducing an element-wise nonlinear gate dynamically restores representation rank without needing to write full head values back into memory.
  • Smoothness beats sparsity for value decoding: Unlike feed-forward networks where sparse activations like ReLU or SiLU promote feature selection, the gating function in GTA works best with Sigmoid. Sparser activations zero out components and diminish the effective rank of values, harming task accuracy.

Key Results

  • Cache & FLOP Reductions: GTA achieves up to a 70% reduction in KV cache footprint and reduces attention FLOPs by up to 62.5% relative to GQA. Per-layer KV cache dimension at 160M dropped to 192 (versus 384 for GQA and 1536 for MHA).
  • Quality Parity / Improvement:
  • At the 160M and 500M scales, GTA achieved lower evaluation loss and better downstream task accuracy than MHA, GQA, and MLA at both 2k and 4k sequence lengths.
  • At the 1B scale, after supervised fine-tuning, GTA-1B-SFT scored an average downstream accuracy of 42.17% compared to 40.64% for GQA-1B-SFT, while using only 30% of GQA's cache.
  • Hardware Throughput: Yields up to a 2× increase in end-to-end inference speed across both compute-bound prefill and I/O-bound decode phases. These gains held consistently across server GPUs (H100, A800), consumer hardware (RTX 3060), and edge platforms (Apple M2, Raspberry Pi BCM2712).

Limitations and Future Work

  • Engineering-Specific Kernel Optimizations: The current implementation uses standard PyTorch operations. Custom fused CUDA/Triton kernels tailored for the shared-attention and gated decoding are needed to reach the theoretical upper bound of hardware efficiency.
  • Model Scale: While the authors evaluate scaling up to 1B parameters (with roofline simulations up to 8B), validation on frontier scale (e.g., 70B+ LLMs) across multi-trillion token pretraining runs remains to be explored.

Summary updated

BibTeX
@misc{sun2025grouped,
  author = {Luoyang Sun and Jiwen Jiang and Cheng Deng and Xinjian Wu and Haifeng Zhang and Lei Chen and Lionel Ni and Jun Wang},
  title = {{Grouped-head latenT Attention}},
  year = {2025},
  eprint = {2506.17286},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.17286},
}
Figure