arXiv:2610.01403cs.AIOct 2026

Manuscript Offprint

arXiv:2610.01403

Contrastive Attention Mitigates Spectral Bias in Spiking Transformers

Xiaoli Liu, Malu Zhang, Yang Yang

Abstract

Spiking Transformers merge the energy-efficiency of spiking neural networks (SNNs) with the representational power of self-attention, creating a promising architecture for high-performance, energy-efficient computation. However, a performance gap persists versus its counterparts in artificial neural networks (ANNs). Unlike prior works attributing this to binary activations, we reveal that both spiking neurons and spiking self-attention (SSA) act as low-pass filters through multiscale spectral analysis. This characteristic leads to the dissipation of high-frequency components. To address this issue, we propose the Spiking Contrastive Attention (SCA) paradigm, which draw inspiration from the edge-detection and differential sensing properties of biological visual system. By extracting contrast prototypes via global contrastive aggregation and applying local differential refinement, SCA effectively enhances high-frequency information. Extensive experiments show that SCA is a general module that consistently boosts Spiking Transformers across image classification, semantic segmentation, and event-based tracking. Furthermore, it achieves lower complexity, offering superior efficiency over original SSA. These results establish its potential as a fundamental building block for energy-efficient Spiking Transformers.

1. Introduction

Spiking Neural Networks (SNNs) [16, 25] offer an energy-efficient alternative to Artificial Neural Networks (ANNs) [50, 65]. This efficiency derives primarily from spiking neurons that leverage spatiotemporal dynamics to mimic the computational principles of the human brain [25, 28]. Spiking neurons transmit information asynchronously [44] and consume energy only when receiving or emitting spikes, remaining silent otherwise. This binary activation mechanism allows SNNs to substitute the energy-intensive Multiply-Accumulate (MAC) operations [4, 43, 59] essential to ANNs.

(a)

Figure

(b)

Transformer Layers

(Spectral Bias Visualization)

High Frequency

Dissipation

Low Frequency Learning (shape, color, ...)

High Frequency Learning (feature, background, ...)

Figure 1. The description of spectral bias.

with simpler spike-based accumulation. Capitalizing on this energy efficiency, Spiking Transformers integrate the powerful Transformer architecture with SNN characteristics, garnering increasing research attention [51].

Currently, the primary obstacle for SNNs is the performance gap relative to ANNs [21]. Existing studies typically attribute this bottleneck to the quantization errors arising from binary spike communication [1, 12, 22]. Although strategies based on surrogate gradients [46] and improved spiking neurons [24] have mitigated these issues, the representational limitations of SNNs persist.

This work systematically investigates this issue via spectral analysis, identifying Spectral Bias [29, 32] as the critical factor limiting Spiking Transformers' performance. We analyze spiking neurons and three representative spiking self-attention (SSA) mechanisms, the results reveal that the SSA mechanism, relying on spiking neurons and softmax-free [49, 50, 65], is equivalent to a low-pass filter (as shown in Fig. 2). This inherent characteristic induces a strong spectral bias during training: the network prioritizes low-frequency components (e.g., contours and backgrounds) while suppressing

∗^{*}Corresponding author

(a) Vanilla Self-Attention (VSA)

Figure

(b) Spiking Self-Attention (SSA)

(c) Spike-driven Self-Attention (SDSA)

Dot product

Hadamard product

(d) Meta-SDSA

Column mask

Column summation

Spiking Neuron

Graph Shift Operator

VSA

Figure

SSA

SDSA

Meta-SDSA

(e) Relative Log Amplitudes of Fourier Transformed Feature Maps

Figure 2. (a) Vanilla Self-Attention (VSA). (b)-(d) Softmax-free Spiking Self-Attention (SSA, SDSA and Meta-SDSA). (e) Relative Logarithmic Amplitude of Fourier Transform Features.

ing high-frequency components (e.g., textures, edges, and fine structures), ultimately impairing the model’s capacity to capture fine visual features (as shown in Fig. 1).

To overcome this limitation, we propose Spiking Contrastive Attention (SCA), a two-stage attention mechanism inspired by the edge-detection and differential sensing property of biological visual system [11, 36]. In Stage I, SCA constructs complementary excitatory and inhibitory contrast prototypes from spatially compressed query features. These prototypes aggregate global key-value information through two parallel streams, whose responses are adaptively integrated by a differential membrane-potential fusion to generate a compact global contrast map. In Stage II, full-resolution query tokens interact with the contrast prototypes and the global contrast map through a second differential fusion, thereby refining local representations and emphasizing edge-related high-frequency information. By replacing quadratic token interactions with efficient interactions between N query tokens and n contrast prototypes ( n≪Nn \ll N), SCA effectively aggregates global context while reducing the complexity from O(TN2C)\mathcal{O}(TN^{2}C) to O(TNnC)\mathcal{O}(TNnC). The main contributions are summarized as follows:

• We presents theoretical analysis of Spiking Transformer in the frequency-domain perspective at both neuronal and architectural levels. We reveal that the spiking neuron and several representative spiking self-attention mechanisms exhibit low-pass characteristics, which leading to severe spectral bias.

• To address this issue, we propose Spiking Contrastive Attention (SCA), which inspired by the edge detection and differential perception property of biological visual system. This achieves efficient aggregation of global context, and enhancing the model’s ability to represent high-frequency information.

• Extensive experiments demonstrate that SCA achieves substantial performance improvements across diverse tasks, including image classification, semantic segmentation, and event-based tracking. These results establish its potential as a fundamental building block for Spiking Transformers.

References (58)