CryptoMoE: Privacy-Preserving and Scalable Mixture of Experts Inference via Balanced Expert Routing

Yifan Zhou, Tianshi Xu, Jue Hong, Ye Wu, Meng Li

Introduction

The evolution of Large Language Models (LLMs) has seen a significant shift from dense architectures to Mixture of Experts (MoE) designs. MoE models, such as DeepSeek and QWen, utilize a "router" mechanism to direct input tokens to a specific subset of "expert" sub-networks. This sparse activation allows for massive parameter counts with relatively low computational costs during inference.

However, deploying MoE models in privacy-sensitive environments presents a unique challenge. In a private inference scenario—where the server must not see the user's input and the user must not see the model's weights—the routing decision itself becomes a side-channel. If a server observes which expert is triggered, it can infer semantic properties of the input (e.g., a math-specific expert indicates a mathematical query). Standard privacy frameworks using Secure Multi-Party Computation (MPC) and Homomorphic Encryption (HE) often resort to "dense" execution to hide these patterns, which negates the efficiency benefits of MoE. CryptoMoE aims to bridge this gap, providing MoE-level efficiency without sacrificing privacy or accuracy.

The CryptoMoE Framework

CryptoMoE is the first framework designed to enable private, efficient, and accurate inference specifically for MoE architectures. It addresses the privacy-efficiency trade-off through four primary technical innovations.

1. Balanced Expert Routing

To prevent information leakage via expert activation, CryptoMoE implements a balanced routing strategy. Every expert is forced to process a fixed number of tokens ($t$). If an expert receives fewer than $t$ tokens, it processes "dummy" tokens to fill the capacity. Conversely, if an expert is over-capacity, the least relevant tokens are dropped. This ensures that the computational workload and communication patterns remain identical regardless of the actual input, effectively masking the routing decisions from the server.

2. Confidence-Aware Token Selection

To mitigate the accuracy loss associated with dropping tokens, CryptoMoE utilizes the router's confidence scores. Tokens are re-ranked based on these scores, ensuring that the most critical tokens for a specific expert's domain are prioritized within the fixed capacity $t$. Research indicates that setting $t$ to approximately twice the expected average load ($t = 2mk/n$) allows the model to retain 99.2% of its original accuracy.

3. Optimized Secure Dispatch and Combine

The framework introduces specialized MPC protocols for the "dispatch" (moving tokens to experts) and "combine" (aggregating expert outputs) phases. By decoupling the sorting logic (performed on small scalar scores) from the data movement logic (performed on large token embeddings), CryptoMoE significantly reduces the communication overhead typically associated with shuffling data in a private context.

4. Batch MatMul Protocol

Matrix multiplication is the primary bottleneck in private inference. CryptoMoE introduces a novel Batch MatMul protocol that leverages the fragmented nature of MoE. By packing tokens destined for different experts into a single ciphertext, the framework reduces the number of expensive "rotation" operations in Homomorphic Encryption by a factor of $n$ (the number of experts), leading to substantial speedups.

Experimental Evaluation

The authors evaluated CryptoMoE across three major MoE-based LLM families: DeepSeekMoE (2.8B and 16.4B), QWenMoE (2.7B and 14.3B), and OLMoE (1.3B and 6.9B). Performance was benchmarked across eight zero-shot reasoning tasks, including SIQA (social intelligence), BoolQ (boolean questions), and HellaSwag (common sense).

Key Results

  • Latency: In LAN environments, CryptoMoE achieves a 2.8× to 3.5× end-to-end latency reduction compared to dense private baselines.
  • Communication: The framework reduces bandwidth requirements by 2.9× to 4.3×.
  • Accuracy: On average, the models retain 99.2% of their non-private accuracy, demonstrating that balanced routing is a viable strategy for maintaining model utility.
  • Comparative Advantage: When compared to adapting prior state-of-the-art pruning methods like CipherPrune to the MoE setting, CryptoMoE is up to 2.4× faster.

Discussion and Limitations

While CryptoMoE represents a significant advancement, several challenges remain. The "top-k" selection protocol requires multiple communication rounds, which can become a bottleneck in high-latency Wide Area Network (WAN) environments. Additionally, the balanced routing strategy is less effective for very short input sequences (e.g., fewer than 64 tokens), where token distribution across experts is more volatile. Finally, the memory overhead inherent in cryptographic operations remains a hurdle for deploying extremely large models (100B+ parameters) on commodity hardware.

Conclusion

CryptoMoE successfully bridges the gap between the efficiency of Mixture of Experts models and the stringent requirements of private inference. By transforming the routing process into a balanced, predictable workload and optimizing the underlying cryptographic primitives, it enables scalable, privacy-preserving LLM applications.

Summary updated

BibTeX
@inproceedings{zhou2025cryptomoe,
  author = {Yifan Zhou and Tianshi Xu and Jue Hong and Ye Wu and Meng Li},
  title = {{CryptoMoE: Privacy-Preserving and Scalable Mixture of Experts Inference via Balanced Expert Routing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=8pEqukyGrj},
}
Figure