arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2610.33625cs.AIcs.LG
收藏

RAQ-MLA:面向多头潜在注意力缓存的角色感知量化

RAQ-MLA: Role-Aware Quantization for Multi-Head Latent Attention Caches

School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);Tencent(腾讯)

Tianqi Chen, Xunchao Li, Linchuan Xie, Guanghua Yu, Jianchen Zhu, Peisong Wang, Jian Cheng

AI总结:

该研究针对现有KV缓存量化方法不适用于MLA的问题,提出RAQ-MLA角色感知量化方法,在不损失精度的前提下将MLA缓存量化至约2.5比特/元素,理论KV缓存容量提升6.5倍。

摘要:

多头潜在注意力(Multi-Head Latent Attention,MLA)已被近期前沿大语言模型采用。与标准注意力的按头键值不同,MLA缓存压缩后的KV潜在向量,该向量在解码时会被上投影为键和值,同时还有携带位置信息的窄位置键,用于注意力分数计算。现有的KV缓存量化方法是围绕标准注意力的键和值设计的,未考虑MLA实际缓存的内容,这会在低位宽时损失精度。我们从激活分布和量化误差向注意力输出的传播两方面分析MLA缓存,发现两个缓存张量扮演不同角色:潜在向量主要提供值,而位置键主导注意力分数。因此我们提出RAQ-MLA(面向多头潜在注意力缓存的角色感知量化),它针对每个缓存张量拟合可逆变换,变换依据是该张量对注意力输出产生的误差:针对潜在向量的注意力加权值误差,以及针对位置键的分数扰动。无需训练,RAQ-MLA可将完整MLA缓存量化至每个元素约2.5比特,理论KV缓存容量提升6.5倍,同时在四个MLA模型的推理和编码任务上保持几乎无损失。

英文摘要:

Multi-Head Latent Attention (MLA) has been adopted by recent frontier large language models. Instead of per-head keys and values, MLA caches a compressed KV latent that is up-projected into keys and values at decode time, together with a narrow positional key that carries position information into the attention score. Existing KV-cache quantization methods are designed around the keys and values of standard attention and do not account for what MLA actually caches, which costs accuracy at low bit widths. We analyze the MLA cache both in activation distribution and in how quantization error propagates to the attention output, and show that the two cached tensors play different roles: the latent mainly supplies the values, whereas the positional key dominates the attention score. We therefore propose RAQ-MLA (Role-Aware Quantization for Multi-Head Latent Attention Caches), which fits an invertible transform to each cached tensor against the error that tensor delivers to the attention output: attention-weighted value error for the latent and score perturbation for the positional key. Without training, RAQ-MLA quantizes the full MLA cache to about 2.5 bits per element, a 6.5x increase in theoretical KV-cache capacity, while remaining nearly lossless on reasoning and coding tasks across four MLA models.

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

↑