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

深度注意力:语言模型的跨层值混合

Depth-Attention: Cross-Layer Value Mixing for Language Models

LUMIA Lab(LUMIA实验室);School of Artificial Intelligence(人工智能学院);Shanghai Jiao Tong University(上海交通大学);Shanghai AI Laboratory(上海人工智能实验室);Sun Yat-sen University(中山大学);Shanghai Innovation Institute(上海创新研究院)

Boyi Zeng, Yiqin Hao, Zitong Wang, Shixiang Song, He Li, Feichen Song, Yifan Liu, Ziwei He, Xinbing Wang, Zhouhan Lin

AI总结:

提出深度注意力机制,在注意力模块内部实现跨层值混合,无需额外参数和推理状态,提升语言模型性能。

摘要:

自注意力机制可以在序列中自由选择信息,但在深度方向上,Transformer仅将每一层的输出加到残差流中,因此后续层无法选择性重用早期层的表示。最近的跨层方法改善了这种流动,但在注意力之外的隐藏状态上操作,在推理时增加了键值缓存之外的状态——随着现代LLM使用分组查询和多头潜在注意力压缩缓存,这一成本日益显著。我们引入深度注意力,它在注意力模块内部执行这种选择:在一层对序列进行注意力之前,其查询在同一token位置上对早期层的键进行注意力,并将它们的值混合到自注意力随后读取的值中。由于深度注意力重用标准的注意力查询、键和值缓存槽,将深度混合后的值替换原始值,因此它不增加参数,也不引入超出标准键值缓存的持久推理状态——缓存大小与普通解码器相同,且小于基于隐藏状态的跨层方法。在1.5B和3B参数的Qwen3风格解码器上,深度注意力取得了最低的困惑度和最高的平均下游准确率,相比普通Transformer提升高达2.3个准确率点,在困惑度和平均准确率上超越了强跨层基线,同时仅增加不到0.01%的额外算术FLOPs,且无额外持久推理状态。这些增益在360M到3B参数范围内保持一致,并扩展到循环Transformer。

英文摘要:

Self-attention selects information freely across the sequence, but across depth, Transformers merely add each layer's output to the residual stream, so later layers cannot selectively reuse earlier-layer representations. Recent cross-layer methods improve this flow but operate on hidden states outside attention, adding state beyond the key-value cache at inference--a cost that becomes increasingly salient as modern LLMs compress the cache with grouped-query and multi-head latent attention. We introduce Depth-Attention, which performs this selection inside the attention module itself: before a layer attends over the sequence, its query attends over the keys of earlier layers at the same token position and mixes their values into the value that self-attention then reads. Because Depth-Attention reuses the standard attention queries, keys, and value-cache slots, storing depth-mixed values in place of the original values, it adds no parameters and introduces no persistent inference state beyond the standard key-value cache--the same cache size as a vanilla decoder and less than hidden-state-based cross-layer methods. On Qwen3-style decoders at 1.5B and 3B parameters, Depth-Attention attains the lowest perplexity and the highest average downstream accuracy, improving over the vanilla Transformer by up to 2.3 accuracy points and surpassing strong cross-layer baselines in perplexity and average accuracy, while adding under 0.01% extra arithmetic FLOPs and no additional persistent inference state. The gains hold from 360M to 3B parameters and extend to looped Transformers.

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

↑