HMoE: Heterogeneous Mixture of Experts for Language Modeling

An Wang, Xingwu Sun, Ruobing Xie, Shuaipeng Li, Jiaqi Zhu, Zhen Yang, Pinxue Zhao, J. N. Han, Zhanhui Kang, Di Wang, Naoaki Okazaki, Cheng-Zhong XuarXiv 2024 · DOI

Abstract

Traditional Mixture of Experts (MoE) models utilize homogeneous experts, leading to inefficient parameter allocation where simple and complex tokens consume identical computational resources. We introduce Heterogeneous Mixture of Experts (HMoE), an architecture employing experts of varying sizes. By incorporating a novel Parameter Penalty (P-Penalty) loss, HMoE incentivizes the router to assign smaller experts to simpler tokens, reserving larger capacity for complex inputs. Our results demonstrate that HMoE-3B achieves superior performance over conventional MoE and dense models while activating significantly fewer parameters (0.68B vs 1.23B), establishing a new frontier for efficient Large Language Model (LLM) scaling.

Introduction

Mixture of Experts (MoE) has become a cornerstone for scaling LLMs efficiently, allowing for massive total parameter counts while maintaining manageable inference costs by activating only a subset of parameters per token. However, standard MoE models are homogeneous, meaning every expert is identical in size. This leads to three primary inefficiencies: a lack of specialization where experts learn redundant representations, inefficient allocation where simple tokens (e.g., "the") consume as much compute as complex ones, and the "Big Expert Trap," where routers naturally favor larger, more powerful experts if sizes are varied without a specific strategy.

Methodology

HMoE addresses these limitations through two primary innovations: a heterogeneous architecture and a specialized loss function.

Heterogeneous Architecture

Instead of uniform Feed-Forward Networks (FFNs), HMoE utilizes experts with varying hidden dimensions. The researchers explored several distribution strategies, including Arithmetic (constant size gaps) and Hybrid (a mix of identical and varying sizes) models, to provide a balanced range of capabilities across the expert pool.

Parameter Penalty (P-Penalty) Loss

To prevent the router from over-utilizing large experts, HMoE introduces the Parameter Penalty (P-Penalty) Loss. While traditional MoE uses load balancing to distribute tokens evenly, the P-Penalty loss assigns a "cost" to each expert based on its size. This forces the router to justify the use of larger experts, effectively training the model to route "easy" tokens to smaller experts and reserve high-capacity experts for tokens where the performance gain outweighs the parameter cost.

Comparison between conventional homogeneous MoE (left) and the proposed HMoE architecture with P-Penalty loss (right).

Experimental Results

The HMoE framework was evaluated using the RedPajama dataset for pre-training and six standard benchmarks (PIQA, Hellaswag, BoolQ, ARC-Easy, Winogrande, and SIQA) for language understanding.

Efficiency and Performance

HMoE-3B (Top-P) achieved an average benchmark score of 46.53, significantly outperforming the conventional MoE-3B (45.62) and a Dense-1B model (45.03). Most notably, HMoE achieved these gains while activating only 0.68B parameters on average per token, compared to the 1.23B parameters required by the standard MoE baseline.

Performance analysis showing HMoE's superior parameter efficiency (left) and training efficiency across FLOPs (right).

Token Specialization

Analysis of routing behavior confirmed successful specialization. Smaller experts specialized in common functional words like "the" and "both," while larger experts were triggered by complex sub-word units and ambiguous suffixes (e.g., "decom", "inf"). The model also demonstrated a "crossover point" in training efficiency, where HMoE began to significantly outperform homogeneous models for the same computational budget (FLOPs).

Conclusion

HMoE demonstrates that heterogeneity is a vital component for the next generation of sparse models. By aligning expert capacity with token complexity, HMoE achieves higher performance with nearly half the activated parameters of traditional MoE architectures. Future work will focus on hardware-level optimizations for heterogeneous batch processing and scaling these findings to frontier-class models.

Summary updated

BibTeX
@misc{wang2024hmoe,
  author = {An Wang and Xingwu Sun and Ruobing Xie and Shuaipeng Li and Jiaqi Zhu and Zhen Yang and Pinxue Zhao and J. N. Han and Zhanhui Kang and Di Wang and Naoaki Okazaki and Cheng-Zhong Xu},
  title = {{HMoE: Heterogeneous Mixture of Experts for Language Modeling}},
  year = {2024},
  eprint = {2408.10681},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.10681},
}
Figure