TL;DR
ExFold is a training-free framework that accelerates both the prefill and decode phases of Mixture-of-Experts (MoE) Large Language Models. Instead of blindly dropping skipped experts, ExFold "folds" their contributions into the retained experts using offline-calibrated scalar multipliers. This simple metadata adjustment delivers up to 1.41× speedups in prefill (TTFT) and 2.45× in decode (TPOT) while preserving roughly 99% of the original model quality.
What Problem Does This Paper Address?
Mixture-of-Experts (MoE) architectures allow large language models to scale up their parameter counts drastically without a proportional increase in computing costs. They achieve this by routing each token to only a sparse subset of "experts" (neural network layers) instead of activating the entire model.
However, serving MoE models efficiently in production is incredibly difficult because inference is split into two phases with completely opposite hardware bottlenecks:
- Prefill Phase (Compute-Bound): Processes the initial user prompt. Because many tokens are processed simultaneously, every expert gets heavily utilized, making the phase bound by raw compute (FLOPs).
- Decode Phase (Memory-Bound): Generates subsequent tokens one by one. Across a batch of different user requests, the union of requested experts usually covers almost the entire model. The system is forced to constantly fetch massive expert weights from high-bandwidth memory for just a handful of tokens, creating a severe memory-bandwidth bottleneck.
Existing training-free acceleration methods typically optimize for only one of these phases—either by dropping experts per token or restricting the global pool of experts. Worse, they simply discard the skipped experts' contributions, causing severe model quality degradation when hardware budgets get tight.
Methods
The authors introduce ExFold (Expert Folding), a framework that treats MoE acceleration as a unified output-approximation problem. Instead of throwing away budget-excluded experts, ExFold mathematically projects their contributions onto the experts that are being executed.
The process works in three main steps:
- Offline Calibration: The model runs a single, frozen forward pass over a small set of unlabeled text. It calculates two per-layer matrices: a projection-loss matrix (which determines which retained expert is the best substitute for an excluded one) and a scalar-projector matrix (which determines how much to scale the substitute's output).
- Phase-Specific Selection: At inference time, ExFold applies phase-specific constraints. For prefill, it restricts the number of experts executed per token ($K_{pre}$). For decode, it caps the total number of unique experts loaded for the entire batch ($D$).
- Unified Folding: If an expert is excluded by the budget, ExFold routes its weight to its closest retained substitute and scales that substitute's gating weight using the pre-calculated scalar.
Crucially, because this scaling factor is absorbed directly into the model's routing metadata before execution, it requires zero changes to the underlying model weights and introduces virtually no runtime overhead. The authors implemented this as a plug-and-play plugin in the popular vLLM serving engine using a lightweight custom Triton/CUDA kernel.
Datasets
ExFold was calibrated using 32 to 64 unlabeled text sequences drawn from the public NVIDIA Nemotron Post-Training Dataset.
To prove its generalizability, the authors evaluated the framework across several state-of-the-art MoE models (including Qwen3-30B-A3B, GLM-4.5-Air, DeepSeek-V2-Lite, and DeepSeek-V4-Flash) across a diverse suite of standard benchmarks:
- Mathematics: MATH500, AIME24
- Code Generation: LiveCodeBenchV5, HumanEval+
- Instruction Following: IFEval, IFBench
- Reasoning & Knowledge: GPQA-Diamond, MMLU-Pro
Key Insights and Ideas
- Redundancy is Magnitude-Separable: The core "aha!" moment of the paper is that expert outputs are directionally aligned but differ wildly in scale. When you apply Principal Component Analysis (PCA) to raw expert outputs, they look scattered. However, once normalized to a unit scale, they collapse onto a thin, shared axis. This means an excluded expert's output can be highly accurately approximated simply by rescaling a retained expert's output.
- One Shared Recovery Mechanism: Even though prefill and decode have different operational bottlenecks, the mathematical mathematical residual left behind when you drop an expert is identical. ExFold exploits this by using the exact same scalar-projector matrix to recover dropped information in both phases.
Key Results
ExFold demonstrates a superior quality-speed trade-off compared to direct expert-dropping or static pruning methods.
- Prefill Speedups: By halving the active experts per token (e.g., Top-8 down to Top-4), ExFold achieved up to a 1.41× speedup in Time-to-First-Token (TTFT).
- Decode Speedups: By aggressively capping the batch-wide expert pool, it achieved up to a 2.45× speedup in Time-per-Output-Token (TPOT).
- Near-Lossless Quality: Across the board, ExFold maintained roughly 99% of the original model's average performance, preventing the steep quality drops seen in baseline methods under tight compute budgets.
Limitations and Future Work
While ExFold is highly effective, it does rely on an offline calibration step. Even though the authors demonstrated that the calibration is stable and doesn't require task-specific data, changes in a model's underlying distribution might still necessitate re-calibration.
Additionally, when scaling up to massive models like DeepSeek-V4-Flash (which features 256 routed experts), the wider variance in router scores required the authors to introduce an extra "confidence-aware safeguard" to prevent poorly aligned expert pairs from introducing errors. Exploring more dynamic, online scaling adjustments for ultra-large expert spaces remains an open avenue for future research.
Summary updated