Manuscript Offprint

arXiv:2608.26650

Meta-Learning Where to Allocate Experts: Task-Conditioned Layer-Wise Compression for MoEs

Rongfeng Wang, Shichao Weng, Zhiqiang Wang, Xinyu Liu, Yang Yi, Peilong Zhou, Hongwei Tang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Mixture-of-Experts (MoE) models route each token to a subset of expert networks, increasing capacity while keeping per-token computation sparse. In many deployed MoEs, the number of active experts is fixed across layers and tasks, although layer roles and expert redundancy vary with depth [1–3] and demand varies with difficulty [4–6]. Existing approaches address only part of this setting: layer-wise allocations are usually determined offline and reused for all tasks [2, 3], while token-level methods vary expert activation using local routing signals without task-level context [4–6]. We propose MetaNet, a support-set controller that predicts, for each layer, an expert-retention threshold and a bounded routing bias. The backbone, experts, and router remain frozen. On DeepSeek-MoE-16B-Chat, MetaNet provides a tunable accuracy–expert-activation trade-off. Relative to fixed k=6, a conservative setting activates 3.61 experts on average (40% fewer) and achieves comparable MMLU accuracy (0.489 vs. 0.474), whereas an aggressive setting activates 2.28 experts on average (62% fewer) with accuracy approximately 3.7 percentage points lower. The MMLU-trained controller also transfers to C-Eval without retraining, activating 2.90 experts on average (52% fewer than fixed k=6) at 0.386 accuracy.

1. Introduction

Serving large language models (LLMs) at scale is expensive [7–9]. Mixture-of-Experts (MoE) architectures [10, 11] reduce per-step compute by routing each token to a small subset of expert subnetworks, enabling large total capacity without activating it all at once. This design is used in recent MoE language models such as DeepSeekMoE [12] and Mixtral [13].

Yet standard pretrained MoE inference typically uses the same number of experts at every layer for every token and every task [10–12]. This contrasts with evidence that layer-wise capacity demands differ. In dense Transformers, layers have distinct functional roles [1, 14] and contribute differently to task performance [15, 16]. In MoE models, lower layers exhibit higher expert redundancy than upper layers [2], and this cross-layer redundancy pattern shifts across tasks [17, 18]. Some works exploit depth heterogeneity through layer-wise capacity allocation—OpenELM [19] places fewer parameters in shallow layers, while AlphaLoRA [3] and LExI [20] assign layer-specific expert budgets—but these allocations are fixed offline and shared across tasks. Token-level dynamic routing [4, 5] lets each token activate a variable number of experts, but decisions are made from per-token routing confidence alone, with no access to task context. Expert pruning [17, 18, 21, 22] fixes the retained set at deployment and cannot adapt to novel tasks. Router-modification or construction methods [23, 24] alter the gating mechanism rather than preserving the original router.

This paper studies task-conditioned layer-wise expert allocation for frozen MoE inference. Given a small support set for the current task, MetaNet predicts a per-layer expert activation policy: a retention threshold ρτ,l\rho_{\tau,l}, which determines how many experts are needed to cover the required routing mass at layer l, and a bounded routing bias bτ,lb_{\tau,l}, whose magnitude is much smaller than typical gate logits and therefore only weakly perturbs the frozen router. The backbone, original router, and full expert set remain unchanged. On DeepSeek-MoE-16B-

Chat, MetaNet reduces the mean number of activated experts by 62% relative to fixed k=6 (from 6.00 to 2.28) with a 3.7 pp accuracy drop on MMLU, and transfers to C-Eval without retraining with a similar reduction in activated experts. With a weaker budget penalty, it keeps 3.61 mean experts, achieves comparable accuracy to fixed k=6, and reduces the mean activated-expert count by 40%.

References (43)