Manuscript Offprint

arXiv:2610.12657

Kronecker Product Attention: Memory-Efficient KV Compression via Structured Factorization

Bahareh Nikpour, Hossein Rajabzadeh, Maryam Dialameh, Vahid Partovi Nia, Parsa Omidi

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Efficient autoregressive generation is increasingly limited by the memory footprint of the key-value (KV) cache, which grows linearly with sequence length, batch size, and model depth. Existing approaches such as Multi-Query Attention (MQA), Grouped-Query Attention (GQA), Multi-Head Latent Attention (MLA), and Tensor Product Attention (TPA) reduce this cost through different trade-offs, but often sacrifice expressivity, require additional positional-encoding machinery, or impose restrictive low-rank structure. We propose Kronecker Product Attention (KPA), which represents key and value activations as sums of Kronecker products of compact, token-dependent matrix factors. KPA strictly generalizes TPA: rank-one vector-outer-product factorization arises as a degenerate Kronecker split, while non-degenerate matrix factors can represent richer block-structured patterns. We further show that a structured rotary embedding operator matched to the Kronecker representation preserves the relative-position property of RoPE while rotating only the compact factors, removing the need for a decoupled RoPE branch as in MLA. Empirically, KPA matches or exceeds TPA, MHA, MQA, GQA, and MLA across four model scales and nine downstream benchmarks under identical training conditions, while achieving up to 10×10\times KV cache compression. The Kronecker head split is a tuneable hyperparameter that allows practitioners to navigate the compression–accuracy trade-off at design time without architectural changes.

1 Introduction

The deployment of large-scale Transformer-based language models is increasingly bottlenecked by inference-time memory rather than parameter count. At the core of this bottleneck is the key-value (KV) cache, which stores projected keys and values across every layer and token so they do not need to be recomputed during decoding. This cache grows linearly with sequence length, batch size, and head dimensionality. As context windows extend to hundreds of thousands of tokens and batch sizes increase for throughput, the KV cache can dominate total GPU memory consumption, leaving little headroom for model weights or activations and directly limiting the context length, batch size, and deployment scale that practitioners can afford, motivating a broad line of work on KV compression.

Existing approaches address this along several lines. Token eviction and sparse attention methods risk discarding relevant tokens [Zhang et al., 2023, Xiao et al., 2023]. Others propose off-chip storage of key-value states, trading memory pressure for increased I/O latency. At the architectural

∗^{*}This work was done while the author was affiliated with Huawei Canada.

40th Conference on Neural Information Processing Systems (NeurIPS 2026). Workshop: SLM-Agents: 1st Workshop on Small Language Models for Agentic Systems.

Figure

Figure 1: Overview of Multi-Head Attention (MHA), Tensor Product Attention (TPA), and Kronecker Product Attention (KPA, ours). MHA projects x directly into dense Q, K, V. TPA and KPA instead factor each projection into two components, combined via an outer product (×) for TPA or a Kronecker product (⊗) for KPA. RoPE is applied only to Q and K (never V), and rotates only the B factor in both methods (Theorem 2.4 formalizes this for KPA); A is cached unrotated. Since TPA's A, B are vectors, their outer product is a flat, unstructured matrix; since KPA's A, B are matrices, their Kronecker product is block-structured with a two-level head/feature hierarchy (shown by the internal grid lines). Only K, V factors enter the KV cache; Q is not cached. The token index t is omitted throughout except on the final QtQ_t, KtK_t, VtV_t, for clarity.

level, Multi-Query Attention (MQA) Shazeer [2019] and Grouped-Query Attention (GQA) [Ainslie et al., 2023] share keys and values across heads at the cost of representational diversity. Multi-Head Latent Attention (MLA) [DeepSeek-AI, 2024] avoids this by caching compressed latent representations instead, but requires a decoupled RoPE branch, in which a small set of uncompressed key dimensions carry the rotary embedding and are concatenated to the latent key at each decoding step. Tensor Product Attention (TPA) imposes low-rank CP (Canonical Polyadic) structure directly on KV projections, storing only the low-dimensional factors[Zhang et al., 2025]. However, CP decomposition operates on vectors and cannot jointly encode structure at both the head level and the feature level within each head. This limitation is important as empirical studies have shown that attention heads specialize into distinct functional roles, with different subsets attending to syntactic, semantic, and positional patterns, suggesting that an effective KV factorization should operate at both levels simultaneously [Michel et al., 2019, Voita et al., 2019].

Motivated by this, we use Kronecker product structure to represent per-token key and value matrices via two smaller contextual matrix factors. Unlike CP decomposition which operates on vectors, the Kronecker product expands two small matrices into a larger block-structured matrix with the same shape as a standard key or value slice, making it naturally suited to multi-head attention where both the head axis and the within-head feature axis have product structure. Among structured factorizations, the Kronecker product is distinguished by combining three properties in a single operation: its mixed-product identity lets inner products between Kronecker-structured queries and keys factor into products of smaller inner products; it admits a Kronecker-separable rotary operator that acts on only one compact factor; and a rank-1 outer product, which is the basic building block of CP decomposition, is a special case, making Kronecker factorization strictly more general than CP at the same parameter budget. We note that Kronecker structure has also been explored in attention mechanisms for encoder models operating on multi-dimensional inputs [Omranpour et al., 2024], reducing training-time computation rather than KV cache size. That setting differs fundamentally from autoregressive decoding, which is our focus.

We introduce Kronecker Product Attention (KPA), a structured attention mechanism that applies this factorization to the query, key, and value projections of each attention head. This yields a family of KV compression schemes parameterized by the factor dimensions, allowing flexible trade-offs between compression ratio, head structure, and representational capacity. We provide a theoretical analysis characterizing the expressivity of KPA as a function of rank and factor dimensions, and prove that a modified frequency schedule we call Kronecker-Separable RoPE integrates seamlessly with the factorized KV representation without materializing the full key or value tensors and without breaking the standard relative-position property. To evaluate KPA empirically, we train models at four scales including 124M, 353M, 773M, and 1.5B parameters on the FineWeb-Edu corpus. We compare KPA variants against TPA at matched compression ratios, finding that KPA matches or exceeds TPA across all scales. Figure 1 summarizes the contrast between MHA, TPA, and KPA. Our contributions are as follows:

• We propose Kronecker Product Attention (KPA), the first application of Kronecker product factorization to per-token, contextual key and value representations for KV cache compression in autoregressive decoding. Unlike prior Kronecker attention work that decomposes static attention score matrices for encoder models, KPA operates on input-dependent factors and directly reduces inference-time memory.

• We introduce Kronecker-Separable RoPE, which applies rotary position encoding directly to the compact key factors, preserving the standard relative-position property without a decoupled RoPE branch as in MLA.

• We train KPA at four scales (125M–1.5B) on FineWeb-Edu under identical conditions to TPA, showing KPA matches or exceeds TPA, MHA, MQA, GQA, and MLA across nine benchmarks while achieving 6.4×−10×6.4 \times -10 \times KV cache compression.

References (34)

  • Gqa: Training generalized multi-query transformer models from multi-head checkpoints
  • Extending context window of large language models via positional interpolation
  • Rethinking attention with Performers
  • Monarch: Expressive structured matrices for efficient and accurate training
  • KronA: Parameter efficient tuning with Kronecker adapter (opens arXiv in a new tab)
  • Kronecker decomposition for GPT compression
  • KVQuant: Towards 10 million context length LLM inference with KV cache quantization
  • Efficient memory management for large language model serving with PagedAttention
  • KIVI: A tuning-free asymmetric 2bit quantization for KV cache
  • Are sixteen heads really better than one? In Advances in Neural Information Processing Systems, volume 32, 2019
  • Tensorizing neural networks
  • Higher order transformers: Efficient attention mechanism for tensor structured data
  • The fineweb datasets: Decanting the web for the finest text data at scale (opens arXiv in a new tab)
  • YaRN: Efficient context window extension of large language models
  • Train short, test long: Attention with linear biases enables input length extrapolation
  • GLU Variants Improve Transformer
  • Roformer: Enhanced transformer with rotary position embedding
  • A length-extrapolatable transformer
  • Kronecker-BERT: Significant compression of pre-trained language models through Kronecker decomposition and knowledge distillation
  • Approximation with kronecker products
  • Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned
  • Linformer: Self-attention with linear complexity
  • Efficient Streaming Language Models with Attention Sinks
  • Efficient streaming language models with attention sinks
  • H2O: Heavy-hitter oracle for efficient generative inference of large language models
  • All models use the nanoGPT codebase [Karpathy, 2022] with SwiGLU activations [Shazeer, 2020] and RoPE embeddings [Su et al., 2024]
  • KPA outperforms TPA and all other baselines on eight of nine benchmarks, with the only exception being MMLU where MHA achieves a slightly higher score
  • Consistent with the pattern at larger scales, asymmetric splits with larger $h_1$ perform better: $h = (6 \times 2)$ achieves the best average, followed by $h = (4 \times 3)$, $h = (3 \times 4)$, and $h = (2 \times 6)$
  • Baselines from Zhang et al. [2025]
  • KPA avoids head sharing entirely and eliminates the decoupled RoPE branch by exploiting the Kronecker structure of its projections
  • These methods target the quadratic complexity of attention rather than KV cache size and do not apply to autoregressive decoding
  • KIVI [Liu et al., 2024] and KVQuant [Hooper et al., 2024] compress the cache through low-bit quantization, trading precision for memory
  • ALiBi [Press et al., 2022] instead adds position-dependent biases to attention logits, avoiding explicit positional embeddings
  • KroneckerBERT [Tahaei et al., 2022] compresses BERT weight matrices via Kronecker decomposition with knowledge distillation