MLP Can Be A Good Transformer Learner

要約

自己注意メカニズムは Transformer の鍵ですが、その計算要求がしばしば批判されます。
以前のトークン プルーニングの作業は、計算の冗長性の観点からその手法を動機付けていましたが、それでもネットワーク全体に負荷をかける必要があり、同じメモリ コストが必要でした。
この論文では、エントロピーの考慮に基づいて、ビジョン トランスフォーマーを簡素化し、必須ではない注目層を選択的に削除することで計算負荷を軽減する新しい戦略を紹介します。
最下位ブロックのアテンション層に関して、後続の MLP 層、つまり 2 つのフィードフォワード層が同じエントロピー量を引き出すことができることを確認します。
一方、付随する MLP は、上位ブロックの MLP と比較して特徴エントロピーが小さいため、十分に活用されていません。
したがって、非有益なアテンション層を同一のマッピングに縮退することで後続の対応層に統合し、特定の変換ブロックで MLP のみを生成することを提案します。
ImageNet-1k での実験結果は、提案された方法が DeiT-B の 40% のアテンション層を除去し、パフォーマンスを犠牲にすることなくスループットとメモリ制限を改善できることを示しています。
コードは https://github.com/sihaoevery/lambda_vit で入手できます。

要約(オリジナル)

Self-attention mechanism is the key of the Transformer but often criticized for its computation demands. Previous token pruning works motivate their methods from the view of computation redundancy but still need to load the full network and require same memory costs. This paper introduces a novel strategy that simplifies vision transformers and reduces computational load through the selective removal of non-essential attention layers, guided by entropy considerations. We identify that regarding the attention layer in bottom blocks, their subsequent MLP layers, i.e. two feed-forward layers, can elicit the same entropy quantity. Meanwhile, the accompanied MLPs are under-exploited since they exhibit smaller feature entropy compared to those MLPs in the top blocks. Therefore, we propose to integrate the uninformative attention layers into their subsequent counterparts by degenerating them into identical mapping, yielding only MLP in certain transformer blocks. Experimental results on ImageNet-1k show that the proposed method can remove 40% attention layer of DeiT-B, improving throughput and memory bound without performance compromise. Code is available at https://github.com/sihaoevery/lambda_vit.

arxiv情報

著者 Sihao Lin,Pumeng Lyu,Dongrui Liu,Tao Tang,Xiaodan Liang,Andy Song,Xiaojun Chang
発行日 2024-04-08 16:40:15+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CV パーマリンク