Scaling depth is a key driver for large language models (LLMs). Yet, as LLMs become deeper, they often suffer from signal degradation: informative features formed in shallow layers are gradually diluted by repeated residual updates, making them harder to recover in deeper layers. We introduce mixture-of-depths attention (MoDA), a mechanism that allows each attention head to attend to sequence KV pairs at the current layer and depth KV pairs from preceding layers. We further describe a hardware-efficient algorithm for MoDA that resolves non-contiguous memory-access patterns, achieving 97.3% of FlashAttention-2's efficiency at a sequence length of 64K. Experiments on 1.5B-parameter models demonstrate that MoDA consistently outperforms strong baselines. Notably, it improves average perplexity by 0.2 across 10 validation benchmarks and increases average performance by 2.11% on 10 downstream tasks, with a negligible 3.7% FLOPs computational overhead. We also find that combining MoDA with post-norm yields better performance than using it with pre-norm. These results suggest that MoDA is a promising primitive for depth scaling. Code is released at https://github.com/hustvl/MoDA .


翻译:增加深度是驱动大语言模型(LLM)发展的关键因素。然而,随着大语言模型变得更深,它们常常遭受信号退化问题:在浅层形成的具有信息量的特征,会因重复的残差更新而逐渐被稀释,使得这些特征在更深层中更难被恢复。我们提出了深度混合注意力机制(MoDA),该机制允许每个注意力头同时关注当前层的序列键值对以及来自前面各层的深度键值对。我们进一步描述了一种硬件高效的MoDA算法,该算法解决了非连续内存访问模式的问题,在序列长度为64K时达到了FlashAttention-2 97.3%的效率。在15亿参数模型上的实验表明,MoDA始终优于强基线模型。值得注意的是,它在10个验证基准测试中平均困惑度降低了0.2,在10个下游任务上平均性能提升了2.11%,而计算开销仅增加了微不足道的3.7% FLOPs。我们还发现,将MoDA与后归一化结合使用,比将其与前归一化结合能获得更好的性能。这些结果表明,MoDA是一种有前景的深度扩展基础组件。代码发布于 https://github.com/hustvl/MoDA。

0
下载
关闭预览

相关内容

Deep Research(深度研究):系统性综述
专知会员服务
50+阅读 · 2025年12月3日
TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
混合专家模型在大模型微调领域进展
专知会员服务
48+阅读 · 2024年9月23日
最新《注意力机制与深度学习结合》综述论文
专知会员服务
76+阅读 · 2021年6月17日
注意力机制综述
专知会员服务
83+阅读 · 2021年1月26日
注意力机制介绍,Attention Mechanism
专知会员服务
172+阅读 · 2019年10月13日
注意力机制综述(中文版)
专知
23+阅读 · 2021年1月26日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
Attention!注意力机制模型最新综述
专知
65+阅读 · 2019年4月8日
注意力机制(Attention)最新综述论文及相关源码
人工智能学家
30+阅读 · 2018年11月17日
【干货】注意力机制(Attention)最新综述论文及相关源码
GAN生成式对抗网络
11+阅读 · 2018年11月16日
深度学习中的注意力机制
人工智能头条
16+阅读 · 2017年11月2日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Arxiv
0+阅读 · 2月24日
Arxiv
0+阅读 · 2月17日
Arxiv
0+阅读 · 2月4日
VIP会员
最新内容
人工智能在战场行动中的演进及伊朗案例
专知会员服务
2+阅读 · 今天13:08
美AI公司Anthropic推出网络安全模型“Mythos”
专知会员服务
2+阅读 · 今天12:58
【博士论文】面向城市环境的可解释计算机视觉
专知会员服务
0+阅读 · 今天12:57
大语言模型的自改进机制:技术综述与未来展望
专知会员服务
0+阅读 · 今天12:50
《第四代军事特种作战部队选拔与评估》
专知会员服务
1+阅读 · 今天6:23
相关VIP内容
Deep Research(深度研究):系统性综述
专知会员服务
50+阅读 · 2025年12月3日
TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
混合专家模型在大模型微调领域进展
专知会员服务
48+阅读 · 2024年9月23日
最新《注意力机制与深度学习结合》综述论文
专知会员服务
76+阅读 · 2021年6月17日
注意力机制综述
专知会员服务
83+阅读 · 2021年1月26日
注意力机制介绍,Attention Mechanism
专知会员服务
172+阅读 · 2019年10月13日
相关资讯
注意力机制综述(中文版)
专知
23+阅读 · 2021年1月26日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
Attention!注意力机制模型最新综述
专知
65+阅读 · 2019年4月8日
注意力机制(Attention)最新综述论文及相关源码
人工智能学家
30+阅读 · 2018年11月17日
【干货】注意力机制(Attention)最新综述论文及相关源码
GAN生成式对抗网络
11+阅读 · 2018年11月16日
深度学习中的注意力机制
人工智能头条
16+阅读 · 2017年11月2日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员