Every time you prompt a large language model, you pay a hidden tax. When the model outputs a simple comma, a period, or the word “the”, it runs those tokens through the exact same number of transformer layers as it does for a complex mathematical calculation or a deep philosophical analysis. This uniform processing wastes an enormous amount of compute. We are treating every single token as if it requires the absolute maximum amount of cognitive effort, which forces hardware to run hot and slow.
For more on this topic, you might also want to check out How to Master AI-Native Databases for Modern AI Apps and Ultimate Guide: Mastering AI Agents with Self-Correction and How to Master Token-Free LLMs to Eliminate Tokenization and How to Master State Space Models for AI Development Today and How to Use Multi-Agent Systems to Boost LLM Performance.
To solve this fundamental inefficiency, researchers introduced a novel structural approach called Mixture of Depths. This architecture changes how neural networks allocate computational power. Instead of forcing every token through every single layer of the network, it allows the model to decide on the fly which tokens deserve deep processing and which ones can skip ahead. The result is a massive leap in generation speed without a corresponding drop in model capabilities.
Beyond Uniform Processing: How Mixture of Depths Works
To understand why Mixture of Depths is such a massive leap forward, we have to look at the traditional transformer pipeline. In a standard transformer model, an input sequence goes through a fixed stack of layers. If a model has 32 layers, every token goes through all 32 layers, regardless of how simple or complex that token is. This rigid structure is highly predictable for hardware, but it is incredibly inefficient from a computational standpoint.
This is where Mixture of Depths breaks the traditional mold of transformer designs. Instead of processing every token at every layer, the network sets a strict computational budget for each layer. It decides which tokens are essential for that specific step of processing and which tokens can bypass the layer entirely using a simple identity connection.
When you compare Mixture of Depths to Mixture of Experts (MoE), the structural difference becomes clear. Mixture of Experts keeps the depth of the model constant but increases its width. It routes different tokens to different specialized subnetworks, which means the model still processes every token through the same total number of layers. The main issue with MoE is that it requires a massive amount of video memory (VRAM) to keep all those expert weights active. Mixture of Depths takes the opposite path. It keeps the width of the model identical to a standard dense model but dynamically reduces the depth of computation for simple tokens. This keeps the VRAM footprint low while dramatically cutting down the number of floating-point operations (FLOPs) required per token.
Under the Hood: The Routing and Capacity Mechanism
The core innovation of Mixture of Depths lies in its routing mechanism. Each transformer layer has a small router that assigns a scalar score to each token in a sequence. This score represents how much that token will benefit from being processed by the self-attention and feed-forward blocks of that specific layer.
In a typical Mixture of Depths implementation, the model designer sets a capacity budget. This budget is usually expressed as a percentage, such as 50 percent of the total sequence length. If a sequence has 2048 tokens and the capacity is set to 50 percent, the router will select only the 1024 tokens with the highest scores to go through the heavy computations of that layer. The remaining 1024 tokens with lower scores bypass the layer entirely, passing through a residual connection to the next layer in the stack.
This approach introduces a major engineering challenge. Standard sorting algorithms used to find the top-k tokens are highly inefficient on modern graphics cards. GPUs prefer static tensor shapes and predictable memory access patterns. If the number of processed tokens shifts constantly, the hardware cannot execute operations efficiently. To solve this, researchers use a learned threshold during inference. Instead of sorting all tokens to find the top-k, the router simply checks if a token’s score exceeds a specific number. This allows the GPU to process the tokens in parallel without expensive sorting steps.
The table below highlights the structural differences between standard transformers, Mixture of Experts, and Mixture of Depths:
| Feature | Standard Transformer | Mixture of Experts (MoE) | Mixture of Depths (MoD) |
|---|---|---|---|
| Compute Per Token | Static (High) | Static (High) | Variable (Low on average) |
| VRAM Footprint | Baseline | Extremely High | Baseline |
| Routing Target | None | Specialized subnetworks | Attention/MLP bypass |
| Hardware Efficiency | Excellent | Complex (Network bottlenecks) | Excellent (With threshold routing) |
By forcing the model to select a limited number of tokens for each layer, the system learns to prioritize. Words that carry heavy context, like proper nouns, verbs, or complex technical terms, get routed through the full depth of the network. Punctuation marks, conjunctions, and repetitive words bypass the heavy layers, saving precious GPU cycles.
Hardware Benefits and Training Efficiency
Implementing Mixture of Depths in real-world systems requires solving some hardware challenges, but the rewards are substantial. Because the VRAM footprint of a Mixture of Depths model is identical to a standard dense model of the same parameter count, you do not need specialized multi-GPU setups to run them. A 70-billion parameter model using this architecture fits into the exact same memory space as a standard 70-billion parameter model, but it runs at a fraction of the compute cost.
This makes Mixture of Depths highly friendly to standard hardware setups. It allows developers to run larger, more capable models on consumer-grade graphics cards that would normally struggle with high-latency inference. During training, this architecture also offers massive advantages. Standard models spend a lot of time learning trivial relationships between simple tokens. By forcing the network to select which tokens get processed, the training phase naturally focuses its parameter capacity on the most difficult semantic transitions. This results in highly efficient training runs, yielding smarter models in less time.
Another major benefit is the reduction in power consumption. Running large language models in data centers requires massive amounts of electricity. Because this architecture slashes the total FLOPs per forward pass by up to 50 percent, it directly translates to lower energy bills and reduced cooling requirements in production environments.
Frequently Asked Questions
How does Mixture of Depths differ from token dropping?
Token dropping completely removes unimportant tokens from the sequence to speed up processing, meaning the model loses that context in later layers. Mixture of Depths does not discard any tokens. It simply bypasses specific computational blocks using residual connections, ensuring the model retains full context across the entire sequence.
Can you combine Mixture of Depths with Mixture of Experts?
Yes, these two architectures are highly complementary. You can design a model that uses Mixture of Depths to decide whether a token should bypass a layer, and if it does not bypass, use Mixture of Experts to route it to the best specialized subnetwork. This combination offers the ultimate level of compute efficiency.
Does Mixture of Depths affect the quality of the generated text?
Research shows that models using this architecture can match the accuracy and perplexity of standard dense models. By training the routing mechanism alongside the rest of the network, the model learns exactly which tokens can safely skip layers without degrading the overall understanding of the text.
As the demand for local AI execution grows, efficiency will dictate which architectures survive. The traditional approach of brute-forcing every token through every layer is no longer sustainable. By treating compute as a precious, finite resource that must be allocated intelligently, this new design path opens the door to incredibly fast, highly capable models that can run comfortably on everyday devices.



