Lune

EMNLP2024Top-tier venue

Mixture-of-Modules: Reinventing Transformers as Dynamic Assemblies of Modules

Zhuocheng Gong, Ang Lv, Jian Guan, Wei Wu, Huishuai Zhang, Minlie Huang, Dongyan Zhao, Rui Yan

Abstract

Is it always necessary to compute tokens from shallow to deep layers in Transformers? The continued success of vanilla Transformers and their variants suggests an undoubted "yes". In this work, however, we attempt to break the depthordered convention by proposing a novel architecture dubbed mixture-of-modules (MoM), which is motivated by an intuition that any layer, regardless of its position, can be used to compute a token as long as it possesses the needed processing capabilities. The construction of MoM starts from a finite set of modules defined by multi-head attention and feed-forward networks, each distinguished by its unique parameterization. Two routers then iteratively select attention modules and feed-forward modules from the set to process a token. The selection dynamically expands the computation graph in the forward pass of the token, culminating in an assembly of modules. We show that MoM provides not only a unified framework for Transformers and their numerous variants but also a flexible and learnable approach for reducing redundancy in Transformer parameterization. We pre-train various MoMs using OpenWebText. Empirical results demonstrate that MoMs, of different parameter counts, consistently outperform vanilla transformers on both GLUE and XSUM benchmarks. More interestingly, with a fixed parameter budget, MoM-large enables an over 38% increase in depth for computation graphs compared to GPT-2-large, resulting in absolute gains of 1.4 on GLUE and 1 on XSUM. On the other hand, MoM-large also enables an over 60% reduction in depth while involving more modules per layer, yielding a 16% reduction in TFLOPs and a 43% decrease in memory usage compared to GPT-2-large, while maintaining comparable performance. 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.

7 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

  • Autonomy-of-Experts Models cites Mixture of In-Context Experts Enhance LLMs' Long Context Awareness
  • Autonomy-of-Experts Models cites GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding
  • Mixture of In-Context Experts Enhance LLMs' Long Context Awareness cites PEAR: Position-Embedding-Agnostic Attention Re-weighting Enhances Retrieval-Augmented Generation with Zero Inference Overhead
  • PEAR: Position-Embedding-Agnostic Attention Re-weighting Enhances Retrieval-Augmented Generation with Zero Inference Overhead cites Mixture of In-Context Experts Enhance LLMs' Long Context Awareness
  • GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding cites Depth-Adaptive Transformer
  • Confident Adaptive Language Modeling cites BERT Loses Patience: Fast and Robust Inference with Early Exit
  • Confident Adaptive Language Modeling cites Depth-Adaptive Transformer
  • Confident Adaptive Language Modeling cites GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding
  • Coupling Experts and Routers in Mixture-of-Experts via an Auxiliary Loss cites Autonomy-of-Experts Models
  • Coupling Experts and Routers in Mixture-of-Experts via an Auxiliary Loss cites Mixture of In-Context Experts Enhance LLMs' Long Context Awareness
  • Coupling Experts and Routers in Mixture-of-Experts via an Auxiliary Loss cites GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. Mixture of In-Context Experts Enhance LLMs' Long Context AwarenessHongzhan Lin, Ang Lv, Yuhan Chen, Chen Zhu et al.NeurIPS 2024 · 25 citations
  2. Coupling Experts and Routers in Mixture-of-Experts via an Auxiliary LossAng Lv, Jin Ma, Yiyuan Ma, Siyuan QiaoICLR 2026 · 14 citations
  3. D2MoE: Dual Routing and Dynamic Scheduling for Efficient On-Device MoE-based LLM ServingHaodong Wang, Qihua Zhou, Zicong Hong, Song GuoMobiCom 2025 · 8 citations
  4. PEAR: Position-Embedding-Agnostic Attention Re-weighting Enhances Retrieval-Augmented Generation with Zero Inference OverheadTao Tan, Yining Qian, Ang Lv, Hongzhan Lin et al.WWW 2025 · 4 citations
  5. Autonomy-of-Experts ModelsAng Lv, Ruobing Xie, Yining Qian, Songhao Wu et al.ICML 2025

Builds on11

  1. Scalable Diffusion Models with TransformersWilliam Peebles, Saining XieICCV 2023 · 5,568 citations
  2. GShard: Scaling Giant Models with Conditional Computation and Automatic ShardingDmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen et al.ICLR 2021 · 1,954 citations
  3. BERT Loses Patience: Fast and Robust Inference with Early ExitWangchunshu Zhou, Canwen Xu, Tao Ge, Julian J. McAuley et al.NeurIPS 2020 · 473 citations
  4. Confident Adaptive Language ModelingTal Schuster, Adam Fisch, Jai Gupta, Mostafa Dehghani et al.NeurIPS 2022 · 394 citations
  5. Depth-Adaptive TransformerMaha Elbayad, Jiatao Gu, Edouard Grave, Michael AuliICLR 2020 · 264 citations

Related papers

  1. Mixture of Tokens: Continuous MoE through Cross-Example AggregationSzymon Antoniak, Michal Krutul, Maciej Pióro, Jakub Krajewski et al.NeurIPS 2024 · 6 citations
  2. Hyperparameter Transfer with Mixture-of-Expert LayersTianze Jiang, Blake Bordelon, Cengiz Pehlevan, Boris HaninICML 2026 · 6 citations
  3. MoEUT: Mixture-of-Experts Universal TransformersRóbert Csordás, Kazuki Irie, Jürgen Schmidhuber, Christopher Potts et al.NeurIPS 2024 · 65 citations
  4. MoM: Linear Sequence Modeling with Mixture-of-MemoriesJusen Du, Weigao Sun, Disen Lan, Jiaxi Hu et al.ICLR 2026 · 43 citations
  5. XMoE: Sparse Models with Fine-grained and Adaptive Expert SelectionYuanhang Yang, Shiyi Qi, Wenchao Gu, Chaozheng Wang et al.ACL Findings 2024 · 10 citations
Dusk over the sea between two cliffs drawn in fine vertical lines