要約
アテンション層は、現在の最先端のニューラルネットワークアーキテクチャであるトランスフォーマーの中心的な構成要素である。ソフトマックスベースのアテンションは、効果的な情報の流れを妨げる傾向があるため、その代替案が検討されている。初期化時でさえ、このようなランダムなネットワークを介した信号と勾配の伝搬が病理学的になる理由はまだ十分に理解されておらず、(i)勾配の消失/爆発、(ii)ランク崩壊$textit{in depth}$として知られる問題が生じる。深さにおけるランク崩壊は、繰り返される行列乗算から自然に生じるが$unicode{x2013}$、これは様々なアーキテクチャに共通するパターンである$unicode{x2013}$、我々は、ソフトマックス注意層に特有の、これまで知られていなかった追加の課題を特定する:(iii)コンテキストの長さが長くなるにつれて生じるランク崩壊$textit{in width}$。ランダム行列理論を用いて厳密な解析を行い、(iii)の原因として注意行列の2つの最大の特異値間のスペクトルギャップを発見し、これが(i)と(ii)を悪化させる。この洞察に基づき、外れ値の固有値を除去することで、幅のランク崩壊を緩和する、斬新かつシンプルな実用的解決策を提案する。我々の理論的枠組みは、(Ye et al., 2024; Ali et al., 2023)のような最近の実用的な研究に対して新しい視点を提供する。この研究は、現在進行中の大規模な実証研究に貴重な理論的裏付けを提供し、変圧器の理解において理論と実践を一歩近づけるものである。
要約(オリジナル)
Attention layers are the core component of transformers, the current state-of-the-art neural network architecture. Alternatives to softmax-based attention are being explored due to its tendency to hinder effective information flow. Even at initialisation, it remains poorly understood why the propagation of signals and gradients through these random networks can be pathological, resulting in issues known as (i) vanishing/exploding gradients and (ii) rank collapse $\textit{in depth}$, i.e. when all tokens converge to a single representation along layers. While rank collapse in depth naturally arises from repeated matrix multiplications$\unicode{x2013}$a common pattern across various architectures$\unicode{x2013}$we identify an additional and previously unknown challenge unique to softmax attention layers: (iii) rank collapse $\textit{in width}$, which occurs as the context length increases. Using Random Matrix Theory, we conduct a rigorous analysis that uncovers a spectral gap between the two largest singular values of the attention matrix as the cause of (iii), which in turn exacerbates (i) and (ii). Building on this insight, we propose a novel yet simple practical solution to mitigate rank collapse in width by removing the outlier eigenvalue(s). Our theoretical framework offers a fresh perspective on recent practical studies, such as (Ye et al., 2024; Ali et al., 2023), whose ad hoc solutions can now be interpreted as implicit efforts to address the spectral gap issue. This work provides valuable theoretical support for ongoing large-scale empirical research, bringing theory and practice one step closer in the understanding of transformers.
arxiv情報
著者 | Alireza Naderi,Thiziri Nait Saada,Jared Tanner |
発行日 | 2025-02-03 17:45:29+00:00 |
arxivサイト | arxiv_id(pdf) |