Abstract
The Mixture-of-Experts (MoE) architecture has been widely adopted in large language models (LLMs) to reduce computation cost through model sparsity. Employing speculative decoding (SD) can further accelerate MoE inference by drafting multiple tokens per step and verifying them in parallel. However, combining MoE with SD inflates GPU memory and aggravates CPU-GPU bandwidth contention during multi-token verification. Existing MoE offloading systems are SD-agnostic and do not address this bottleneck. We present SP-MoE, the first SD-aware expert-offloading and compute-communication pipelining framework. SP-MoE introduces: (1) speculative expert prefetching that exploits structural correspondence between the draft and target models to prefetch likely experts ahead of verification; (2) a cutoff-layer policy that bounds per-layer prefetch depth based on empirical profiles and an analytical latency model, guaranteeing just-in-time availability without overfetch; and (3) a pipelined runtime with asynchronous prefetch threads and batched I/O to hide loading latency. Extensive experiments demonstrate that SP-MoE achieves a 1.07-3.5 times TPOT speedup over state-of-the-art methods across diverse datasets, environments, and MoE-based models.
Introduction
Large Language Models (LLMs) utilizing the Mixture-of-Experts (MoE) architecture, such as Mixtral 8x7B or DeepSeek, achieve high performance by activating only a subset of parameters for each token. Despite this computational efficiency, the sheer size of these models often exceeds the memory capacity of consumer-grade GPUs. For instance, an NVIDIA RTX 4090 with 24GB of VRAM cannot natively host the ~87GB required for Mixtral.
The standard mitigation is offloading, where experts reside in CPU memory and are transferred to the GPU on demand. However, the PCIe bus becomes a critical bottleneck, as data transfer is significantly slower than computation. While Speculative Decoding (SD)—using a small "draft" model to predict tokens for a "target" model to verify—typically accelerates inference, it exacerbates offloading issues. During verification, the target model processes multiple tokens simultaneously, creating a massive, synchronized demand for diverse experts that leads to severe I/O congestion and GPU idle time.
The SP-MoE Framework
SP-MoE is the first system designed to harmonize MoE offloading with speculative decoding. It leverages the inherent "idle" window of the I/O bus during the drafting phase to prepare for the verification stage.
The framework is built upon three core components:
- Speculative Expert Prefetching: By identifying structural similarities between draft and target models, SP-MoE uses the draft model's hidden states to predict which experts the target model will require. This "scouting" happens during the drafting phase, allowing experts to be loaded before they are needed for verification.
- Cutoff-Layer Policy: To prevent "cache thrashing" and memory overload, SP-MoE employs an analytical latency model to determine a "cutoff layer." This policy limits prefetching depth to ensure experts arrive "just-in-time" without exceeding GPU memory limits.
- Pipelined Runtime: The system utilizes an asynchronous worker thread for I/O. While the GPU executes the draft model, the CPU concurrently pushes predicted experts over the PCIe bus using batched I/O to minimize overhead.
Experimental Evaluation and Results
The framework was evaluated across diverse benchmarks, including HumanEval (coding), BigBench (reasoning), WikiText-103 (language modeling), and MMLU-Pro (specialized knowledge). Tests spanned hardware from consumer RTX 3090/4090s to data-center A100 GPUs.
Key findings include:
- Performance Gains: SP-MoE achieved a 1.07× to 3.5× speedup in Time Per Output Token (TPOT) compared to state-of-the-art baselines like Mixtral-Offloading and MoE-Infinity.
- Efficiency on Constrained Hardware: The most significant improvements were observed on memory-constrained consumer GPUs, with a 1.75× speedup on coding tasks using an RTX 3090.
- High Prediction Accuracy: Despite the size difference, draft models (e.g., Mistral 7B) provide hidden states similar enough to the target (Mixtral 8x7B) to achieve ~88% expert prediction accuracy.
Discussion and Future Work
While SP-MoE significantly advances MoE inference efficiency, it currently focuses on a batch size of 1 to optimize single-user latency. Scaling to larger batches presents challenges due to uncorrelated expert activation patterns across different requests. Additionally, the current implementation assumes greedy decoding; future work will explore the impact of sampling-based decoding and the integration of tree-based speculative methods like Medusa to further enhance throughput.
Summary updated