将自注意力机制统一为图上的连接行走,揭示其几何本质。
From Self-Attention to Connection Laplacian: A Unified Operator View of Transformers

- 把注意力看作在词元位置图上沿边传播消息的连接行走。
- 发现不同层的注意力图趋于稳定几何算子,传输矩阵近似保距变换。
- 适合研究Transformer几何结构与模型可解释性的研究人员。
自注意力是现代序列模型的核心组件,但其算子层面的几何特性仍不明确。本文将词元序列视为定义在词元位置图上的向量场,将注意力建模为一种连接行走:信息通过非负行走矩阵聚合,并沿每条边由学习的线性映射运输。在此框架下,证明单头注意力(SHA)等价于常数运输的连接传播步骤,多头注意力(MHA)等价于依赖边的连接行走,其有效运输为各头运输的注意力加权混合。进一步阐明了生成器退化为随机游走连接拉普拉斯算子的条件,强调了随机性、可逆性及度量相容运输的作用。实验发现,从124M到8B参数量、编码器/解码器结构的训练后Transformer均表现出与理论一致的几何特征:深层中有效注意力图收敛至稳定几何算子,学习的传输矩阵自组织为近似缩放等距变换,且这些现象随模型规模增强。本文提供了精确的连接行走形式化,将自注意力与经典几何算子联系起来,并给出一套基于几何视角分析Transformer的算子工具。
原文摘要 · Abstract (English)
Self-attention is a ubiquitous primitive in modern sequence models, yet its operator-level geometry is only partially understood. We view a token sequence as a vector field over the token-position graph and identify attention as a connection walk: messages are aggregated by a nonnegative walk matrix while being transported along each edge by a learned linear map. Within this framework, we prove that single-head attention (SHA) is exactly a connection propagation step with constant transport, and that multi-head attention (MHA) is exactly a single edge-dependent connection walk whose effective transport is an attention-gated mixture of headwise transports. We further clarify the conditions under which the corresponding generator reduces to a random-walk connection Laplacian, highlighting the roles of stochasticity, reversibility, and metric-compatible transports. Empirically, we find that trained Transformers across scales (from 124M to 8B) and structures (encoder/decoder) exhibit geometric structure consistent with our theory: effective attention graphs converge to stable geometric operators in deeper layers, learned transports self-organize into approximate scaled isometries, and both phenomena strengthen consistently with scale. Overall, the paper provides a precise connection-walk formalism that links self-attention to classical geometric operators, along with a set of operator-level tools for analyzing transformer models from a geometric perspective.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。