Mixture-of-Modules: Reinventing Transformers as Dynamic Assemblies of Modules
Not on the map. Why?
Abstract (arXiv)
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 depth-ordered 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.
Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). Builds on 39 of its 52 references that are in the map. First posted on arXiv 9 Jul 2024.
Builds on
39 of 52 references.
References · 39
- 2017Attention Is All You Needcited by 59,932
- 2022Scalable Diffusion Models with Transformerscited by 5,931
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,016
- 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layercited by 3,413
- 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,014
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2013Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computationcited by 2,031
- 2022Large Language Models Encode Clinical Knowledgecited by 1,807
- 2019SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systemscited by 1,718
- 2020GShard: Scaling Giant Models with Conditional Computation and Automatic Shardingcited by 1,601
27 more
- 2018Don't Give Me the Details, Just the Summary! Topic-Aware Convolutional Neural Networks for Extreme Summarizationcited by 1,308
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,307
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,130
- 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,093
- 2022In-context Learning and Induction Headscited by 930
- 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 700
- 2018Universal Transformerscited by 613
- 2016Adaptive Computation Time for Recurrent Neural Networkscited by 479
- 2017SkipNet: Learning Dynamic Routing in Convolutional Networkscited by 328
- 2020DeeBERT: Dynamic Early Exiting for Accelerating BERT Inferencecited by 322
- 2022Confident Adaptive Language Modelingcited by 297
- 2020BERT Loses Patience: Fast and Robust Inference with Early Exitcited by 267
- 2015Highway Networkscited by 257
- 2024Mixture-of-Depths: Dynamically allocating compute in transformer-based language modelscited by 242
- 2019Depth-Adaptive Transformercited by 227
- 2023The Hydra Effect: Emergent Self-repair in Language Model Computationscited by 145
- 2024LaCo: Large Language Model Pruning via Layer Collapsecited by 124
- 2016Spatially Adaptive Computation Time for Residual Networkscited by 118
- 2023SkipDecode: Autoregressive Skip Decoding with Batching and Caching for Efficient LLM Inferencecited by 89
- 2023CoLT5: Faster Long-Range Transformers with Conditional Computationcited by 84
- 2023Conditional Adapters: Parameter-efficient Transfer Learning with Fast Inferencecited by 69
- 2013Low-Rank Approximations for Conditional Feedforward Computation in Deep Neural Networkscited by 44
- 2024Interpreting Key Mechanisms of Factual Recall in Transformer-Based Language Modelscited by 30
- 2020Controlling Computation versus Quality for Neural Sequence Modelscited by 27
- 2014Exponentially Increasing the Capacity-to-Computation Ratio for Conditional Computation in Deep Learningcited by 24
- 2023Learning to Skip for Language Modelingcited by 19
- 2024Accelerating Inference in Large Language Models with a Unified Layer Skipping Strategycited by 17
Built on by
Citing papers per year: 2024: 5; 2025: 3; 2026: 3.
11 papers.
- 2024Layerwise Recurrent Router for Mixture-of-Expertscited by 21
- 2025D2MoE: Dual Routing and Dynamic Scheduling for Efficient On-Device MoE-based LLM Servingcited by 17
- 2025Coupling Experts and Routers in Mixture-of-Experts via an Auxiliary Losscited by 11
- 2024More Expressive Attention with Negative Weightscited by 9
- 2025Autonomy-of-Experts Modelscited by 7
- 2024Duo-LLM: A Framework for Studying Adaptive Computation in Large Language Modelscited by 6
- 2024PEAR: Position-Embedding-Agnostic Attention Re-weighting Enhances Retrieval-Augmented Generation with Zero Inference Overheadcited by 1
- 2024Extracting and Combining Abilities For Building Multi-lingual Ability-enhanced Large Language Modelscited by 1
- 2026UniPool: A Globally Shared Expert Pool for Mixture-of-Expertscited by 1
- 2026Mixture of Layers with Hybrid Attentioncited by 0
- 2026CORTEX: Learning to Share and Specialize in Dense Language Modelscited by 0
- 2026CORTEX: Learning to Share and Specialize in Dense Language Models28 Sep 2026
- 2026Mixture of Layers with Hybrid Attention10 May 2026
- 2026UniPool: A Globally Shared Expert Pool for Mixture-of-Experts7 May 2026
- 2025Coupling Experts and Routers in Mixture-of-Experts via an Auxiliary Loss29 Dec 2025
- 2025D2MoE: Dual Routing and Dynamic Scheduling for Efficient On-Device MoE-based LLM Serving17 Apr 2025
- 2025Autonomy-of-Experts Models22 Jan 2025
- 2024More Expressive Attention with Negative Weights11 Nov 2024
- 2024Extracting and Combining Abilities For Building Multi-lingual Ability-enhanced Large Language Models10 Oct 2024
- 2024Duo-LLM: A Framework for Studying Adaptive Computation in Large Language Models1 Oct 2024
- 2024PEAR: Position-Embedding-Agnostic Attention Re-weighting Enhances Retrieval-Augmented Generation with Zero Inference Overhead29 Sep 2024
- 2024Layerwise Recurrent Router for Mixture-of-Experts13 Aug 2024