SwitchHead: Accelerating Transformers with Mixture-of-Experts Attention

Authors: róbert  csordás
piotr  piękos
kazuki  irie
jürgen  schmidhuber
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-15 16:17:11

Abstract: Despite many recent works on Mixture of Experts (MoEs) for resource-efficient Transformer language models, existing methods mostly focus on MoEs for feedforward layers. Previous attempts at extending MoE to the self-attention layer fail to match the performance of the parameter-matched baseline. Our novel SwitchHead is an effective MoE method for the attention layer that successfully reduces both the compute and memory requirements, achieving wall-clock speedup, while matching the language modeling performance of the baseline Transformer. Our novel MoE mechanism allows SwitchHead to compute up to 8 times fewer attention matrices than the standard Transformer. SwitchHead can also be combined with MoE feedforward layers, resulting in fully-MoE "SwitchAll" Transformers. For our 262M parameter model trained on C4, SwitchHead matches the perplexity of standard models with only 44% compute and 27% memory usage. Zero-shot experiments on downstream tasks confirm the performance of SwitchHead, e.g., achieving more than 3.5% absolute improvements on BliMP compared to the baseline with an equal compute resource.

Main paper: 
 introduction: 
 Figure 1 : A schematic representation of SwitchHead. It consists of a few independent heads, each with multiple experts for value and output projections. Each head has a single attention matrix.Large language models (LLMs) have shown remarkable capabilities [1, 2, 3, 4] and great versatility [5] . However, training large Transformers [6, 7] requires a considerable amount of computing power and memory, which is not accessible to most researchers, academic institutions, and even companies.Even running them in inference mode-typically much less resource-intensive-requires significant engineering effort [8] . Accelerating Transformers remains an important research question.In this context, Mixture of Experts (MoE) layers [9, 10, 11] have become popular to efficiently scale up Transformers to a large number of parameters [12, 13, 14, 15, 16, 17] . However, most of these works mainly focus on applying MoE to the 2-layer feedforward blocks [6] , i.e., the multi-layer perceptron (MLP) components of the Transformer, while keeping the self-attention layers unchanged. Given that attention also accounts for a considerable amount of compute and memory usage in Transformers (especially for long context sizes), using MoE for attention has potential to further improve resource efficiency in Transformers. While MoE-based attention remains underexplored in general, there are existing works on MoE approaches for attention [18, 19] . However, in practice, previously proposed methods typically require a lot of engineering tricks for successful training, and most importantly, only achieve a modest reduction in computing and memory requirements in the end (as we also confirm in our experiments).Here, we present a novel MoE-based attention method, SwitchHead, whose mechanism allows to reduce the number of attention matrices that need to be computed and stored. Following σ-MoE [17] , our method uses a non-competitive selection activation function (sigmoid), and does not require regularization or extra tricks for stable training. Importantly, we show that it is possible to compute the MoE projections outside of the attention core, which enables a significant reduction in the number of computed attention maps, resulting in significant resource savings. Our thorough investigation shows that it is enough to choose the value and output projections from a pool of experts and share keys and queries between them.We evaluate our method on C4 [20] , Enwik8 [21] , peS2o [22] and Wikitext 103 [23] , with two model sizes (47M and 262M). Additionally, we measure the zero-shot performance of our main models on Lambada [24] , BLiMP [25] , and Children's Books Test [26] datasets. Our experiments demonstrate that SwitchHead can achieve performance comparable to parameter-matched baselines with just a fraction of the compute and memory budget. In addition, we introduce "SwitchAll", a fully MoE-based Transformer model, that combines a σ-MoE-based MLP layer with our SwitchHead attention, often outperforming dense baselines with the same parameter budgets.Finally, we analyze the attention maps of our SwitchHead. We find that the attention maps taken over all heads are qualitatively similar to the dense baselines, indicating a significant reduction in redundancy without a loss of expressivity. In addition, expert selections are often interpretable. 
background: 
 The standard multi-head self-attention (MHA) layer [6] consists of four major steps: (1) compute key, query, and value projections, (2) compute the attention matrix, (3) use the attention matrix to project the values, and (4) map the projected values to the output. Let h, T , n heads , d model , d head denote positive integers. Let x ∈ R T ×dmodel denote an input to the MHA layer with n heads heads, T be the sequence length, and d model denote the size of the hidden representations of the model. W h {K,V,Q} ∈ R dmodel×dhead are the projection matrices for head h ∈ {1, ..., n heads }.Then K h = xW h K , Q h = xW h Q , and V h = xW h V (thus K h , Q h , V h ∈ R T ×dhead) are the keys, queries, and values, respectively. The attention matrix for the head h, A h ∈ R T ×T , and the output y ∈ R T ×dmodel are calculated as follows:EQUATIONwhere | denotes concatenation in the last dimension, the softmax(•) is also over the last dimension, and W O ∈ R nheadsdhead×dmodel . However, an alternative formulation reflects the role of W O better. Let us divide W O along the first dimension into submatrices for each head, W h O ∈ R dhead×dmodel , such thatW O = W 1 O ⊺ |W 2 O ⊺ |...|W nheads O ⊺ ⊺ .In this case, the output (Eq. 2) can be equivalently written as:y = h A h V h W h O (3)From this, it can be seen that all computations are local to each head. Computing the attention matrix A h and the readout A h V h requires compute in order of O(n heads d head T 2 ) MACs (multiplicationaccumulation operation 2 ). During training, it requires the storage of O(n heads T 2 ) for the attention matrices and O(n heads T d head ) for storing the sub-results of the projections. Given a sufficiently long sequence, computing the attention matrix and projecting the values will dominate the compute requirements due to the quadratic dependence on the sequence length T .Our goal is to obtain resource reductions while maintaining the fundamental properties of attention and retaining a fully expressive attention matrix. For that, we start from the following observation: modern LLMs use tens of heads [2, 27] . Are so many of them all necessary? As we show later in Sec. 3, indeed, naively reducing the number of heads (while keeping the same number of parameters by increasing the head dimension) results in performance loss. Explaining the reason for the need for many heads is beyond the scope of this paper. Nevertheless, here are some hypotheses: (1) they provide multiple inputs for the operations that the network performs in each step, (2) they are specialized and provide inputs only for specific operations (in this case, each operation would use a different subset of heads), (3) they may provide diverse outputs due to different initializations, some being more successful than others, thus enabling better learning. Among these, ( 2) and (3) may offer an opportunity for resource savings: if not all heads are needed at the same time, it might be possible to switch among them depending on the context.One naive method to achieve this is to use a gating signal using a linear projection W S ∈ R dmodel×nheads , and use the heads with the highest score, by replacing Eq. 3 with Eq. 6:EQUATIONEQUATIONwhere y[t, c] ∈ R denotes indexing the specific element of the output matrix y ∈ R T ×dmodel , for timestep t and channel c, and k is the number of active experts. Following the σ-MoE method [17] , we use a non-competitive selection function (sigmoid σ in Eq. 4). Now, let us define the source side of attention as the keys and values and the destination side as the queries and output. Intuitively, the above method corresponds to choosing a subset of attention heads based on the destination side alone 3 .Our preliminary experiments confirmed that this method is indeed feasible for language modeling on WikiText-103. However, it is difficult to achieve acceleration and memory savings with this method.To see why, notice that the entries of the attention matrix A h depend on pairs of tokens, one for the source and one for the destination side, but the choice is made only based on the destination side. Thus, in the worst case, for each destination, a different source might be chosen, in which case all possible source projections have to be computed for the keys and values, which we would like to avoid.Alternatively, we propose to improve the method above by introducing conditional computations for the source and destination projections independently of each other. That is, we parameterize each of key, query, value, output projection by an independent MoE. This avoids conditional computations that involve the attention matrix itself. Our solution implements this using Mixtures of Experts (MoEs). The concepts of "heads" are no longer well defined in the conventional sense: we redefine a head as an instance of a computed attention matrix. We call the total number of them n heads . For each head h, we define a separate list of E experts. The total number of experts is then n heads • E. Then, the projection matrices become W h,e K , W h,e Q , W h,e V and W h,e O ∈ R dhead×dmodel , where h denotes the head index and e the specific expert. Then we compute the source-side expert selection as follows:EQUATIONEQUATION2The number of MACs is a metric used in prior work [18] , which is independent of both the specific hardware and implementation, unlike wall-clock time. For wall-clock-time measurements, see Sec. 3.7. 3 To clarify, we allocate a routing function for each of key/value/query projections; these routing functions belong to the source or destination side accordingly. If we compare Eq. 10 and Eq. 6, one can notice that the routing function in Eq. 6 effectively corresponds to what we define as the destination-side routing in Eq. 10.where W h S ∈ R dmodel×E . We compute the destination-side experts similarly:s h D = σ(xW h D ), E h D = arg topk(s h D , k), E h S ⊂ {1, ..., E}, W h D ∈ R dmodel×E .Then, the value projection V h is computed as a weighted sum of the selected experts:EQUATIONThe key and query projections are computed similarly:K h = e∈E h S s h S [e]xW h,e K , and Q h = e∈E h D s h D [e]xW h,e Q .The output projection also becomes an MoE:EQUATIONAs we'll show, it is not necessary to make all projections MoEs. In Section 3.1 we show that keeping a single, head-specific copy of the query and key projections and reusing them for all experts is beneficial. We call this method SwitchHead.Essentially, SwitchHead reduces the number of attention matrices that have to be computed (n heads ) significantly, by using multiple experts per head. Note that our method does not depend on the specific implementation of the attention, allowing for easy experimentation and research. A schematic representation is shown in Figure 1 . Question: Does the paper discuss the limitations of the work performed by the authors?Answer: [Yes] Justification: We discuss the limitations in Sec. 6.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. 
experiments: 
 We conduct our experiments in a parameter-matched setting [17] which better reflects the task of language modeling (than the FLOPS-matched setting often used to evaluate MoEs). Our main experiments use Transformer XL, because we found them to consistently and significantly outperform RoPE-based baselines [28] for a fixed amount of compute. We provide the details of this analysis in Appendix A.4. The conclusions on the effectiveness of SwitchHead are consistent in both cases.As an important specification, under this parameter-matched setting, we always configure Switchhead such that it matches the perplexity of the baseline dense Transformer, and we maximize its resource reductions. For this, we follow a systematic procedure. First, we set n heads * E to be the same as n heads of the dense baseline. We start with setting n heads = 2 and k = 2, which provide the most resource reductions. If the resulting model underperforms, we increase k. If k = 4 underperforms as well, we set n heads = 4 and k = 2. We always set d head so that the total number of parameters of the resulting model matches the number of parameters of the baseline. This reasonably simple procedure ensures a good amount of resource savings, while avoiding doing an expensive hyperparameter search.Note that all the perplexity gains seen in the main result tables are the byproduct of imperfect matching, and our goal is to achieve reductions in resource requirements, unless noted otherwise (See Sec. 3.5). Detailed hyperparameters of all our models can be found in Sec. A.5 in the Appendix. We use and adopt the Triton kernel of σ-MoE [17] for our purposes.For all datasets except the character-level Enwik8 [21] , we use sub-word units [29, 30] obtained with a SentencePiece tokenizer [31] with a vocabulary size of 8k tokens. For most of our experiments, we use Transformer XL [32] with the context size being twice the size of the active/current chunk, because we found it to be significantly more resource-efficient than the standard setup. However, in order to show that our method is also competitive in the standard Transformer with RoPE positional ecodings, we also demonstrate our main findings in this setup (Appendix A.4).All models are trained for 100k batches. Some of the datasets we consider (C4 [20] , and peS2o [22] ) are much larger. In this case, we train on the first 10 5 * T * N batch tokens of the dataset.As discussed in Sec. 2.2, each linear projection (keys, values, queries, and output) can potentially be replaced independently by an MoE. Here we first check which projection benefits from such a replacement. As we target the parameter-matched setting, using MoE where it is not necessary can have a negative effect. Since experts use a significant part of the parameter budget, they can reduce the number of parameters available for the more useful parts of the model. Thus, we did a search over all possible combinations of MoE versus fixed projections with two active heads and compared them to the parameter-matched baseline. We find that the output projection is necessary to match the performance of the baseline (for detailed results refer to Tab. 6 in the appendix). Having MoE in the key and query projections turn out to be unnecessary. Models without the output and value MoE underperform the dense baseline with n heads = 2 heads.In sum, the best-performing model is the one using MoE for value and output projections. We use this model variant in the rest of experiments in this paper.The method most related to ours is the so-called Mixture of Attention Heads, or MoA [18] . Unlike SwitchHead, MoA uses a single key and value projection and chooses n heads active query and output projections from a pool of E experts.MoA computes the attention map for each selected expert and computes their weighted average after the attention computation takes place. In contrast, SwitchHead calculates the weighted average of the K selected experts before and after attention computation. Because of this, in practice, the same perplexity is achieved with the required number of computed attention matrices (n heads ) which is much lower for SwitchHead compared to MoA, allowing significant resource savings.Also, unlike MoA, SwitchHead uses a non-competitive activation function (sigmoid) [17] . We confirm that with this, our method performs well without any regularization, while MoA requires three different regularizers.We compare our method with MoA in Table 1 . It can be seen that while MoA can slightly outperform our method in terms of perplexity, it can only do so at the price of significantly more resource usage. Given a similar computation and memory budget, our method consistently outperforms MoA.We test our methods on a diverse set of language modeling datasets, including C4 [20] , Enwik8 [21] , peS2o [22] , at two different scales: a 47M and a 262M parameters. We chose this experimental setting taking into account our compute-budget and confidence in our results which are consistent in across various configurations.The results are shown in Table 2 . We compare our models to two baselines: one with the same number of heads as the total number of experts (n heads • E) of the SwitchHead models, and the other has the same number of heads as the number of active attention matrices (n heads ) as our models. Our models closely match the performance of the full, many-head baseline with the fraction of memory and compute requirements (see Sec. 3.7 for more details).In addition, we verify the performance of our models trained on the C4 dataset downstream tasks in a zero-shot manner. We consider Lambada [24] , BLiMP [25] and Children's Book Test (CBT) [26] . The results are shown in Table 4 : our SwitchHead models consistently outperform or match the performance of the baseline dense Transformer models.The goal of achieving more resource-efficient Transformers includes reducing the resource requirements of both the MLP and the attention layers. σ-MoE [17] was recently proposed as a parameterefficient MoE method for accelerating the MLP layers. However, it remains unclear whether it can be efficiently combined with our SwitchHead, or can have some negative interaction effect if combined in a "SwitchAll", where every layer is MoE-based.To verify this, we take the baseline architecture of Csordás et al. [17] without any hyperparameter change and replace the attention layer with SwitchHead. The hyperparameters for the attention are directly taken from the experiments shown in Tab. 2. The results are shown in Tab. 3. The combined, fully-MoE model often outperforms the dense baselines for each dataset and model size considered, except in the case of the 262M parameter model on the C4 dataset.All our experiments so far were calibrated so that the predictive performance (perplexity) matches to the performance of the baseline Transformer, and we were aiming for maximum resource savings. However, it is also a valid question to ask what is the performance of SwitchHead in a MAC-matched setup, where the compute requirements of our model are matched to those of the baseline. We achieve this by increasing d head and n heads until we have the same MAC requirements as the baseline. This results in a model with more parameters. For the small Transformer XL, we increase d head from 76 to 112 and n heads from 2 to 3. For large XL, we increase n heads from 4 to 6 and d head from 112 to 168.For the small RoPE model, we change n heads from 2 to 3 and d model from 64 to 84, for big n heads from 4 to 6 and d model from 112 to 168. We show the results in Tab. 4: MAC-matched models outperform the others by a large margin both in perplexity and in zero-shot task performance.For further time savings, we can share the expert selection between the source and destination side.Acceleration is achieved by reducing the number of sorting and top-k steps compared to the full SwitchHead. However, this results in a minor performance loss, which might be tolerated in some cases where the acceleration is more important. See Tab. 4 for more details.In all of our tables, we report the number of multiply-accumulate (MAC) operations following Zhang et al. [18] . The reason for this is that the actual wall-clock time is highly implementation and hardware-dependent. Nevertheless, we measured the runtime and total memory usage of our entire training pipeline (including the feedforward layer) to demonstrate that our current (suboptimal) implementation is already capable of providing wall-clock time acceleration. We show the results in Tab. 5. The measurements are taken on identical hardware with the same implementation (including for the attention core), the only difference being the MoE-based projections for the attention. It can be seen that for both scales, SwitchHead trains around 1.5 times faster, while using 61%-67% as much memory as the baseline.We also report the performance of MoA for reference in Table 5 . For measuring the resource usage of MoA, we chose the fastest MoA model that can match the performance of the dense baseline, or simply the best MoA model when no MoA model can match the baseline performance. This resulted in choosing MoA with H = 4 for the 47M model and MoA with H = 8 for the 262M parameter model. SwitchHead outperforms MoA on both scales, both in wall clock time and memory requirements. Note that these measurements also include the MLP layers, the optimizer, and the gradient synchronization in the case of multi-GPU training. Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?Answer Justification: We read the Ethics guidelines, and to the best of our knowledge, we are complying with it.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). 
analysis: 
 In order to see how the network uses the attention heads, we trained a small, 6-layer, 8-head Transformer on ListOps [33, 34] . The reason for this choice is that small, algorithmic tasks tend to be more interpretable compared to language modeling tasks. We also train a parameter-matched, 2-head We visualize the maximum of attention heads for each layer, both for the standard Transformer (Fig. 2a ) and SwitchHead (Fig. 2b ). The attention maps are qualitatively similar. Due to different initialization and learning dynamics, thus the overlap between the two models would not be perfect.Complete attention map visualizations can be found in Fig. 4 and 3 in the appendix.In addition, we anlyze individual attention heads for SwitchHead. We find that it is often possible to interpret the selection weights: on synthetic tasks, the output experts specialize according to different operations, while the input ones distinguish numbers and closed parentheses. The attention map itself appears to distribute information about contiguous chunks of numbers (see Fig. 5 in the appendix).Attention maps of the language models are more difficult to interpret. However, we visualize the attention maps of the 47M parameter Transformer XL and the SwitchHead model from Tab. 2. We find them to be qualitatively similar. We also identified induction heads [35] in both models, some examples shown for SwitchHead in Fig. 6a and for Transformer in Fig. 6b in the appendix. Other typical vertical line-lined attention patterns are shown in Fig. 6c and 6d . 
related work: 
 The method most closely related to ours is MoA [18] , which introduces a MoE style attention. It defines each attention head as an expert but shares the key and value projections between them. Unlike in our Switchhead, each of the selected experts requires a separate attention matrix, which significantly increases its memory usage. Due to the use of a competitive softmax-based activation function in the selection network, it requires complex regularization to prevent expert collapse [17] .In the original formulation, the number of active heads is high. Our experiments also confirm that MoA needs many attention heads to match the performance of the dense baseline (see Sec. 3.2), and it is only possible to do so with a significantly higher resource budget than our method.Nguyen et al. [36] analyze the attention matrices, and they conclude that they are usually low rank. Motivated by this, the authors construct a few (e.g., 2) "global attention matrices", and they compute each local matrix for specific heads by a weighted average of those. However, they average the logits, not the final matrix, so each individual head-specific matrix has to be computed. This means that in the best case, they can only save half of the computation associated with the attention matrix because the readout (Eq. 3) is still needed. For the same reason, memory savings are also low.B [M E D [M E D [M IN 0 8 9 5 ] 8 8 0 9 ] 6 9 6 [M A X 7 6 [M A X 4 [M A X 5 [M A X 3 8 0 8 ] [M IN 2 6 ] 5 ] 1 5 4 ] 5 ] ] E src B [Peng et al. [19] propose to reweight the contribution of each head by a gating function. However, they only reduce the number of total attention heads by one, presumably to compensate for the parameters used by the selection logic. Their goal was not to reduce resource usage but to have better predictive performance, which they achieve. They use a softmax-based competitive selection mechanism. To avoid collapse, the gating function is trained only in some steps.More broadly, there have been several works on MoE to accelerate language models. Shazeer et al. [11] introduce sparsely-gated mixture of experts. Fedus et al. [37] introduce Mixture of Experts in Transformers. Lepikhin et al. [13] train a MoE-based LLM, and Clark et al. [15] analyze the scaling laws of MoE models. Lewis et al. [12] introduce an alternative method for preventing collapse. However, none of these methods focus on the important, parameter-matched setting. Csordás et al. [17] introduce the non-competitive activation based MoE method, σ-MoE, which was shown to be successful in such a setting, but the authors only focused on accelerating the MLPs and not the attention.Multi-Query attention [38] uses a single key and value projection that is shared between the heads while using multiple queries. Our findings show that such a configuration is suboptimal: using multiple output and value projections is the most important choice in our model design.Dao et al. [39] provides a hardware-aware CUDA implementation of the entire attention layer, which avoids storing the attention matrix. By saving memory bandwidth in this way, they achieve a significant wall clock time speedup, despite that the attention matrix should be recomputed in the backward pass. This is orthogonal to our method and they can be combined for further acceleration. 
limitations: 
 Our models are modest in size compared to the current state-of-art LLMs. However, training such models is estimated to cost millions of dollars, which we cannot afford. Instead, we aim to show the versatility of our model by choosing a diverse set of datasets, including Enwik 8, Wikitext 103, C4 and peS2o, and different positional encodings, such as Transformer-XL-style relative positional encoding and RoPE. We also demonstrate the competitiveness of our models in zero-shot downstream tasks. We believe that the evidence we provided is enough for a research group with a larger amount of resources at their disposal to verify our findings in a state-of-the-art model.The Triton kernel that we used is currently around 60% of the speed of a single dense matrix multiplication of the size of a single expert with cuBLAS. Even this, we showed wall-clock time speedup. We estimate that 80-90% should be achievable with a more optimal kernel. Model-parallel training requires the implementation of a load-balancing system that can dynamically move experts between GPUs. 
conclusion: 
 On a wide range of language modeling datasets with different model sizes, our novel Mixtureof-Experts (MoE) based attention method called SwitchHead achieves performance of parametermatched dense counterparts, with only a fraction of the computational cost and memory usage. SwitchHead drastically reduces the number of attention matrices that have to be computed, by using MoE for the value and output projections. Our method is stable and does not need additional regularization to prevent degenerate solutions (a well-known practical issue in many existing MoE models).Our method can also be successfully combined with MoE MLP layers, to obtain "SwitchAll" where every layer of the Transformer is MoE-based, achieving a huge reduction in resource requirements. 
broader impacts: 
 Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?Answer: [Yes]Justification: We consider our paper to be a foundational research paper without direct consequences.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). 
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: [NA] Justification: The models in this paper are small by modern standards and we do not release pre-trained weights.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: Justification: Our code is under MIT license and the paper is CC-BY 4.0. To the best of our knowledge, we always credit the reused code if we reuse any.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. 
new assets: 
 Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?Answer: [Yes] Justification: We provide the source code and instructions on how to run it.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. 
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: We do not work 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. 
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: We do not work 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. 
 
 Appendix: The resource reductions from Flash Attention might be, in many cases, larger than those from our method alone. However, Flash Attention depends on GPU-specific memory bandwidth/compute trade-offs, which might not be available on all hardware, especially on edge devices. SwitchHead and FlashAttention can also be combined for further speedups. We demonstrated the viability of this setup in our RoPE experiments. Additionally, certain architectures, such as shared-layer transformers, might require a drastic increase in the number of heads, which FlashAttention alone might not be able to do.In this section, we discuss the compute and memory usage of different attention variants. We will define the compute in terms of the number of multiply-accumulate operations (MACs, also used by Zhang et al. [18] ), which is arguably better defined than FLOPs (e.g., does one step of the matrix multiplication count as 1 FLOP or 2? Do we include the softmax?). All calculations will be presented for a single attention layer for a single sequence, and they are presented this way in all our tables. Both the memory and compute requirements scale linearly with both the batch size and the number of layers.Consider a sequence of inputs of length T , with representation size d model . Let d head be the width of the key, query and value projections used for the attention layer. For Transformer XL-style attention, let the size of the context be CT , where C -1 is the number of past chunks included in the context of the current attention step. We can divide the computation into two major parts: calculating the projections, which do not involve the attention map, and calculating the attention map and projecting the sequence of values using it.First, consider the case of the standard Transformer XL [32] . Here, from the input x ∈ R T ×dmodel , we calculate the K h , Q h , V h ∈ R T ×dhead using projection matrices of shape R dmodel×dhead . The output after the attention is projected in a similar manner (Eq. 3). Thus, the projections take a total of 4T d model d head MACs per head. For backpropagation, we have to store all the intermediate results. This takes T d head numbers of K h , Q h and V h . Also, the projected values should be stored. They have an identical shape, therefore, the total memory used by projections is 4T d head numbers per head. Now consider the resource usage related to the attention matrix. It involves calculating the product of Q h K h ⊺ , which takes d head CT 2 MACs (multiplication by C is needed because the shape of K h and V h for Transformer XL is CT × d head ). The projection of the values with the attention matrix A h V h is similar. For the memory usage, the attention needs CT 2 numbers, but it needs to be stored both before and after the activation function. In addition, calculating the projection of the position encodings is necessary. This depends on the implementation, but in our case, it involves a matrix multiplication, and the total amount of computation is 2d head d model T C, and it needs 2d head T C numbers of storage. Thus the resource requirements are:EQUATION)EQUATION)The resource usage of SwitchHead is different. First, the number of heads n heads is significantly reduced, but d head is typically larger. Additionally, there are k experts active at the same time. Here, we only consider the case where the value and outputs are experts, but Q h and K h are not (this version performs the best; see Sec. 3.1). Then, we have two projections that are identical with that of Transformer XL, and two MoE-based projections. These use T kd model d head MACs to calculate the projection and another T kd head to calculate their weighted average. With a smart kernel implementation, memory usage is not affected by k, thus the formula remains the same as Eq. 12 (note, however, that n heads and d head are very different in practice). The compute requirement can be calculated as:N SwitchHead MAC = n heads 2T d head d model + 2T kd head (d model + 1) + 2CT 2 d head + 2CT d head d model (13)Additionally, the expert selection logic needs minimal additional resources, which can be ignored. Note that the comparison between the MACs of the standard (Eq. 11) and SwitchHead (Eq. 13) depends on the exact values of the hyper-parameters. However, as we'll see in Sec. 3, in our typical configurations, SwitchHead provides good predictive performance with significantly lower n heads compared to the standard Transformer, resulting in reduced resource usage in the end.The resource requirements of MoA [19] are very similar to those of Transformer XL , except that it uses a single shared key and value projection for each head.EQUATIONN MoA mem = (2n heads + 2)T d head + 2n heads CT 2 + 2CT d head (15)In order to analyze which projections are the most important to be mixture-of-experts, we exhaustively tried all combinations. We analyze our 47M parameter models on WikiText 103 dataset. We show the results in Tab. 6. We also include a parameter-matched baseline with two heads, which serves as a lower bound for the performance. We found that the value and output projections are the most important, and having key and query projections hurts the performance. This is possible because we perform all our experiments in a parameter-matched setting. Allocating parameters to these projections uses the budget that can be otherwise spent on other parts of the network. In our preliminary experiments, we found that, allowing the parameter budget to increase, more experts always help.All of our experiments in the main paper have used a Transformer XL model. Thus, it remains unclear whether SwitchHead is specific to this model or can be also used with other attention methods. As an alternative, we consider RoPE positional encodings [28] without the XL cache (thus, the attention matrices are square). This is the standard setup used by modern language models, such as all versions of Llama [27] . We tested these models in Wikitext 103 and C4. The results are shown in Tab. 7, and zero-shot performance on downstream tasks in Tab. 8. This shows that SwitchHead also performs well in the standard setup and is not tied to Transformer XL.We train all our models with Adam optimizer [40] , with a batch size of 64, a learning rate of 0.00025, and gradient clipping with a maximum norm of κ. Large models (> 200K parameters) use a learning It can be seen in Tab. 3 that the parameter count of the SwitchAll models is often less than that of their dense counterparts. The reason is that we normally compensate for the final difference in the number of parameters by increasing d ff (see Sec. 3 for details of the parameter matching). However, that can only be done in a very coarse-grained way with σ-MoE: the size of all experts must be increased at once, and the CUDA kernel supports only sizes of multiple of 4. Therefore, increasing the size of the experts would add too many parameters and the model would outgrow the baseline.For this reason, we simply keep the hyperparameters for Csordás et al. [17] and combine them with our SwitchHead configuration from Tab. 2.As discussed in Sec. 4, we analyze the attention maps of SwitchHead and compare them with the dense models. We show all the attention maps of the models trained on ListOps in Fig. 3 and Fig. 3 . We show individual heads of SwitchHead, including the expert selection scores in Fig. 5 . Some selected attention maps of our 47M parameter models on Wikitext 103 are shown in Fig. 6 .We report the compute used for our experiments, including the GPU type, count (the number of GPUs used per experiment, and not the total in the machine), and the runtime in "hh:mm" format in Tab. 10. We report the total number of CPUs (N CPU ) and RAM because they are shared between concurrent runs. Note that most of the experiments were done prior to the much faster, Triton-based kernel implementation. Because of this, the runtimes appear longer for SwitcHead compared to the baseline. For timing benchmarks with our new kernel, see Tab. 5.Note that we only report the resources used for the paper here. We estimate that the total cost of the failed experiments and preliminary runs is around 10 times higher than this. Justification: We summarized the motivation, method, and main findings in these sections.EQUATIONEQUATIONGuidelines:• 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.† Work done at IDSIA.1 Our code is public: https://github.com/robertcsordas/switchhead 


Decision: SwitchHead demonstrates impressive performance improvements in language modeling tasks, showcasing the potential of MoE in self-attention layers. Despite some minor limitations, the reviewers generally agree on the technical soundness and significance of the work.
Given the overall positive reviews, I recommend accepting this paper. Addressing the weaknesses identified during the review process, such as expanding the evaluation to additional tasks and providing more quantitative analysis of attention maps, would further enhance the paper's contribution.

Reviews: review: paper_summary: paper_summary: This work proposes a novel Multi-Head-Attention (MHA) mechanism which is more efficient than the standard MHA used in most transformers. The method---called SwitchHead---is relying on Mixture-of-Experts (MoEs) to save computation while retaining the same model capacity and performance. To achieve this, instead of naively selecting which head should be computed for each token, a small number of heads are **always** computed, and MoEs are used to modulate the value and output projections for each head. Using multiple transformer variants and datasets, they empirically show how SwichHead transformers reach a similar perplexity as the baseline, for the same number of parameters, while requiring fewer operations and memory. They also show how their approach can yield a significant speedup during training.
strength_weakness: strength_weakness: - As mentioned in the limitations section, the models are relatively small. 
- I could not find the sequence length used in your experiments, which prevents me from computing the number of tokens used during training. 
- I find it odd that dropout is used for the baseline but not for the switchAll models, on C4 I'm expecting dropout to slow down learning. 
- What is explaining the differences in the transformers' PPLs in table 4 compared to the PPLs in table 2?
questions: questions: See above.
limitations: limitations: Limitations have been discussed adequately.
paper_summary: paper_summary: This paper presents SwitchHead, a Mixture of Experts (MoE) method applied to the self-attention layer in transformer blocks. By applying MoE to the self-attention layer, SwitchHead reduces computational and memory costs while maintaining language modeling performance comparable to traditional dense models. It can be combined with existing MoE methods for feedforward layers, resulting in a fully MoE-based transformer, SwitchAll transformers. Tests on various language modeling datasets (C4, Enwik8, peS2o) show that SwitchHead performs well compared to models with parameter-matched settings.
strength_weakness: strength_weakness: - The paper only evaluates the proposed method on language modeling datasets, lacking demonstration of its effectiveness on other important NLP tasks such as document summarization or open-domain question answering.
- While the authors claim similarity between SwitchHead and dense baseline attention maps, the provided figures suggest simplification in SwitchHead's maps. The lack of quantitative analysis (e.g., entropy measurements) weakens this claim.
- There's a concern that the simplified attention maps produced by SwitchHead could lead to performance degradation when SwitchHead used in encoder-based models due to information bottleneck, which isn't addressed in the current evaluation.
- The paper doesn't clearly explain why regularization methods used in σ-MoE (e.g., entropy maximization, expert dropout) are unnecessary for SwitchHead, potentially leaving gaps in the method's theoretical foundation.
- The paper suggests that Top-K selection can be treated as a hyperparameter, but doesn't provide a clear analysis of the method's sensitivity to different K values, leaving questions about the necessity of hyperparameter search.
- The paper mentions "preliminary experiments" multiple times without proper citation or section indicators, which may confuse readers and reduce the reproducibility of the work.
questions: questions: - While the paper demonstrates strong performance on language modeling tasks, it would be beneficial to see results on a broader range of NLP tasks. How does SwitchHead perform on tasks such as document summarization[1] or open-domain question answering[2]? This would help demonstrate the method's versatility and potential impact beyond language modeling.
- The paper claims that attention maps from SwitchHead and dense baseline models (Transformer XL) are qualitatively similar. However, Figures 2 and 6 suggest that SwitchHead produces simplified attention maps. Could you provide quantitative analysis (e.g., entropy measurements) to more rigorously demonstrate the complexity and quality of SwitchHead's attention maps compared to the dense baseline?
- If SwitchHead indeed produces simplified attention maps, there's a concern about potential information bottleneck in encoder-based models. Have you considered evaluating SwitchHead's performance when applied to the query encoder in a retrieval-augmented generation (RAG) setup for open-domain QA tasks[2]? This could help address concerns about information loss in more complex, multi-step tasks.
- The paper mentions that SwitchHead doesn't require the extra regularization techniques used in σ-MoE, such as entropy maximization for load balancing or expert dropout. Could you clarify what specific differences between σ-MoE and SwitchHead make these extra tricks unnecessary? A more detailed explanation of this point would strengthen the theoretical foundation of your approach.
- You demonstrate that K in Top-K selection can be treated as a hyperparameter in the proposed method. How sensitive is the model's performance to different K values? If the sensitivity is low, is extensive hyperparameter searching always necessary, or could a default value be recommended for most use cases?
- The paper mentions "Our preliminary experiments" several times (e.g., lines 91, 473) without providing citations or section indicators. Could you clarify these references to improve the paper's clarity and reproducibility? Consider either expanding on these preliminary experiments in the main text or including them in an appendix.

[1] Nallapati, Ramesh, et al. "Abstractive text summarization using sequence-to-sequence rnns and beyond." arXiv preprint arXiv:1602.06023 (2016).

[2] Kwiatkowski, Tom, et al. "Natural questions: a benchmark for question answering research." Transactions of the Association for Computational Linguistics 7 (2019): 453-466.
limitations: limitations: - In section 6 and appendix A.1, the authors appropriately present the limitations and societal impacts of their work. This acknowledgment of their model framework's constraints effectively strengthens the motivation for additional research topics in future work. The authors' awareness of these limitations demonstrates a commendable level of scientific rigor and transparency. However, the claim that performance can potentially reach 80-90% raises some questions. While this projection is intriguing, it would be more convincing if supported by more robust quantitative assessments. The addition of more detailed quantitative evaluations could provide valuable insights and significantly aid future research efforts. For instance, a breakdown of current performance bottlenecks and a roadmap for potential optimizations would offer clearer guidance for researchers looking to build upon this work. Furthermore, a more granular analysis of the trade-offs between model size, computational resources, and performance could enhance the paper's contribution to the field. Overall, while the authors have done a commendable job in addressing limitations and societal impacts, the inclusion of more quantitative metrics and projections would further solidify the paper's value as a foundation for future research in this area.
paper_summary: paper_summary: This paper introduces SwitchHead, a Mixture of Experts (MoE) method for improving the efficiency of the self-attention layer in Transformers. Unlike traditional MoE methods focused mainly on feedforward layers, SwitchHead effectively reduces both compute and memory requirements, achieving significant wall-clock speed improvements without compromising language modeling performance. This is accomplished by reducing the number of attention matrices needed, offering substantial savings in computational resources, which is validated through extensive experiments across multiple datasets and model sizes.
strength_weakness: strength_weakness: The proposed SwitchHead method shares similarities with the Mixture of Attention Heads (MoA), but a key distinction lies in its use of a non-competitive activation function (sigmoid) instead of SoftMax. This design choice is important to understand, and I would appreciate an explanation for opting for the sigmoid activation function over SoftMax in this context.
questions: questions: 1. The authors mention employing a parameter-matched setting to better reflect the task of language modeling. However, the paper lacks explicit justification for why this setting is more representative of language modeling tasks. Additionally, the description of parameters in Table 1 is ambiguous—it should be clarified whether the numbers represent total parameters or only those that are actively used during inference.

2. The paper occasionally uses notations without adequate explanations, which can lead to confusion. For instance, the term “Shared selection” used in Table 4 is not clearly defined.

3. In Table 5, the authors present the training times for the baseline Transformer and SwitchHead models, but the training time for the MoA model is not included. To provide a comprehensive comparison and better evaluate the efficiency of SwitchHead relative to other models, it would be beneficial if the authors could also include the training time data for the MoA model.
limitations: limitations: The authors have discussed the limitations of their study.
paper_summary: paper_summary: This paper introduces SwitchHead, a novel MoE architecture for the attention layer. Unlike the existing MoA approach, which computes the output of the attention layer as a weighted average of the top-k heads determined by a learnable routing mechanism, SwitchHead independently applies expert mixtures to the heads' key, value, and output projections. This design allows SwitchHead to achieve comparable or superior performance to MoA and dense Transformers while requiring less computational power.  The reduced compute cost is achieved by performing fewer matrix multiplications: since fewer heads need to be instantiated, the attention matrix operations are performed less frequently (same number of params is ensured by setting d_head accordingly). Reduced memory cost is achieved by having to store less activations for the backward pass. The paper points out that only applying MoE to value and output projection in each head performs sufficiently well as compared to applying MoE to the key and query projections as well.
strength_weakness: strength_weakness: I cannot identify any fundamental weaknesses with the paper beyond several confusing passages that might require further clarification, and a couple of potentially missing citations (see questions).
questions: questions: - similar techniques for transforming attention heads into MoE have been proposed in the context of parameter efficient MoEs for the fine-tuning stage where experts are represented with LoRA adapters, authors can consider mentioning these works [2,3,4 inter alia]
- ll. 88 - 91: "Intuitively, the above method corresponds to choosing a subset of attention heads based on the destination side alone": given that routing vector s is calculated conditioned on the input x, I do not understand why is it the case that attention heads are selected based on the destination (queries and outputs) side alone. In my understanding the attention head selection is dependent on the input x.
- ll. 93 - 96 (related to above point) the explanation is somewhat confusing, why is it the case that in the worst case all possible source projections have to be computed?
- l. 439: does the 4 in the calculation of the total MACs for the projections already include the output projection?
- ll. 158 - 161: it might be worth noting that the idea of sharing key and value projection across heads has been introduced in earlier work on multi-query attention [1]. Additionally, to enhance the overall clarity, it could be useful to explicitly highlight how exactly MoA differs from the naive attention head mixing technique described in the first part of the Sec. 2.2.
- ll. 119 - 120: it would be helpful if authors could provide a brief discussion clarifying how and why exactly parameter-matched setting "better reflects the task of language modelling"? 
- ll. 225 - 227: the visualization in Fig. 2 is only for 1 layer, and not for all layers as stated in the text
- ll. 282 - 287: does not exactly fit into the "Limitations" section, since, according to the authors (ll. 266-269) FlashAttention is orthogonal to SwitchHead
- how important is it to have MoE in the attention the the fully-connected block is already an MoE? Could authors add comparison to σ-MoE?
 
Overall solid paper, I am happy to revisit my score upon the rebuttal.

[1] Shazeer, Noam. "Fast transformer decoding: One write-head is all you need." arXiv preprint arXiv:1911.02150 (2019).

[2] Page-Caccia, Lucas, et al. "Multi-head adapter routing for cross-task generalization." Advances in Neural Information Processing Systems 36 (2024).

[3] Zadouri, Ted, et al. "Pushing mixture of experts to the limit: Extremely parameter efficient moe for instruction tuning." arXiv preprint arXiv:2309.05444 (2023).

[4] Ostapenko, Oleksiy, et al. "Towards modular llms by building and reusing a library of loras." arXiv preprint arXiv:2405.11157 (2024).
limitations: limitations: Limitations are addressed in section 6.

Comments: title: Official Comment by Reviewer YarL
comment: Thank you very much for your response! We are glad to hear that the reviewer found our response useful!

Regarding the first point:

> Perhaps the authors could consider alternative methods or metrics that could provide more meaningful insights into the relationship between attention map characteristics and model performance

We agree with the reviewer that going beyond this qualitative findings would be valuable. However, currently, we do not have any convincingly good metrics for this purpose.

Regarding the second point:

> There seems to be an underlying assumption that similar attention maps between the baseline model and the MoE model could explain why the MoE model performs well. If this is indeed a key point, …

We think there is a misunderstanding here. We did not intend to make such an assumption. The sole goal of our attention map analysis is to qualitatively examine how the reduced number of heads (a characteristic of Switchhead) affects the global attention patterns. Here for ListOps, we observe that a high-level pattern is similar to the baseline. This is a purely behavioral comparison between our model and the baseline; we do not use this observation to justify the performance of our model. We will clarify this in the future version of the paper.

We hope this response provides further clarifications about the purpose of our attention map analysis.
The review committee extends its sincere appreciation to the authors for their comprehensive and insightful responses to the critiques provided. The diligence demonstrated in addressing the concerns raised and elucidating various aspects of the research is highly commendable. In light of these thorough explanations, the committee is inclined to view the manuscript more favorably.
While substantial progress has been made in addressing the initial reservations, there remains one salient point that warrants further deliberation:

Regarding the quantitative analysis of attention maps:

- I appreciate the authors' insight that it's challenging to draw definitive conclusions from raw entropy measurements of attention maps. The perspective that downstream task performance is ultimately the most meaningful metric for assessing the adequacy of attention maps is well-taken. However, the paper's current statements about attention maps being "qualitatively similar" (Lines 227, 236) could potentially be expanded upon to provide more valuable insights. Perhaps the authors could consider alternative methods or metrics that could provide more meaningful insights into the relationship between attention map characteristics and model performance.
- There seems to be an underlying assumption that similar attention maps between the baseline model and the MoE model could explain why the MoE model performs well. If this is indeed a key point, it might be beneficial to explore this assumption further. For instance, is there a way to investigate any potential correlation between the similarity of attention maps and downstream task performance?

By addressing these points, the paper could potentially offer deeper insights into the workings of the SwitchHead model and strengthen its contributions to the field.
I thank the authors for these clarifications.
Thank you very much for the increased score! We are glad to hear that the reviewer found our response useful! Thank you again for your valuable feedback!
Thank you to the authors for their comprehensive response to the review comments. The efforts made to address the concerns and clarify the points discussed are highly appreciated. Given these responses, I am inclined to increase my score.
Thank you very much for your response! We are glad to hear that the reviewer found our response useful! Yes, we will make sure to include these clarifications in the next version. Thank you again for this valuable feedback!
I would like to thank the authors for their responses. Upon clarification, I now understand a bit better what the authors mean in ll. 84-96. It would help future readers if authors could incorporate the clarifications regarding these lines in the future paper version.