Toward Relative Positional Encoding in Spiking Transformers
Changze Lv, Yansen Wang, Dongqi Han, Yifei Shen, Xiaoqing Zheng, Xuanjing Huang, Dongsheng Li

TL;DR
This paper introduces novel relative positional encoding strategies for spiking Transformers, improving their ability to model sequences and images while maintaining binary spike properties, and demonstrates their effectiveness across multiple tasks.
Contribution
The paper proposes Gray-PE and Log-PE methods for relative positional encoding in spiking Transformers, extending them to 2D for image processing, and validates their performance improvements.
Findings
Gray-PE maintains constant Hamming distance for positional indices differing by powers of two.
Log-PE integrates logarithmic relative distances into attention maps.
RPE methods enhance performance in time series, text, and image classification tasks.
Abstract
Spiking neural networks (SNNs) are bio-inspired networks that mimic how neurons in the brain communicate through discrete spikes, which have great potential in various tasks due to their energy efficiency and temporal processing capabilities. SNNs with self-attention mechanisms (spiking Transformers) have recently shown great advancements in various tasks, and inspired by traditional Transformers, several studies have demonstrated that spiking absolute positional encoding can help capture sequential relationships for input data, enhancing the capabilities of spiking Transformers for tasks such as sequential modeling and image classification. However, how to incorporate relative positional information into SNNs remains a challenge. In this paper, we introduce several strategies to approximate relative positional encoding in spiking Transformers while preserving the binary nature of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsRobotics and Automated Systems
MethodsSoftmax · Attention Is All You Need
