KEEP: Dynamic Expert Sparsification for Mixture-of-Experts Models

Maximilian Kleinegger, Dan AlistarharXiv 2026

TL;DR

Running massive Mixture-of-Experts (MoE) language models on local hardware usually hits a hard wall: statically deleting more than 50% of the model’s "experts" to save memory causes its intelligence to collapse. This paper introduces KEEP, an algorithm-and-system co-design that dynamically selects a custom subset of experts for each individual user prompt right before generating an answer. By keeping only the specialists needed for the task at hand, KEEP trims up to 75% of experts while retaining 90–97% of the full model’s accuracy and speeding up token generation by up to 3$\times$.

What Problem Does This Paper Address?

Modern powerhouse LLMs increasingly use a Mixture-of-Experts (MoE) architecture. Instead of firing every parameter for every word, MoEs divide their feed-forward layers into specialized sub-networks ("experts") and use a router to activate only a tiny fraction per token. This makes computation fast, but there's a catch: you still have to hold all the experts in memory, requiring massive VRAM budgets that price out local consumer hardware.

A popular fix is expert pruning—permanently amputating the least useful experts. However, state-of-the-art pruning methods hit a ceiling around 50% sparsity. Push past that, and the model either forgets general knowledge or becomes narrowly obsessed with whatever domain was in its calibration data. Why? Because current pruning is static: it forces every future user prompt—whether a Python bug or a French poem—to share the exact same surviving experts.

Methods

KEEP (Keep the Experts) flips pruning from a static, offline surgery into a dynamic, per-request decision, exploiting the natural split in LLM inference between prefill (reading the prompt in parallel) and decoding (generating the response one token at a time).

Figure 3. Overview of the method. Calibration: The full model processes calibration prompts and responses to train a ridge regression model predicting decoding expert importance from prompt routing patterns. Serving: Each prompt is prefilled using all experts. After prefill, each MoE layer retains the top-% experts by predicted importance (green) for decoding.
  • Offline Calibration (What's New): You can't just keep the experts that fired while reading the prompt, because reading a question and writing an answer use surprisingly different experts. Instead, KEEP runs calibration prompts offline and trains a lightweight linear predictor (via ridge regression) for each MoE layer. It learns to map prefill expert activation rates to decoding expert saliency (a metric combining how strongly an expert is routed with the magnitude of its output).
  • Dynamic Serving: When a prompt arrives, KEEP runs prefill using all experts—streaming them from disk if needed, since parallel processing amortizes the slow read cost once. As prefill finishes each layer, the linear predictor instantly scores which experts will matter for the upcoming response and masks out the rest.
  • Three-Tier Serving Engine: Built atop the MoE engine FreeToken, KEEP manages VRAM, pinned host RAM, and SSD disk. During prefill, double-buffering overlaps computation with disk reads. Simultaneously, a custom Triton kernel copies the newly chosen "kept set" of experts into GPU VRAM and pinned host RAM (managed as an LRU cache). During decoding, the model never touches the slow disk.

Datasets

  • Evaluation Benchmarks: Tested across math, reasoning, knowledge, and coding using MATH-500, GPQA-Diamond, MMLU-Pro, MBPP+, and HumanEval+. For agentic coding and tool-calling, the authors used SWE-Bench Verified (multi-turn) and BFCL-v4.
  • Calibration Data: Calibration prompts were sampled from a multi-domain mix (specific dataset composition is deferred to the paper's Appendix C.1, not included in the main text). No new benchmark datasets were introduced.

Key Insights and Ideas

  • The "Shared Wardrobe" Problem: Within any single prompt, just 25% of experts account for 84–94% of total contribution (saliency). Yet across all domains, a single static top-25% set captures only 64–82%. Static pruning fails past 50% not because models need more parameters per prompt, but because different prompts need different subsets.
Figure 2. Cross-domain expert saliency for Qwen3.6-35B-A3B. Rows represent the top 50% highest-saliency experts per layer selected from each task group. Cells show the fraction of column- group saliency captured, averaged over layers and 3 prompts. Boxed cells indicate matching selection and evaluation groups.
  • Specialists Don't Travel Well: As shown above, the top 50% of experts selected for Math capture 93% of math saliency, but drop to 52–54% on creative writing or general knowledge.
  • Prefill $\neq$ Decode, Yet Prefill Predicts Decode: The top-25% most important experts during prompt reading overlap by only 57–59% with those needed during response generation. Directly reusing prefill experts fails—but the routing pattern during prefill acts as a reliable fingerprint for a linear model to predict which decoding experts to wake up.
  • Broken Models Babble: Statically pruned models at 75% sparsity generated up to 18$\times$ more tokens than dense models due to degraded reasoning loops and excessive "thinking." KEEP kept token inflation modest (18–66%), saving both time and compute.

Key Results

Evaluated across three MoE models ranging from 35B to 749B parameters (Qwen3.6-35B-A3B, Qwen3.8-Flash-Next, and DeepSeek-V4.1-Flash):

  • Accuracy: At 50% sparsity, KEEP retains $\geq$99% of dense accuracy across all models. At an aggressive 75% sparsity, KEEP retains 90–97% of dense performance (staying within 2–3 percentage points on the two larger models), whereas static pruning (REAP) plunges by 26 to nearly 40 points.
  • Agentic Tasks: On SWE-Bench Verified and BFCL-v4, KEEP is virtually lossless at 50% sparsity and drops only ~2 points at 65% sparsity.
  • Hardware Speedups: On a desktop RTX 5090, KEEP introduces negligible prefill overhead while boosting decoding throughput by 2–3$\times$ over llama.cpp and FreeToken—and enables running massive models (like Qwen3.8-Flash-Next) on memory-constrained setups where FreeToken previously crashed out of memory.

Limitations and Future Work

  • Disk I/O Bottlenecks During Prefill: Because KEEP runs dense prefill using the entire model, prompts that require fetching uncached layers from SSD are bound by disk bandwidth, which can dominate Time-To-First-Token (TTFT) latency on memory-tight machines.
  • Fixed Expert Set Over Long Horizons: Because the kept expert set is locked in right after reading the initial prompt (and preserved across multi-turn prefix caches), if a conversation or agentic trajectory pivots sharply into an unexpected domain mid-generation, the locked decoding mask cannot swap in new experts from disk on the fly. Future directions are not explicitly detailed in the main text.

Summary updated

BibTeX
@misc{kleinegger2026keep,
  author = {Maximilian Kleinegger and Dan Alistarh},
  title = {{KEEP: Dynamic Expert Sparsification for Mixture-of-Experts Models}},
  year = {2026},
  eprint = {2611.36547},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.36547},
}
Figure