Mixture of Experts Architecture: Fine-Grained Routing and Efficient Scaling

    Mixture of Experts (MoE) models use conditional computation to increase capacity without executing all parameters for every token. This article examines the architecture fundamentals, fine-grained expert partitioning, shared and routed expert separation, routing and load-balancing mechanisms, and the distinction between total and activated parameters. It also covers training and inference engineering challenges, deployment tuning, multimodal and scale-specific design considerations, and the scenarios and limitations that determine when MoE is a practical choice.

    1. Core Idea of Mixture of Experts

    Mixture of Experts (MoE) is a neural network architecture that improves model capacity through conditional computation. A traditional dense model usually performs computation over almost all parameters for every input. An MoE model instead maintains multiple expert networks with different functions and uses a router to dynamically select a subset of experts based on the input.

    This mechanism can be summarized as follows:

    1. The input passes through a shared representation layer.
    2. The router computes expert selection scores for the current token.
    3. Each token is dispatched to a small number of experts.
    4. The experts perform local transformations.
    5. The routed results are weighted and aggregated before continuing to subsequent network layers.

    As a result, an MoE model can have a large total parameter count while activating a relatively limited number of parameters for each token. Model capacity is mainly determined by all expert parameters together, while computational cost depends more on how many experts each token selects.

    This characteristic makes MoE suitable for building large-scale models: without executing all parameters during every inference pass, the model can still gain stronger knowledge storage and task adaptation capabilities.

    2. Fine-Grained Expert Partitioning

    Traditional MoE designs usually divide the network into a smaller number of large experts. Fine-grained expert design further splits expert modules, decomposing one large expert into multiple smaller expert units.

    For example, while keeping the overall parameter scale roughly similar, more small experts can replace a few large experts. The main benefits include the following.

    2.1 Greater Compositional Flexibility

    Different inputs do not have identical knowledge requirements. A token may involve language understanding, factual knowledge, code structure, mathematical reasoning, or several of these at once. With fewer experts, the router can only make selections at a coarser granularity. After experts are split into finer units, the model can combine multiple small experts to perform more precise knowledge invocation.

    2.2 Lower Per-Activation Cost

    Fine-grained experts allow the model to activate only a subset of smaller modules instead of calling one complete large expert. With a similar number of activated parameters, more small experts generally provide a finer combination space and help control per-token computation.

    2.3 Improved Expert Utilization

    When there are too few experts, some experts may carry too many tasks while others remain underutilized for long periods. A finer expert partition gives the router more choices and helps assign different types of input to more suitable computation paths.

    However, more experts is not always better. Experts that are too small may have insufficient representational capacity, and a larger expert count increases the complexity of routing, communication, scheduling, and parameter management. Design therefore needs to balance expert granularity, activation count, device communication cost, and training stability.

    3. Separating Shared and Routed Experts

    One representative design divides experts into shared experts and routed experts.

    Shared experts execute for all inputs and are used to capture general knowledge, basic syntax, and stable contextual representations. Routed experts are dynamically selected according to the input and mainly handle differentiated domain knowledge, task patterns, and local features.

    This division can alleviate a common problem: if all experts depend entirely on dynamic routing, foundational capabilities may also be scattered across different experts, making representations less stable across inputs. With shared experts, the model always retains a general computation path; dynamic experts then focus on differentiated information.

    Functionally, the roles can be understood as follows:

    • Shared experts: handle foundational capabilities and cross-task general capabilities.
    • Routed experts: handle input-specific specialized capabilities.
    • Router: determines which specialized capabilities the current token needs.
    • Aggregation module: fuses shared computation and dynamic computation results.

    This structure does not mean that experts are completely independent. Shared experts still participate in overall training, and routed experts may also learn some general patterns. Its more important role is to clarify responsibilities through structural design and reduce the pressure on the routing system to carry all modeling responsibility.

    4. Routing and Load Balancing

    The router typically generates expert scores from the input hidden state. Let the input representation be (x), the number of experts be (N), and the router output scores be:

    [
    s = W_r x
    ]

    Here, (W_r) is the routing parameter matrix. After normalization, the system selects the highest-scoring experts and dispatches the input to them. The final output can be represented as:

    [
    y = \sum_{i \in \mathcal{E}(x)} p_i(x)E_i(x)
    ]

    Here, (\mathcal{E}(x)) denotes the selected expert set, (p_i(x)) denotes the corresponding weight, and (E_i) denotes the computation result of the (i)-th expert.

    During actual training, routers are prone to load imbalance. For example, if a large number of tokens are concentrated in a few experts, the following problems can occur:

    • Popular experts reach their capacity limits.
    • Cold experts do not receive sufficient training.
    • Severe communication imbalance occurs across devices.
    • Some tokens are dropped or require additional buffering.
    • Training throughput and convergence stability decline.

    Therefore, load-balancing constraints are usually needed so that the number of tokens received by each expert stays as close as possible. Common approaches include adding auxiliary losses, setting expert capacity limits, constraining routing probabilities, and monitoring expert utilization during training.

    It is important to note that load balancing does not mean forcing all experts to process exactly the same number of inputs. Differentiated expert capabilities are a core value of MoE. A reasonable goal is to avoid extreme congestion or long-term idleness while preserving expert specialization.

    5. Parameter Scale and Activated Scale

    When understanding MoE, it is essential to distinguish total parameter count from activated parameter count.

    Total parameter count includes all experts, shared modules, attention modules, embedding layers, and output layers. Activated parameter count refers to the number of parameters that actually participate in computation when processing one token. For models with many experts, there can be a significant gap between the two.

    For example, a model can have tens of billions or more total parameters while activating only a small fraction of them per token. This expands the model’s knowledge capacity while preventing inference computation from growing linearly with total parameter count.

    However, activated parameter count is not equivalent to full deployment cost. Practical systems also need to consider:

    • Whether all expert parameters remain resident in GPU memory.
    • Whether expert parameters need to be transferred across devices.
    • Extra overhead introduced by routing and aggregation operations.
    • Batch size and sequence length.
    • Network bandwidth and communication latency between devices.
    • Expert caching, loading, and memory fragmentation.

    Therefore, when evaluating an MoE model, it is not enough to look only at total parameters or activated parameters. End-to-end latency, throughput, memory usage, communication ratio, and expert load distribution should also be observed.

    6. Engineering Challenges in Training

    6.1 Expert Parallelism

    When the number of experts and the parameter scale are large, a single device usually cannot hold all experts. In engineering practice, different experts are often distributed across multiple compute devices, and tokens are sent to the corresponding locations according to routing results. This process requires efficient collective communication and data rearrangement mechanisms.

    If communication time exceeds the computation time of the experts themselves, the theoretical computational advantage of MoE may be offset. Device topology, batch organization, communication coalescing, and data layout therefore all require dedicated optimization.

    6.2 Capacity Control

    Each expert usually has an upper limit on the number of tokens it can receive. Too small a capacity causes token overflow, while too large a capacity increases memory usage and tail latency. The training system needs to determine a reasonable capacity based on batch size, sequence length, expert count, and routing strategy.

    6.3 Training Stability

    Routers may change drastically in the early stages of training, leading to unstable expert usage. Common improvement directions include:

    • Moderately normalizing routing scores.
    • Using load-balancing auxiliary objectives.
    • Controlling routing temperature or the number of selected experts.
    • Using stable parameter initialization.
    • Monitoring expert utilization and routing entropy.
    • Dynamically adjusting abnormal congestion.

    7. Key Issues in Inference Deployment

    During inference, the main benefit of MoE is reducing the computation per token, but the deployment system still needs to store a relatively large set of expert parameters. For long-form text generation, routing patterns change continuously, and the system needs to schedule different experts frequently. It therefore cannot be optimized simply in the same way as a dense model.

    In practice, the following areas deserve attention:

    1. Batch optimization: Aggregate tokens routed to the same expert and compute them together to reduce small-batch calls.
    2. Cache optimization: Arrange caching of expert parameters and intermediate results reasonably to reduce repeated transfer costs.
    3. Communication optimization: Minimize cross-device expert dispatch where possible, or place frequently used experts on closer compute nodes.
    4. Quantization and compression: Reduce expert weight storage and transfer costs within acceptable accuracy limits.
    5. Dynamic concurrency control: Adjust scheduling strategies based on request length, concurrency level, and expert hotspots.
    6. Observability: Continuously record expert hit rates, load variance, communication time, and request tail latency.

    8. Applications Across Model Forms

    Fine-grained MoE is not limited to text-only models. For vision-language models, visual encoder outputs, text representations, and cross-modal fusion features can all be fed into the router, allowing different experts to handle tasks such as visual recognition, text understanding, spatial relations, and cross-modal reasoning.

    MoE can also adopt different designs at different parameter scales:

    • Small-scale models focus more on expert count and training stability.
    • Medium-scale models need to balance activation cost and expert specialization.
    • Large-scale models focus on communication, storage, and load balancing.
    • Multimodal models also need to handle data distribution differences across modalities.

    MoE is therefore not a single fixed structure, but an architectural approach that can be composed and designed according to task, scale, and hardware environment.

    9. Suitable Scenarios and Limitations

    MoE is suitable for knowledge-intensive scenarios with diverse task types and high model capacity requirements. It is especially applicable to systems that need to cover general language, code, mathematics, specialized domains, and multimodal information at the same time.

    However, it also has clear limitations:

    • System implementation is more complex than that of dense models.
    • Total parameter count is large, and storage cost may not necessarily decrease.
    • Cross-device communication may become a bottleneck.
    • Routing instability can affect training quality.
    • Excessive expert specialization may cause knowledge fragmentation.
    • Evaluation needs to consider quality, cost, and load stability together.

    Therefore, before adopting MoE, teams should confirm whether the business truly needs large-capacity conditional computation. If the model scale is small, deployment devices are limited, or request patterns are highly stable, a simpler dense model can sometimes achieve more stable returns.

    10. Conclusion

    The core value of Mixture of Experts lies in relatively decoupling model capacity from per-pass computation. Through fine-grained expert partitioning, the model can combine different capabilities more flexibly. Through separation of shared and routed experts, it can retain stable general representations. Through reasonable load balancing and parallel scheduling, the theoretical advantages of conditional computation can be translated into practical engineering gains.

    During design and deployment, attention should be paid simultaneously to model structure, routing strategy, expert load, device communication, storage management, and inference latency. Only by co-designing algorithmic mechanisms and systems engineering can teams expand model capability while controlling resource consumption and build next-generation intelligent model architectures that are scalable, maintainable, and stable.