μ-MoE: Test-Time Pruning as Micro-Grained Mixture-of-Experts

Toshiaki Koike-Akino, Jing Liu, Ye WangarXiv 2025 · DOI

Abstract

Large Language Models (LLMs) are computationally intensive, necessitating efficiency techniques like pruning. However, standard offline pruning often leads to domain shift, where the model loses critical information for tasks not represented in the calibration data. We propose μ-MoE (Micro-Grained Mixture-of-Experts), a novel approach that performs dynamic, test-time pruning for every individual prompt. By treating every parameter as a "micro-expert" and leveraging the ultra-fast Wanda algorithm online, μ-MoE achieves higher accuracy and lower computational costs than static pruning. Our evaluation across language and multimodal benchmarks demonstrates that μ-MoE effectively mitigates domain shift while significantly reducing Multiply-Accumulate (MAC) operations.

The Challenge of Static Pruning

Pruning aims to create sparse models by removing less important weights. Traditional methods are "offline": they use a small calibration dataset to determine weight importance statically. This approach is prone to domain shift. If the calibration data (e.g., Wikipedia) differs significantly from the user's prompt (e.g., specialized code), the static sparse structure may lack the necessary weights for accurate inference.

Comparison between (a) Offline Static Pruning, which suffers from domain shift, and (b) Online Dynamic Pruning, which adapts to specific tasks at test-time.

While some advanced pruning methods like SparseGPT offer high accuracy, their computational complexity makes them too slow for real-time use. Faster alternatives like Wanda have historically been limited to static applications. μ-MoE bridges this gap by enabling Wanda to run as a test-time operation.

μ-MoE: Micro-Grained Adaptation

The core idea of μ-MoE is to push the granularity of Mixture-of-Experts (MoE) to its limit. Instead of routing inputs to large sub-networks (coarse-grained) or specific modules (fine-grained), μ-MoE treats every single parameter as an independent expert that can be activated or deactivated based on the current input.

Evolution of MoE granularity from (a) Coarse-Grained (LLM blocks) to (b) Fine-Grained (MHA/MLP modules) and finally (c) Micro-Grained (individual weights) as proposed in μ-MoE.

Instant Wanda Pruning

μ-MoE utilizes the Wanda algorithm to calculate importance scores online. The score for each weight is the product of its magnitude and the $l_2$-norm of the corresponding input activations. Because LLM inference complexity is dominated by the hidden dimension and sequence length ($d^2T$), and the pruning logic is only $O(d^2)$, the overhead of re-pruning for every prompt becomes negligible as sequence length increases. This "free lunch" allows the model to find an optimal sparse structure on the fly for every interaction.

Experimental Evaluation

We evaluated μ-MoE using the OPT model family (125M to 13B parameters) and the LLaVA-7B multimodal model across several benchmarks, including WikiText-2, C4, ScienceQA, and TextVQA.

Key Results

  • Accuracy Gains: On OPT-125M with 40% active weights, μ-MoE achieved a perplexity of 66.9, outperforming static Wanda (81.6).
  • Multimodal Performance: For LLaVA-7B on ScienceQA (40% active weights), μ-MoE reached 41.12% accuracy, surpassing both SparseGPT (39.05%) and static Wanda (32.45%).
  • Efficiency: For an OPT-17B model, μ-MoE can reduce MAC operations from 1.64T to 342G (at 20% active weights) while maintaining superior performance over static alternatives.

Discussion and Future Work

μ-MoE demonstrates that micro-grained granularity is key to solving domain shift in sparse LLMs. By calibrating on the actual test prompt, the model becomes task-agnostic and robust for general-purpose use.

However, practical speedups on current hardware remain a challenge, as GPUs are primarily optimized for dense operations. Future work includes developing specialized sparse kernels and exploring "sparsity-aware fine-tuning" to further enhance performance. Additionally, since efficiency depends on amortizing the pruning cost over the sequence length, the method is most effective for longer prompts.

Summary updated

BibTeX
@misc{koikeakino2025moe,
  author = {Toshiaki Koike-Akino and Jing Liu and Ye Wang},
  title = {{μ-MoE: Test-Time Pruning as Micro-Grained Mixture-of-Experts}},
  year = {2025},
  eprint = {2505.18451},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.18451},
}
Figure