All models

stspikformer_temporal_attention

A spiking transformer whose attention spans blocks of time steps as well as space, at spatial-only cost.

Spiking networks · 530 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (22 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
33K
Operations
530
Framework
PyTorch
Recurrent
No
Published
CVPR (arXiv 2024)
Cited by
26 (as of 9 October 2026)
Authors
Donghyun Lee, Yuhang Li, Youngeun Kim and others
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m12157
Graph hash
0e0aa458148e047e8be041f426b6915d2c44c3c157937f3c50833d7592818887
Skeleton hash
4cd0355833c577ee35690249fad8af76e6e3ab6f2ae8c3cc8fc4bd3a4276feba
Architecture hash
364578eac48b4b2e0851e13742ad8eaa947b075b8f5bec220c7ae0594a52cdf6
Diagram SHA-256
dd8f71f6c822d1c5379ad59f493ca374580458c53fe2112c663ede6984e77fae
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

STAtten, the Spiking Transformer with Spatial-Temporal Attention, is a spike-based transformer whose self-attention mixes information across time steps as well as across space. Spike-based transformers are pitched as an energy-efficient alternative to ANN transformers, getting their results through sparse binary computations. The authors' complaint is that existing spike-based transformers focus on spatial attention and neglect the temporal dependencies inherent in spike-based processing.

Their motivating analysis uses entropy: on CIFAR100, spatial-temporal attention gave lower entropy (4.85) and higher accuracy (79.9%) than the alternatives. Correlating every time step with every other would cost too much memory and, they argue, produce more dead neurons when distant time steps are paired. So STAtten partitions the temporal sequence into blocks of size B and computes attention within each block. With T = 4 and B = 2, time steps are grouped in pairs, [0,1] and [2,3]. Because the binary Q, K and V need no Softmax, the computations can be reordered freely. The resulting complexity stays at O(TND²), matching spatial-only attention while adding temporal dependencies.

The LIF neurons underneath fire a spike when the membrane potential exceeds the threshold Vth, after which the potential is reset to 0. STAtten is meant as a plug-and-play module, dropped into Spikformer, Spike-driven Transformer, SpikingReformer or QKFormer in place of their spatial-only attention. After the block-wise attention, the blocks are concatenated and passed through convolution and batch normalization layers. On sequential CIFAR10 and CIFAR100, adding STAtten to Spike-driven Transformer improves accuracy by 3.09% and 3.22%.

Key idea. STAtten is a block-wise spatial-temporal attention mechanism for spike-based transformers that keeps the original O(TND²) computational complexity.

  • STAtten
  • Spiking Transformer with Spatial-Temporal Attention
  • stspikformer
  • spiking transformer
  • spatial-temporal attention
  • spiking neural network
  • SNN
  • Spikformer
  • image classification

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{lee2025spikingtransformerspatialtemporalattention,
      title={Spiking Transformer with Spatial-Temporal Attention}, 
      author={Donghyun Lee and Yuhang Li and Youngeun Kim and Shiting Xiao and Priyadarshini Panda},
      year={2025},
      eprint={2409.19764},
      archivePrefix={arXiv},
      primaryClass={cs.NE},
      url={https://arxiv.org/abs/2409.19764}, 
}