Skip to main content
QUICK REVIEW

[論文レビュー] Neural Architecture Search on Efficient Transformers and Beyond

Zexiang Liu, Dong Li|arXiv (Cornell University)|Jul 28, 2022
Advanced Neural Network Applications被引用数 11
ひとこと要約

本稿では、計算効率の高いTransformer向けに最適なアーキテクチャを自動で発見することを目的としたニューラルアーキテクチャサーチ(NAS)フレームワークを提案する。特にカーネルベースのcosFormerを対象として、Softmax注意と線形注意を組み合わせたミックスド注意探索空間を導入することで、標準のTransformerと同等の性能を達成しつつ、大幅に高い計算効率を実現した。純粋に効率的なモデルよりも高い精度を維持しながら、FLOPSを低く抑えることに成功した。

ABSTRACT

Recently, numerous efficient Transformers have been proposed to reduce the quadratic computational complexity of standard Transformers caused by the Softmax attention. However, most of them simply swap Softmax with an efficient attention mechanism without considering the customized architectures specially for the efficient attention. In this paper, we argue that the handcrafted vanilla Transformer architectures for Softmax attention may not be suitable for efficient Transformers. To address this issue, we propose a new framework to find optimal architectures for efficient Transformers with the neural architecture search (NAS) technique. The proposed method is validated on popular machine translation and image classification tasks. We observe that the optimal architecture of the efficient Transformer has the reduced computation compared with that of the standard Transformer, but the general accuracy is less comparable. It indicates that the Softmax attention and efficient attention have their own distinctions but neither of them can simultaneously balance the accuracy and efficiency well. This motivates us to mix the two types of attention to reduce the performance imbalance. Besides the search spaces that commonly used in existing NAS Transformer approaches, we propose a new search space that allows the NAS algorithm to automatically search the attention variants along with architectures. Extensive experiments on WMT' 14 En-De and CIFAR-10 demonstrate that our searched architecture maintains comparable accuracy to the standard Transformer with notably improved computational efficiency.

研究の動機と目的

  • 標準のTransformer設計から派生した手作業で設計されたアーキテクチャが、効率的Transformerにおいて性能が最適でないという問題に対処すること。
  • NASが、線形注意のような効率的注意メカニズムに特化したカスタマイズされたアーキテクチャを発見できるかを調査すること。
  • Softmax注意を線形注意に置き換える場合に、精度と効率のトレードオフがどのように変化するかを明らかにすること。
  • 単一のモデル内でSoftmaxと線形注意を組み合わせた新しいミックスド注意メカニズムを提案・検証すること。
  • 機械翻訳や画像分類といった実世界のタスクにおいて、提案されたNASフレームワークの有効性を実証すること。

提案手法

  • 探索コストを削減するため、ペairワイズ順序付けとハードウェアに配慮した制約を用いたRankNASフレームワークを採用し、ニューラルアーキテクチャサーチを高速化する。
  • アーキテクチャハイパーパramータ(例:ヘッド数、フィードフォワード次元)と各レイヤーごとの注意タイプ(Softmax対線形)を同時に探索できる新しい探索空間を設計する。
  • cosFormerを効率的Transformerのターゲットモデルとして採用し、そのSoftmax注意を線形注意に置き換えることで、O(N)の複雑度で効率的な計算を可能にする。
  • 汎化性能を評価するために、WMT’14 En-De機械翻訳およびCIFAR-10画像分類の2つのベンチマークタスクでNASを実施する。
  • 探索結果に基づき、各レイヤーでSoftmaxと線形注意の動的選択が可能なmFormerアーキテクチャを導入し、ハイブリッド注意メカニズムを実現する。
  • 探索空間のプルーニングと早期停止を適用することで、モデル品質に損なわれることなくNASプロセスの効率を向上させる。

実験結果

リサーチクエスチョン

  • RQ1手作業で設計されたアーキテクチャが標準のTransformer向けに作られたものであるのに対し、NASは効率的Transformer向けにより適したアーキテクチャを発見できるか?
  • RQ2同じ探索空間を用いた場合、純粋に効率的なTransformer(例:cosFormer)と標準のTransformerとの間で、精度とFLOPSの性能はどのように異なるか?
  • RQ3Softmaxと線形注意を組み合わせたミックスド注意メカニズムは、単独で使用する場合と比較して、精度と計算効率のバランスをより良くするか?
  • RQ4異なるタスクにおいて、NASが効率的Transformer向けに発見した最適アーキテクチャにどのような構造的パターンが現れるか?
  • RQ5提案されたNASフレームワークは、標準のTransformerと比較して顕著に低いFLOPSで高い精度を達成しつつ、競争力のある性能を維持できるか?

主な発見

  • 効率的cosFormerモデルの最適アーキテクチャは、標準のTransformerと比較して18%少ないパラメータと18%低いFLOPSを実現したが、精度は低く、性能と効率のバランスが崩れていることが示された。
  • Softmaxと線形注意を組み合わせたmFormerは、標準のTransformerと同等のBLEUスコア(1.51ポイント低い)を達成しながら、FLOPSを23%削減、パラメータを20%削減した。
  • CIFAR-10では、mFormerはcosFormer*を5.19ポイントの精度向上を達成したが、FLOPSはわずか1.38G増加に抑えられ、優れたバランスを示した。
  • mFormer内のすべての線形注意をSoftmaxに置き換えると、わずかな精度の向上が得られたが、FLOPSは著しく増加し、効率とコストのトレードオフが確認された。
  • Transformer*のすべてのSoftmax注意を線形注意に置き換えると、特に画像分類タスクで顕著な精度の低下が生じた。これは、線形注意の精度に制限があることを示している。
  • mFormerアーキテクチャは、『浅く細い』設計を特徴とし、25%のレイヤーで線形注意(例:レイヤー3, 7, 11)が使用され、残りはSoftmax注意が使用される。ヘッド数はフィードフォワード次元と逆相関関係にある。

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

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

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

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