Long-context inference in large language models is bottlenecked by Key--Value (KV) cache loading during the decoding stage, where the sequential nature of generation requires repeatedly transferring the KV cache from off-chip High-Bandwidth Memory (HBM) to on-chip Static Random-Access Memory (SRAM) at each step. While Multi-Head Latent Attention (MLA) significantly reduces the total KV cache size, it suffers from a sharding bottleneck during distributed decoding via Tensor Parallelism (TP). Since its single latent head cannot be partitioned, each device is forced to redundantly load the complete KV cache for every token, consuming excessive memory traffic and diminishing TP benefits like weight sharding. In this work, we propose Multi-Head Low-Rank Attention (MLRA), which enables partitionable latent states for efficient 4-way TP decoding. Extensive experiments show that MLRA achieves state-of-the-art perplexity and downstream task performance, while also delivering a 2.8$\times$ decoding speedup over MLA. Code is available at https://github.com/SongtaoLiu0823/MLRA. Pretrained weights, along with the training and evaluation data, are available at https://huggingface.co/Soughing/MLRA.


翻译:大型语言模型的长上下文推理在解码阶段受到键值(KV)缓存加载的瓶颈制约,其中生成的序列性要求在每一步都将KV缓存从片外高带宽存储器(HBM)重复传输至片内静态随机存取存储器(SRAM)。虽然多头潜在注意力(MLA)显著减少了KV缓存的总大小,但在通过张量并行(TP)进行分布式解码时,它会遇到分片瓶颈。由于其单个潜在头无法被分区,每个设备被迫为每个令牌冗余加载完整的KV缓存,消耗过多的内存流量并削弱了权重分片等TP优势。在本工作中,我们提出了多头低秩注意力(MLRA),它实现了可分区潜在状态,以实现高效的4路TP解码。大量实验表明,MLRA在困惑度和下游任务性能上达到了最先进水平,同时相比MLA实现了2.8$\times$的解码加速。代码可在 https://github.com/SongtaoLiu0823/MLRA 获取。预训练权重以及训练和评估数据可在 https://huggingface.co/Soughing/MLRA 获取。

0
下载
关闭预览

相关内容

大型语言模型的规模效应局限
专知会员服务
14+阅读 · 2025年11月18日
TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
浅谈多模态大模型幻觉缓解方法
专知会员服务
24+阅读 · 2024年12月17日
【ICML2024】通过动态可组合多头注意力改进Transformers
专知会员服务
21+阅读 · 2024年5月17日
基于多头注意力胶囊网络的文本分类模型
专知会员服务
79+阅读 · 2020年5月24日
注意力机制介绍,Attention Mechanism
专知会员服务
172+阅读 · 2019年10月13日
用Attention玩转CV,一文总览自注意力语义分割进展
注意力机制可解释吗?这篇ACL 2019论文说……
机器之心
11+阅读 · 2019年6月16日
深度学习中的注意力机制
人工智能头条
16+阅读 · 2017年11月2日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Mixture-of-Depths Attention
Arxiv
0+阅读 · 3月16日
VIP会员
最新内容
《美陆军最新条令:兵力防护》
专知会员服务
1+阅读 · 11分钟前
《人工智能的挑战:算法战的想象与现实》
专知会员服务
1+阅读 · 28分钟前
首场人工智能战争:Maven如何重塑武装冲突
专知会员服务
1+阅读 · 42分钟前
《通往人工通用智能之路上的均衡策略》
专知会员服务
7+阅读 · 6月3日
《Palantir的科技生态系统》
专知会员服务
17+阅读 · 6月2日
相关VIP内容
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员