Query-key (QK) normalization stabilizes attention by controlling the scale of queries and keys before the dot product, but is not immediately compatible with Multi-head Latent Attention (MLA). MLA achieves efficient decoding by caching low-dimensional latent states instead of full keys, whereas post-projection QK RMSNorm appears to require the fully projected key for every cached token. We show this apparent incompatibility is an implementation artifact, not an architectural constraint. RMSNorm decomposes into a static affine weight and a dynamic scalar RMS statistic. The static key-side weight can be absorbed into the MLA query-side projection; the dynamic key statistic reduces to one inverse-RMS scalar per token and KV group. The resulting formulation is exactly equivalent to explicit post-projection QK RMSNorm in exact arithmetic and preserves MLA's latent decode path. In our 400M runs trained for up to 100B tokens, QK-Normed MLA achieves lower training loss and better downstream accuracy than QK clipping, while H800 decode benchmarks show less than 2% latency overhead up to 256k context. These results make QK normalization a practical stabilization option for MLA models without requiring full-key caching.


翻译:查询-键(QK)归一化通过控制点积前查询与键的尺度来稳定注意力机制,但该技术无法直接兼容多头潜在注意力(MLA)。MLA通过缓存低维潜在状态而非完整键向量实现高效解码,而后投影QK RMSNorm似乎需要为每个缓存令牌存储完整投影后的键。我们证明这种表面上的不兼容性源于实现伪影而非架构约束。RMSNorm可分解为静态仿射权重与动态标量RMS统计量:键侧静态权重可吸收至MLA的查询侧投影中,而键动态统计量则简化为每个令牌及KV组对应的逆RMS标量。该推导公式在精确算术运算下与显式后投影QK RMSNorm完全等价,并保留了MLA的潜在解码路径。在训练量高达1000亿令牌的4亿参数模型中,QK归一化MLA相比QK裁剪方法实现了更低的训练损失与更优的下游准确率,而H800解码基准测试显示在最长256k上下文长度下延迟开销不足2%。这些结果表明QK归一化可为MLA模型提供无需全键缓存的实用稳定方案。

0
下载
关闭预览

相关内容

何恺明&Lecun新论文CVPR2025《无需归一化的 Transformer》
专知会员服务
18+阅读 · 2025年3月15日
TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
【CVPR2024】PromptKD: 无监督提示蒸馏用于视觉-语言模型
专知会员服务
21+阅读 · 2024年3月8日
【总结】强化学习需要批归一化(Batch Norm)吗?
深度强化学习实验室
28+阅读 · 2020年10月8日
详解GAN的谱归一化(Spectral Normalization)
PaperWeekly
11+阅读 · 2019年2月13日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
最新内容
ICML 2026 | CFPO:用反事实策略优化提升多模态推理
专知会员服务
1+阅读 · 今天14:45
综述 | 世界动作模型:少做梦,多行动
专知会员服务
1+阅读 · 今天14:43
美以伊冲突:无人机与人工智能的运用
专知会员服务
3+阅读 · 今天14:31
《特种部队在透明战场中的生存力》最新报告
专知会员服务
2+阅读 · 今天14:11
《人工智能生成的零日漏洞:对未来作战的影响》
综述 | 3D场景图:开放挑战与未来方向
专知会员服务
8+阅读 · 6月22日
21世纪的无人机战争
专知会员服务
4+阅读 · 6月22日
《量子技术的军事任务技术适配与利用》
专知会员服务
5+阅读 · 6月22日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员