Large Language Models (LLMs) often exhibit slash attention patterns, where attention scores concentrate along the $Δ$-th sub-diagonal for some offset $Δ$. These patterns play a key role in passing information across tokens. But why do they emerge? In this paper, we demystify the emergence of these Slash-Dominant Heads (SDHs) from both empirical and theoretical perspectives. First, by analyzing open-source LLMs, we find that SDHs are intrinsic to models and generalize to out-of-distribution prompts. To explain the intrinsic emergence, we analyze the queries, keys, and Rotary Position Embedding (RoPE), which jointly determine attention scores. Our empirical analysis reveals two characteristic conditions of SDHs: (1) Queries and keys are almost rank-one, and (2) RoPE is dominated by medium- and high-frequency components. Under these conditions, queries and keys are nearly identical across tokens, and interactions between medium- and high-frequency components of RoPE give rise to SDHs. Beyond empirical evidence, we theoretically show that these conditions are sufficient to ensure the emergence of SDHs by formalizing them as our modeling assumptions. Particularly, we analyze the training dynamics of a shallow Transformer equipped with RoPE under these conditions, and prove that models trained via gradient descent exhibit SDHs. The SDHs generalize to out-of-distribution prompts.


翻译:大型语言模型(LLM)常呈现斜线注意力模式,即注意力分数集中在偏移量为$Δ$的第$Δ$条次对角线上。这类模式在跨词元信息传递中起关键作用。但其为何会产生?本文从实证与理论双重视角揭示了斜线主导注意力头(SDH)的涌现机制。首先,通过分析开源LLM,我们发现SDH是模型固有特性,并能泛化至分布外提示。为解释其固有涌现性,我们分析了共同决定注意力分数的查询向量、键向量及旋转位置编码(RoPE)。实证分析揭示了SDH的两大特征条件:(1)查询向量与键向量近似秩为一;(2)RoPE由中高频分量主导。在此条件下,各词元的查询向量与键向量近乎相同,且RoPE中高频分量间的相互作用催生了SDH。除实证证据外,我们通过将上述条件形式化为建模假设,从理论上证明这些条件足以保证SDH的涌现。特别地,我们分析了满足这些条件的浅层Transformer在RoPE作用下的训练动态,并证明通过梯度下降训练的模型必然呈现SDH特性,且该特性可泛化至分布外提示。

0
下载
关闭预览

相关内容

扩散模型中的注意力机制:综述
专知会员服务
24+阅读 · 2025年4月10日
TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
注意力机制综述
专知会员服务
83+阅读 · 2021年1月26日
专知会员服务
326+阅读 · 2020年11月24日
注意力机制模型最新综述
专知会员服务
271+阅读 · 2019年10月20日
注意力机制介绍,Attention Mechanism
专知会员服务
172+阅读 · 2019年10月13日
注意力机制可解释吗?这篇ACL 2019论文说……
机器之心
11+阅读 · 2019年6月16日
【干货】注意力机制(Attention)最新综述论文及相关源码
GAN生成式对抗网络
11+阅读 · 2018年11月16日
入门 | 什么是自注意力机制?
机器之心
17+阅读 · 2018年8月19日
深度学习中的注意力机制
人工智能头条
16+阅读 · 2017年11月2日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Arxiv
0+阅读 · 2月4日
VIP会员
最新内容
《美陆军条例:陆军指挥政策(2026版)》
专知会员服务
10+阅读 · 4月21日
《军用自主人工智能系统的治理与安全》
专知会员服务
5+阅读 · 4月21日
《系统簇式多域作战规划范畴论框架》
专知会员服务
10+阅读 · 4月20日
高效视频扩散模型:进展与挑战
专知会员服务
5+阅读 · 4月20日
乌克兰前线的五项创新
专知会员服务
8+阅读 · 4月20日
 军事通信系统与设备的技术演进综述
专知会员服务
7+阅读 · 4月20日
《北约标准:医疗评估手册》174页
专知会员服务
6+阅读 · 4月20日
相关VIP内容
扩散模型中的注意力机制:综述
专知会员服务
24+阅读 · 2025年4月10日
TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
注意力机制综述
专知会员服务
83+阅读 · 2021年1月26日
专知会员服务
326+阅读 · 2020年11月24日
注意力机制模型最新综述
专知会员服务
271+阅读 · 2019年10月20日
注意力机制介绍,Attention Mechanism
专知会员服务
172+阅读 · 2019年10月13日
相关资讯
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员