BitShift-RoPE: Zero-FLOP Relative Positional Encoding for Spiking Neural Network Transformers
Seung-Kyu Hong ⋅ Sangheum Hwang ⋅ HYUK-YOON KWON
Abstract
Spiking Neural Networks (SNNs) provide energy-efficient computation by using binary, spike-driven additions, but applying transformer architectures remains challenging because SNNs lack an SNN-compatible positional encoding (PE). Current PE methods either rely on floating-point arithmetic, which destroys the fundamental binary nature of SNNs, or fail to accurately capture relative spatial distances. To overcome this, we introduce Bit Shift Rotary Position Embedding (BitShift-RoPE), a relative PE framework that preserves the binary integrity of SNN queries and keys. By replacing the floating-point trigonometric rotations in standard RoPE with discrete cyclic-shift operations via hardware memory-pointer routing, our method achieves zero-FLOP position encoding. We analytically map multi-scale exponential-decay frequencies to integer shift steps and theoretically extend the formulation to 2D orthogonal spaces to capture spatial structure. Crucially, because the binary integrity of the queries and keys is preserved, the subsequent attention calculations rely solely on sparse bitwise AND operations. Our evaluations across time-series forecasting ($R^2$ 0.758), text classification (Acc 69.91\%), and image classification benchmarks (Acc 84.17\%) demonstrate that BitShift-RoPE is consistently at least as good as existing SNN positional encodings while consuming the same energy as the vanilla SNN backbone (0.216 mJ/sample, identical to vanilla Spikformer). The code is available at \url{https://github.com/bigbases/Bit_Shift_RoPE}.
Successful Page Load