Skip to main content
QUICK REVIEW

[Paper Review] Tensor Decomposition Based Attention Module for Spiking Neural Networks

Haoyu Deng, Ruijie Zhu|arXiv (Cornell University)|Oct 23, 2023
Advanced Memory and Neural ComputingEngineering4 citations
TL;DR

This paper proposes the Projected Full Attention (PFA) module for spiking neural networks (SNNs) using tensor decomposition to enable efficient, low-rank, three-dimensional (temporal-channel-spatial) attention with linearly growing parameters. By leveraging CP decomposition and its inverse process via linear projection and attention map composition, PFA achieves state-of-the-art performance on static and dynamic SNN benchmarks with minimal computational overhead.

ABSTRACT

The attention mechanism has been proven to be an effective way to improve spiking neural network (SNN). However, based on the fact that the current SNN input data flow is split into tensors to process on GPUs, none of the previous works consider the properties of tensors to implement an attention module. This inspires us to rethink current SNN from the perspective of tensor-relevant theories. Using tensor decomposition, we design the extit{projected full attention} (PFA) module, which demonstrates excellent results with linearly growing parameters. Specifically, PFA is composed by the extit{linear projection of spike tensor} (LPST) module and extit{attention map composing} (AMC) module. In LPST, we start by compressing the original spike tensor into three projected tensors using a single property-preserving strategy with learnable parameters for each dimension. Then, in AMC, we exploit the inverse procedure of the tensor decomposition process to combine the three tensors into the attention map using a so-called connecting factor. To validate the effectiveness of the proposed PFA module, we integrate it into the widely used VGG and ResNet architectures for classification tasks. Our method achieves state-of-the-art performance on both static and dynamic benchmark datasets, surpassing the existing SNN models with Transformer-based and CNN-based backbones.

Motivation & Objective

  • To address the lack of tensor-aware attention mechanisms in existing SNNs, which typically treat event data as static tensors without exploiting tensor structure.
  • To design a lightweight attention module that maintains low parameter growth while enabling full attention across temporal, channel, and spatial dimensions.
  • To leverage tensor decomposition theory—specifically CP decomposition and its inverse—for efficient attention map generation in SNNs.
  • To provide a theoretically grounded, interpretable, and scalable attention mechanism compatible with neuromorphic computing and GPU-accelerated frameworks.

Proposed method

  • Proposes the Linear Projection of Spike Tensor (LPST) module to compress the input spike tensor into three lower-dimensional projected tensors using learnable, dimension-specific linear projections.
  • Introduces the Attention Map Composing (AMC) module that reconstructs the full attention map by reversing the CP decomposition process using a connecting factor.
  • Employs a rank selection criterion based on tensor rank analysis and dataset-specific properties to determine the optimal decomposition rank $ r $, ensuring performance and efficiency.
  • Uses Hadamard product to fuse the refined attention map with the original input tensor, enabling dynamic feature reweighting.
  • Applies the PFA module within VGG and ResNet architectures for end-to-end training on static (CIFAR10/100) and dynamic (CIFAR10DVS) datasets.
  • Employs a differentiable framework compatible with backpropagation, enabling end-to-end training of SNNs with attention.
Figure 3: The detailed workflow of PFA. The input tensor is first sent to Linear Projection of Spike Tensor (LPST) unit to generate three projections and split the three projections into corresponding vectors. In Attention Map Composing (AMC) unit, these vectors are composed into the final attention
Figure 3: The detailed workflow of PFA. The input tensor is first sent to Linear Projection of Spike Tensor (LPST) unit to generate three projections and split the three projections into corresponding vectors. In Attention Map Composing (AMC) unit, these vectors are composed into the final attention

Experimental results

Research questions

  • RQ1Can tensor decomposition be effectively leveraged to design a lightweight, parameter-efficient attention mechanism in spiking neural networks?
  • RQ2How does the rank of the input tensor and the choice of connecting factor $ r $ affect attention map quality and model performance in SNNs?
  • RQ3To what extent do temporal, channel, and spatial attention components contribute to classification accuracy in SNNs?
  • RQ4Can a tensor-based attention mechanism outperform existing Transformer- and CNN-based SNN models on both static and dynamic benchmark datasets?

Key findings

  • PFA achieves state-of-the-art performance on CIFAR10 (94.85% accuracy) and CIFAR100 (78.65% accuracy), surpassing existing SNN models with both Transformer- and CNN-based backbones.
  • The ablation study shows that removing attention from any of the three dimensions (temporal, channel, spatial) degrades performance, with spatial attention having the most significant impact (drop to 79.60% when ablated).
  • Inserting even a single PFA layer improves network accuracy, and performance increases monotonically with more PFA layers, indicating scalability and consistent benefit.
  • The attention map rank remains low even in sparse SNNs, revealing untapped optimization potential in sparse representations.
  • Visualization confirms that PFA learns meaningful attention distributions across all three dimensions, with spatial attention being most prominent, followed by temporal and channel dimensions.
  • The proposed rank selection criterion based on tensor rank and connecting factor analysis effectively predicts optimal $ r $, aligning with empirical performance.
Figure 8: Attention visualization on CIFAR10DVS dataset. Temporal and channel parts are taken from the deep layer of VGGSNN. The spatial layer visualizations are extracted from the shallow layer of the network due to the inherent complexity of the information contained in the deeper layers, which ma
Figure 8: Attention visualization on CIFAR10DVS dataset. Temporal and channel parts are taken from the deep layer of VGGSNN. The spatial layer visualizations are extracted from the shallow layer of the network due to the inherent complexity of the information contained in the deeper layers, which ma

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.