Lune

NeurIPS2023顶会

Monarch Mixer: A Simple Sub-Quadratic GEMM-Based Architecture

Daniel Y. Fu, Simran Arora, Jessica Grogan, Isys Johnson, Evan Sabri Eyuboglu, Armin W. Thomas, Benjamin Spector, Michael Poli, Atri Rudra, Christopher Ré

摘要

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×\times 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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 29 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Hydra: Bidirectional State Space Models Through Generalized Matrix Mixers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Hydra: Bidirectional State Space Models Through Generalized Matrix Mixers 引用了 Zoology: Measuring and Improving Recall in Efficient Language Models
  • Hydra: Bidirectional State Space Models Through Generalized Matrix Mixers 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Hydra: Bidirectional State Space Models Through Generalized Matrix Mixers 引用了 Gated Linear Attention Transformers with Hardware-Efficient Training
  • Hydra: Bidirectional State Space Models Through Generalized Matrix Mixers 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Language Models are Few-Shot Learners
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 Language Models are Few-Shot Learners
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Zoology: Measuring and Improving Recall in Efficient Language Models
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Language Models are Few-Shot Learners
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Gated Linear Attention Transformers with Hardware-Efficient Training
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • Zoology: Measuring and Improving Recall in Efficient Language Models 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Zoology: Measuring and Improving Recall in Efficient Language Models 引用了 Language Models are Few-Shot Learners
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 CutMix: Regularization Strategy to Train Strong Classifiers With Localizable Features
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 Zoology: Measuring and Improving Recall in Efficient Language Models
  • Gated Linear Attention Transformers with Hardware-Efficient Training 引用了 Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 Gated Linear Attention Transformers with Hardware-Efficient Training
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 Zoology: Measuring and Improving Recall in Efficient Language Models
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality 引用了 Language Models are Few-Shot Learners
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper29

  1. Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 次引用
  2. Gated Linear Attention Transformers with Hardware-Efficient TrainingSonglin Yang, Bailin Wang, Yikang Shen, Rameswar Panda 等ICML 2024 · 390 次引用
  3. The Mamba in the Llama: Distilling and Accelerating Hybrid ModelsJunxiong Wang, Daniele Paliotta, Avner May, Alexander M. Rush 等NeurIPS 2024 · 146 次引用
  4. Zoology: Measuring and Improving Recall in Efficient Language ModelsSimran Arora, Sabri Eyuboglu, Aman Timalsina, Isys Johnson 等ICLR 2024 · 140 次引用
  5. Hydra: Bidirectional State Space Models Through Generalized Matrix MixersSukjun Hwang, Aakash Sunil Lahoti, Ratish Puduppully, Tri Dao 等NeurIPS 2024 · 54 次引用

它引用的 Paper31

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu 等ICCV 2021 · 31,683 次引用
  3. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
  4. CutMix: Regularization Strategy to Train Strong Classifiers With Localizable FeaturesSangdoo Yun, Dongyoon Han, Sanghyuk Chun, Seong Joon Oh 等ICCV 2019 · 5,843 次引用
  5. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用

相关 Paper

  1. Compute Better Spent: Replacing Dense Layers with Structured MatricesShikai Qiu, Andres Potapczynski, Marc Anton Finzi, Micah Goldblum 等ICML 2024 · 26 次引用
  2. MonarchAttention: Zero-Shot Conversion to Fast, Hardware-Aware Structured AttentionCan Yaras, Alec S. Xu, Pierre Abillama, Changwoo Lee 等NeurIPS 2025 · 5 次引用
  3. Monarch: Expressive Structured Matrices for Efficient and Accurate TrainingTri Dao, Beidi Chen, Nimit Sharad Sohoni, Arjun D. Desai 等ICML 2022 · 125 次引用
  4. VMonarch: Efficient Video Diffusion Transformers with Structured AttentionCheng Liang, Haoxian Chen, Liang Hou, Qi Fan 等CVPR 2026 · 2 次引用
  5. Benchmarking and Building Long-Context Retrieval Models with LoCo and M2-BERTJon Saad-Falcon, Daniel Y. Fu, Simran Arora, Neel Guha 等ICML 2024 · 24 次引用
黄昏的海面,两侧是细线勾勒的悬崖