内在与外在的组织化注意力:Softmax不变性与网络稀疏性
Intrinsic and Extrinsic Organized Attention: Softmax Invariance and Network Sparsity
AI总结:
本研究通过抛物微积分证明Transformer自注意力对softmax不变性,并利用张量层次组织构建划分树,揭示注意力头结构,支持模型剪枝与可解释性分析。
摘要:
我们研究了Transformer中自注意力机制的内在(注意力头内部)和外在(注意力头之间)结构。通过借助抛物微积分,我们获得了自注意力机制对softmax激活函数具有不变性的理论证据(并辅以计算示例支持),该不变性依赖于注意力头的内在组织。此外,我们利用一种现有的张量层次组织方法,通过构建关于网络三阶张量的查询、键和头轴的分层划分树来考察网络结构。这种组织具有重要意义,因为它允许人们在组织化网络三阶张量表现出规律性的几何结构上,有效地执行常见的信号处理任务。我们通过可视化由注意力头和扩散映射嵌入组成的树的层次组织来定性示例说明,并通过考察网络稀疏性来定量说明,即利用网络查询、键和头空间上的双哈尔和三哈尔基(分别)对单个注意力头和整个网络的展开系数。为了展示我们理论和方法论发现的实用性,我们提供了使用视觉和语言Transformer的计算示例。这些发现的影响有两方面:(1)在可解释性分析中,后续步骤在理论上被允许,并且可以在经验上用于下游可解释性任务;(2)可以利用网络三阶张量组织进行经验性网络应用,如模型剪枝(凭借网络稀疏性)和网络架构比较。
英文摘要:
We examine the intrinsic (within the attention head) and extrinsic (amongst the attention heads) structure of the self-attention mechanism in transformers. Theoretical evidence for invariance of the self-attention mechanism to softmax activation is obtained by appealing to paradifferential calculus, (and is supported by computational examples), which relies on the intrinsic organization of the attention heads. Furthermore, we use an existing methodology for hierarchical organization of tensors to examine network structure by constructing hierarchal partition trees with respect to the query, key, and head axes of network 3-tensors. Such an organization is consequential since it allows one to profitably execute common signal processing tasks on a geometry where the organized network 3-tensors exhibit regularity. We exemplify this qualitatively, by visualizing the hierarchical organization of the tree comprised of attention heads and the diffusion map embeddings, and quantitatively by investigating network sparsity with the expansion coefficients of individual attention heads and the entire network with respect to the bi and tri-haar bases (respectively) on the space of queries, keys, and heads of the network. To showcase the utility of our theoretical and methodological findings, we provide computational examples using vision and language transformers. The ramifications of these findings are two-fold: (1) a subsequent step in interpretability analysis is theoretically admitted, and can be exploited empirically for downstream interpretability tasks (2) one can use the network 3-tensor organization for empirical network applications such as model pruning (by virtue of network sparsity) and network architecture comparison.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。