Lune

NeurIPS2024Top-tier venue

SwitchHead: Accelerating Transformers with Mixture-of-Experts Attention

Róbert Csordás, Piotr Piekos, Kazuki Irie, Jürgen Schmidhuber

Abstract

Despite many recent works on Mixture of Experts (MoEs) for resource-efficient Transformer language models, existing methods mostly focus on MoEs for feedforward layers. Previous attempts at extending MoE to the self-attention layer fail to match the performance of the parameter-matched baseline. Our novel SwitchHead is an effective MoE method for the attention layer that successfully reduces both the compute and memory requirements, achieving wall-clock speedup, while matching the language modeling performance of the baseline Transformer. Our novel MoE mechanism allows SwitchHead to compute up to 8 times fewer attention matrices than the standard Transformer. SwitchHead can also be combined with MoE feedforward layers, resulting in fully-MoE"SwitchAll"Transformers. For our 262M parameter model trained on C4, SwitchHead matches the perplexity of standard models with only 44% compute and 27% memory usage. Zero-shot experiments on downstream tasks confirm the performance of SwitchHead, e.g., achieving more than 3.5% absolute improvements on BliMP compared to the baseline with an equal compute resource.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

8 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Unified Scaling Laws for Routed Language Models cites Language Models are Few-Shot Learners
  • Unified Scaling Laws for Routed Language Models cites BASE Layers: Simplifying Training of Large, Sparse Models
  • Unified Scaling Laws for Routed Language Models cites GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Language Models are Few-Shot Learners
  • MoEUT: Mixture-of-Experts Universal Transformers cites Unified Scaling Laws for Routed Language Models
  • MoEUT: Mixture-of-Experts Universal Transformers cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • MoEUT: Mixture-of-Experts Universal Transformers cites Language Models are Few-Shot Learners
  • MoEUT: Mixture-of-Experts Universal Transformers cites GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding
  • Routing Mamba: Scaling State Space Models with Mixture-of-Experts Projection cites GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding
  • Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free cites MoEUT: Mixture-of-Experts Universal Transformers
  • UMoE: Unifying Attention and FFN with Shared Experts cites MoEUT: Mixture-of-Experts Universal Transformers
  • UMoE: Unifying Attention and FFN with Shared Experts cites BASE Layers: Simplifying Training of Large, Sparse Models
  • BAM! Just Like That: Simple and Efficient Parameter Upcycling for Mixture of Experts cites Language Models are Few-Shot Learners
  • BASE Layers: Simplifying Training of Large, Sparse Models cites Language Models are Few-Shot Learners
  • GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers8

  1. Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-FreeZihan Qiu, Zekun Wang, Bo Zheng, Zeyu Huang et al.NeurIPS 2025 · 336 citations
  2. MoEUT: Mixture-of-Experts Universal TransformersRóbert Csordás, Kazuki Irie, Jürgen Schmidhuber, Christopher Potts et al.NeurIPS 2024 · 65 citations
  3. BAM! Just Like That: Simple and Efficient Parameter Upcycling for Mixture of ExpertsQizhen (Irene) Zhang, Nikolas Gritsch, Dwaraknath Gnaneshwar, Simon Guo et al.NeurIPS 2024 · 18 citations
  4. Routing Mamba: Scaling State Space Models with Mixture-of-Experts ProjectionZheng Zhan, Liliang Ren, Shuohang Wang, Liyuan Liu et al.NeurIPS 2025 · 4 citations
  5. UMoE: Unifying Attention and FFN with Shared ExpertsYuanhang Yang, Chaozheng Wang, Jing LiNeurIPS 2025 · 4 citations

Builds on11

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
  3. GShard: Scaling Giant Models with Conditional Computation and Automatic ShardingDmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen et al.ICLR 2021 · 1,954 citations
  4. BASE Layers: Simplifying Training of Large, Sparse ModelsMike Lewis, Shruti Bhosale, Tim Dettmers, Naman Goyal et al.ICML 2021 · 382 citations
  5. Unified Scaling Laws for Routed Language ModelsAidan Clark, Diego de Las Casas, Aurelia Guy, Arthur Mensch et al.ICML 2022 · 266 citations

Related papers

  1. XMoE: Sparse Models with Fine-grained and Adaptive Expert SelectionYuanhang Yang, Shiyi Qi, Wenchao Gu, Chaozheng Wang et al.ACL Findings 2024 · 10 citations
  2. MoH: Multi-Head Attention as Mixture-of-Head AttentionPeng Jin, Bo Zhu, Li Yuan, Shuicheng YanICML 2025 · 2 citations
  3. AutoMoE: Heterogeneous Mixture-of-Experts with Adaptive Computation for Efficient Neural Machine TranslationGanesh Jawahar, Subhabrata Mukherjee, Xiaodong Liu, Young Jin Kim et al.ACL Findings 2023 · 5 citations
  4. MoE++: Accelerating Mixture-of-Experts Methods with Zero-Computation ExpertsPeng Jin, Bo Zhu, Li Yuan, Shuicheng YanICLR 2025
  5. Pushing Mixture of Experts to the Limit: Extremely Parameter Efficient MoE for Instruction TuningTed Zadouri, Ahmet Üstün, Arash Ahmadian, Beyza Ermis et al.ICLR 2024 · 169 citations
Dusk over the sea between two cliffs drawn in fine vertical lines