为何“经典”Transformer 是浅层的以及如何使其加深
Why "classic" Transformers are shallow and how to make them go deep
AI总结:
该研究揭示经典Transformer深度受限源于token相似性攀升问题,提出精准移除过度相似性的新策略,实验验证其在小规模post-norm Transformer中有效。
摘要:
自2017年问世以来,Transformer已成为主流神经网络架构,推动了众多AI领域的革命性进展。Transformer的核心创新是旨在捕捉上下文信息的自注意力(Self-Attention, SA)机制。然而,将原始Transformer设计扩展到更深层的模型已被证明极具挑战性,甚至近乎不可能。尽管学界已提出各类改进方案,试图将更多SA机制层堆叠为更深的模型,但人们对这一深度问题仍缺乏全面理解。本文从理论和实证层面开展全面研究,证实深度问题由“token相似性攀升”导致,即token在反复经过SA机制后会变得越来越相似。分析表明,在注意力矩阵的不变主特征空间与大谱隙的作用下,token相似性会以线性速率攀升,这一点已得到证明。基于这一洞见,我们提出一种全新策略:精准移除过度相似性,这与现有显式或隐式削弱SA机制的方法(例如pre-norm Transformer中的做法)形成对比。初步实验结果证实,该策略在小规模post-norm Transformer模型中具备有效性。
英文摘要:
Since its introduction in 2017, Transformer has emerged as the leading neural network architecture, catalyzing revolutionary advancements in many AI disciplines. The key innovation in Transformer is a Self-Attention (SA) mechanism designed to capture contextual information. However, extending the original Transformer design to models of greater depth has proven exceedingly challenging, if not impossible. Even though various modifications have been proposed in order to stack more layers of SA mechanism into deeper models, a full understanding of this depth problem remains lacking. In this paper, we conduct a comprehensive investigation, both theoretically and empirically, to substantiate the claim that the depth problem is caused by \emph{token similarity escalation}; that is, tokens grow increasingly alike after repeated applications of the SA mechanism. Our analysis reveals that, driven by the invariant leading eigenspace and large spectral gaps of attention matrices, token similarity provably escalates at a linear rate. Based on the gained insight, we propose a new strategy of surgically removing excessive similarity in contrast to the existing approach of diminishing the SA mechanism explicitly or implicitly (such as in pre-norm transformers). Preliminary experimental results confirm the effectiveness of the proposed strategy in small-scale post-norm Transformer models.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。