Positional Encoding for Spiking Transformers

Zijian Zhou, Yu Liang, Honglin Cao, Ammar Belatreche, Jieyuan Zhang, Wenjie Wei, Shuai Wang, Malu Zhang, Yang Yang, Haizhou Li
Proceedings of the 43rd International Conference on Machine Learning, PMLR 306:165320-165338, 2026.

Abstract

Transformer-based Spiking Neural Networks (SNNs) have recently emerged as a promising paradigm to sequential modeling, combining the strong representational capabilities of Transformers with the sparse spike-driven computation of SNNs. Within such position-agnostic architectures, positional encoding is critical for injecting order information, allowing the model to distinguish token positions, capture sequential dependencies, and represent relative relationships among tokens. However, existing positional encoding methods for SNNs are largely inherited from ANNs and, in doing so, undermine the spike-driven computational properties that are central to spiking transformers. To address this limitation, we propose the Spiking Positional Encoding (SPE), a method designed specifically for Spiking Transformers, aimed at encoding relative positional information while preserving both spike-driven computation and the linear complexity of spiking self-attention. The core component of SPE is the Positional Encoding Leaky Integrate-and-Fire (PE-LIF) neuron, which incorporates position-dependent signals into neuronal thresholds and implicitly propagates this information through spike trains via continuous firing and membrane potential reset dynamics. Extensive experiments on thirteen NLP benchmarks demonstrate that SPE consistently outperforms existing SNN positional encoding methods, strengthens the sequence modeling capability, and improves energy efficiency without introducing additional trainable parameters. Code is available at https://github.com/CayleyZ/SPE.

Cite this Paper


BibTeX
@InProceedings{pmlr-v306-zhou26ab, title = {Positional Encoding for Spiking Transformers}, author = {Zhou, Zijian and Liang, Yu and Cao, Honglin and Belatreche, Ammar and Zhang, Jieyuan and Wei, Wenjie and Wang, Shuai and Zhang, Malu and Yang, Yang and Li, Haizhou}, booktitle = {Proceedings of the 43rd International Conference on Machine Learning}, pages = {165320--165338}, year = {2026}, editor = {Zhang, Tong and Dudik, Miroslav and Jaggi, Martin and Agarwal, Alekh and Li, Sharon and Schuurmans, Dale and Zhu, Jerry and Berkenkamp, Felix and Dong, Hanze and Bietti, Alberto}, volume = {306}, series = {Proceedings of Machine Learning Research}, month = {06--11 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v306/main/assets/zhou26ab/zhou26ab.pdf}, url = {https://proceedings.mlr.press/v306/zhou26ab.html}, abstract = {Transformer-based Spiking Neural Networks (SNNs) have recently emerged as a promising paradigm to sequential modeling, combining the strong representational capabilities of Transformers with the sparse spike-driven computation of SNNs. Within such position-agnostic architectures, positional encoding is critical for injecting order information, allowing the model to distinguish token positions, capture sequential dependencies, and represent relative relationships among tokens. However, existing positional encoding methods for SNNs are largely inherited from ANNs and, in doing so, undermine the spike-driven computational properties that are central to spiking transformers. To address this limitation, we propose the Spiking Positional Encoding (SPE), a method designed specifically for Spiking Transformers, aimed at encoding relative positional information while preserving both spike-driven computation and the linear complexity of spiking self-attention. The core component of SPE is the Positional Encoding Leaky Integrate-and-Fire (PE-LIF) neuron, which incorporates position-dependent signals into neuronal thresholds and implicitly propagates this information through spike trains via continuous firing and membrane potential reset dynamics. Extensive experiments on thirteen NLP benchmarks demonstrate that SPE consistently outperforms existing SNN positional encoding methods, strengthens the sequence modeling capability, and improves energy efficiency without introducing additional trainable parameters. Code is available at https://github.com/CayleyZ/SPE.} }
Endnote
%0 Conference Paper %T Positional Encoding for Spiking Transformers %A Zijian Zhou %A Yu Liang %A Honglin Cao %A Ammar Belatreche %A Jieyuan Zhang %A Wenjie Wei %A Shuai Wang %A Malu Zhang %A Yang Yang %A Haizhou Li %B Proceedings of the 43rd International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2026 %E Tong Zhang %E Miroslav Dudik %E Martin Jaggi %E Alekh Agarwal %E Sharon Li %E Dale Schuurmans %E Jerry Zhu %E Felix Berkenkamp %E Hanze Dong %E Alberto Bietti %F pmlr-v306-zhou26ab %I PMLR %P 165320--165338 %U https://proceedings.mlr.press/v306/zhou26ab.html %V 306 %X Transformer-based Spiking Neural Networks (SNNs) have recently emerged as a promising paradigm to sequential modeling, combining the strong representational capabilities of Transformers with the sparse spike-driven computation of SNNs. Within such position-agnostic architectures, positional encoding is critical for injecting order information, allowing the model to distinguish token positions, capture sequential dependencies, and represent relative relationships among tokens. However, existing positional encoding methods for SNNs are largely inherited from ANNs and, in doing so, undermine the spike-driven computational properties that are central to spiking transformers. To address this limitation, we propose the Spiking Positional Encoding (SPE), a method designed specifically for Spiking Transformers, aimed at encoding relative positional information while preserving both spike-driven computation and the linear complexity of spiking self-attention. The core component of SPE is the Positional Encoding Leaky Integrate-and-Fire (PE-LIF) neuron, which incorporates position-dependent signals into neuronal thresholds and implicitly propagates this information through spike trains via continuous firing and membrane potential reset dynamics. Extensive experiments on thirteen NLP benchmarks demonstrate that SPE consistently outperforms existing SNN positional encoding methods, strengthens the sequence modeling capability, and improves energy efficiency without introducing additional trainable parameters. Code is available at https://github.com/CayleyZ/SPE.
APA
Zhou, Z., Liang, Y., Cao, H., Belatreche, A., Zhang, J., Wei, W., Wang, S., Zhang, M., Yang, Y. & Li, H.. (2026). Positional Encoding for Spiking Transformers. Proceedings of the 43rd International Conference on Machine Learning, in Proceedings of Machine Learning Research 306:165320-165338 Available from https://proceedings.mlr.press/v306/zhou26ab.html.

Related Material