Skip to main content
QUICK REVIEW

[论文解读] Attention-free Spikformer: Mixing Spike Sequences with Simple Linear Transforms

Qingyu Wang, Duzhen Zhang|arXiv (Cornell University)|Aug 2, 2023
Advanced Memory and Neural ComputingEngineering被引用 3
一句话总结

本文提出无需注意力机制的Spikformer,用无参数的线性变换——傅里叶变换和小波变换——替代参数化的脉冲自注意力(SSA)模块,以实现脉冲序列混合。尽管去除了可学习参数,该方法在神经形态和静态数据集上仍达到SOTA或相当的准确率,训练速度提升29–51%,推理速度提升61–70%,内存占用降低4–26%。

ABSTRACT

By integrating the self-attention capability and the biological properties of Spiking Neural Networks (SNNs), Spikformer applies the flourishing Transformer architecture to SNNs design. It introduces a Spiking Self-Attention (SSA) module to mix sparse visual features using spike-form Query, Key, and Value, resulting in the State-Of-The-Art (SOTA) performance on numerous datasets compared to previous SNN-like frameworks. In this paper, we demonstrate that the Spikformer architecture can be accelerated by replacing the SSA with an unparameterized Linear Transform (LT) such as Fourier and Wavelet transforms. These transforms are utilized to mix spike sequences, reducing the quadratic time complexity to log-linear time complexity. They alternate between the frequency and time domains to extract sparse visual features, showcasing powerful performance and efficiency. We conduct extensive experiments on image classification using both neuromorphic and static datasets. The results indicate that compared to the SOTA Spikformer with SSA, Spikformer with LT achieves higher Top-1 accuracy on neuromorphic datasets (i.e., CIFAR10-DVS and DVS128 Gesture) and comparable Top-1 accuracy on static datasets (i.e., CIFAR-10 and CIFAR-100). Furthermore, Spikformer with LT achieves approximately 29-51% improvement in training speed, 61-70% improvement in inference speed, and reduces memory usage by 4-26% due to not requiring learnable parameters.

研究动机与目标

  • 探究更简单的无参数序列混合机制是否可替代Spikformer中复杂的脉冲自注意力(SSA)模块。
  • 在保持或提升性能的同时,将SSA的二次方时间复杂度($\mathcal{O}(N^2)$)降低至对数线性($\mathcal{O}(N\log N)$)。
  • 评估固定基变换(傅里叶变换与小波变换)在SNN中稀疏脉冲序列上的有效性。
  • 在不依赖可学习参数的前提下实现显著的计算效率提升,增强在神经形态硬件上的可部署性。

提出的方法

  • 用无参数的线性变换(具体为傅里叶变换(FT)和小波变换(WT))替代Spikformer中的脉冲自注意力(SSA)模块,以实现脉冲序列混合。
  • 采用FT和WT的一维与二维变体,在时间域或频域中对脉冲序列进行操作,实现无需可学习权重的高效特征混合。
  • 将变换应用于脉冲形式的Query、Key和Value张量,利用其固有的非负性和稀疏性,避免使用Softmax归一化。
  • 将线性变换模块作为SSA层的即插即用替代品,集成到Spikformer架构中,保持相同的模型深度和宽度。
  • 默认使用哈尔小波和标准FFT基函数,同时通过消融实验研究其他小波基函数的性能。
  • 在相同的超参数设置下,对神经形态数据集(CIFAR10-DVS、DVS128 Gesture)和静态数据集(CIFAR-10、CIFAR-100)进行训练和评估。

实验结果

研究问题

  • RQ1无参数的线性变换(如傅里叶变换和小波变换)是否能有效替代Spikformer中参数化的脉冲自注意力(SSA)模块,用于脉冲序列混合?
  • RQ2用线性变换替代SSA是否能在保持或提升模型准确率的同时降低计算复杂度,适用于神经形态和静态图像数据集?
  • RQ3在稀疏、二值化脉冲序列的背景下,固定基变换在多大程度上优于自适应注意力机制?
  • RQ4不同小波基函数对性能有何影响?基函数的选择是否对分类准确率有显著影响?
  • RQ5用线性变换替代SSA后,在训练和推理速度、内存占用及参数数量方面能获得多大的实际性能提升?

主要发现

  • 使用线性变换(LT)的Spikformer在CIFAR10-DVS上达到81.6%的Top-1准确率,超过原始Spikformer(SSA)的80.9%(原始结果)和79.7%(复现结果)。
  • 在DVS128 Gesture数据集上,采用1D-FFT的Spikformer比SOTA的Spikformer(SSA)高出0.8%的准确率,并优于使用浮点脉冲的TA-SNN。
  • 所提出的Spikformer与LT结合,由于无需可学习参数,内存使用量降低4–26%,在CIFAR-10和CIFAR-100上模型参数量减少25%。
  • 与原始Spikformer(SSA)相比,训练速度提升29–51%,推理速度提升61–70%,主要得益于FT和WT的对数线性复杂度。
  • 除哈尔小波外的其他小波基函数在CIFAR10-DVS和DVS128 Gesture上也表现出相当或更优的性能,表明对基函数选择具有鲁棒性。
  • 在神经形态数据集上的性能提升表明,固定基变换比自适应注意力更适合处理稀疏、事件驱动的脉冲序列。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。