Skip to main content
QUICK REVIEW

[論文レビュー] Long-Short Transformer: Efficient Transformers for Language and Vision

Chen Zhu, Wei Ping|arXiv (Cornell University)|Jul 5, 2021
Multimodal Machine Learning Applications参考文献 62被引用数 56
ひとこと要約

Transformer-LS は動的な低ランク長距離アテンションと局所的なスライディングウィンドウアテンションを組み合わせることで、言語と視覚の長い系列に対して線形時間の自己アテンションを実現し、複数のタスクで最先端の効率的トランスフォーマーを上回ります。

ABSTRACT

Transformers have achieved success in both language and vision domains. However, it is prohibitively expensive to scale them to long sequences such as long documents or high-resolution images, because self-attention mechanism has quadratic time and memory complexities with respect to the input sequence length. In this paper, we propose Long-Short Transformer (Transformer-LS), an efficient self-attention mechanism for modeling long sequences with linear complexity for both language and vision tasks. It aggregates a novel long-range attention with dynamic projection to model distant correlations and a short-term attention to capture fine-grained local correlations. We propose a dual normalization strategy to account for the scale mismatch between the two attention mechanisms. Transformer-LS can be applied to both autoregressive and bidirectional models without additional complexity. Our method outperforms the state-of-the-art models on multiple tasks in language and vision domains, including the Long Range Arena benchmark, autoregressive language modeling, and ImageNet classification. For instance, Transformer-LS achieves 0.97 test BPC on enwik8 using half the number of parameters than previous method, while being faster and is able to handle 3x as long sequences compared to its full-attention version on the same hardware. On ImageNet, it can obtain the state-of-the-art results (e.g., a moderate size of 55.8M model solely trained on 224x224 ImageNet-1K can obtain Top-1 accuracy 84.1%), while being more scalable on high-resolution images. The source code and models are released at https://github.com/NVIDIA/transformer-ls .

研究の動機と目的

  • 長い言語系列と高解像度の視覚入力を扱えるスケーラブルなトランスフォーマーの必要性を動機づける。
  • 長距離動的投影アテンションと短期局所窓アテンションを統合する統一的な Long-Short Transformer(Transformer-LS)を提案する。
  • 長距離成分と短距離成分のスケール不一致に対処する DualLN を導入する。
  • 言語と視覚のベンチマークで最先端の性能と効率を示す。
  • 実装の詳細を提供し、タスク間での頑健性とスケーラビリティを示す。

提案手法

  • 動的低ランク長距離アテンションと局所窓短期アテンションを集約する二重アテンション方式を導入する。
  • K から導出された動的射影 P_i を定義し、K と V を低ランクの bar{K}_i、bar{V}_i に射影する計算量を O(rn) にする。
  • 長距離アテンションを bar{H}_i = A_i (P_i^T W^V V) として計算する。ここで A_i は softmax(QW_i^Q bar{K}_i^T)/sqrt(d_k) 。
  • 長距離と短距離のアテンションをヘッドごとに [tilde{K}_t; bar{K}_i] と [tilde{V}_t; bar{V}_i] にアテンションすることで統合し、ノルムを揃える DualLN スキームを適用する。
  • 自己回帰モデルと双方向モデルの両方に対して線形時間・空間計算量の効率的アテンションを適用する。
  • Dynamic Projection の系列長バリアントおよび摂動に対する頑健性を実証する。

実験結果

リサーチクエスチョン

  • RQ1統一された Long-Short Transformer が、長距離言語タスクと高解像度の視覚タスクの両方で性能を保つまたは向上させながら線形時間の自己アテンションを実現できるか。
  • RQ2動的長距離投影と局所窓アテンションを組み合わせることで、LRA、IMDb、enwik8、text8、ImageNet などの多様な設定で従来の効率的トランスフォーマー手法を上回るか。
  • RQ3提案された DualLN 正規化は、長距離と短距離アテンション間のスケール不一致を抑制するのに有効か。
  • RQ4Transformer-LS は言語と視覚のベンチマークにおいて、自動回帰モデリングと双方向モデリングの両方でどう機能するか。
  • RQ5提案されたアテンション統合が入力摂動(挿入/削除)や可変系列長に対する頑健性に与える影響は。

主な発見

  • Transformer-LS は効率的なトランスフォーマーの中で Long Range Arena のベンチマークで最先端の結果を達成する。
  • 自動回帰的言語モデル化では、Transformer-LS は enwik8 で 0.97 のテスト BPC を達成し、以前の手法の半数のパラメータで同じハードウェア上で同じバジェット内においてより長い系列を扱える。
  • 視覚タスクでは、Transformer-LS 系 CvT および ViL の派生が、FLOPs を削減または同等に抑えつつ ImageNet で競争力のある/最先端の結果を達成する。
  • DualLN アラインメントは、DualLN を用いないモデルと比較して最適化と検証損失を大幅に改善する。
  • Dynamic Projection は挿入/削除摺動に対する頑健性を示し、固定の Linformer ラインプロジェクションより優れた性能を提供する。
  • タスクを跨いで、w および r 設定を用いた Transformer-LS は、精度、FLOPs、系列長のサポートの間で有利なトレードオフを達成することが多い。

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。