Title: Multi-Head Mixture-of-Experts
Venue: NeurIPS 2024
Accepted: yes
Keywords: Mixture-of-Experts; Multi-head Mechanism
Abstract: Sparse Mixtures of Experts (SMoE) scales model capacity without significant increases in computational costs. However, it exhibits the low expert activation issue, i.e., only a small subset of experts are activated for optimization, leading to suboptimal performance and limiting its effectiveness in learning a larger number of experts in complex tasks. In this paper, we propose Multi-Head Mixture-of-Experts (MH-MoE). MH-MoE split each input token into multiple sub-tokens, then these sub-tokens are assigned to and processed by a diverse set of experts in parallel, and seamlessly reintegrated into the original token form. The above operations enables MH-MoE to significantly enhance expert activation while collectively attend to information from various representation spaces within different experts to deepen context understanding. Besides, it's worth noting that our MH-MoE is straightforward to implement and decouples from other SMoE frameworks, making it easy to integrate with these frameworks for enhanced performance. Extensive experimental results across different parameter scales (300M to 7B) and three pre-training tasks—English-focused language modeling, multi-lingual language modeling and masked multi-modality modeling—along with multiple downstream validation tasks, demonstrate the effectiveness of MH-MoE.

Multi-Head Mixture-of-Experts

Abstract

Sparse Mixtures of Experts (SMoE) scales model capacity without significant increases in computational costs. However, it exhibits the low expert activation issue, i.e., only a small subset of experts are activated for optimization, leading to suboptimal performance and limiting its effectiveness in learning a larger number of experts in complex tasks. In this paper, we propose Multi-Head Mixture-of-Experts (MH-MoE). MH-MoE split each input token into multiple sub-tokens, then these sub-tokens are assigned to and processed by a diverse set of experts in parallel, and seamlessly reintegrated into the original token form. The above operations enables MH-MoE to significantly enhance expert activation while collectively attend to information from various representation spaces within different experts to deepen context understanding. Besides, it's worth noting that our MH-MoE is straightforward to implement and decouples from other SMoE frameworks, making it easy to integrate with these frameworks for enhanced performance. Extensive experimental results across different parameter scales (300M to 7B) and three pre-training tasks-English-focused language modeling, multi-lingual language modeling and masked multi-modality modeling-along with multiple downstream validation tasks, demonstrate the effectiveness of MH-MoE.

1 Introduction

Large capacity models, such as Large Language Models (LLMs) [39, 28, 6, 25] and Large Multimodal Models (LMMs) [37, 27], have demonstrated their efficacy across various domains and tasks. To further enhance performance, a reliable approach involves scaling up these models by augmenting the parameter count [13]. But for most of these densely-activated large-capacity models (referred to as Dense models), which utilize all their parameters to process all inputs, the extremely large size of these models significantly reduces inference speed, further limiting their practicality.

Apromising alternative, facilitating model scalability while mitigating the burdensome computational costs, resides in Sparse Mixtures of Experts (SMoE) [31, 12, 5, 7]. In contrast to Dense model, SMoE contains parallel feed-forward neural networks (referred to as experts) within each building block, and strategically activates distinct experts for specific input tokens via a router, thereby yielding noteworthy efficiency enhancements. For instance, GShard [21] scales a Dense model from 2B to 600B parameters with lower training costs than a 100B Dense model. And recently, Mixtral 8 × 7B [16], a SMoE model containing 8 experts is shown to outperform or matches LLaMA-2 70B [34] and GPT-3.5 .

Despite its success, SMoE exhibits the low experts activation issue, which means that only a small subset of experts are activated during optimization and inference, e.g., 8.33% activation ratio 1 shown in Figure 1 (a), while the majority of them are not used at all (see the dark area). As a result, SMoE

fails to utilize the full expressive power of these experts, especially when the number of experts is large, which significantly limits effectiveness and scalability of SMoE.

Our aim in this paper is to achieve denser expert activation (i.e., better utilization of 'dead' experts) without increase in computational cost. To achieve this, we propose Multi-Head Mixture-ofExperts (MH-MoE). The workflow of MH-MoE is illustrated in Figure 2. Inspired by the multi-head mechanism utilized in Multi-Head Self-Attention (MHSA) block, MH-MoE splits each input token into multiple sub-tokens and distribute them to different experts. After expert processing, subtokens are seamlessly reintegrated into the original token form, thereby achieving denser expert activation, e.g., 90.71% activation in Figure 1 (a), while also circumventing any additional computational burden in subsequent non-parallel layers, e.g., MHSA block. Specifically, as shown in Figure 2, when provided with a single input token, MH-MoE activates four experts by splitting it into four sub-tokens, whereas SMoE only activates a single expert.

Furthermore, we observe an interesting phenomenon: for tokens with richer semantic information, the sub-tokens split from these tokens are more likely to be allocated to distinct experts. For example, refer to the bright area in Figure 1 (b), where sub-tokens split from these patches are allocated to a greater number of different experts, facilitating the capture of semantically-rich information (e.g., the eagle in the figure). We therefore speculate that the allocation of sub-tokens to dis-

SMoE

MH-MoE

Activation: 8.33%

Activation: 90.71%

(a)

Sub-tokens Assign

(b)

BT

Layers

0.6

Layers

0.4

0.2

Expert

Expert

tinct experts enables MH-MoE to simultaneously focus on information from various representation spaces within different experts, ensuring a more granular understanding for subtle differences in both vision and language patterns, finally achieving better finer-grained understanding ability. See in Figure 2, sub-tokens assigned to Experts 3 and 2 capture a detailed understanding of each character's actions within an image patch, while those assigned to Experts 1 and 4 explicitly model the semantics of the false cognate 'camera'.

MH-MoE maintains following strengths: (1) Higher experts activation & better scalability . MHMoE can alleviate lower expert activation problem and significantly enhance the usage of larger experts by enabling optimization of almost all of experts, allowing for more efficient scaling of model capacity. (2) Finer-grained understanding ability . By adaptively assigning sub-tokens to different experts based on the semantic richness of the token, MH-MoE enabling to jointly attend to information from different representation spaces at different experts, and finally achieving better finer-grained understanding ability. (3) Seamless integration . The implementation of MH-MoE is remarkably straightforward and decoupled from other SMoE optimization methods (e.g., GShard [21]), making it very easy to integrate them together to achieve better performance.

We evaluate the proposed MH-MoE on three model pre-training and fine-tuning setting: Englishfocused language modeling, multi-lingual language modeling and masked multi-modality modeling, across different parameter scales (300M to 7B). Extensive experimental among these three tasks demonstrate the effectiveness of MH-MoE.

MH-MoE Assign

SMoE Assign

Expert3

English

：

during the wildlife safari, I used my high-resolution camera to capture

stunning photographs of lions, elephants, and giraffes in their natural

habitat, creating unforgettable memories of the adventure.

Italian

：

dopo una lunga giornata di lavoro, non vedo l'ora di rilassarmi nella

mia camera

(

means bedroom

caldi e tessuti morbidi per creare un ambiente accogliente e tranquillo.

camera

Inputs

Tokenization &

Embedding

Vision Data

Language Data

𝛼

Router

Embeddings

ℎ

ℎ

Token Assign to Experts

or

There are three person.

(Lacking too many details)

Camera means

Multi-head Layer

𝛼

Router

ℎ

Expert3

Expert2

Expert1

Expert4

In Italian, it means

In English, It means

He presses his hands against his

chest, earnestly speaking

towards the left side.

He stretched out a finger,

as if to ask a question.

ℎ

ℎ

2 Background

Sparse Mixture-of-Experts (SMoE) [31, 12, 5, 7] enhances model capacity while maintaining a constant computational demand, thus achieving better performance than densely-activated models on various tasks [22, 19, 39, 28].

Different from densely-activated models, each MoE layer consists of N independent Feed-Forward Networks (FFN) { f FFN i } N i =0 as the experts, along with a gating function g ( · ) to model a probability distribution indicating the weights over these experts' outputs. For the hidden representation h ∈ R d of each input token, the gating value of routing h to expert f FFN i is denoted as:

where e i denotes the trainable embedding of the i -th expert and ∑ N i =0 g ( f FFN i ) = 1 . Then, the corresponding k experts, according to the topk gated values, are activated and the output O of the MoE layer is O = h + ∑ i ∈ Φ g ( f FFN i ) · f FFN i ( h ) , where Φ denote activated experts set and | Φ | = k .

As described above, the most commonly used routing mechanism involves selecting the topk experts from N experts, where k ≪ N [32], e.g., k = 2 and N = 2048 in GShard [21]. Such a routing mechanism allows the combination of data parallelism and expert parallelism. Some works [38, 21] suggest that larger values of k often contribute to better model performance. However, with the increase in the value of k , training models with conventional topk routing implementation becomes much less efficient [21]. In this paper, we introduce MH-MoE, a simple but efficient manner to make denser expert activation without an increase in computational complexity.

3 Method

3.1 Multi-Head Mixture-of-Experts

Concretely, we denote a sequence of inputs tokens by X ∈ R l × d , where l is the number of tokens and d represents the length of token dimension. In MH-MoE, each parallel layer contains a set of N experts, each presented as { f FFN i : R d h → R d h } N i =0 , where h denotes the number of heads (i.e., the number of sub-tokens a single token is split into), which is decoupled from the head in the multi-head self-attention layer. For clarity, we describe the operation of a single MH-MoE layer here only.

The full architecture of MH-MoE can be seen in Figure 3. First, X is projected by a multi-head layer with parameter matrices W head ∈ R d × d ,

where ˆ X ∈ R l × d . After that, every token in ˆ X is split into h sub-tokens along the token dimensions, and these sub-tokens are arranged in parallel according to the original token sequence, forming a new

Transformer Block

FFN1

FFN2

FFN3

FFN4

Expert Networks

𝒆𝟏

𝒆𝟐

𝒆𝟑

𝒆𝟒

Router

Expert Embeddings

Hidden States

…

𝒉

Dot Product

Routing Scores

Sequence Direction

Transformer Block

Hidden States

Transformer Block

FFN1

FFN2

FFN3

FFN4

Expert Networks

𝒆𝟏

𝒆𝟐

𝒆𝟑

𝒆𝟒

Router

Expert Embeddings

Hidden States

…

𝒉

Dot Product

Routing Scores

Sequence Direction

Transformer Block

Hidden States

Multi-head Layer

…

…

…

…

Transformer Block

FFN1

FFN2

FFN3

FFN4

Expert Networks

𝒆𝟏

𝒆𝟐

𝒆𝟑

𝒆𝟒

Router

Expert Embeddings

Hidden States

…

𝒉

Dot Product

Routing Scores

Sequence Direction

Transformer Block

Hidden States

Transformer Block

FFN1

FFN2

FFN3

FFN4

Expert Networks

𝒆𝟏

𝒆𝟐

𝒆𝟑

𝒆𝟒

Router

Expert Embeddings

Hidden States

…

𝒉

Dot Product

Routing Scores

Sequence Direction

Transformer Block

Hidden States

Multi-head Layer

…

…

…

…

(a) SMoE

(b) MH-MoE

feature space ¨ X ∈ R ( l × h ) × d h as 2 :

where function 𭟋 s denotes the token splitting operation: R l × d → R ( l × h ) × d h , and each sub-token is presented as x i j ∈ R d h , meaning it is the the j th sub-token split from the i th token. Then all these sub-tokens are fed into the gating function g ( · ) . The gating value of routing a certain sub-token x i j into the p th expert is computed as

where e p ∈ R d h is the learnable embedding of the p th expert. In this paper, we mainly focus on topk routing, i.e. , only the experts with the largest topk routing score is activated. Φ = Top k ( g ( f FFN )) denote the set of activated experts and | Φ | = k . Then x i j is processed by these activated experts as following,

After that, all obtained o i j are rearranged in the original order of sub-tokens and concatenated together as 2 :

where O ∈ R ( l × h ) × d h . After that, O is transformed back the into original token form by a token merging operation 𭟋 m: R ( l × h ) × d h → R l × d and then projected by a merge layer with parameter matrices W merge ∈ R d × d to effective integration of multiple features o i j capturing detailed information from different expert representation spaces:

Then we get the final output ˘ X of the single MH-MoE layer.

By implementing the aforementioned operations, we effectively increase the average volume of data routed to a specific expert by a factor of h (as demonstrated in Eq. 3), thus achieving denser expert

activation. Besides, the shapes of the input and output in the MH-MoE layer remain unchanged, thus no additional computational cost is introduced in the subsequent block. Specifically, we introduce a hyperparameter β to scale the inner dimensions of each expert, aiming to balance the parameters introduced by the multi-head layer and merge layer, aligning the model's parameters and computational complexity with the original SMoE. Furthermore, the allocation of sub-tokens to distinct experts within MH-MoE enables us to collectively capture semantic information from diverse feature spaces across these experts, thereby enhancing the model's ability to achieve a finer-grained understanding.

As the Pytorch-like style pseudocode of MH-MoE shown in Appendix D, MH-MoE is characterized by its overall simplicity of implementation and decoupled from other SMoE optimization strategies [21, 5], making it easy to integrate with other optimized SMoE frameworks to enhance performance.

3.2 Training Objectives

Load balancing loss. To mitigate the expert load imbalance issue, given the sub-token set ¨ X (depicted in Eq. 3) and the frequency t p of how many sub-tokens are routed to the p th expert, we follow existing works [21, 13] to compute the load balancing loss L balance via:

where N denotes the number of experts, | ¨ X | is the number of sub-tokens contained in ¨ X . g ( f FFN p ) denotes the gating value of routing a certain sub-token x i j into the p th expert (see in Eq. 4).

Task specific loss. The term L task is dependent on the particular task that MH-MoE is designed to learn. For instance, during pre-training in the English-focused Language Modeling task, we utilize the language modeling loss [29], whereas the model predicts the next word in a sequence.

So, the overall training objective of MH-MoE is to minimize:

where α is a coefficient for load balancing.

4 Experiments

4.1 Experimental Setup

Compared Baselines. We include two baseline models for comparison: (1) Dense , which represents a Transformer decoder without the incorporation of sparsely-activated parallel modules (i.e., SMoE layer). (2) X-MoE , which is our implementation based on the SMoE proposed by [5]. We build MH-MoE upon X-MoE and use identical settings. Note that the all models are pre-trained using the same training data and loss (Eq. 9) as MH-MoE, and we ensure that the parameter count of MH-MoE remains consistent with or lower than that of X-MoE, ensuring a fair and equitable comparison. A detailed comparison about parameter and computational complexity can be found in Table 11.

Pre-training Data. We detail the pre-training data of MH-MoE in three areas: (1) English-focused experiments use the RedPajama dataset [8], which is an open-source pre-training dataset. (2) multilingual tasks follow XLM [20] and use the multilingual Wikipedia as training data. (3) multimodal tasks use a masked multi-modality modeling task with a large dataset of images, documents, and image-text pairs. Further details are available in the Appendix A.

Model Architecture and Hyperparameters. For all experiments, we use the X-MoE [5] as our backbone architecture to build our MH-MoE, which has shown better performance than prior SMoE models such as Switch Transformers [13] on cross-lingual understanding benchmarks. For Englishfocused Language Modeling and Multi-lingual Language Modeling, we construct Dense, X-MoE and MH-MoE using the Transformer [36] decoder (L = 12, H = 768, A = 12) with the GPT-4 3 vocabulary

(a)

English-focused language modeling

(b)

Multi-lingual language modeling

(c)

Masked multi-modal modeling

22

12

30.0

20

XMoEwith8experts

MH-MoEwith8experts

11

XMoEwith8experts

MH-MoEwith8experts

27.5

XMoEwith8experts

MH-MoEwith8experts

Perplexity

18

XMoEwith32experts

MH-MoEwith32experts

Perplexity

10

XMoEwith32experts

MH-MoE with 32experts

Perplexit

25.0

22.5

XMoEwith32experts

MH-MoEwith32experts

16

20.0

14

7

P

17.5

15.0

12

6

12.5

10

0

50k

100k

TrainingStep

150k

200k

250k

300k

0

50k

100k

TrainingStep

150k

200k

250k

300k

10.0

0

50k

Training Step

100k

150k

200k

as the backbone architecture. The pre-training procedure takes 14 days on 2 NVIDIA DGX-2 Stations. For Masked Multi-modal Modeling, we build Dense, X-MoE and MH-MoE following the same Transformer encoder architecture as BEiT v3 [37]. The pre-training procedure takes 4 days on 2 NVIDIA DGX-2 Stations. For all three pre-training tasks, we set the head number h = 4. More details about architecture and training hyperparameters can be found in Appendix B and C.

4.2 Perplexity Evaluation

We examined the validation perplexity curves for all pretrained models and pre-training tasks under two expert settings (8 experts and 32 experts). The perplexity trends are depicted in Figure 4, with the final perplexity values listed in Table 1. We can observe that as training progresses: 1) the perplexity of our MH-MoE remained lower in comparison to the compared baselines, indicating more effective learning; 2) MH-MoE achieved the lowest perplexity across three distinct experimental setups; 3) an increase in the number of experts led to a corresponding decrease in the perplexity of MH-MoE, suggesting that the model benefits from enhanced representation learning capabilities as more experts are incorporated. These results collectively demonstrate the superiority of MH-MoE in terms of learning efficiency and language representation across multiple pre-training paradigms.

4.3 Downstream Evaluation

English-focused Language Modeling. We evaluate our models on a total of 9 different zeroshot benchmarks to assess their abilities across various natural language tasks like common sense reasoning, general language understanding and knowledge understanding using the LLM Evaluation Harness [14]. As shown in Table 2, comparing X-MoE with the Dense model, X-MoE show notable improvement, indicating that SMoE models (e.g., X-MoE) benefit from the large model capacity. Overall, for all benchmarks, our MH-MoE obtains the best performance, achieving an average performance gain of 1.1 for 8 experts setting and 1.5 for 32 experts setting compared to X-MoE, demonstrating the effectiveness of our proposed MH-MoE on modeling English-focused language.

Multi-lingual Language Modeling. We evaluate our multi-lingual language models on the crosslingual natural language inference (XNLI) corpus [10], which is the extension of the multi-genre NLI

(MultiNLI) corpus to 14 languages. We follow the LLM Evaluation Harness pipeline and use the zeroshot setting to evaluate the multi-lingual ability. Table 3 presents the zero-shot evaluation results on XNLI task. Similarly, X-MoE benefit from the large model capacity and show notable improvement compared with Dense model. Overall, MH-MoE obtains the best performance, surpassing X-MoE by an average performance gain of 0.6 for 8 experts setting and 0.8 for 32 experts setting. Comparing MH-MoE with the X-MoE, it shows that MH-MoE models provide consistent gains on downstream tasks, demonstrating the effectiveness of our proposed MH-MoE on modeling cross-lingual natural language.

Masked Multi-modal Modeling. We evaluate on the widely used vision-language understanding and generation benchmarks, including visual question answering [15], visual reasoning [33] and image captioning [23]. We report vqa-score on VQAv2, accuracy for NLVR2. For COCO image captioning, we report BLEU@4 (B@4), METEOR (M), CIDEr (C), and SPICE (S). Table 4 presents the evaluation results. For VQA task, MH-MoE outperforms both Dense and X-MoE by a large margin, e.g., 4.24 and 1.69 points gain on test-dev split, respectively. For visual reasoning task, MH-MoE beats all these two baselines on both dev (1.5 points gain than X-MoE) and test-P split (1.7 points gain than X-MoE). For image captioning task, MH-MoE surpasses X-MoE by 4.2%, 10.2%, 9.4% in terms of B@4, M and S, respectively. Above results show that X-MoE exhibits enhanced visual information comprehension, which also validates the effectiveness of our proposed MH-MoE in capturing diverse semantic information within text-image pair data.

4.4 Ablation Studies

This section presents experimental analysis to demonstrate the functionality of MH-MoE. In all comparative experiments, we ensure parameter equality across models by adjusting the internal dimensions of the experts .

Number of Heads h . We conduct experiments by adjusting the number of heads ( h = 2 , 4 , 6 , 8 , and 12 ) in MH-MoE. As shown in Figure 5, we find that across all settings of h , our model consistently outperforms the X-MoE. Besides, as the value of h increases, we observe an initial improvement followed by a decline in our model's performance. This leads us to hypothesize that as h initially increases, the enhancement in performance benefits from MH-MoE by activating a greater number of experts, thereby enhancing the model's effectiveness and capturing a wider range of fine-grained token information. However, as h becomes too large, the excessive subdivision of tokens may impair their original semantic content, leading to decreased model performance.

Does the Token-Splitting-Merging Really Matters? The key motivation of MH-MoE is to split each token into several sub-tokens and then merge the sub-tokens after processing by experts. We use two MLP layers for the splitting and merging processes. We conduct a detailed analysis to determine whether the performance improvement is due to the Token-Split-Merging (TSM) operation or the additional MLP layers.

X-MoE

MH-MoE

ℎ = 4

MH-MoE

ℎ = 8

X-MoE

MH-MoE

h

= 4

MH-MoE

h

= 8

-12

Exoert

ExDert

Exoert

Expert

Expert

20

(a) Upstream perplexity

(b) Downstream accuracy scores

(c) Sub-tokens assign

15

37

600

Tokentype

14

I

MH-MoE

36

8

Non P&F

P&F

13

Perplexity

35

400

Count

11

34

10

33

200

9

32

XMoE@hellaswag

MH-MoE@ hellaswag

8

816 32

64

128

256

31

816 32

64

128

256

0

1

2

3

4

5

6

7

8

NumberofExperts

NumberofExperts

Assigndiversity

The results are presented in Table 5. A comparative analysis between Dense v.s. Dense w/ MLP, as well as X-MoE v.s. X-MoE w/ MLP, reveals that introduction of the MLP layer does not enhance the model's performance. Similarly, when comparing MH-MoE with MH-MoE w/o TSM, it becomes evident that the inclusion of only the MLP, in the absence of the TSM, also does not yield any improvement in the model's effectiveness. The parameter quantities of the models being compared pairwise are equal.

An intriguing observation is made when comparing MH-MoE with MH-MoE w/o MLP. Introducing TSM alone, without MLP, results in a slight increase in model performance. In contrast, a significant enhancement in model performance is only achieved when both MLP and TSM are incorporated simultaneously. We hypothesize that introduction of TSM, without the integration of MLP, activates more experts, but the segmentation and merging of the model appears overly straightforward and abrupt in its execution. This limitation hinders the model's ability to meaningfully segment tokens into sub-tokens and effectively merge the diverse information gathered from different expert spaces.

We also conducted additional ablation studies to examine the impact of varying the number of MLP layers , different splitting-merging methods and different balance loss . The details of these experiments are provided in Appendix E.

5 Analysis

Experts Activation. We visualize the activation of each expert varies across parallel expert layers for X-MoE and MH-MoE at Figure 6. It can be observed that: 1) X-MoE demonstrate a more skewed distribution, wherein a significant portion of experts remain inactivated all the time. 2) Our MH-MoE achieves a denser expert activation compared to X-MoE, effectively mitigating the issue of low expert utilization. 3) As the number of heads h increases, the expert activation frequency in MH-MoE also rises.

Scalability. We explore the scalability for both X-MoE and MH-MoE by scaling up the number of experts from 8 to 256 (about 7B parameters). For upstream performance, as shown in Figure 7 (a), with the increase of experts, our MH-MoE could bring more gains. It is because MH-MoE could mitigate the low expert activation problem effectively. With this ability, the superiority of the large-scale SMoE model will be better exerted, thereby achieving the improvement of the upper bound

of SMoE with more experts. Detailed validation perplexity curves for these scaling up experiments can be found in Figure 10 at Appendix F. For downstream performance shown in Figure 7 (b), for X-MoE, expert number = 64 is the upper bound, meaning that continuing to increase the number of experts will not bring performance gain. Our MH-MoE not only has a performance advantage over the X-MoE with the same number of experts, but also improves the upper bound from 64 to 256, which demonstrates the effectiveness of the scalability of our MH-MoE on downstream tasks.

Experts Assign within Token. We delve into a more granular analysis to validate how the multihead mechanism aids MH-MoE in capturing diverse and intricate semantic information that is often challenging to comprehend, e.g., polysemous and false cognates words (denoted as PF tokens) in languages, and semantically-rich areas in images.

For languages data, we compute and compare the divergence levels (i.e., the number of different experts these sub-tokens are routed to) of sub-tokens split from PF tokens and Non-PF tokens. The results, presented in Figure 7 (c), clearly demonstrate that the distribution of divergence for PF tokens is significantly skewed towards the right when compared to that of Non-PF tokens. This indicates that during the MH-MoE's inference process, PF tokens route their sub-tokens to a greater number of different experts, thereby capturing diverse semantic information in contrast to Non-PF tokens for a better polysemous and false cognates word modeling. Note that we utilized the GPT-4 API [25] to extract polysemous words and false cognates from the XNLI [10] corpus, and the corresponding prompt can be found in Table 12.

For image data, we analyzed how the divergence levels of different patches evolve during the training process, as illustrated in Figure 7. Notably, as training progresses, divergence levels gradually increase in high-frequency texture regions (or regions with rich semantics), while they decrease in low-frequency texture regions. This suggests that MH-MoE tends to route tokens from complex texture areas to a wider variety of experts, thereby enhancing the finer-grained understanding of semantics in those regions. For more visualization examples, please refer to Figure 11 in Appendix G.

Experiments on Pure Vision Tasks. We conduct small-scale experiments on pure vision tasks to further validate the effectiveness of MH-MoE. We utilize ViT-B(ase) [11] as the Dense model and AdaMV-MoE [4] as the SMoE baseline. AdaMV-MoE is a multi-task vision SMoE model demonstrating a superior performance across various vision tasks. We build our MH-MoE upon AdaMV-MoE. The comparison results are shown in Table 6, which demonstrates that MH-MoE exhibits corresponding effectiveness and versatility in pure vision tasks.

Model Collapses. Concerns may arise that MH-MoE could revert to the original SMoE approach, routing all sub-tokens from the same token to a single expert. In MH-MoE's training framework, the load balancing loss L balance (Eq 8) serves as a weak constraint, treating all sub-tokens as independent entities and uniformly distributing them among experts, promoting a balanced allocation. Our observations indicate that most sub-tokens from the same token are distributed among 3-5 different experts (see Figures 7 and Figures 7 (c)).

6 Conclusion

In this paper, we study how we can to achieve a denser experts activation without introducing additional cost, while improving the fine-grained understanding ability. With the proposed MultiHead Mixture-of-Experts, we can easily implement the aforementioned functionality. Furthermore, the simplicity of MH-MoE allows it to integrate with other SMoE frameworks to enhance performance easily. Extensive empirical results across three tasks demonstrate the effectiveness of MH-MoE.

References

H. Bao, L. Dong, F. Wei, W. Wang, N. Yang, X. Liu, Y. Wang, J. Gao, S. Piao, M. Zhou, and H. Hon. UniLMv2: Pseudo-masked language models for unified language model pre-training. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event , volume 119 of Proceedings of Machine Learning Research , pages 642-652. PMLR, 2020.

L. Caccia, E. Ponti, Z. Su, M. Pereira, N. L. Roux, and A. Sordoni. Multi-head adapter routing for cross-task generalization. arXiv preprint arXiv:2211.03831 , 2022.

S. Changpinyo, P. Sharma, N. Ding, and R. Soricut. Conceptual 12m: Pushing web-scale image-text pre-training to recognize long-tail visual concepts. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021 , pages 3558-3568. Computer Vision Foundation / IEEE, 2021.

T. Chen, X. Chen, X. Du, A. Rashwan, F. Yang, H. Chen, Z. Wang, and Y. Li. Adamv-moe: Adaptive multi-task vision mixture-of-experts. In Proceedings of the IEEE/CVF International Conference on Computer Vision , pages 17346-17357, 2023.

Z. Chi, L. Dong, S. Huang, D. Dai, S. Ma, B. Patra, S. Singhal, P. Bajaj, X. Song, X.-L. Mao, et al. On the representation collapse of sparse mixture of experts. Advances in Neural Information Processing Systems , 35:34600-34613, 2022.

H. W. Chung, L. Hou, S. Longpre, B. Zoph, Y. Tay, W. Fedus, Y. Li, X. Wang, M. Dehghani, S. Brahma, et al. Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416 , 2022.

A. Clark, D. d. l. Casas, A. Guy, A. Mensch, M. Paganini, J. Hoffmann, B. Damoc, B. Hechtman, T. Cai, S. Borgeaud, et al. Unified scaling laws for routed language models. arXiv preprint arXiv:2202.01169 , 2022.

T. Computer. Redpajama: An open source recipe to reproduce llama training dataset, 2023.

A. Conneau, K. Khandelwal, N. Goyal, V. Chaudhary, G. Wenzek, F. Guzm´ an, E. Grave, M. Ott, L. Zettlemoyer, and V. Stoyanov. Unsupervised cross-lingual representation learning at scale. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020 , pages 8440-8451. Association for Computational Linguistics, 2020.

A. Conneau, R. Rinott, G. Lample, A. Williams, S. Bowman, H. Schwenk, and V. Stoyanov. XNLI: Evaluating cross-lingual sentence representations. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing , pages 2475-2485, Brussels, Belgium, Oct.-Nov. 2018. Association for Computational Linguistics.

A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, J. Uszkoreit, and N. Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations , 2021.

N. Du, Y. Huang, A. M. Dai, S. Tong, D. Lepikhin, Y. Xu, M. Krikun, Y. Zhou, A. W. Yu, O. Firat, et al. Glam: Efficient scaling of language models with mixture-of-experts. arXiv preprint arXiv:2112.06905 , 2021.

W. Fedus, B. Zoph, and N. Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. The Journal of Machine Learning Research , 23(1):5232-5270, 2022.

L. Gao, J. Tow, B. Abbasi, S. Biderman, S. Black, A. DiPofi, C. Foster, L. Golding, J. Hsu, A. Le Noac'h, H. Li, K. McDonell, N. Muennighoff, C. Ociepa, J. Phang, L. Reynolds, H. Schoelkopf, A. Skowron, L. Sutawika, E. Tang, A. Thite, B. Wang, K. Wang, and A. Zou. A framework for few-shot language model evaluation, 12 2023.

Y. Goyal, T. Khot, D. Summers-Stay, D. Batra, and D. Parikh. Making the V in VQA matter: Elevating the role of image understanding in visual question answering. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017 , pages 6325-6334. IEEE Computer Society, 2017.

A. Q. Jiang, A. Sablayrolles, A. Roux, A. Mensch, B. Savary, C. Bamford, D. S. Chaplot, D. d. l. Casas, E. B. Hanna, F. Bressand, et al. Mixtral of experts. arXiv preprint arXiv:2401.04088 , 2024.

R. Krishna, Y. Zhu, O. Groth, J. Johnson, K. Hata, J. Kravitz, S. Chen, Y. Kalantidis, L. Li, D. A. Shamma, M. S. Bernstein, and L. Fei-Fei. Visual genome: Connecting language and vision using crowdsourced dense image annotations. Int. J. Comput. Vis. , 123(1):32-73, 2017.

T. Kudo and J. Richardson. SentencePiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstrations , pages 66-71, Brussels, Belgium, Nov. 2018. Association for Computational Linguistics.

K. Kumatani, R. Gmyr, F. C. Salinas, L. Liu, W. Zuo, D. Patel, E. Sun, and Y. Shi. Building a great multi-lingual teacher with sparsely-gated mixture of experts for speech recognition. arXiv preprint arXiv:2112.05820 , 2021.

G. Lample and A. Conneau. Cross-lingual language model pretraining, 2019.

D. Lepikhin, H. Lee, Y. Xu, D. Chen, O. Firat, Y. Huang, M. Krikun, N. Shazeer, and Z. Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. arXiv preprint arXiv:2006.16668 , 2020.

D. Lepikhin, H. Lee, Y. Xu, D. Chen, O. Firat, Y. Huang, M. Krikun, N. Shazeer, and Z. Chen. { GS } hard: Scaling giant models with conditional computation and automatic sharding. In International Conference on Learning Representations , 2021.

T. Lin, M. Maire, S. J. Belongie, J. Hays, P. Perona, D. Ramanan, P. Doll´ ar, and C. L. Zitnick. Microsoft COCO: common objects in context. In D. J. Fleet, T. Pajdla, B. Schiele, and T. Tuytelaars, editors, Computer Vision - ECCV 2014 - 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part V , volume 8693 of Lecture Notes in Computer Science , pages 740-755. Springer, 2014.

Y. Liu, M. Ott, N. Goyal, J. Du, M. Joshi, D. Chen, O. Levy, M. Lewis, L. Zettlemoyer, and V. Stoyanov. Roberta: A robustly optimized BERT pretraining approach. CoRR , abs/1907.11692, 2019.

OpenAI. Gpt-4 technical report. ArXiv , abs/2303.08774, 2023.

V. Ordonez, G. Kulkarni, and T. L. Berg. Im2text: Describing images using 1 million captioned photographs. In J. Shawe-Taylor, R. S. Zemel, P. L. Bartlett, F. C. N. Pereira, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 24: 25th Annual Conference on Neural Information Processing Systems 2011. Proceedings of a meeting held 12-14 December 2011, Granada, Spain , pages 1143-1151, 2011.

Z. Peng, W. Wang, L. Dong, Y. Hao, S. Huang, S. Ma, and F. Wei. Kosmos-2: Grounding multimodal large language models to the world. arXiv preprint arXiv:2306.14824 , 2023.

H. Pham, Y. J. Kim, S. Mukherjee, D. P. Woodruff, B. Poczos, and H. H. Awadalla. Task-based moe for multitask multilingual machine translation. arXiv preprint arXiv:2308.15772 , 2023.

A. Radford, K. Narasimhan, T. Salimans, and I. Sutskever. Improving language understanding by generative pre-training. 2018.

P. Sharma, N. Ding, S. Goodman, and R. Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In I. Gurevych and Y. Miyao, editors, Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers , pages 2556-2565. Association for Computational Linguistics, 2018.

N. Shazeer, A. Mirhoseini, K. Maziarz, A. Davis, Q. Le, G. Hinton, and J. Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. In International Conference on Learning Representations , 2017.

N. Shazeer, A. Mirhoseini, K. Maziarz, A. Davis, Q. Le, G. Hinton, and J. Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. arXiv preprint arXiv:1701.06538 , 2017.

A. Suhr, S. Zhou, A. Zhang, I. Zhang, H. Bai, and Y. Artzi. A corpus for reasoning about natural language grounded in photographs. In A. Korhonen, D. R. Traum, and L. M` arquez, editors, Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers , pages 6418-6428. Association for Computational Linguistics, 2019.

H. Touvron, L. Martin, K. Stone, P. Albert, A. Almahairi, Y. Babaei, N. Bashlykov, S. Batra, P. Bhargava, S. Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288 , 2023.

T. H. Trinh and Q. V. Le. A simple method for commonsense reasoning. ArXiv , abs/1806.02847, 2018.

A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017 , pages 5998-6008, 2017.

W. Wang, H. Bao, L. Dong, J. Bjorck, Z. Peng, Q. Liu, K. Aggarwal, O. K. Mohammed, S. Singhal, S. Som, et al. Image as a foreign language: Beit pretraining for all vision and vision-language tasks. arXiv preprint arXiv:2208.10442 , 2022.

A. Yang, J. Lin, R. Men, C. Zhou, L. Jiang, X. Jia, A. Wang, J. Zhang, J. Wang, Y. Li, et al. M6-t: Exploring sparse expert models and beyond. arXiv preprint arXiv:2105.15082 , 2021.

X. Zhao, X. Chen, Y. Cheng, and T. Chen. Sparse moe with language guided routing for multilingual machine translation. In Conference on Parsimony and Learning (Recent Spotlight Track) , 2023.

Y. Zhu, R. Kiros, R. Zemel, R. Salakhutdinov, R. Urtasun, A. Torralba, and S. Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of the IEEE international conference on computer vision , pages 19-27, 2015.

A Pre-training Data of Masked multi-modal modeling task

Table 8 presents of pre-training data in Masked multi-modal modeling task. For multi-modal data, there are about 15 Mimages and 21 Mimage-text pairs collected from five public datasets: Conceptual 12M (CC12M) [3], Conceptual Captions (CC3M) [30], SBU Captions (SBU) [26], COCO [23] and Visual Genome (VG) [17]. For monomodal data, we use 14 M images from ImageNet-21K and 160 GB text corpora [1] from English Wikipedia, BookCorpus [40], OpenWebText 4 , CC-News [24], and Stories [35].

B Model Hyperparameters of Language modeling tasks

Table 9 presents the model hyperparameters of X-MoE and MH-MoE for both English-focused language modeling and Multi-lingual language modeling tasks. The gating temperature τ 0 is initialized as 0 . 3 and 0 . 07 for the softmax gating and sigmoid gating, respectively. We use the same vocabulary as XLM-R [9] with 250K subwords tokenized by SentencePiece [18].

C Hyperparameters for Pre-training

Table 10 presents the hyperparameters for pre-training across three tasks: Language modeling tasks (English-focused language modeling and Multi-lingual language modeling tasks) and Masked multi-modal modeling task.

D PyTorch-style Code

We also provide the PyTorch-style code in Algorithm 1 to explain our MH-MoE, which including two main aspects: 1) Stage 1. The creation and initialization of multi-head layer and merge layer. 2) Stage 2. The segmentation of tokens, followed by processing through an expert network, and ultimately merging.

Algorithm 1 The Overall Procedures of MH-MoE in a PyTorch-like style.

Your role is to identify polysemous and false cognates in different languages from the given textual input ( ### Input ). Note that "Polysemous" refers to a word having two or more completely different meanings (for example, "grouse" has meanings related to complaining and also refers to a type of bird), while "false cognates in different languages" refers to words in different languages that have similar forms but carry different meanings (for example, in English and Italian, "camera" looks similar but represents different semantic concepts).

### Input

Text: {Prompt}

Note: Please provide your identify results in the following format:

### Output for Word 1

Rationale: [Rationale for why this word is polysemous or false cognates, think step by step]

Word: [Make sure that there is only a word here.]

### Output for Word 2

Rationale: [Rationale for why this word is polysemous or false cognates, think step by step]

Word: [Make sure that there is only a word here.]

----

E Ablation Studies

Number of MLP layers. We explore the impact of varying the number of layers ( n = 0, 1, 2, 3) in MLP on MH-MoE performance. For configurations exceeding a single layer, ReLU activation functions were incorporated between MLP layers to ensure the non-linearity of transformations. The parameter quantities of the models being compared are equal. Upon analyzing the results in Table 13, we observe that increasing the number of MLP layers beyond one had a negligible impact on the model's performance. This indicates that a single-layer MLP is sufficient for accomplishing token segmentation and fusion.

What Makes a Good Splitting-Merging Method? We designed ablation experiments to investigate whether the tokenization method affects the MH-MoE's performance. We replace the multi-head layer and merge layer (both are FC layers) with Conv1d layers (denoted as MH-MoE ♯ ).

We conducted experiments in two settings (English-focused language modeling and Multi-lingual language modeling tasks) and explored different levels of randomness by using different kernel sizes and strides for the Conv1d layers. We ensure that the parameters are kept as consistent as possible by adjusting the number of Conv1d layers and the dimensions of experts. Through experimental results presented at Figure 8, we observe that replacing splitting method with Conv1d (denoted as MH-MoE ♯ ) resulted in significantly inferior performance compared to the original MH-MoE. This underscores the importance of tokenization methods, indicating that tokenization methods such as Conv1d, which disrupt the original input sequence features, are not suitable for this context.

Impact of different balance loss We conducted experiments with three groups to assess the impact of different constraints on sub-token allocation: (1) MH-MoE ¶ : MH-MoE trained without the L balance, (2) MH-MoE † : MH-MoE trained with the L balance, and (3) MH-MoE ‡ : MH-MoE trained with both L balance and diversity loss L div . L div is designed to enhance sub-token allocation diversity and defined as: given a set of sub-tokens Υ split from the same token, with P i representing the gating probability distribution of the i th sub-token, L div = -∑ | Υ | i =1 ∑ | Υ | j = i +1 KL ( P i || P j ) , where

15.5

15.1

Perplexity

15.0

14.91

14.86

14.83

14.5

14.0

13.92

13.5

MH-MoE

MH-MoE(K= 3.S =1)

MH-MoE(K=5,S =1)

MH-MoE(K=3,S=2)

MH-MoE(K =5,S=2)

14.4

14.23

8.00

7.9

Perplexity

Perplexity

14.2

7.75

7.50

7.41

14.0

7.35

13.92

13.89

7.25

13.8

7.00

MH-MoE

MH-MoEt

MH-MoE#

MH-MoE

MH-MoEt

MH-MoE

Figure 10: Validation perplexity reported for both X-MoE and MH-MoE.

XMoE with 8experts

MH-MoEwith64experts

MH-MoE with 8 experts

XMoE with 128 experts

XMoE with32 experts

MH-MoEwith128experts

MH-MoEwith32experts

XMoEwith256experts

XMoE with 64 experts

MH-MoEwith256experts

Perplexity

50k

100k

150k

200k

250k

KL ( · ) indicate Kullback-Leibler divergence. This constraint increases the inconsistency in gating distributions among sub-tokens in Υ , enhancing expert allocation diversity.

The experimental results (perplexity) are summarized in the Figure 9. Key findings include: (1) Without any constraints (MH-MoE ¶ ), the model's performance degrades, likely due to severe imbalance, causing some experts to receive insufficient data, resulting in suboptimal performance. (2) The addition of L div did not significantly improve model performance compared to using only L balance. We hypothesize that L balance alone provides sufficient diversity in sub-token allocation.

F Visualization of training perplexity

We provide the training perplexity curve for model training in the experimental setting of increasing the number of experts (from 8 to 256) in Figure 10.

G Visualization

We provide more visualization of variation in assign diversity for sub-tokens split from different patches in vision data at Figure 11.

NeurIPS Paper Checklist

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer:[Yes]

Justification: Please refer to our abstract and introduction.

Guidelines:

The answer NA means that the abstract and introduction do not include the claims made in the paper.

The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.

The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.

It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors?

Answer: [NA]

Justification: If we discover limitations, we will include them in the latest version of the paper.

Guidelines:

The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.

The authors are encouraged to create a separate 'Limitations' section in their paper.

The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.

The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.

The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.

The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.

If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.

While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.

3. Theory Assumptions and Proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [No]

Justification: In our paper, we do not make any assumptions, and consequently, there are no associated proof processes.

Guidelines:

The answer NA means that the paper does not include theoretical results.

All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced.

All assumptions should be clearly stated or referenced in the statement of any theorems.

The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.

Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.

Theorems and Lemmas that the proof relies upon should be properly referenced.

4. Experimental Result Reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [Yes]

Justification: We provide detailed explanations of the model training and data specifics in Sections 3 and Appendix A B and C.

Guidelines:

The answer NA means that the paper does not include experiments.

If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.

If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.

Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.

While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example

(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.

(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.

(c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).

(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.

5. Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [Yes]

Justification: We provide the code for model training and testing in the supplementary materials. The training data used are publicly available, and we detail the data specifics in the paper.

Guidelines:

The answer NA means that paper does not include experiments requiring code.

Please see the NeurIPS code and data submission guidelines ( https://nips.cc/ public/guides/CodeSubmissionPolicy ) for more details.

While we encourage the release of code and data, we understand that this might not be possible, so 'No' is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).

The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines ( https: //nips.cc/public/guides/CodeSubmissionPolicy ) for more details.

The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.

The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.

At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).

Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.

6. Experimental Setting/Details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [Yes]

Justification: Please refer to Sections 3 and Appendix A, B and C.

Guidelines:

The answer NA means that the paper does not include experiments.

The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.

The full details can be provided either with the code, in appendix, or as supplemental material.

7. Experiment Statistical Significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [NA]

Justification: All results are reported as the average of five randomly initialized tests.

Guidelines:

The answer NA means that the paper does not include experiments.

The authors should answer 'Yes' if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.

The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).

The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)

The assumptions made should be given (e.g., Normally distributed errors).

It should be clear whether the error bar is the standard deviation or the standard error of the mean.

It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.

For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).

If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.

8. Experiments Compute Resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer: [Yes]

Justification: Please refer to Sections 3 and Appendix A B and C.

Guidelines:

The answer NA means that the paper does not include experiments.

The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.

The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.

The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper).

9. Code Of Ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [Yes]

Justification:

Guidelines:

The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.

If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.

The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).

10. Broader Impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [NA]

Justification: Our model serves as the foundational architecture for large models rather than their socio-economic applications. As such, it operates on a different level, and we do not provide an analysis of societal impact.

Guidelines:

The answer NA means that there is no societal impact of the work performed.

If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.

Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.

The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.

If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [No]

Justification: We will conduct this before our model is publicly released.

Guidelines:

The answer NA means that the paper poses no such risks.

Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.

Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.

We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [Yes]

Justification: Please refer to Section 4.

Guidelines:

The answer NA means that the paper does not use existing assets.

The authors should cite the original paper that produced the code package or dataset.

The authors should state which version of the asset is used and, if possible, include a URL.

The name of the license (e.g., CC-BY 4.0) should be included for each asset.

For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.

If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.

If this information is not available online, the authors are encouraged to reach out to the asset's creators.

13. New Assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [Yes]

Justification: Please refer to the README.md in our supplement code.

Guidelines:

The answer NA means that the paper does not release new assets.

Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.

The paper should discuss whether and how consent was obtained from people whose asset is used.

At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.

14. Crowdsourcing and Research with Human Subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [NA]

Justification: This paper does not involve crowdsourcing nor research with human subjects Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.

According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.

15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?

Answer: [NA]

Justification: This paper does not involve crowdsourcing nor research with human subjects Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.

We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.

For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.

Peer reviews:
comments: SUMMARY:
The work presents an advanced MoE model architecture to further improve the expert utilization. Authors conduct comprehensive experiments on three pre-training tasks, English-focused language modeling, multi-lingual language modeling and masked multi-modality modeling with models at different scales (300M to 7B).

STRENGTHS:
1) Important research problem. Better expert utilization has great potential to improve the MoE scalability.
2) Comprehensive experiments. From 300M to 7B. From NLP to CV.
3) Cool visualization. Figure 1 is very helpful in understanding why and how this model works.

WEAKNESSES:
I only have one but important concern: the end-to-end training and inference throughput. I understand that the theoretical computation and communication cost is not high, but since we are conducting a more complicated/fine-grained routing decision, the routing process may take longer in practice. Considering that MoE models are sometimes trained and deployed at very large scale, the intra-node all2all is sometimes required. Will the proposed approach slow down this?

I can increase my score to positive if this concern can be solved.

QUESTIONS:
See weakness.

LIMITATIONS:
NA
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 2
DATE: 2024-06-16

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper proposes Multi-Head Mixture-of-Experts (MH-MoE), a simple yet effective routing strategy that splits each input token into multiple sub-tokens for expert routing. This operation significantly enhances the ratio of activated experts for each token, enabling more fine-grained assigning of tokens. Through extensive experimental results across different parameter scales (300M to 7B) and three 15 pre-training tasks, the paper validates the effectiveness of the proposed MH-MoE strategy.\n\nSTRENGTHS:\n1. The paper is well-written and easy to follow.\n2. The proposed MH-MoE is simple yet effective. It is easy to be integrated into existing frameworks with MoE optimization. This improves the feasibility of the method.\n3. The experiments cover both CV and NLP modeling scenarios and the results are consistently positive.\n\nWEAKNESSES:\n1. My major concern is about the experimental settings. Implementing MH-MoE based on the X-MoE instead of the vanilla SMoE is strange. The improvements shown by the experiments may not be generalizable to other MoE structures, which makes the proposed method less convincing.\n2. Lack of experiments on scaling computations (activated experts). Though the paper conducts scaling experiments on scaling total parameters (number of experts), the computation remains static. The information conveyed by this kind of scaling is limited as the computation is also important in affecting the performance of MoE. I’m not expecting additional experiments as the time is limited during rebuttal. However, a computational scaling experiment would make the method more convincing.\n\nQUESTIONS:\nCan you provide the balance loss curves for your method and the baselines? I’m curious about the effect of your method on load balancing as it introduces more sub-tokens for routing.\n\nLIMITATIONS:\nNone", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 5, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2024-07-11"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper introduces Multi-Head Mixture-of-Experts (MH-MoE), a method for training MoE models with enhanced expert activation. In particular, MH-MoE splits each input token into multiple sub-tokens, which are processed by a set of experts in parallel, and then merges them back into their original token form. The results show improved performance over dense and X-MoE models in parameter-matching settings.\n\nSTRENGTHS:\nThe authors propose a simple yet effective idea of splitting tokens into sub-tokens to boost expert activation. The paper is clear and well-written. The authors verify their approach on a variety of tasks, including English-focused language modeling, multi-lingual language modeling, and masked multi-modality modeling, across different parameter scales (ranging from 300M to 7B by scaling the number of experts).\n\nWEAKNESSES:\n1. Experiments are performed on a limited number of models and baselines, making the results less convincing.\n\n- The experiments are limited by a single model architecture. The authors apply their approach by modifying the previously released X-MoE model.\n\n- The authors compare their performance with the mentioned X-MoE model, whereas there are a variety of MoE approaches that have been proposed and released recently.\n\n- The ablation studies are limited. The performance of SMoE heavily depends on the choice of hyper-parameters, one of the most important being the number of experts to be activated (referred to as top-k). How does the activation map change with an increase in k? Would MH-MoE still perform better, or is there a saturation point? In other words, does MH-MoE seem superior to X-MoE only because a small k=2 was chosen?\n\n2. There is a lack of discussion on limitations. The authors claim that their approach does not have any limitations. I would urge the authors to reflect on the guidelines and reconsider their answer. For example, the weaknesses mentioned above (but not limited to) should be considered.\n\nQUESTIONS:\nPlease see the reasons to reject.\n\nLIMITATIONS:\nNo. authors did not disclose any limitations of their method. See \"Weaknesses\" section for more details.", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2024-07-12"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper proposed a new architectural extension to large pre-trained models (e.g. LLMs, or Multi-modal models). Specifically, the focus is on Mixture of Experts (MoE) models and the paper proposes a new method by introducing subtokens and routing each subtoken to experts.\n\nThe resulting architectural change performs better on down-stream tasks and demonstrates a higher use of a variety of experts.\n\nThe author's also conduct a variety of ablation studies to test various aspects and changes of their proposed architectural change.\n\nSTRENGTHS:\nStrengths:\n- Achieves strong performance on down-stream tasks and seems to out-perform the baseline methods presented in the paper.\n- Paper claims that they achieve better results with same cost\n- Good reporting on experiments for reproducibility\n- Decent amount of experiments and evaluations\n\nWEAKNESSES:\nWeaknesses:\n1. No actual comparison in terms of \"cost\" is given except for parameter count and complexity calculations in the appendix. It would be interesting to see actual evaluation of cost (e.g. computational cost of training & computational cost of inference vs. MoE alone).\n2. Evaluation and comparison is not done on publicly available and popular (& stat-of-the-art) models of relevant sizes (e.g. Mistral, Aya, Gemma ...). Therefore, it is not clear if this method actually performs better or just on the models and training runs presented in this paper.\n3. Clarity\na. some parts are unclear, e.g. equations 2,3,6,7 speak about the new additions of the method, however, it is not clear at all that there is MLP layer present (only later in the paper it is mentioned), however, it is \"still\" not clear whether and how it applied during equations 2,3,6,7.\nb. some mistakes in the paper e.g. Paper checklist 7, the answer is N/A. However, N/A means no experiments were run, the correct answer should be No.)\n4. The core claim that the problem with MoE is: \"low experts activation issue\" has a few problems:\na. It is never clearly explained why this is an issue (and no evidence is given that this is a real issue).\nb. On one hand the paper presents that the method increases activations, however, the paper also shows that increasing the number of heads (and therefore activations) seems to also decrease performance after a specific number of heads [Figure 5, Section 4.4]. (Great for reporting this, however, this also challenges the introduction / proposition of the method). I.e. it seems that \"low experts activation\" is not always a problem, or only a problem to a certain degree. => Therefore, it would be interesting to revise this hypothesis, and also to provide a counter hypothesis (with evidence).\n5. Reporting on sharding of the models on the DGX-2 system is not quite described. (Which is quite essential to run it sensibly.)\n\nQUESTIONS:\nQuestions:\n1. How does your model compare against some popular & state-of-the-art models (e.g. MoE LLMs like Mistral) in terms of performance?\n2. Referring to \"Weakness 4.b\", what is your explanation of why your method actually works better? \n3. What is the actual cost of running standard MoE vs. yours (in terms of practical training or inference time) - given the same computation budget.\n\nLIMITATIONS:\nLimitations:\n1. Limitations are not really considered in the paper.\n2. It would be really interesting to understand what does NOT work in the method in practice?\na.  What did not work during developing of the method?\nb. When is the method worse than previous other methods?\nc. Computational limitations?\nd. etc. etc.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-13"}