Spiking Transformer with Experts Mixture

Authors: zhaokun  zhou
yijie  lu
yanhao  jia
kaiwei  che
jun  niu
liwei  huang
xinyu  shi
yuesheng  zhu
guoqi  li
zhaofei  yu
li  yuan
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-13 15:23:38

Abstract: Spiking Neural Networks (SNNs) provide a sparse spike-driven mechanism which is believed to be critical for energy-efficient deep learning. 
Mixture-of-Experts (MoE), on the other side, aligns with the brain mechanism of distributed and sparse processing, resulting in an efficient way of enhancing model capacity and conditional computation. 
In this work, we consider how to incorporate SNNs’ spike-driven and MoE’s conditional computation into a unified framework. 
However, MoE uses softmax to get the dense conditional weights for each expert and TopK to hard-sparsify the network, which does not fit the properties of SNNs. 
To address this issue, we reformulate MoE in SNNs and introduce the Spiking Experts Mixture Mechanism (SEMM) from the perspective of sparse spiking activation. 
Both the experts and the router output spiking sequences, and their element-wise operation makes SEMM computation spike-driven and dynamic sparse-conditional. 
By developing SEMM into Spiking Transformer, the Experts Mixture Spiking Attention (EMSA) and the Experts Mixture Spiking Perceptron (EMSP) are proposed, which performs routing allocation for head-wise and channel-wise spiking experts, respectively. Experiments show that SEMM realizes sparse conditional computation and obtains a stable improvement on neuromorphic and static datasets with approximate computational overhead based on the Spiking Transformer baselines.

Main paper: 
 introduction: 
 The spiking neural networks (SNNs) are regarded as the third generation of neural networks [1] , distinguished by biological plausibility [2] , spike-driven characteristic, and low power consumption. SNNs emulate the dynamics of biological neurons at a microscopic level, utilizing asynchronous binary spikes for information transmission. The membrane potential of spiking neurons in SNNs is only updated upon the arrival of spikes, avoiding calculations of zero values. The inherent features make SNNs promising candidates for low-energy consumption on neuromorphic hardware, such as TrueNorth [3] and Loihi [4] . There are lots of architectures in SNNs include Spiking Recurrent Neural Networks [5] , ResNet-like SNNs [6] [7] [8] [9] , Spiking Graph Neural Networks [10] , and Spiking Transformers [11] [12] [13] . Spiking Transformers stands at the forefront. Spikformer [11] introduces Spiking Self-Attention (SSA). The Spike-Driven Transformer [12] introduces Spike-driven Self-Attention. Other works explore the Spiking Transformer in terms of structural improvements [14] [15] [16] [17] , training methods [18] , and different tasks [19] , respectively. Mixture-of-Experts (MoE) [20, 21] is known for allowing each expert to learn specific tasks or features, showing better performance, conditional computing and dynamic adaptability, which are crucial features in the brain mechanism [22, 23] . In this work, we are committed to exploring the effective integration of MoE and Spiking Transformer. As shown in Fig. 1 (a), MoE introduces a large number of parameters based on the original Transformer, and the conditional computation is achieved by calculating the routing probability of each token on each expert through the softmax function. Selecting Top-K experts based on the routing probability, MoE achieves hard sparsification. However, SNN calculations need to avoid multiplication and cannot use complex softmax functions. The features in SNNs are dynamically sparse and do not require additional TopK. All the parameters of the expert must be loaded, which aggravates the difficulty of neuromorphic chip deployment. These factors make porting MoE to SNNs non-trivial. To tackle this problem, we develop the Spiking Experts Mixture Mechanism (SEMM), as shown in Fig. 1 (b), a universal SNN-MoE paradigm with the following three main features. 1) The SEMM is spike-driven. The outputs of the expert and the router are spike sequences, and the element-wise operation between them conforms to the SNN characteristics, i.e., avoiding multiplication. 2) SEMM leverages the sparse spiking activation of SNNs to achieve dynamic conditional computation of MoEs, which is more flexible than the fixed hard sparsification of Artificial Neural Network MoE (ANN-MoE). 3) With reasonable parameter count settings, SEMM enables Spiking Transformers to achieve stable performance gains with negligible overhead. Based on SEMM, we modify the Spiking Self-attention (SSA) and Multi-layer Perceptron (MLP) of Spiking Transformers to obtain the Experts Mixture Spiking Attention (EMSA) and the Experts Mixture Spiking Perceptron (EMSP). EMSA treats each head of SSA as an expert, computes respective attention, and employs a temporal-aware router to integrate attention. As for Multi-layer Perceptron (MLP), it is common to substitute the entire MLP with MoE [24] , which leads to better performance but a significant increase in the overall parameter number. EMSP implements a channel-wise MoE within MLP to overcome the shortcoming. EMSA and EMSP can be inserted directly and seamlessly into existing Spiking Transformer variants [11, 14, 12] . Our work contributes in three main aspects:• We introduce the Spiking Experts Mixture Mechanism (SEMM), a universal SNN-MoE paradigm. SEMM is spike-driven, capable of efficient dynamic sparse conditional computation.• Based on SEMM, we develop the Experts Mixture Spiking Attention (EMSA), whose information from all head-wise experts is selectively integrated through a temporal-aware router. We restructure MLP by a channel-level spiking-sparse SEMM, named the Experts Mixture Spiking Perceptron (EMSP). They can seamlessly replace self-attention and MLP in Spiking Transformers.• Extensive experiments demonstrate the stable performance improvement of SEMM on both static and neuromorphic datasets. Notably, Spike-driven Transformer-8-512 with SEMM achieves a remarkable 76.62% accuracy on ImageNet with 4 time steps, surpassing the baseline (74.57%). 
related work: 
 Deep Spiking Neural Networks and Spiking Transformers. Spatio-temporal backpropagation(STBP) [25] directly trains SNNs by performing backpropagation on both spatial and temporal domains. Temporal backpropagation [26] computes the gradients of the timings of existing spikes for the membrane potential at the spike timing. Treshold-dependent batch normalization (tdBN) [8] is used to extend the network depth. SEW-ResNet [7] proposed the spiking element-wise residual for SNNs. Spikformer [11] firstly converts all the components of Vision Transformer (ViT) into spike-form and pioneers the field of SNN-Transformer. Spike-driven Transformer [12] goes further by introducing linear spike-driven self-attention. Spikingformer [14] proposes a hardware-friendly spike-driven residual learning architecture. Besides, Masked Spiking Transformer [27] combines SNNs and Transformers from the perspective of the ANN-to-SNN conversion. However, the SNN Transformer architecture that can bring SNNs' superiority into full play is still ongoing research.Mixture-of-Experts. The Mixture-of-Experts (MoE) [28, 29] combines the predictions of multiple specialized experts, which is effective in handling high-dimensional data and complex problems.Researchers explore diverse gating mechanisms [30, 31] , optimizing expert allocation strategies [32, 33] , and enhancing the scalability of MoE models [34, 35] . Sparsely-Gated Mixture-of-Experts [30] adopted MoE into architectures such as the Long Short-Term Memory (LSTM) [36] , showcasing effectiveness in Language Modeling. The Transformer also benefits from MoE with the substitution of the Multi-layer Perceptron (MLP) [24, 37] . Switch Transformer [35] has scaled the models with trillions of parameters. Currently, there is no existing work on MoE with Spiking Transformers.3 Methodology EQUATIONEQUATIONEQUATIONSpiking Transformer [11, 14, 12] baselines contain Patch Splitting (PS), Relative Position Embedding (RPE), Spiking Self Attention (SSA) (e.g., Spiking Self-Attention [11] and Spike-driven Self-Attention [12] ), MLP and linear classification head, as shown in Fig. 2 (a). Given a 2D image sequence I ∈ R T ×C×H×W , where T , C, H, and W denote time-step, channel, height and width, the PS splits it into a sequence of N flattened spike patches x with D dimensional channel. A Convolution-BatchNorm-LIF block generates Relative Position Embedding (RPE):EQUATIONEQUATIONEQUATIONEQUATIONwhere the X 0 is fed into the L-blocks and each block consists of a SSA and a MLP. X ′ l , X l are spike sequences and l = 1...L is layer. A Global Average-pooling (GAP) is utilized on the X L and the linear Classification Head (CH) to output the prediction Y. See Appendix. A for more details. 
spiking experts mixture mechanism: 
 Before exploring the adaptation of spiking MoE in SNNs, we first review MoE in ANNs. An ANN-MoE layer typically comprises a set of m experts E A = {E 1 , E 2 , ..., E m }, along with a router R A for selecting the corresponding experts. Given an input sequence X A , the resulting output can be expressed as the sum of the Top-K selected experts from m candidates using a router:EQUATIONEQUATIONEQUATION)where W R is the router weight matrix. The TopK(•, K) together with the softmax(•) sets all elements of the routing vector to zero except the largest top K values. The sparse conditional computing is obtained from the selecting of TopK and the different routing weights of the softmax, while K is usually taken as 0.5 * m. We argue that the ANN-MoE is not suitable for SNN for two main reasons. First, the float-point routing-expert and the softmax which involve exponentiation and division, do not adhere to the computation principles of SNNs. Second, SNN experts are inherently highly sparse, so the hard sparsification approach of additional TopK is unnecessary. An eventtriggered spike-based sparse conditional computation on asynchronous neuromorphic chips is needed more than TopK. To bridge these gaps, we introduce a generalized representation of the Spiking Experts Mixture Mechanism (SEMM), which is as follows,EQUATIONwhere E = {E 1 , E 2 , ..., E m } represents the spiking sequence of m spiking experts in the Spiking Transformer, and R ∈ {0, 1}T ×N ×m represents the spiking router for allocating computation. F(•) denotes the element-wise form of the operation between the router and the expert output spiking sequence, i.e., Hadamard product and addition.As a MoE mechanism specifically designed for SNNs, SEMM has the following three significant advantages. i) Spike-driven. The SEMM is spike-driven, which is important for SNNs. Due to the spike-driven computation mode of experts, i.e., Spiking Self-attention and Spiking-MLP, SEMM computations are triggered by sparse spikes of experts and require only synaptic manipulation. For example, the Hadamard product between the spiking signals R and E is equivalent to mask. ii) Sparse-spiking conditional computation. The SEMM subtly utilizes the sparse activation of the spiking routers for the conditional computation of MoE. SEMM has a variable sparsity when dealing with different data. Additionally, SEMM does not suffer from the load imbalance problem in ANN-MoE, i.e., TopK selects fixed number of experts. The sparse conditional computation is distributed to each expert. iii) Efficient computation. Unlike loading with multiple heavy expert modules of ANN-MoE, the SEMM has comparable parameters and operations to the previous SSA and MLP of Spiking Transformers. These are further discussed in Sec. 3.5. Without loss of generality, we use the mainstream architecture of Spiking Transformer for SEMM embedding in Sec. 3.3 and Sec. 3.4.We begin by reviewing the processing of Spiking Self-Attention (SSA). Different from vanilla ANN-Transformers [38] , it discards the softmax normalization for the attention map. The SSA mechanism can be described by the following equation:EQUATIONA = SSA(Q, K, V) = SN (QK T V * s), for Spiking Self-Attention SN (SUM c (Q ⊙ K)) ⊙ V,for Spike-Driven Self-Attention (13) where SN represents the spiking neuron and L-BN represents that the features pass sequentially through Linear and BatchNorm. s is the scaling factor and Q, K, V ∈ {0, 1} EQUATIONEQUATIONEQUATIONEQUATIONwhere A m ∈ {0, 1} T ×N ×d is the output of each SSA experts, and W R ∈ R D×m is the router weight matrix. R ∈ {0, 1} T ×N ×m is the routing sequence. We set d ≤ D by default to avoid introducing too many parameters. The operation F(•) between expert-router is computed by masking the expert using router pair-by-pair and then summing them up. The output of EMSA is obtained by performing matrix multiplication between SEMM(E, R, F(•)) and synaptic weight W o ∈ R d×D , the same as the last layer of SSA block in Spiking Transformers.As illustrate in Fig. reffig :method, the Experts Mixture Spiking Perceptron (EMSP) launches the channel-wise SEMM within MLP. The architecture can be written as follows:EQUATIONEQUATIONEQUATIONwhere W 1 , W R ∈ R D×m is the weight matrix of first layer in MLP and router, respectively. We integrate a 3 × 3 Depth Wise Convolution layer DWC to capture local features on each channel expert, which has fewer parameters and is computationally efficient compared to original convolution. W o ∈ R m×D is the wight matrix of output layer. The original Spiking Transformer's MLP would have a D to 4 * D channel dimension increase after the first layer and the second layer would reduce the dimension back to D. In EMSP we set m to (8//3) * D to try to match the parameter number of the original MLP. EMSP integrates sparse routing of multiple channel-wise experts. It can also be viewed as the channel-wise gating, which is suitable for temporal information processing, allowing information to flow unimpeded through potentially many time steps [39] . The gate (router) branch and expert branch can be also regarded as incorporating the Spike Element-Wise (SEW) [7] residual block into EMSP. Channel-wise convolution and element-wise (Hadamard) products only introduce a minor increase in computational cost. By appropriately configuring the number and dimensions of expert networks, our EMSP achieves more efficient computation compared to the original spiking MLP. More details of the computational overhead are given in the next sub-section.We explain each of the three advantages of SEMM, i.e., Spike-driven, Sparse-spiking conditional computation and efficient computation.Spike-driven has the following formal definition, meaning that the gathering of input current is initiated by sparse spikes released from presynaptic neurons: Definition 1. In SNN, the operation is spike-driven if the input currents satisfy the following form,EQUATIONwhere I i [t] is the input current of the i-th postsynaptic neuron at time step t, s j [t] ∈ {0, 1} is the spike output of the j-th pre-synaptic neuron, w i,j is the weight of the synaptic connection from j to i.For EMSA, the input current for the LIF in Eq. 18 at a specific time step t is given by:EQUATIONEQUATIONwhere I[t] has a dimension of P ×Q, with p and q represent the p-th row and q-th column, respectively. EMSA is essentially spike element-wise addition after masking operation on SSA, consistent with the characteristics of spike-driven. For EMSP, the operation between two spiking sequences E and R corresponds to the logical AND function [7] , which also conforms to the spike driven, Sparse-spiking conditional computation means using spiking routers to dynamically allocate the computation in temporal and spatial dimension. More analysis is detailed in experiments.EQUATIONEQUATION)Efficient computations means that SEMM approximates SSA and MLP in terms of number of parameters and theoretical synaptic operations. Tab. 1 demonstrates the computation load for EMSA, EMSP versus SSA and MLP. In terms of parameter number, despite having a routing layer mD, EMSA has a smaller number of parameters than SSA when the number of experts is within a reasonable range (≥ 2). EMSP additionally introduces a 3 × 3 depthwise convolution, and the number is slighter higher than MLP. Due to the similarity of the actual spiking rates, EMSA is smaller than SSA on the T N D 2 term, while the calculation of the additional introduced by SEMM is on the T N D term (much smaller than T N D 2 ) and therefore can be ignored. The situation is similar on EMSP, with depth-wise convolution adding a slight computational overhead. The design of EMSP is different from ANN-MoE, which selects multiple heavy MLPs as experts. We demonstrate it's validity in Fig. 3, i .e., it performs better while the number of parameters is much smaller than ANN-MoE. 
sparse conditional computation analysis: 
 We analyze the average spiking rate (ASR) of routers for EMSA and EMSP on the ImageNet validation set, which is shown in Tab. 2. The SD-Transformer-8-512 is used for the analysis. The ASR of EMSA is around 0.5, which is comparable to the regular TopK setting of ANN-MoE. The ASR of EMSP is low and gradually decreases as the block deepens, compared to the fixed TopK hard sparse in ANN-MoE, SEMM fully reflects the advantage of SNN dynamic sparse conditional computation. To further verify the spiking router, we ablate it, i.e., cancel it in EMSA and EMSP, as Table 1 : Number of parameters and theoretical synaptic operations. R, R, R and R denote the average spike firing rates (the proportion of non-zero elements in the spike matrix) in various spike matrices. T , N , and D are the time step, sequence length, and channel dimension of the input features, respectively. d is the channel dimension of Am and m is the number of experts. The details are provided in the Appendix. B.OPs shown in Fig. 4 , the accuracy decreases significantly after canceling the router, and it is even lower than the baseline model on the Spikingformer. Directly analyzing the conditional computation of SEMM is challenging, we therefore use visualizations to illustrate this intuitively. As show in Fig. 5 , for the same image, each expert's router assigns a different computational region, e.g., the third router filters the background of the expert's features, while the second router assigns the computation to the foreground target. The computation allocation of the spiking router to the irregular object "snake" can be seen that the router is highly dynamic and effective. See Appendix. D for more samples. In addition, as shown in Fig. 6 , we also report the ASR of spatial-temporal locations of routers in different kinds of images. As can be seen by the difference in average firing rates, spiking router has a dynamic adjustment of ASR processing different kinds of images, further illustrating its data-dependent conditional computation property. We conduct experiments on static datasets, i.e., Im-ageNet [40] and CIFAR [41] , and neuromorphic datasets, i.e., CIFAR10-DVS [42] , DVS128 Gesture [43] The experimental results on CIFAR, CIFAR10-DVS, and DVS128 Gesture are shown in Tab. 4. These four datasets are relatively small. We basically keep the experimental setup in [11, 12, 14] , including the network structure, training settings, etc., and details are given in the Appendix. C.1. SEMM has demonstrated stable performance improvements across various datasets when integrated SSA 4D 2 4RT N D 2 + 2 RT N 2 D EMSA (1 + 1/m)D 2 + (2d + m)D (1 + 1/m)RT N D 2 + (2d + m) RT N D + (D + md)RT N 2 MLP 8D 2 8RT N D 2 EMSP 8D 2 + 24D 8RT N D 2 +Module ablation. EMSA and EMSP together improve the performance of the baseline, as shown in Fig. 7 . The use of both EMSA and EMSP alone is better than baseline, illustrating their respective superiority.Experts number. We examine the utility brought by different numbers of experts of EMSA. The results of Spiking Transformer baselines on CIFAR are presented in Fig. 8 . It indicates that within a certain range of expert numbers, the results can still be competitive and robust. Among these, we select 4 experts as the parameter setting for our final application. 
conclusion: 
 In A global average-pooling (GAP) is utilized on the processed feature from the encoder and outputs the D-dimension feature which will be sent to the fully-connected-layer classification head (CH) to output the prediction Y . The architecture can be written as follows:EQUATIONEQUATIONEQUATIONEQUATIONEQUATIONEQUATIONEQUATIONFollowing the Spiking Experts Mixture Mechanism and Spike-driven Self-Attention (SDSA) used in Spike-driven Transformer, the EMSA can be written as:EQUATIONEQUATIONThe rest operate according to standard EMSA 18. The EMSP in Spike Driven Transformer is also much the same as the standard 22, except that no spiking neuron layer in the output layer. 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: Please see the codes in the supplementary material.Guidelines:• The answer NA means that paper does not include experiments requiring code. 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). 
broader impacts: 
 Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?Answer: [NA] Justification: Our work does not involve social 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). 
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: Our work does not release data or models with a high risk of misuse.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: We describe in Section C.1. 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. • 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: m , K, V is (D + md)R R T N 2 .The number of router matrix computation operations is m RT N D. Due to the sparsity of SEMM and the smaller data dimensions, the number of element-wise operations for the router and expert is negligible.The parameter number of W 1 , W R , W o are all (8//3)D 2 . The number of parameters for 3 × 3 depthwise convolution is 3 × 3 × (8//3)D = 24D. The all parameter number is 8D 2 + 24D. The operation number of W 1 , W R , W o are all (8//3)T N D 2 . The number of operations for depthwise convolution is 24 RT N D.Our experimental framework closely aligns with the methodology outlined in [11] . All of Baseline's code is publicly available, and we abide by their credentials. For the ImageNet-1K, we utilize a fixed timestep count of T = 4. The optimizer is the AdamW, with a batch size of 128 or 256 over the course of 310 training epochs. The learning rate is governed by a cosine-decay schedule, starting from an initial value of 0.0004. We incorporate a suite of standard data augmentation techniques, including random augmentation, mixup, and cutmix, into our training. For four small datasets, we adapt the SEMM to a variety of baseline models, following the precedents set by [11, 12] . For CIFAR, we maintain a timestep count of T = 4. For the neuromorphic datasets, we increase this to T = 10 and T = 16, respectively. Our experimental setup is consistent with each Spiking Transformer baselines, as detailed below.Spikformer with SEMM. The training epoch is set to 310 for CIFAR, 200 for DVS128 Gesture, and 106 for CIFAR10-DVS. The batch size is 128 for CIFAR, 16 for DVS128 Gesture and CIFAR10-DVS. The learning rate is initialized to 0.0005 for CIFAR10/100, 0.001 for DVS128 Gesture and CIFAR10-DVS. All of them are reduced with cosine decay. We follow [11] to apply data augmentation on DVS128 Gesture and CIFAR10-DVS. In addition, the network structures used in CIFAR-10, CIFAR10-DVS, and DVS128 Gesture are Spiking Transformer-4-384, Spiking Transformer-2-256 and Spiking Transformer-2-256.Spike Driven Transformer with SEMM. The training epoch is set to 210 for CIFAR10/100 datasets, 200 for DVS128 Gesture, and 106 for CIFAR10-DVS. The batch size is 32 for CIFAR10/100, 16 for DVS128 Gesture and CIFAR10-DVS. The learning rate is initialized to 0.0005 for CIFAR10/100, 0.0003 for DVS128 Gesture and 0.01 for CIFAR10-DVS. The rest is consistent with Spikformer.The training epoch is set to 410 for CIFAR10/100 datasets, 200 for DVS128 Gesture, and 106 for CIFAR10-DVS. The batch size is 64 for CIFAR10/100, 16 for DVS128 Gesture and CIFAR10-DVS. The learning rate is initialized to 0.0005 for CIFAR10/100, 0.1 for DVS128 Gesture and CIFAR10-DVS. The rest is consistent with Spikformer.In our experiments, we use 8 NVIDIA-4090 GPUs for ImageNet, and 1 NVIDIA-4090 GPU for other datasets. We adjust the value of membrane time constant τ in spike neuron when training models on DVS datasets. In direct training SNN models with surrogate function,EQUATIONWe select the Sigmoid function as the surrogate function with α = 4 in all experiments. The accuracy regarding different simulation time steps of the spiking neuron is shown in Tab. 5. At all the time steps, our Spiking Transformer with SEMM shows competitive performance. When the time step is 1, our Spikformer with SEMM is 1.7% lower than the network with T = 4 on CIFAR10, and our Spikformer with SEMM with 1 time step still achieves 74.67% on CIFAR100. The above results show that Spikformer with SEMM is robust under fewer time steps.In EMSP, the role of Deep Wise Convolution layer (DWC) is to independently extract features at the channel-level experts using a 3x3 receptive field, thereby enhancing representational capacity. The ablation study about DWC in Tab. 6 demonstrates its effectiveness. More dynamic allocation visualizations of the spiking router are given in Fig. 9 E Discussion on the Feasibility of Hardware Deployment for SEMM SEMM can theoretically be deployed on chips that are synchronous within layers and asynchronous between layers, such as TrueNorth [48] . Specifically, multiple spiking router matrices, i.e. {r 1 , r 2 , ..., r m }, can be implemented by one block (Linear-BatchNorm-SpikingNeuron), thus can be mapped to the one core of the neuromorphic chip for computation. Outputs from the same core are considered synchronous. The spiking Hadamard product and addition that occur in SEMM are analogous to the AND and ADD operations in SEW ResNet [7] . These element-wise spiking operations can be adapted on neuromorphics chips that support multiple branches and residuals, such as Speck V2 [49] . • 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. 


Decision: The reviewers found that this paper presents a novel, interesting idea in a clear way. There was less consensus on the merits of the empirical validation presented, but after following the discussion I am convinced that the authors provided sufficient evidence to make the paper a useful contribution to the conference.

From the discussion among the reviewers, one minor point emerged that the authors should take care to fix in the final version of the paper. The explanation given in Appendix B for EMSA's parameter count in Table 1 seems incorrect. This is easily checked by comparison with the code given as supplementary material (for instance in `Supplementary Material/ImageNet/models_spikformer_v1_moe.py`, lines 68-124). In appendix B,
1. the authors say that the the output layer needs $N^2$ parameters. This is incorrect: the output layer maps a mixture of the output of the experts, which lives in dimension $d$, to an output of dimension $D$; therefore it has $dD=D^2/m$ parameters.
2. the authors say that $K$, $V$, and $Q$ all need $dD=D^2/m$ parameters each. This is correct only for $K$ and $V$ (which are shared among all experts) but incorrect for $Q$. Each experts has an independent $Q$, each of which has $dD$ parameters, so the total number of parameters associated with $Q$ is $mdD=D^2$.

In practice, the two errors cancel each other out in the formula reported in Table 1, so the formula is correct, but the explanation in Appendix B should be fixed, and the main text should highlight the fact that $K$ and $V$ are shared among experts.

Reviews: review: paper_summary: paper_summary: This research introduces the Spiking Experts Mixture Mechanism (SEMM), a paradigm that combines Spiking Neural Networks (SNNs) with Mixture-of-Experts (MoE) to enhance the capabilities of Spiking Transformers. The proposed SEMM leverages the energy-efficient, sparse spiking activation characteristic of SNNs, resulting in an SNN-MoE framework that is both computation-efficient and SNN-compatible. By integrating SEMM into existing spiking Transformers, performance improvements are achieved. This work contributes to the exploration of high-performance and high-capacity Spiking Transformers.
strength_weakness: strength_weakness: **Major:**

1.	As mentioned in the first contribution (Line 68-69), the proposed SEMM is a universal SNN-MoE paradigm. Therefore the application of SEMM on the most state-of-the-art Spiking Transformers such as Spike-driven Transformer V2[R1] is crucial to establish the generalizability of SEMM. However, provided baselines do not include it, which weakens the persuasiveness of its generalizability. Moreover, SEMM-based Spiking Transformers underperform compared to [R1]'s peak results, suggesting MoE might not be essential for boosting performance. I would consider raising my rate if you can provide consistent performance improvements using SEMM on [1].
2.	Can you provide evidence or previous studies demonstrating the effectiveness of using DWConv after MLP.fc1? If such evidence exists, it should be cited; otherwise, conducting an ablation study on this layer is recommended. Without this clarification, the motivation behind adding this layer remains unclear, weakening the persuasiveness of SEMM's design applied to MLP.
3.	Is the ANN-MoE paradigm derived from prior ANN-MoE studies, or is it an original concept from your research? If it's based on earlier work, citations are necessary; otherwise, you should highlight the unique advantages of your proposed ANN-MoE paradigm compared to existing ones.

**Minor:**

1.	The description for Figure 3 is not clear enough. Given the explanation provided, I cannot fully understand the meaning of each line in the diagram.
2.	In Figure 4, do the four graphs in each sub-figure relate to four images from the same class?

References:

[R1] Man Yao, JiaKui Hu, Tianxiang Hu, Yifan Xu, Zhaokun Zhou, Yonghong Tian, Bo XU and Guoqi Li.  Spike-driven transformer v2: Meta spiking neural network architecture inspiring the design of next-generation neuromorphic chips. In International Conference on Learning Representations (ICLR), 2024.
questions: questions: See weakness
limitations: limitations: See weakness
paper_summary: paper_summary: The paper presents a novel integration of Spiking Neural Networks (SNNs) with Mixture-of-Experts (MoE) to form the Spiking Transformer, introducing the Spiking Experts Mixture Mechanism (SEMM). The SEMM enables dynamic sparse-conditional computation by having both experts and routers output spiking sequences, which aligns with the sparse and energy-efficient nature of SNNs. The proposed model incorporates two key components: Experts Mixture Spiking Attention (EMSA) for head-wise routing and Experts Mixture Spiking Perceptron (EMSP) for channel-wise allocation of spiking experts. Empirical evaluations demonstrate that SEMM improves performance on neuromorphic and static datasets with minimal additional computational overhead compared to traditional SNN-based transformers.
strength_weakness: strength_weakness: 1.The paper could benefit from more comprehensive empirical evaluations across diverse datasets to generalize the findings.

2.The lack of theoretical guarantees or analysis regarding the convergence and stability of SEMM leaves room for skepticism about its robustness.

3.A more detailed discussion on computational efficiency and scalability with respect to dataset size and complexity would be beneficial.
questions: questions: 1.Can the authors provide more empirical evidence demonstrating the effectiveness of SEMM on larger and more diverse datasets?
2.How does the proposed SEMM adapt to varying levels of sparsity in the input data, and what is the impact on computational efficiency?
limitations: limitations: 1.Generalizability: The experiments, though indicative of the SEMM's effectiveness, are limited to a specific subset of datasets. Extending the evaluation to include a wider variety of data, especially those with different characteristics and scales, would strengthen claims about the model's versatility and robustness.
2. Implementation Details for Reproducibility: Although the paper outlines the conceptual framework of SEMM, more explicit details on the implementation and the source code, such as hyperparameter tuning strategies and specifics of the spiking sequences' generation and handling, would facilitate reproducibility and foster further advancements built upon this work.
3. The novelty of the router mechanism for expert mixture is limited for the router mechanism seems have little difference with that in ANN MoE methods.
paper_summary: paper_summary: The authors introduce MOE into SNN, propose the SEMM structure, and use this structure to enhance the attention and MLP modules in the Spikeformer-like architecture. They transform these elements into the EMSA and EMSP modules. The new network architecture achieved better performance under similar parameter settings compared to the original spiking transformer structures.
strength_weakness: strength_weakness: 1. The authors claim that SEMM's advantage lies in its spike-driven characteristics and suitability for asynchronous chips. However, the author did not run the SEMM structure on real asynchronous hardware. In my opinion, due to the spike-driven nature of an asynchronous chip lacking a hardware clock, it is difficult for multiple spike matrices in the router part (in SEMM) to arrive simultaneously and interact, resulting in most outputs being 0. The author needs to provide a more detailed explanation of the spike-driven advantage, especially on asynchronous hardware.

2. Prior to Eqn. 14, the authors omitted the equation for partitioning the input X (how to get the $A_m$?).

3. In Eqn. 17, $BN(SEMM(E, R, F(·)))W_o$ undoubtedly involves floating-point matrix operations; is there a writing error present here?
questions: questions: 1. The SEMM(E, R, F(·)) obtained from Eqn. 16 is described as containing only 0 or 1. But it should be a floating-point matrix.

2. Line 217 What means “The ASR of EMSA is around 0.5, which is comparable to the regular TopK setting of ANN-MoE”? What's the relationship between the ASR in EMSA and the TopK rate in ANN-MoE?

3. What is the purpose of Fig. 6? In my view, different inputs leading to different activations are natural.
limitations: limitations: NA
paper_summary: paper_summary: The manuscript presents an innovative approach to integrating SNNs and MoE methodologies into a cohesive framework.  It introduces the Spiking Experts Mixture Mechanism (SEMM), which leverages the sparse spiking activations of SNNs and the conditional computation of MoE.  The proposed SEMM has been adapted into the Spiking Transformer architecture, resulting in two novel structures: the Experts Mixture Spiking Attention (EMSA) and the Experts Mixture Spiking Perceptron (EMSP). Experimental results are provided, showing SEMM's effectiveness in achieving stable improvements on neuromorphic and static datasets with manageable increases in computational overhead.
strength_weakness: strength_weakness: 1. Several Unclear Notations.
(1) In Fig.1 (b) and Line 132, the authors use the notation of $N$, but what does the $N$ denote? I cannot find explanations on this issue. Does $N$ denote the length of image patches?
(2) In Fig.2 (c), why does "DWL" stand for Depth-Wise Conv? I think it would be better to denote it as "DWC" or just explain it as Depth-Wise Linear.
(3) In Equation 24 and 26, what’s the meaning of $p$ and $q$?
Please clarify these notations.
2. The Section 4.3 is more like a sensitivity experiment of hyper-parameters rather than an ablation study. The real ablation study has been shown in Fig. 4. Please correct this issue to avoid misleading readers.
questions: questions: 1. Can you discuss the feasibility of adapting your proposed EMSA and EMSP modules to neuromorphic hardware? Are there any specific types of neuromorphic hardware or setups that are particularly well-suited or ill-suited for deploying SEMM? 
2. How does SEMM handle the trade-off between sparsity and accuracy?
limitations: limitations: While the authors indicate that the limitations are addressed in Section 5 (refer to Line 533 in the Checklist), it appears that this section does not currently include a discussion on the limitations.
Can you include a discussion on the limitations of the work?

Comments: title: Rebuttal by Authors
comments
Rebuttal by Authors
Good Rebuttal
comment: Dear Reviewer,
Thank you for your time and effort in reviewing our work. We will explain and discuss your concerns.

> ***Concern 1**: Explain the statement "SEMM has a variable sparsity when dealing with different data".*

**AW1**: Sorry for the confusion caused by the unclear statement. We intend to convey that SEMM exhibits variable sparsity when dealing with different data within the same dataset. As shown in Fig. 5,6, and Tab. 2, for different images, each expert's corresponding router selects a different number and position of tokens, while the overall low firing rate indicates the sparsity.

> ***Concern 2**: Show the final contributions or advantages of "sparse conditional computation".*

**AW2**: Similar to ANN-MoE mechanisms, the sparsity conditional computation characteristic of SEMM serves as the source of the performance improvement and computational efficiency achievement. Our experiments show that SEMM can bring stable performance improvements to SNN Transformers. 

In terms of computational efficiency, as shown in Tab.R2-3, SEMM results in a substantial reduction in both parameters and operations (OPs), approaching the level of the baseline when compared to the introduction of ANN-MoE mechanisms.

> ***Concern 3**: Evaluation on larger datasets.*

**AW3**: We apologize for not being able to provide results on larger datasets due to the resource constraints. We will add discussions on this issue in the Limitation.

> ***Concern 4**: Only the LIF neurons are not so strong to support the novelty of the proposed model.*

**AW4**: Unlike ANN-MoE, the spike-form routers and experts in SEMM, as well as their integration process, are all in line with the spike-driven characteristics of SNNs. At the same time, SEMM also achieves a similar effect of sparse conditional computation as ANN-MoE, thereby stably enhancing performance on SNN Transformers. In addition, the lightweight architectural design is also an advantage over ANN-MoE. As shown in various experiments, the number of parameters and the number of operations after introducing SEMM are close to the baselines, far less than that of ANN-MoE introduction.

Best regards

Authors
Thank you for your response and for supplementing the experiments with the time series dataset. However, there are still some concerns that remain unresolved:

1.The question regarding varying sparsity stems from the statement in your paper that "SEMM has a variable sparsity when dealing with different data" (Column 141, Page 4).

2.In Table R2-3, the parameter count and operations (OPs) do not appear to show significant advantages over the Spikformer baseline. In fact, the OPs of Spikformer SEMM are even higher than those of the Spikformer baseline. This raises doubts about the claimed advantage of "realizes sparse conditional computation" (as stated in the abstract). That is, what is the final contributions or  advantages of  " sparse conditional computation"? That still is confused.

3.The efficiency of the expert mixture system based on the Spiking Transformer has not been evaluated on larger datasets, which is a limitation that cannot be ignored. Models with expert mixture architectures typically demonstrate superior performance on larger datasets, so a broader evaluation would be necessary to support the high quality publication for  this conference.

4.There are also concerns regarding the novelty of the proposed approach. Specifically, the differences between the proposed model and existing ANN MoE methods beyond the LIF neurons are not so strong to support the nolvelty of the proposed model, as mentioned by other reviewers.
Dear Reviewer, 

Thank you again for your valuable time and feedback.

Best regards

Authors
Dear Reviewer, 

Thank you for your recognition of this work.

Best regards

Authors
Dear Reviewer,

We hope this message finds you well.
We have provided thorough responses to you and sincerely hope you can look through them and update the scores if your concerns have been resolved. We are also open to further discussion if the concerns have not been fully addressed. Please feel free to let us know if you still have any questions.

Best regards

Authors
Dear Reviewer,

Based on your suggestion, after overcoming significant challenges in resource allocation, we provide a performance report of using SEMM on the largest Meta-SDT-V2 model:
### Table R1-4
| Model | ImageNet（T=1） | ImageNet (T=4)|
| -------- |:--------:|:--------:|
| Meta-SDT-V2-55M DT  | 78.00    | 79.70    |
| Meta-SDT-V2-55M KD  | 79.10    | 80.00    |
| Meta-SDT-V2-54M with SEMM DT  | __79.94__      | __81.80__    |

Here, DT stands for Direct Training, while KD denotes Knowledge Distillation Assisted Training. SDT-V2-54M with SEMM DT shows an improvement of 2.10% over the direct training of the original model, and 1.80% higher than the knowledge distillation training of the original model.

SEMM can still achieve stable performance improvements on the largest Meta-SDT-V2 model while maintaining a similar number of model parameters, demonstrating its generalizability and effectiveness.

The logs, accuracy curves, specific code, and weights have been posted on an anonymous external link:
https://huggingface.co/SDTV2SEMM/Rebuttal-SDTV2-SEMM-55M

Best regards

Authors
Thank you for your response. 

To reiterate my previous comments, my primary concern is whether the proposed method is indispensable for enhancing the performance of Spiking Neural Networks (SNNs).  As confirmed by the authors, the paradigm is derived from previous works on MoE in ANNs [R1, R2], my perspective is unchanged: the significance of this paper hinges on “**verifying whether techniques developed for Artificial Neural Networks (ANNs) remain effective in the context of SNNs**”.  Therefore, the verification of the essentiality of the proposed method is crucial for the significance of this paper.  

For this reason, I had previously suggested that demonstrating an improvement over the state-of-the-art (SOTA) method [1] would be necessary. However, I find the authors' results unconvincing for the following reasons:
1. **Model Selection:** The authors chose the smallest model variant, which achieves a performance of 74.1%, whereas the best performance reported in [1] is 80.0% with the largest model.
2. **Experiment Setup:** For the selected model, the highest performance (74.1%) is achieved with 4 time steps. However, the authors used only 1 time step without providing a compelling rationale. This contrasts with their claim that their method is a "universal plug-and-play paradigm that can reliably improve performance". This is quite unacceptable to me. And I would decrease my rating due to the questionable results. 

Given the two-week time (including the author-review discussion period), I believe there is sufficient time for the authors to present more convincing results using the appropriate model that achieves the top performance of 80.0%.
I have thoroughly reviewed the authors' response, as well as their replies to the other reviewers. The authors have addressed my concerns, and I was pleasantly surprised to find that in their response to Reviewer RYQd, they mentioned applying SEMM to Spikformer, which notably improves time-series forecasting performance. This finding left a strong impression on me. In light of this, I have decided to raise my score.
Thanks for your response. All my concerns have been addressed.