Skip to main content
QUICK REVIEW

[Paper Review] Masked Spiking Transformer

Ziqing Wang, Yuetong Fang|arXiv (Cornell University)|Oct 3, 2022
Advanced Memory and Neural ComputingEngineering5 citations
TL;DR

This paper proposes the Masked Spiking Transformer (MST), a novel SNN architecture that leverages ANN-to-SNN conversion to achieve state-of-the-art performance in image classification. By introducing Random Spike Masking (RSM), the method prunes redundant spikes during inference, reducing power consumption by 26.8% at a 75% masking ratio without performance loss, demonstrating high energy efficiency and model robustness.

ABSTRACT

The combination of Spiking Neural Networks (SNNs) and Transformers has attracted significant attention due to their potential for high energy efficiency and high-performance nature. However, existing works on this topic typically rely on direct training, which can lead to suboptimal performance. To address this issue, we propose to leverage the benefits of the ANN-to-SNN conversion method to combine SNNs and Transformers, resulting in significantly improved performance over existing state-of-the-art SNN models. Furthermore, inspired by the quantal synaptic failures observed in the nervous system, which reduces the number of spikes transmitted across synapses, we introduce a novel Masked Spiking Transformer (MST) framework that incorporates a Random Spike Masking (RSM) method to prune redundant spikes and reduce energy consumption without sacrificing performance. Our experimental results demonstrate that the proposed MST model achieves a significant reduction of 26.8% in power consumption when the masking ratio is 75% while maintaining the same level of performance as the unmasked model.

Motivation & Objective

  • To close the performance gap between SNNs and ANNs in complex vision tasks like ImageNet classification.
  • To reduce energy consumption in SNNs without sacrificing accuracy, especially in Transformer-based architectures.
  • To explore the feasibility of applying the ANN-to-SNN conversion method to full self-attention mechanisms in SNNs.
  • To develop a general-purpose spike pruning method that maintains model performance while reducing redundant spike transmission.

Proposed method

  • The MST framework uses the ANN-to-SNN conversion method to convert a pre-trained artificial Transformer into a spiking version, preserving high accuracy.
  • Random Spike Masking (RSM) is applied during inference to randomly discard a fraction of input spikes, reducing spike count and energy use.
  • The RSM method is applied to both the self-attention and MLP modules in the Transformer blocks, targeting redundant spike activity.
  • Batch normalization (BN) layers replace layer normalization (LN) in the Transformer blocks to improve training stability and compatibility with SNNs.
  • The masking ratio is varied (0%, 50%, 75%) to evaluate trade-offs between energy savings and performance degradation.
  • The method is evaluated across multiple architectures, including Swin Transformer, ResNet18, and VGG16, demonstrating generalization beyond Transformers.

Experimental results

Research questions

  • RQ1Can the ANN-to-SNN conversion method be effectively applied to full self-attention mechanisms in Transformers to achieve high performance in SNNs?
  • RQ2To what extent can redundant spikes be pruned via random masking without degrading model accuracy in SNNs?
  • RQ3How does the Random Spike Masking (RSM) method affect power consumption and inference performance across different SNN architectures?
  • RQ4Can the RSM method be generalized beyond Transformers to other deep spiking networks like ResNet and VGG?
  • RQ5What is the optimal masking ratio that balances energy efficiency and model accuracy in spiking Transformer models?

Key findings

  • The Masked Spiking Transformer (MST) achieves top-1 accuracy improvements of 1.21%, 7.3%, and 3.7% over the previous SOTA SNN model on CIFAR-10, CIFAR-100, and ImageNet, respectively.
  • At a 75% masking ratio, the MST model reduces power consumption by 26.8% while maintaining the same accuracy as the unmasked model.
  • The RSM method reduces spike transmission by up to 74% in the MST model, demonstrating significant energy savings with no performance drop.
  • On ResNet18, the RSM method reduces power consumption by 30.1% at 75% masking, though with a 3.6% accuracy drop, indicating a trade-off at high masking levels.
  • Attention maps from the MST model show consistent focus on object-relevant regions across different masking ratios, confirming that critical information is preserved.
  • The RSM method generalizes effectively to non-Transformer SNNs, reducing power consumption in ResNet18 and VGG16 with moderate to significant energy savings.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.