Abstract
Mixture-of-Experts (MoE) architectures offer a promising path for scaling Large Language Models (LLMs) without proportional increases in computational cost. However, their massive storage requirements present a significant barrier for deployment on resource-constrained edge devices. This paper introduces CoMoE, the first framework to jointly optimize expert aggregation and expert offloading. By dynamically balancing these strategies based on real-time hardware states, CoMoE reduces memory usage by up to 70% and latency by 10.5%, enabling 7B+ parameter models to run on devices with less than 5GB of RAM.
Introduction
MoE models suffer from "storage redundancy": while only a few experts are activated per input, all must be stored. On edge devices like smartphones or IoT gateways, this creates a massive bottleneck. Existing solutions typically choose between two suboptimal paths: aggregation (merging experts to reduce size, which often degrades accuracy) or offloading (keeping experts in slow system RAM and loading them into the GPU as needed, which introduces massive communication latency).
CoMoE addresses this by creating a unified, resource-aware framework. The core insight is a synergistic effect: merging experts doesn't just save space; it makes offloading more predictable. By reducing the total pool of experts, the system achieves a higher "hit rate" when prefetching, significantly cutting down on communication stalls.
The CoMoE Framework
The CoMoE architecture addresses three sub-problems through a centralized Collaborative Decision Engine, as illustrated in Figure 1.
1. Dynamic Resource Perception
This module monitors real-time hardware metrics, including GPU/CPU utilization, available memory, and bandwidth. It utilizes Exponentially Weighted Moving Averages (EWMA) to smooth noise and predict future resource availability, ensuring the system reacts to sustained trends rather than momentary spikes.
2. Two-Level Adaptive Aggregation
CoMoE employs a dual-layered approach to model compression:
- Coarse-grained: The system maintains a library of pre-computed model variants with different merging ratios (e.g., keeping 25%, 50%, or 75% of experts). It switches between these versions as device conditions change.
- Fine-grained: Within a specific model, it uses Adaptive-Ratio Fusion. This strategy calculates the "entropy" of expert activation; layers with frequently used ("hot") experts are merged less aggressively than redundant layers.
3. Intelligent Offloading & Prefetching
To mitigate communication latency, CoMoE uses a lightweight 2-layer MLP to predict which experts will be needed for the next layer based on current hidden states. If the prediction probability exceeds a dynamic threshold, those experts are prefetched from CPU RAM to a GPU cache, effectively hiding the PCIe bus latency.
Experimental Evaluation
The authors evaluated CoMoE using the Switch Transformer series (0.5B to 15.8B parameters) across various NLP benchmarks, including SST2, WikiQA, and HotpotQA. Testing was performed on real-world edge hardware: the NVIDIA Jetson AGX Orin (64GB RAM) and an Intel NUC with an RTX A500 (8GB GPU).
Key Results
- Memory Reduction: For the 7.4B-parameter Switch-Base-128 model, CoMoE slashed memory requirements from 15.6GB to 4.7GB.
- Latency Gains: The framework achieved 10.5% lower inference latency compared to state-of-the-art offloading-only methods.
- Efficiency: CoMoE achieved a 3-4x improvement in the Performance-Memory Ratio (PMR), measuring tokens-per-second per GB of memory used.
- Deployability: Under a strict 4GB memory limit, CoMoE was the only method capable of successfully deploying the Switch-Base-64 model.
Conclusion
CoMoE demonstrates that joint optimization of aggregation and offloading is essential for deploying large MoE models at the edge. While the current evaluation focused on the Switch Transformer architecture, the principles of predictive prefetching and adaptive fusion are broadly applicable. Future work will explore multi-device collaborative inference and extending these optimizations to decoder-only models like Mixtral.
Summary updated