EMNLP Findings2023
Approximating Two-Layer Feedforward Networks for Efficient Transformers
Róbert Csordás, Kazuki Irie, Jürgen Schmidhuber
Abstract
How to reduce compute and memory requirements of neural networks (NNs) without sacrificing performance? Many recent works use sparse Mixtures of Experts (MoEs) to build resource-efficient large language models (LMs). Here we introduce several novel perspectives on MoEs, presenting a general framework that unifies various methods to approximate two-layer NNs (e.g., feedforward blocks of Transformers), including productkey memories (PKMs). Leveraging insights from this framework, we propose methods to improve both MoEs and PKMs. Unlike prior work that compares MoEs with dense baselines under the compute-equal condition, our evaluation condition is parameter-equal, which is crucial to properly evaluate LMs. We show that our MoEs are competitive with the dense Transformer-XL on both the WikiText-103 and enwiki8 datasets at two different scales, while being much more resource-efficient. This demonstrates that MoEs are relevant not only to extremely large LMs but also to any-scale resource-efficient LMs. Our code is public. 1
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.
9 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Learn To be Efficient: Build Structured Sparsity in Large Language Models cites Language Models are Few-Shot Learners
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Language Models are Few-Shot Learners
- MoEUT: Mixture-of-Experts Universal Transformers cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- MoEUT: Mixture-of-Experts Universal Transformers cites SwitchHead: Accelerating Transformers with Mixture-of-Experts Attention
- 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
- SwitchHead: Accelerating Transformers with Mixture-of-Experts Attention cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- SwitchHead: Accelerating Transformers with Mixture-of-Experts Attention cites Language Models are Few-Shot Learners
- SwitchHead: Accelerating Transformers with Mixture-of-Experts Attention 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
- Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free cites SwitchHead: Accelerating Transformers with Mixture-of-Experts Attention
- GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding cites Language Models are Few-Shot Learners
- Sigmoid Gating is More Sample Efficient than Softmax Gating in Mixture of Experts cites GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding
- Linear Transformers Are Secretly Fast Weight Programmers cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
Cited by top-tier papers9
- 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
- MoEUT: Mixture-of-Experts Universal TransformersRóbert Csordás, Kazuki Irie, Jürgen Schmidhuber, Christopher Potts et al.NeurIPS 2024 · 65 citations
- SwitchHead: Accelerating Transformers with Mixture-of-Experts AttentionRóbert Csordás, Piotr Piekos, Kazuki Irie, Jürgen SchmidhuberNeurIPS 2024 · 46 citations
- Sigmoid Gating is More Sample Efficient than Softmax Gating in Mixture of ExpertsHuy Nguyen, Nhat Ho, Alessandro RinaldoNeurIPS 2024 · 35 citations
- Learn To be Efficient: Build Structured Sparsity in Large Language ModelsHaizhong Zheng, Xiaoyan Bai, Xueshen Liu, Zhuoqing Morley Mao et al.NeurIPS 2024 · 29 citations
Builds on12
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- 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
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
- GShard: Scaling Giant Models with Conditional Computation and Automatic ShardingDmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen et al.ICLR 2021 · 1,954 citations
- Linear Transformers Are Secretly Fast Weight ProgrammersImanol Schlag, Kazuki Irie, Jürgen SchmidhuberICML 2021 · 394 citations
Related papers
- Towards A Unified View of Sparse Feed-Forward Network in Pretraining Large Language ModelZeyu Liu, Tim Dettmers, Xi Lin, Veselin Stoyanov et al.EMNLP 2023 · 3 citations
- ResMoE: Space-efficient Compression of Mixture of Experts LLMs via Residual RestorationMengting Ai, Tianxin Wei, Yifan Chen, Zhichen Zeng et al.KDD 2025 · 5 citations
- Pre-gated MoE: An Algorithm-System Co-Design for Fast and Scalable Mixture-of-Expert InferenceRanggi Hwang, Jianyu Wei, Shijie Cao, Changho Hwang et al.ISCA 2024 · 48 citations
- XMoE: Sparse Models with Fine-grained and Adaptive Expert SelectionYuanhang Yang, Shiyi Qi, Wenchao Gu, Chaozheng Wang et al.ACL Findings 2024 · 10 citations
- Diversifying the Expert Knowledge for Task-Agnostic Pruning in Sparse Mixture-of-ExpertsZeliang Zhang, Xiaodong Liu, Hao Cheng, Chenliang Xu et al.ACL Findings 2025 · 5 citations
