Skip to main content
QUICK REVIEW

[論文レビュー] Monarch Mixer: A Simple Sub-Quadratic GEMM-Based Architecture

Daniel Y. Fu, Simran Arora|arXiv (Cornell University)|Oct 18, 2023
Neural Networks and ApplicationsComputer Science被引用数 14
ひとこと要約

Monarch Mixer (M2) は Monarch matrices を用いたサブ二次的混合を導入し、非因果・因果・ビジョンタスクを通じて Transformers と競合する、またはそれを上回る性能を、パラメータ数を抑えて実現します。シーケンス長とモデル次元の両方でサブ二次スケーリングを可能にし、因果的なパラメータ化を提供します。

ABSTRACT

Machine learning models are increasingly being scaled in both sequence length and model dimension to reach longer contexts and better performance. However, existing architectures such as Transformers scale quadratically along both these axes. We ask: are there performant architectures that can scale sub-quadratically along sequence length and model dimension? We introduce Monarch Mixer (M2), a new architecture that uses the same sub-quadratic primitive along both sequence length and model dimension: Monarch matrices, a simple class of expressive structured matrices that captures many linear transforms, achieves high hardware efficiency on GPUs, and scales sub-quadratically. As a proof of concept, we explore the performance of M2 in three domains: non-causal BERT-style language modeling, ViT-style image classification, and causal GPT-style language modeling. For non-causal BERT-style modeling, M2 matches BERT-base and BERT-large in downstream GLUE quality with up to 27% fewer parameters, and achieves up to 9.1$ imes$ higher throughput at sequence length 4K. On ImageNet, M2 outperforms ViT-b by 1% in accuracy, with only half the parameters. Causal GPT-style models introduce a technical challenge: enforcing causality via masking introduces a quadratic bottleneck. To alleviate this bottleneck, we develop a novel theoretical view of Monarch matrices based on multivariate polynomial evaluation and interpolation, which lets us parameterize M2 to be causal while remaining sub-quadratic. Using this parameterization, M2 matches GPT-style Transformers at 360M parameters in pretraining perplexity on The PILE--showing for the first time that it may be possible to match Transformer quality without attention or MLPs.

研究の動機と目的

  • シーケンス長とモデル次元の双方でスケールするサブ二次アーキテクチャの動機付けと開発。
  • Monarch matrices が一連の線形変換を表現でき、GPU 上でハードウェアに優しいことを示す。
  • 非因果言語とビジョンタスクおよび因果言語モデリングでの M2 の性能を示す。
  • Monarch ベースのレイヤの因果パラメータ化の理論的基盤を提供する。
  • Transformer ベースのベースラインと比較したスループットとパラメータ効率をベンチマークする。

提案手法

  • Monarch matrix を、ブロック対角要因とそれに挟まれた置換の積として定義し、O(p N^{(p+1)/p}) 計算を達成する。
  • Monarch ブロックと要素ごとの演算を用いてシーケンス軸と埋め込み軸の混合を行い、M2 を構築する。
  • BERT 的・ViT 的・GPT 的設定において、Transformer のアテンションと MLP ブロックを M2 の原始操作に置換する。
  • サブ二次的な因果マスキングを可能にする多変数多項式評価/補間による因果パラメータ化を提供する。
  • M2 のパラメータ化の因果性条件(定理 3)の理論的解析。
  • GPU における実装ストーリーとハードウェア利用のベンチマークを提供する。

実験結果

リサーチクエスチョン

  • RQ1サブ二次的なプリミティブ(Monarch 行列)が、シーケンス長とモデル次元の両方で Transformers と同等以上の性能を提供できるか。
  • RQ2Monarch ベースのレイヤをサブ二次計算で因果的にすることができるか。
  • RQ3M2 のバリアントが非因果言語、因果言語、ビジョンタスクで Transformer の性能に匹敵または超える一方でパラメータを削減できるか。
  • RQ4dense MLPs およびアテンションと比較した場合の M2 のハードウェア利用特性はどうか。
  • RQ5多項式の解釈を用いた因果パラメータ化を M2 に principled に適用するにはどうするか。

主な発見

  • M2 は非因果言語モデリングで 27% および 24% のパラメータ削減で BERT-base および BERT-large の GLUE 品質に匹敵。
  • M2 は sequence length が 4K の場合、HuggingFace BERT に対して最大 9.1× のスループットを達成。
  • ImageNet では M2-ViT-b が ViT-b をパラメータの半分で上回る 1% の改善。
  • M2-GPT は因果パラメータ化により The PILE で 360M パラメータ時の GPT 風 Transformer の perplexity に匹敵。
  • 因果設定では、M2 は競争力のある perplexity を実現し、全く異なるアーキテクチャで Transformer 品質に匹敵する可能性を示唆。
  • ベンチマーク全体で、M2 は FLOP 利用と密結合ベースラインに対するサブ二次スケーリングの利得を示す。

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。