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

多矩阵分解注意力

Multi-matrix Factorization Attention

StepFun(阶跃星辰);Tsinghua University(清华大学);Fudan University(复旦大学);Megvii Technology(旷视科技)

Jingcheng Hu, Houyi Li, Yinmin Zhang, Zili Wang, Shuigeng Zhou, Xiangyu Zhang, Heung-Yeung Shum, Daxin Jiang

AI总结:

针对现有多头注意力变体在KV缓存约束下性能下降的问题,提出MFA与MFA-KR两种注意力架构,通过低秩分解和键缓存复用降内存,在缓存大幅减少的同时保持优异性能。

摘要:

我们提出了新型注意力架构:多矩阵分解注意力(Multi-matrix Factorization Attention, MFA)与MFA键复用(MFA-Key-Reuse, MFA-KR)。现有标准多头注意力(Multi-Head Attention, MHA)的变体,包括MLA这类当前最优(SOTA)方法,在严格的键值缓存(KV cache)约束下无法保持同等强劲的性能。MFA通过在查询-键(Query-Key, QK)回路中引入低秩矩阵分解,高效扩展注意力头的数量与维度,从而提升模型容量。在MFA的基础上,MFA-KR通过值投影重参数化,将键缓存复用为值缓存,进一步降低了内存需求。MFA的设计使其在KV缓存预算紧张时仍能保持强大的模型容量,而MFA-KR适用于更严苛的KV缓存限制,仅需小幅牺牲性能。值得注意的是,在我们开展的大规模广泛实验中,所提架构性能优于MLA,与MHA相当,同时分别将KV缓存用量降低了最高56%和93.7%。

英文摘要:

We propose novel attention architectures, Multi-matrix Factorization Attention (MFA) and MFA-Key-Reuse (MFA-KR). Existing variants for standard Multi-Head Attention (MHA), including SOTA methods like MLA, fail to maintain as strong performance under stringent Key-Value cache (KV cache) constraints. MFA enhances model capacity by efficiently scaling up both the number and dimension of attention heads through low-rank matrix factorization in the Query-Key (QK) circuit. Extending MFA, MFA-KR further reduces memory requirements by repurposing the key cache as value through value projection re-parameterization. MFA's design enables strong model capacity when working under tight KV cache budget, while MFA-KR is suitable for even harsher KV cache limits with minor performance trade-off. Notably, in our extensive and large-scale experiments, the proposed architecture outperforms MLA and performs comparably to MHA, while reducing KV cache usage by up to 56% and 93.7%, respectively.

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

↑