arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.12657cs.LGcs.AI
收藏

克罗内克积注意力:通过结构化分解实现内存高效的键值缓存压缩

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

Huawei Technologies(华为技术有限公司);University of Waterloo(滑铁卢大学)

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

AI总结:

该研究提出克罗内克积注意力(KPA),通过结构化分解压缩KV缓存,性能优于或匹配现有注意力方法,可实现最高10倍KV缓存压缩,且无需额外位置编码机制。

摘要:

高效自回归生成越来越受到键值(KV)缓存内存占用的限制,KV缓存随序列长度、批量大小和模型深度呈线性增长。现有方法如多查询注意力(MQA)、分组查询注意力(GQA)、多头潜在注意力(MLA)和张量积注意力(TPA)通过不同权衡降低该成本,但常牺牲表达能力、需要额外位置编码机制或施加限制性低秩结构。我们提出克罗内克积注意力(KPA),将键和值激活表示为紧凑的、依赖于标记的矩阵因子的克罗内克积之和。KPA严格泛化TPA:秩1向量外积分解是退化的克罗内克拆分,而非退化矩阵因子可表示更丰富的块结构化模式。我们进一步表明,与克罗内克表示匹配的结构化旋转嵌入算子保留了RoPE的相对位置属性,同时仅旋转紧凑因子,消除了MLA中所需的解耦RoPE分支。经验证,在相同训练条件下,KPA在四种模型规模和九个下游基准上的性能与TPA、多头注意力(MHA)、MQA、GQA、MLA相当或更优,同时实现高达10倍的KV缓存压缩。克罗内克头拆分是可调整的超参数,允许从业者在设计时无需架构更改即可调节压缩-精度权衡。

英文摘要:

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 10x 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑