Mixture-of-Depths: Dynamically allocating compute in transformer-based language models
Summary
MoD caps each (or every other) block to k tokens for attention+MLP; others take a residual. Expert-choice top-k keeps a static graph. IsoFLOP: 12.5% capacity every other block matches or beats vanilla at fewer FLOPs/step (up to ~50–66% faster sampling). An auxiliary router predictor enables causal decode (~99% top-k match). No official code on abs. Not the Luo/Specia Mixture-of-Depths Ensemble (papers_local 576).
- Venue
- arXiv / Google DeepMind
- License
- CC BY 4.0
- License family
- Permissive
- Purpose
- Let transformers skip blocks per token under a static FLOP budget via top-k routing
- Scale
- isoFLOP 6e18/2e19/1e20; models ~60M–3B; seq 2048, batch 128; capacity 12.5% every other block; 256k-seq / 500M-token AR eval
- Time period
- 2024-04-02 (arXiv 2404.02258 v1). HF paper publishedAt 2024-04-02.
- Added
- Oct 1, 2026
- Research status
- done
From the source
- Published
- Apr 2, 2024
- arXiv categories
- cs.LG, cs.CL
- Citations
- 267 (29 influential)
- References
- 19
Abstract (from arXiv)
Transformer-based language models spread FLOPs uniformly across input sequences. In this work we demonstrate that transformers can instead learn to dynamically allocate FLOPs (or compute) to specific positions in a sequence, optimising the allocation along the sequence for different layers across the model depth. Our method enforces a total compute budget by capping the number of tokens ($k$) that can participate in the self-attention and MLP computations at a given layer. The tokens to be processed are determined by the network using a top-$k$ routing mechanism. Since $k$ is defined a priori, this simple procedure uses a static computation graph with known tensor sizes, unlike other conditional computation techniques. Nevertheless, since the identities of the $k$ tokens are fluid, this method can expend FLOPs non-uniformly across the time and model depth dimensions. Thus, compute expenditure is entirely predictable in sum total, but dynamic and context-sensitive at the token-level. Not only do models trained in this way learn to dynamically allocate compute, they do so efficiently. These models match baseline performance for equivalent FLOPS and wall-clock times to train, but require a fraction of the FLOPs per forward pass, and can be upwards of 50\% faster to step during post-training sampling.
Tags
Topics
conditional computation, Mixture-of-Depths, efficient transformers
Research notes
- Primary: arxiv abs (cs.LG; also cs.CL). License CC BY 4.0 on HTML at check. Google DeepMind; Richards also McGill/Mila. No official code on abs. HF paper page 107 upvotes; unofficial linked models/datasets not copied into hf_* fields and not substantial, so no datasets_local row. Discord posted abs with the paper title. Name collides with papers_local 576 (MoDE ensemble).
Cited by, within this collection
- Bridging the Gap Between Latent and Explicit Reasoning with Looped Transformers
- Dr.LLM: Dynamic Layer Routing in LLMs
- Tuning Language Models by Mixture-of-Depths Ensemble
- Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation
- Telescopic Language Models
- Matryoshka Language Model Suites
- LoopFormer: Elastic-Depth Looped Transformers for Latent Reasoning via Shortcut Modulation
- Sparse Layers are Critical to Scaling Looped Language Models
Similar entries
- Model Julia-1 (Supersonic Labs decision model)
- Paper Charformer: Fast Character Transformers via Gradient-based Subword Tokenization
- Paper LiFT: Loop Flow Transformers
- Paper DepthBench: Measuring How Residual Connections Enable More Computational Depth
- Paper How Depth Growth and Looping Shape In-Context Learning in Language Models
- Model Mirendil-Base — Pretraining at Scale Without a Pretraining Team (Mirendil)