Fine-Grained Mixture of Experts Architecture: A Technical Breakdown

    This article explains how fine-grained Mixture of Experts (MoE) architectures decouple model capacity from compute cost. It covers fine-grained expert splitting, shared expert isolation, load balancing and training stability techniques, inference deployment considerations, and evaluation practices for building large-capacity, low per-token cost models.

    1. Why Mixture of Experts?

    A large model’s capability ceiling is closely tied to its parameter count, but dense architectures face a structural constraint: every token activates all parameters in the forward pass, so training and inference costs grow roughly linearly with model size. Mixture of Experts (MoE) breaks this constraint through conditional computation—the model’s total capacity can be very large, while the actual compute per token depends only on the subset of activated experts.

    An open-source MoE architecture released by an open-source team in early 2024 was among the earlier efforts of its kind in China. It supports both Chinese and English and allows free commercial use. It was later applied to general-purpose models and vision-language models across multiple parameter scales, and subsequent versions scaled total parameters to around 671 billion, with roughly 37 billion activated per token. These numbers illustrate the core value of MoE: decoupling capacity from compute.

    2. Two Key Designs: Fine-Grained Splitting and Shared Expert Isolation

    2.1 Fine-Grained Expert Splitting

    Traditional MoE typically uses 8–64 coarse-grained experts, where each expert is a complete FFN. The fine-grained approach splits each FFN into smaller segments along the hidden dimension, increasing the number of experts by one to two orders of magnitude and increasing the top-k routing value k accordingly.

    The benefit lies in the combination space: with coarse granularity, choosing 2 from 64 yields only 2,016 combinations, whereas with fine granularity, choosing 4 from 128 grows the number of combinations exponentially. The router can more precisely assign parameter subsets to tokens with different semantics and languages, achieving higher expert specialization.

    2.2 Shared Expert Isolation

    If all parameters go through routing, general knowledge gets repeatedly duplicated across experts, creating redundancy. Shared expert isolation designates a small number of always-active shared experts to carry general capabilities, while the remaining routed experts focus on capturing differentiated knowledge. A formal expression:

    1. # h: input hidden state; gate: routing score function
    2. def moe_forward(h, shared_experts, routed_experts, top_k=4):
    3. out = sum(shared(h) for shared in shared_experts) # always active
    4. scores = gate(h) # [num_experts]
    5. idx = scores.topk(top_k).indices
    6. for i in idx:
    7. out = out + scores[i] * routed_experts[i](h)
    8. return out

    3. Load Balancing and Training Stability

    The biggest engineering risk of conditional computation is routing collapse: a few experts are over-selected while the rest receive no gradient. The common industry solution has three layers:

    • Auxiliary balancing loss: Construct a penalty term from the entropy or variance of the expert load distribution, weighted and summed with the main task loss.
    • Capacity factor and dropping: Set a token capacity limit per expert; tokens exceeding the limit go through a residual direct connection, preventing memory peaks from spiraling out of control.
    • Random routing and noise injection: Add noise to the scores early in training to encourage exploration.

    On the numerical side, it is recommended to use fp32 accumulation for routing scores while keeping expert computation in low precision, which can significantly reduce loss spikes in later training stages.

    4. Inference Deployment Considerations

    MoE memory usage is determined by total parameters, while compute is determined by activated parameters. This creates two issues that must be planned for in advance:

    1. Memory and parallelism strategy: All expert weights must reside in memory, typically using expert parallelism to distribute different experts across multiple devices, combined with tensor parallelism to split individual experts.
    2. Communication overhead: All-to-All token exchange is the main bottleneck, which can be mitigated through grouped routing, limiting the number of cross-node experts per token, and operator fusion.

    Engineering also requires capacity planning and elasticity: model weights are well suited to object storage for version management, the serving layer can run on a container platform with elastic scaling based on traffic, and logging services plus monitoring and alerting can observe routing distribution, expert hit rate, and tail latency. On the development side, intelligent coding tools can help generate boilerplate code for routing and parallel splitting, reducing manual errors.

    5. Evaluation Recommendations

    Evaluating MoE requires more than total parameter count; it should also report activated parameters, compute per token, expert load balance, and cost per unit throughput. Comparison experiments must fix the training token budget; otherwise, the capacity advantage will be masked by differences in data volume.

    6. Conclusion

    Fine-grained splitting improves routing precision, and shared expert isolation eliminates redundancy in general knowledge. Together they form the architectural foundation for “large capacity, low per-token cost.” The practical takeaway for developers: first define compute and memory boundaries, then decide expert granularity, top-k, and parallel topology, and finally use balancing loss and an observability system to ensure stability over long training cycles.