提升注意力模型效率,让多头潜空间注意力更精准且不增加缓存开销。
CARE: Covariance-Aware and Rank-Enhanced Decomposition for Enabling Multi-Head Latent Attention
- 基于激活特性重构权重,避免传统方法仅关注权重矩阵误差。
- 按需分配秩容量,解决各层能力不均导致的激活漂移问题。
- 保持缓存大小不变,适配主流大模型推理场景,适合部署优化。
将预训练注意力模块(如分组查询注意力)转换为多头潜空间注意力(MLA),可在不增加键值缓存成本的前提下提升表达能力,具有高效推理吸引力。然而,现有转换方法多依赖仅权重的低秩近似(如SVD初始化)和均匀秩分配,忽视输入激活的影响、忽略激活的协方差结构,并强制全层统一秩,导致激活漂移与注意力保真度下降。为此,本文提出CARE:一种在固定键值宽度下的协方差感知、秩增强型转化流程。CARE包含三个关键步骤:(i) 激活保持分解,使近似更贴近实际输入激活而非仅权重;(ii) 调整秩分配,在固定键值预算下将容量优先分配给最需要的层;(iii) KV一致性映射,重新参数化转换后的键值以适配MLA格式,同时保持键值缓存大小不变。实验表明,CARE在Qwen3-4B/30B-A3B-Instruct-2507和Llama-3.1-8B/70B-Instruct上优于均匀秩的SVD基线,单次推理困惑度降低最高达215倍,平均准确率提升最高达1.70倍,且在简短后处理微调后可完全恢复原始模型性能。
原文摘要 · Abstract (English)
Converting pretrained attention modules such as grouped-query attention (GQA) into multi-head latent attention (MLA) can improve expressivity without increasing KV-cache cost, making it attractive for efficient inference. However, many practical conversion baselines rely on weight-only low-rank approximations (e.g., SVD-style initializations) and uniform rank allocation. They focus on minimizing the difference between weight matrices rather than on how those weights affect input activations, ignore the covariance structure of activations, and enforce uniform rank across layers, causing activation drift and degraded attention fidelity. To address these issues, we propose CARE, a Covariance-Aware, Rank-Enhanced MLA conversion pipeline under a fixed KV width. CARE introduces three key steps: (i) activation-preserving factorization, which aligns the approximation with the actual input activations rather than just the weights; (ii) adjusted-rank allocation, which spreads a fixed KV budget across layers by giving more capacity to layers that need it most; and (iii) KV-parity mapping, which reparameterizes the converted K and V to fit the MLA format while keeping the KV-cache size unchanged. Our method outperforms a uniform-rank SVD baseline on Qwen3-4B/30B-A3B-Instruct-2507 and Llama-3.1-8B/70B-Instruct, reducing one-shot perplexity by up to 215x and improving mean accuracy by up to 1.70x at matched KV budgets. With a brief post-SVD healing fine-tune, we fully recover the original model's accuracy.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。