Expert capacity is the maximum number of tokens that can be assigned to a single expert in a Mixture of Experts (MoE) model during a forward pass. It is a critical hyperparameter that balances computational efficiency—achieved by processing tokens in fixed-size batches per expert—against the risk of dropped tokens. Capacity is typically set as a multiple of the average expected load, providing a buffer to handle variance in the router's token distribution.
Glossary
Expert Capacity

What is Expert Capacity?
A core implementation parameter in Mixture of Experts (MoE) models that controls computational batching and token handling.
Setting expert capacity involves a direct trade-off. A low capacity minimizes memory and compute waste from padding but increases the probability of tokens exceeding the limit and being dropped or bypassed. A high capacity reduces this drop risk but creates inefficient computation from excessive padding in underutilized expert batches. This parameter is intrinsically linked to the capacity factor and is a key consideration in systems using expert parallelism, where it influences communication volume and GPU memory allocation.
Key Characteristics of Expert Capacity
Expert capacity is a critical hyperparameter in Mixture of Experts (MoE) models that defines the maximum number of tokens a single expert can process in a forward pass. It acts as a buffer to manage computational load and prevent token dropping.
Core Definition & Purpose
Expert capacity is the maximum number of tokens that can be assigned to a single expert in a Mixture of Experts forward pass. Its primary purpose is to enable efficient batched computation on hardware (like GPUs) by creating fixed-size, dense tensors from sparse token assignments. Without a defined capacity, a variable and unpredictable number of tokens could be routed to each expert, making parallelization inefficient. Setting this parameter involves a direct trade-off: higher capacity reduces the risk of dropped tokens but increases memory usage and computational waste for underutilized experts.
Relationship to Capacity Factor
Expert capacity is typically set using a derived hyperparameter called the capacity factor. The calculation is:
expert_capacity = (batch_size * sequence_length * k) / num_experts * capacity_factor
Where k is the number of experts selected per token (e.g., top-2). A capacity factor greater than 1.0 (e.g., 1.25, 2.0) provides a buffer above the theoretical average load. This buffer accommodates the natural imbalance in token routing, preventing tokens from being dropped when an expert receives slightly more than its 'fair share' of assignments. The capacity factor directly controls the trade-off between computational efficiency and model accuracy.
Token Dropping & Fallback
When the number of tokens routed to an expert exceeds its predefined expert capacity, the system must handle the overflow. The standard solution is token dropping, where excess tokens are not processed by the expert. Common handling strategies include:
- Pass-through: The token's representation is passed unchanged to the next layer.
- Sent to a fallback expert (e.g., a shared expert or the first expert).
- Scaling router scores to fit within capacity. Dropped tokens represent a direct loss of information and degrade model performance. Therefore, setting expert capacity is an optimization to minimize dropping while controlling memory overhead.
Impact on Memory & Computation
Expert capacity has a direct, linear impact on GPU memory consumption during inference. Each expert's activation buffer must be allocated to hold the maximum possible number of tokens (expert_capacity * hidden_dim). Overallocating capacity leads to:
- Increased memory footprint: Storing large, partially empty buffers.
- Computational waste: Performing matrix multiplications on zero-padded sections of the buffer. Underallocating capacity leads to dropped tokens and accuracy loss. Systems like vLLM with MoE support and Fused MoE Kernels optimize this by managing memory pools and combining operations to reduce the overhead of this fixed-size allocation.
Interaction with Load Balancing
Expert capacity works in tandem with load balancing techniques during training. The router is trained with an auxiliary load balancing loss to encourage a uniform distribution of tokens across experts. Effective load balancing reduces the variance in tokens per expert, which allows for a lower capacity factor to be used safely. Without good load balancing, a few 'popular' experts would consistently hit their capacity limit, forcing a higher capacity setting to avoid excessive dropping, thereby increasing memory waste. Thus, the required expert capacity is a reflection of the router's imbalance.
System-Level Optimization
In production serving systems, expert capacity is a key lever for inference cost optimization. Engineers tune it based on:
- Observed routing distributions from production traffic.
- Target latency and throughput SLAs.
- GPU memory constraints. Advanced systems may employ dynamic capacity strategies, where the capacity is adjusted per request batch based on real-time router statistics, or use expert parallelism to scale capacity across multiple devices. The goal is to find the minimal capacity that keeps the rate of dropped tokens below an acceptable threshold for the application.
Expert Capacity: Trade-offs and Configuration
Comparison of configuration strategies for the expert capacity parameter in Mixture of Experts models, balancing computational efficiency against token dropping risk.
| Configuration Metric / Behavior | Low Capacity (Conservative) | Balanced Capacity (Recommended) | High Capacity (Aggressive) | Dynamic Capacity (Adaptive) |
|---|---|---|---|---|
Capacity Factor Value | 1.0 - 1.2 | 1.25 - 1.5 |
| N/A (Algorithmic) |
Token Dropping Risk | Very High | Low | Very Low | Controlled |
GPU Utilization (Batching Efficiency) | Poor | Good | Excellent | Variable |
Memory Overhead per Expert | Low | Moderate | High | Variable |
Router Latency Impact | Low (simple assignment) | Moderate | High (complex shuffling) | High (runtime decisions) |
Typical Use Case | Research / Debugging | Production Inference | Offline Batch Processing | Latency-Sensitive Serving |
Compatibility with Continuous Batching | Poor | Good | Excellent | Complex |
All-to-All Communication Volume | Minimal | Optimized | High | Variable |
Frequently Asked Questions
Expert capacity is a critical hyperparameter in Mixture of Experts (MoE) models that directly controls computational efficiency and token throughput. These questions address its definition, configuration, and impact on production inference systems.
Expert capacity is the maximum number of tokens that can be assigned to a single expert in a Mixture of Experts (MoE) layer during a forward pass. It is a predefined, fixed buffer allocated per expert to enable efficient batched computation. The gating network (router) assigns tokens to experts, but if an expert receives more tokens than its capacity, the excess tokens are dropped—typically passed through the layer unchanged or re-routed to a fallback. Capacity is calculated as capacity = (batch_size * sequence_length * top_k) / num_experts * capacity_factor, where the capacity factor (e.g., 1.25, 2.0) provides a safety margin to minimize drops.
In practice, before computation, tokens are sorted by their assigned expert and packed into fixed-size tensors up to the capacity limit. This allows the system to execute a batched matrix multiplication across all experts, even if some experts have fewer tokens than capacity (the batch is padded). This design trades off some computational waste (padding) against the severe performance penalty of processing tokens sequentially.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Expert capacity is a key implementation parameter within Mixture of Experts (MoE) architectures. Understanding its relationship to these core concepts is essential for designing efficient, high-throughput inference systems.
Capacity Factor
A hyperparameter that defines a soft upper limit on the number of tokens assigned to an expert, calculated as (batch_size * sequence_length * k) / num_experts multiplied by the factor (e.g., 1.25). It provides a computational buffer to prevent dropped tokens while aiming to keep expert batches full for efficient GPU utilization. A factor too low increases drop rates; too high wastes memory and can increase communication overhead in expert-parallel systems.
Dropped Tokens
Tokens that cannot be processed by their assigned expert because it has reached its expert capacity limit. This is a critical failure mode in MoE inference. Common handling strategies include:
- Passing the token unchanged to the next layer.
- Routing it to a fallback or overflow expert.
- Using an auxiliary buffer. Dropped tokens degrade model quality and represent wasted computation, making capacity tuning vital for inference cost optimization.
Load Balancing
A set of techniques to ensure uniform computational load across all experts. Without it, the router may collapse, favoring a few experts and leaving others underutilized, which negates the efficiency benefits of MoE. Key methods include:
- Auxiliary Load Loss: An added training loss term that penalizes imbalance.
- Noise Top-k Gating: Adds tunable noise to router logits to encourage exploration.
- Expert Clipping: Enforcing capacity limits. Effective load balancing is prerequisite for setting optimal expert capacity.
All-to-All Communication
The dominant collective communication pattern in expert parallelism. After the router assigns tokens to experts on different devices, an all-to-all operation scatters tokens from all devices to the devices hosting their assigned experts. After computation, another all-to-all gathers the outputs. The volume of this communication is directly constrained by expert capacity. High capacity can lead to larger, more imbalanced transfers, increasing router latency and creating network bottlenecks.
Sparse Activation
The core efficiency principle of MoE architectures, where only a small, dynamic subset of the model's total parameters (the chosen experts) is activated per token. Expert capacity governs how this sparse computation is batched. While activation is sparse at the token level, within an expert, computation is dense and batched across all tokens assigned to it. The goal is to set capacity high enough to enable large, efficient batches but low enough to preserve the memory and FLOPs advantages of sparsity.
Continuous Batching for MoE
The adaptation of dynamic batching techniques to MoE models. In systems like vLLM, requests are added to and removed from a running batch as they finish generation. For MoE, this is complex because the routing pattern changes each step. Expert capacity must be managed dynamically across the continuous batch, requiring sophisticated scheduling to minimize padding and dropped tokens while maximizing GPU utilization. This is a key focus for inference serving architectures.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us