All models

meta_spikeformer_8_384

A vision transformer whose attention runs on binary spikes, with no softmax and no multiplications.

Spiking networks · 2,483 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

This diagram has 2,483 operations (64 KB) and is drawn when you ask.

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
16.8M
Operations
2,483
Framework
PyTorch
Recurrent
No
Published
ICLR (arXiv 2022)
Cited by
692 (as of 29 November 2026)
Authors
Zhaokun Zhou, Yuesheng Zhu, Chao He 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
m11987
Graph hash
fd4fd4fcaf02bf346de4daa92c872a6a4f4d786a5a223b729c58416a2e9e91a6
Skeleton hash
5c3608db7f8ee46687d96eac7031308e99a7635ace94f4bf9133f36bcd219d9e
Architecture hash
73967a3d0d51bd7838ff026d830d3c921cd0d5bdf304c090a9db8ad074284c12
Diagram SHA-256
ed15d5b74fab7ae0d327a480ada6d64dcadae89f6ff8eb068d0d03afb76167ba
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

An ImageNet-sized build with 8 encoder blocks and a 384-wide embedding; the paper's Spikformer-8-384 has 16.81M parameters and 70.24% top-1 accuracy on ImageNet.

Spikformer, the Spiking Transformer, brings self-attention into spiking neural networks, where information travels as binary spikes rather than floating-point activations. The authors frame it as a marriage of two biologically plausible structures: the energy-efficient, event-driven SNN and the self-attention mechanism that lets Transformers capture feature dependencies. The paper claims this is the first time self-attention and a Transformer have been implemented in SNNs.

The core is Spiking Self Attention (SSA), which models sparse visual features using spike-form Query, Key and Value without softmax. Softmax is unnecessary because an attention map computed from spike-form Query and Key is naturally non-negative, which already ignores irrelevant features. With everything in spikes, the matrix products reduce to logical AND operations and additions, so SSA avoids multiplications and has low computational energy consumption. Because there is no softmax, the calculation order is also changeable, and computing Key times Value first is cheaper when the sequence length exceeds the per-head dimension.

The network itself is a spiking patch splitting module (SPS), a stack of Spikformer encoder blocks and a linear classification head, and it uses batch normalization because the authors found layer normalization does not apply to SNNs. Each SPS block applies a convolution to inject inductive bias, LIF spike neurons are used throughout, and position information comes from a conditional position embedding generator that produces spike-form relative position embeddings. Unlike a standard ViT, Dropout and Droppath are not applied.

The captured members span the paper's CIFAR, CIFAR10-DVS and ImageNet configurations, named by block count and embedding width in the Spikformer-L-D convention. On ImageNet, Spikformer-8-768 reaches 74.81% top-1 accuracy with 4 time steps, which the paper reports as state of the art among directly trained SNNs.

Key idea. Spikformer introduces Spiking Self Attention, a softmax-free attention over spike-form Query, Key and Value that needs only AND operations and additions, and builds the first directly trained spiking Transformer on top of it.

  • spikformer
  • spiking transformer
  • spiking self attention
  • ssa
  • spiking neural network
  • snn
  • spiking vision transformer
  • lif
  • neuromorphic
  • cifar10-dvs
  • dvs128 gesture
  • imagenet

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

Cite the paper

@misc{zhou2022spikformerspikingneuralnetwork,
      title={Spikformer: When Spiking Neural Network Meets Transformer}, 
      author={Zhaokun Zhou and Yuesheng Zhu and Chao He and Yaowei Wang and Shuicheng Yan and Yonghong Tian and Li Yuan},
      year={2022},
      eprint={2209.15425},
      archivePrefix={arXiv},
      primaryClass={cs.NE},
      url={https://arxiv.org/abs/2209.15425}, 
}