HyperMoE: Towards Better Mixture of Experts via Transferring Among Experts

Hao Zhao,Zihan Qiu,Huijia Wu,Zili Wang,Zhaofeng He,Jie Fu
2024-07-25
Abstract:The Mixture of Experts (MoE) for language models has been proven effective in augmenting the capacity of models by dynamically routing each input token to a specific subset of experts for processing. Despite the success, most existing methods face a challenge for balance between sparsity and the availability of expert knowledge: enhancing performance through increased use of expert knowledge often results in diminishing sparsity during expert selection. To mitigate this contradiction, we propose HyperMoE, a novel MoE framework built upon Hypernetworks. This framework integrates the computational processes of MoE with the concept of knowledge transferring in multi-task learning. Specific modules generated based on the information of unselected experts serve as supplementary information, which allows the knowledge of experts not selected to be used while maintaining selection sparsity. Our comprehensive empirical evaluations across multiple datasets and backbones establish that HyperMoE significantly outperforms existing MoE methods under identical conditions concerning the number of experts.
Machine Learning,Artificial Intelligence
What problem does this paper attempt to address?
### Problems the Paper Aims to Solve This paper aims to address the conflict between sparsity and expert knowledge availability in Mixture of Experts (MoE) models. Specifically: 1. **Balancing Sparsity and Expert Knowledge**: - Existing MoE methods face a trade-off between sparsity and the utilization of expert knowledge when selecting experts. Increasing the number of selectable experts can improve performance but reduces sparsity. - To alleviate this conflict, the authors propose a new MoE framework—HyperMoE. 2. **Cross-Expert Knowledge Transfer**: - Utilizing the knowledge of unselected experts to assist the selected experts, similar to knowledge transfer in multi-task learning. - Encoding the information of unselected experts into supplementary information through conditional generation to enhance the capabilities of the selected experts. ### Main Contributions - Proposing a new architecture based on hypernetworks, HyperMoE, which can improve the utilization of expert knowledge while maintaining sparsity. - Validating the effectiveness of HyperMoE on multiple natural language processing tasks, significantly outperforming the baseline methods based on Switch Transformer. - Demonstrating the correlation between selection embeddings and the selected experts, indicating that the selection embeddings effectively encode the knowledge information required by the currently selected experts. ### Summary By introducing a cross-expert knowledge transfer mechanism, this paper resolves the conflict between sparsity and expert knowledge utilization in MoE models, thereby improving the overall performance of the model.