Capacity Factor is a multiplier applied to a Mixture of Experts layer's base expert capacity—the maximum number of tokens that can be routed to a single expert—to create a buffer that prevents dropped tokens. The base capacity is calculated as (batch_size * sequence_length * k) / num_experts, where k is the number of experts selected per token. Multiplying this by the capacity factor (typically 1.0 to 2.0) allocates extra slots, allowing for imbalanced token distributions across experts without exceeding hardware memory limits or requiring costly fallback logic.
Glossary
Capacity Factor

What is Capacity Factor?
A critical hyperparameter in Mixture of Experts (MoE) models that defines a soft upper limit on the computational load any single expert can handle per forward pass.
Setting this factor involves a direct trade-off between memory efficiency and computational waste. A higher factor reserves more memory (increasing the size of padded expert batches) but virtually eliminates token dropping, ensuring model quality. A lower factor minimizes memory overhead but risks exceeding an expert's true capacity, forcing tokens to be skipped or routed to a fallback path, which degrades output. It is a key inference tuning knob for balancing latency, throughput, and predictive accuracy in production MoE systems.
Key Characteristics of Capacity Factor
The capacity factor is a critical hyperparameter that governs the allocation of computational work across experts in a Mixture of Experts (MoE) layer, directly impacting throughput, latency, and the handling of token overflow.
Definition and Core Formula
The capacity factor is a multiplier applied to the base expert capacity to create a soft buffer, preventing token drops during routing. The base capacity for each expert is calculated as:
(batch_size * sequence_length * k) / num_experts
where k is the number of experts selected per token (e.g., top-2). The final capacity per expert is this value multiplied by the capacity factor (typically 1.0 to 2.0). This buffer accounts for the natural imbalance in token distribution, ensuring all routed tokens can be processed even if the load is not perfectly uniform.
Primary Function: Preventing Dropped Tokens
The core purpose of the capacity factor is to act as a safety margin against dropped tokens. Without a buffer (capacity_factor = 1.0), if more tokens are routed to an expert than its base capacity, the excess tokens are 'dropped'—they bypass the expert computation entirely, often being passed to the next layer unchanged or via a fallback. This degrades model quality. A factor >1.0 (e.g., 1.25) allocates extra 'slots' per expert, drastically reducing drop rates and preserving model fidelity, albeit at a small increase in compute cost.
Trade-off: Compute Efficiency vs. Model Fidelity
The capacity factor sits at the center of a key engineering trade-off:
- Low Factor (~1.0): Maximizes compute efficiency and throughput. Experts operate at or near 100% theoretical utilization, but risks high drop rates and potential model degradation.
- High Factor (~1.5-2.0): Maximizes model fidelity by virtually eliminating token drops. However, it reduces efficiency because experts are underutilized; they allocate memory and perform computations on padded, empty slots. The optimal value is found empirically, balancing acceptable drop rate against compute budget.
Interaction with Load Balancing
The capacity factor works in concert with load balancing techniques during training. An auxiliary load balancing loss encourages the router to distribute tokens evenly. A well-balanced router reduces the variance in expert assignment, meaning a lower capacity factor can be used safely. Conversely, poor load balancing necessitates a higher factor to accommodate the 'hot' experts receiving disproportionate traffic. Thus, the required factor is a direct reflection of the router's training quality and the inherent spikiness of the input distribution.
Implementation Impact on Expert Parallelism
In expert parallelism, where experts are sharded across multiple GPUs, the capacity factor directly influences communication volume and memory allocation. A higher factor increases the size of the all-to-all communication buffers used to send tokens to their assigned expert's device. It also dictates the static allocation of memory for expert inputs/outputs on each device. Systems like vLLM with MoE support must manage this padded capacity efficiently within their paging and batching systems to avoid wasted memory and communication overhead.
Tuning and Benchmarking
Tuning the capacity factor is a standard step in MoE inference optimization. The process involves:
- Profiling token distribution across experts for a target workload.
- Measuring the token drop rate at different factor values.
- Benchmarking the end-to-end latency and throughput impact. A typical workflow starts with a factor of 1.25 or 1.5, then iteratively reduces it while monitoring drop rates and downstream task accuracy (e.g., perplexity). The goal is to find the minimum factor where drop rates are negligible (<0.1%), ensuring no quality regression.
Capacity Factor
A critical implementation hyperparameter in Mixture of Experts (MoE) models that defines a soft operational limit for expert processing.
Capacity Factor is a multiplier applied to an expert's base capacity—the maximum number of tokens it can process in a forward pass—to create a buffer that prevents dropped tokens. The base capacity is calculated as (batch_size * sequence_length * k) / num_experts, where k is the number of experts selected per token. A factor greater than 1.0 (e.g., 1.25 or 2.0) allocates extra slots, allowing the system to handle statistical fluctuations in token routing without loss, though at the cost of increased memory and potential compute waste for unused slots.
Setting this factor involves a direct trade-off between robustness and efficiency. A low factor risks token drops, forcing tokens to bypass computation, which degrades model quality. A high factor guarantees processing but increases GPU memory overhead for expert inputs/outputs and can lead to underutilized compute (padding). In production systems like vLLM, it is tuned alongside continuous batching to maximize hardware utilization while maintaining deterministic output. It is a key lever for inference cost optimization in sparse models.
Capacity Factor vs. Expert Capacity
A comparison of two critical, interrelated hyperparameters that govern token routing and computational batching in Mixture of Experts (MoE) models.
| Feature / Metric | Capacity Factor | Expert Capacity |
|---|---|---|
Primary Definition | A multiplicative buffer applied to the theoretical minimum token load per expert. | The absolute, fixed maximum number of tokens a single expert can process in a forward pass. |
Calculation | (batch_size * sequence_length * k) / num_experts * capacity_factor | floor((batch_size * sequence_length * k) / num_experts * capacity_factor) |
Purpose | To provide a safety margin to prevent dropped tokens due to imperfect load balancing and routing variance. | To define the size of the fixed, padded tensor for efficient batched computation on hardware (e.g., GPUs). |
Typical Value Range | 1.0 to 2.0 | Derived value; e.g., 32, 64, 128 tokens |
Impact if Too Low | High probability of token overflow and dropped tokens, degrading model quality. | Forces a lower effective capacity factor, increasing drop token risk. |
Impact if Too High | Increased memory usage and compute waste due to processing padded, empty slots (zero tokens). | Significant memory overhead and computational inefficiency from large, sparsely filled buffers. |
Relation to Other | Directly scales the theoretical load to determine the Expert Capacity. | Is the concrete, integer implementation of the Capacity Factor's intent. |
Tuning Consideration | Trade-off between robustness (fewer drops) and efficiency (less waste). Often set based on empirical validation of router balance. | Must be a multiple of hardware-friendly sizes (e.g., GPU warp size). Constrained by available device memory. |
Frequently Asked Questions
A deep dive into the Capacity Factor, a critical hyperparameter for managing computational load and preventing dropped tokens in Mixture of Experts models.
The Capacity Factor is a hyperparameter in Mixture of Experts (MoE) models that defines a soft, multiplicative limit on the number of tokens that can be routed to a single expert in a forward pass. It is calculated as (batch_size * sequence_length * k) / num_experts, where k is the number of experts selected per token, and then multiplied by the capacity factor (typically a value like 1.25 or 2.0). This creates a buffer above the theoretical average load per expert to prevent dropped tokens—tokens that cannot be processed because an expert has reached its limit—while still allowing for efficient batched computation on the GPU.
In practice, setting the capacity factor involves a direct trade-off: a higher factor increases computational waste and memory usage (as experts process padded, empty slots), while a lower factor increases the risk of token overflow and degradation in model quality. It is a key lever for system architects to balance throughput, latency, and predictive accuracy.
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
The capacity factor is a critical implementation parameter within Mixture of Experts architectures. It operates in concert with several other core concepts that define the system's efficiency, routing logic, and computational footprint.
Expert Capacity
The maximum number of tokens that can be assigned to a single expert in a Mixture of Experts forward pass. It is a hard limit set during model implementation.
- Directly related to Capacity Factor: The capacity factor is a multiplier applied to the base expert capacity calculation to provide a buffer.
- Purpose: Prevents a single expert's computation from becoming a bottleneck by batching token computations, but setting it too low risks dropped tokens.
- Calculation: Base capacity is often
(batch_size * sequence_length * k) / num_experts. The capacity factor (e.g., 1.25) is multiplied by this to set the final, padded capacity.
Top-k Gating
The routing strategy where the gating network selects the top k experts with the highest scores for each input token.
- Defines Sparsity: The value of
k(e.g., 1 in Switch Transformers, 2 in Mixtral) determines how many experts are activated per token, directly controlling conditional computation. - Impacts Capacity Planning: The
kvalue is a key variable in the base expert capacity formula(batch_size * seq_len * k) / num_experts. A higherkincreases the minimum required capacity per expert. - Contrast with Routing: This is the specific algorithm that performs the expert routing decision.
Load Balancing
A set of techniques to ensure the router distributes tokens evenly across all experts, preventing a small subset from being overloaded while others are underutilized.
- Why it's needed: Without it, the router can collapse, always selecting the same few experts. This makes expert capacity a bottleneck for those few experts and wastes the parameters of idle experts.
- Implementation: Often enforced via an auxiliary loss (load loss) added during training, which penalizes the variance in token assignment across experts.
- Relation to Capacity Factor: Good load balancing makes capacity planning more predictable and efficient, as token distribution is uniform, reducing the risk of localized capacity overflows.
Dropped Tokens
Tokens that cannot be processed by their initially assigned expert because that expert has reached its expert capacity limit.
- Primary Cause: Occurs when the number of tokens routed to an expert exceeds its fixed capacity. The capacity factor is a hyperparameter tuned specifically to minimize this occurrence.
- Handling Strategies: Common fallbacks include passing the token unchanged to the next layer (a skip connection) or re-routing it to a secondary, less-loaded expert.
- System Impact: Dropped tokens represent a failure in the routing-computation pipeline and can degrade model performance, making their minimization a key systems optimization goal.
All-to-All Communication
A collective communication pattern essential for expert parallelism, where devices exchange tokens and computed results after routing decisions.
- Process Flow: 1) All devices compute router scores for their local tokens. 2) Tokens are scattered (sent) to the specific devices hosting their assigned experts. 3) Experts compute. 4) Results are gathered back to the original devices.
- Performance Bottleneck: This communication can dominate latency in distributed MoE inference. Efficient capacity planning (via the capacity factor) ensures experts on each device receive balanced workloads, making the all-to-all exchange more efficient.
Sparse Activation
The fundamental property of MoE and other conditional computation models where only a small, dynamically chosen subset of the model's total parameters is used for a given input.
- Core Efficiency Proposition: Enables models with vastly more parameters (e.g., trillions) while keeping the computational cost per token relatively low, proportional to the active subset.
- Enabled by Routing: The gating network and top-k gating are the mechanisms that enable sparse activation.
- System Challenge: Sparse activation creates irregular, data-dependent computation graphs. The capacity factor and expert capacity are levers to make this irregularity manageable for efficient hardware execution (e.g., via fused MoE kernels).

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