Summary (Overview)
- Novel optimization axis: Spectral-MoE introduces learnable per-layer expert utilization allocation for dense-to-MoE conversion, adding a third optimization axis alongside expert partitioning and routing.
- Two allocator tiers: A static allocator learns one scalar per layer shared across tokens, while a dynamic allocator emits per-token schedules—both strictly conserving a user-specified utilization budget.
- Consistent gains: Dynamic allocation reduces WikiText-2 perplexity over uniform allocation by 1.04–2.96 points (learned base) and 2.17–6.26 points (analytic base) across Llama-2-7B, Llama-3-8B, and Qwen2.5-7B at 25% FFN utilization.
- SOTA accuracy: On the learned base at 25% utilization, dynamic allocation improves six-task mean accuracy by 3.0–5.8 percentage points over uniform and matches or exceeds published DOT-MoE results.
- Budget-exact architecture: Both allocators enforce exact per-token budget conservation via straight-through estimators, largest-remainder rounding, and dynamic programming-style feasibility bounds.
Introduction and Theoretical Foundation
Large language models (LLMs) impose substantial memory and arithmetic costs during inference. Dense-to-MoE conversion partitions pretrained feed-forward network (FFN) neurons into experts and selects a subset per token, retaining pretrained weights while reducing active computation. This technique is orthogonal to both quantization and pruning.
Existing dense-to-MoE methods fall into two categories:
- Analytic methods (e.g., CMoE, MoEfication, LLaMA-MoE-v2): produce converted models quickly using heuristics like clustering of neuron activation patterns.
- Learning methods (e.g., DOT-MoE, LTE): optimize via slower gradient-based training, jointly learning partitions and routers.
Key limitation addressed: All prior methods fix the same active expert count ("utilization") at every layer. However, research on layer-dependent sensitivity to compression in quantization and pruning motivates heterogeneous per-layer allocation as an optimization axis.
Theoretical foundation: The paper draws a metaphor between separating a dense FFN into experts and separating a light beam into its spectrum—hence the name "Spectral-MoE." The approach builds on straight-through estimators (Bengio et al., 2013) and budget-preserving allocation techniques.
Methodology
Utilization Budget Formulation
Consider FFN layers indexed by . Each layer contains routed and always-active shared experts, for total experts. Each expert contains neurons, giving FFN width . Per-layer FFN utilization is:
where is the routed count at layer , is the minimum routed experts, and is the free count. The user specifies a nominal utilization , which determines the uniform initial routed count and total routed budget :
Both allocators enforce for every token.
Static Per-Layer Allocation
Learns one continuous routed count per layer, shared across tokens. Key components:
- Hard expert selection: Uses largest-remainder rounding to produce integer counts , flooring each count then adding one to layers with the largest fractional parts.
- Gradients through hard selection: Defines soft inclusion via logistic sigmoid:
where is the inclusion temperature. The router STE combines the inherited router term with the count-gradient term:
Dynamic Per-Layer Allocation
Produces per-token schedules revised from current hidden states. The architecture uses:
- Shared projection
- Initial head
- Revision heads for
The schedule computation involves GELU activations, tanh-bounded revisions, and accumulated corrections. Exact budget conservation is achieved through feasibility bounds:
where is the remaining budget after earlier commitments.
Integration with Conversion Bases
- Analytic base: Uses CMoE for partition/router, recovers weights with LoRA, then freezes everything while training only the allocator.
- Learned base: Extends DOT-MoE to jointly train partition affinities, router weights, and allocator parameters while keeping pretrained weights frozen.
Empirical Validation / Results
Experimental Setup
- Models: Llama-2-7B, Llama-3-8B, Qwen2.5-7B
- Expert configuration: 128 neurons per expert, giving 86, 112, and 148 experts per layer respectively
- Evaluation: WikiText-2 test perplexity and six downstream benchmarks (BoolQ, SciQ, PIQA, WinoGrande, ARC-Challenge, HellaSwag)
Key Results at 25% FFN Utilization
| Model | Base | Allocator | PPL (↓) | Avg. Accuracy |
|---|---|---|---|---|
| Llama-2-7B | Learned | Uniform | 11.61 | 59.9% |
| Llama-2-7B | Learned | Dynamic | 10.57 | 62.8% |
| Llama-3-8B | Learned | Uniform | 19.40 | 58.5% |
| Llama-3-8B | Learned | Dynamic | 16.44 | 62.3% |
| Qwen2.5-7B | Learned | Uniform | 16.92 | 57.6% |
| Qwen2.5-7B | Learned | Dynamic | 14.21 | 63.3% |
Utilization Sweep (Learned Base)
Dynamic allocation improves perplexity and accuracy over uniform across all tested utilizations (12.5%, 25%, 50%):
- 12.5% utilization: Perplexity falls by 1.06–2.46 points; accuracy gains average 1.5 percentage points
- 25% utilization: Perplexity falls by 1.04–2.96 points; accuracy gains average 4.2 percentage points
- 50% utilization: Perplexity falls by 0.91–2.55 points; accuracy gains average 3.6 percentage points
Training Stability Analysis
- Neuron-to-expert turnover: Averages 8.92% over final 500 steps but falls to 0.33% at the final step due to learning-rate decay
- Router refitting: Closed-form ridge regression refitting showed mixed results (+1.0 and −0.4 percentage points for two seeds), suggesting potential for future improvement
Theoretical and Practical Implications
Theoretical Contributions
- New optimization axis: Establishes per-layer expert utilization as a novel, learnable dimension in dense-to-MoE conversion, analogous to how layer-wise sensitivity has informed quantization and pruning research.
- Budget-exact allocation: Both allocators strictly conserve the user-specified utilization budget for every token, making the approach practical for deployment with predictable computational costs.
- Gradient flow through discrete decisions: Demonstrates effective use of straight-through estimators for both expert selection counts and per-token schedule logits.
Practical Implications
- Deployment flexibility: Users can specify a target utilization budget and the allocator automatically distributes it optimally across layers.
- Model-agnostic: Works with both analytic (fast) and learning (accurate) conversion bases, offering a trade-off between conversion time and quality.
- Negligible overhead: The dynamic allocator adds only 158,942 parameters for Llama-2-7B (32 layers, model width 4096)—negligible compared to billion-scale models.
Conclusion
Spectral-MoE learns per-layer expert utilization during dense-to-MoE conversion under a user-specified budget. Key takeaways:
- Static allocation learns a schedule shared across tokens, providing modest but consistent gains over uniform allocation.
- Dynamic allocation revises each token's schedule based on hidden states, delivering substantial perplexity and accuracy improvements across all models and utilization levels tested.
- The learned schedules combine stable layer averages with context-dependent variation while preserving the same routed budget for every token.
- Dynamic allocation exceeds published DOT-MoE mean accuracy on Llama-2-7B and Llama-3-8B and matches it on Qwen2.5-7B.
Future directions: The authors suggest investigating whether stabilizing expert assignments during training improves the joint adaptation of routers and allocators, and exploring additional router-refitting methods that could improve accuracy with minimal token overhead.
Related papers
- FlyingStart: Learned Cross-Token Warm Starts for Fixed-Point Decoding in Recurrent-Depth Language Models
FlyingStart learns a linear warm-start map for recurrent-depth language models, cutting decoding layers by 14–19% while matching accuracy and preserving the exit rule's safety certificate.
- Learning from Recurrence: Internalizing Depth-Induced Preferences in Looped Language Models
Preference write-back, a self-distillation method where looped language models learn from their own deeper recurrent outputs, improves reasoning accuracy by up to 46% without external supervision.
- Unlocking the Power of Loops in Pretrained LLMs with Loop Residuals
LoopRes finetunes pretrained LLMs into looped Transformers, adding loop-aware keys and residual windows to boost math and code scores by up to 29.1% over SFT.