# Mixture-of-Depths: Dynamically allocating compute in transformer-based language models

- **ID:** 563
- **Kind:** paper
- **URL:** https://arxiv.org/abs/2404.02258
- **Authors:** David Raposo, Sam Ritter, Blake Richards, Timothy Lillicrap, Peter Conway Humphreys, Adam Santoro
- **Venue:** arXiv / Google DeepMind
- **Published:** 2024
- **License:** CC BY 4.0
- **License family:** Permissive (auto-classified)
- **Tags:** mixture-of-depths, mod, conditional-compute, routing, deepmind, isoflop
- **Topics:** conditional computation, Mixture-of-Depths, efficient transformers
- **Added:** 2026-10-01
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/563

## 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).

## Attributes

- **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.

## From the source (fetched 2026-10-03)

- **Published:** Apr 2, 2024 (arXiv)
- **arXiv categories:** cs.LG, cs.CL (arXiv)
- **Citations:** 267 (29 influential) (Semantic Scholar)
- **References:** 19 (Semantic Scholar)

## Abstract

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.

## 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](https://papers.projxon.ai/entries/476) (paper 2026, #476)
- [Dr.LLM: Dynamic Layer Routing in LLMs](https://papers.projxon.ai/entries/542) (paper 2025, #542)
- [Tuning Language Models by Mixture-of-Depths Ensemble](https://papers.projxon.ai/entries/557) (paper 2024, #557)
- [Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation](https://papers.projxon.ai/entries/735) (paper 2025, #735)
- [Telescopic Language Models](https://papers.projxon.ai/entries/748) (paper 2026, #748)
- [Matryoshka Language Model Suites](https://papers.projxon.ai/entries/890) (paper 2026, #890)
- [LoopFormer: Elastic-Depth Looped Transformers for Latent Reasoning via Shortcut Modulation](https://papers.projxon.ai/entries/1078) (paper 2026, #1078)
- [Sparse Layers are Critical to Scaling Looped Language Models](https://papers.projxon.ai/entries/1085) (paper 2026, #1085)

## Similar entries

- [Julia-1 (Supersonic Labs decision model)](https://papers.projxon.ai/entries/1081) (model, #1081)
- [Charformer: Fast Character Transformers via Gradient-based Subword Tokenization](https://papers.projxon.ai/entries/569) (paper, #569)
- [LiFT: Loop Flow Transformers](https://papers.projxon.ai/entries/1274) (paper, #1274)
- [DepthBench: Measuring How Residual Connections Enable More Computational Depth](https://papers.projxon.ai/entries/789) (paper, #789)
- [How Depth Growth and Looping Shape In-Context Learning in Language Models](https://papers.projxon.ai/entries/1464) (paper, #1464)
- [Mirendil-Base — Pretraining at Scale Without a Pretraining Team (Mirendil)](https://papers.projxon.ai/entries/1429) (model, #1429)
