Elastic Spiking Transformers for Efficient Gesture Understanding

Alberto Ancilotto, Gianluca Amprimo, Stefano Di Carlo, Elisabetta FarellaarXiv 2026

TL;DR

NESTformer introduces the first runtime-adaptive ("elastic") Spiking Neural Network (SNN) transformer that can dynamically scale its parameter footprint and energy consumption during inference without retraining. By redesigning attention to be row-wise and native to neuromorphic hardware, it eliminates the need for power-hungry CPU offloading while achieving state-of-the-art accuracy in gesture recognition.

What Problem Does This Paper Address?

Spiking Neural Networks (SNNs) combined with event-based cameras are ideal for low-power edge applications like clinical gesture recognition because they process data using sparse, energy-efficient "spikes." However, current Spiking Transformers are structurally rigid: they are trained as static networks with fixed sizes. If a deployment target changes or has strict hardware constraints, developers must scale and retrain an entirely new model from scratch.

Furthermore, existing spiking transformers rely on global operations like Batched Matrix Multiplication (BMM) to compute attention maps. True neuromorphic chips (such as Intel Loihi or SpiNNaker) cannot execute these global operations natively because they lack global memory, forcing the workload to be offloaded to a power-hungry support CPU. Finally, standard scaling approaches fail to scale energy down linearly because the input patch embedding stage generates a massive, non-scalable bottleneck of spikes.

Methods

The authors introduce NESTformer (Neuromorphic Elastic Spiking Transformer), which incorporates Matryoshka-style nested elasticity across three core building blocks. This allows a single trained "universal" model to be dynamically sliced into four granularities ($g0$ to $g3$) at runtime without retraining:

  1. Elastic Spiking MLP: Uses log-spaced variable hidden dimensions ($64 \rightarrow 160 \rightarrow 416 \rightarrow 1024$) to dynamically adjust parameter counts and compute requirements.
  2. Elastic Spiking Attention: Slices the Query, Key, and Value tensors to dynamically adjust the active head count ($4 \rightarrow 8 \rightarrow 16 \rightarrow 32$).
  3. Spiking Row-wise Attention: To make the attention mechanism neuromorphic-native, the authors replace global matrix multiplications with a row-wise formulation. This decomposes the operation into a sequence of two local Leaky Integrate-and-Fire (LIF) operations, allowing it to run entirely on neuromorphic hardware without CPU intervention.
  4. Elastic Patch Embedding (XiSPS): A novel feature extractor that uses a tunable compression factor to scale down the number of spikes generated at the input stage, fixing the sub-linear energy savings bottleneck of prior models.
Fig. 1: Proposed NESTformer modules.
Fig. 2: Proposed spiking row-wise attention module

To train this elastic architecture efficiently, the authors utilize a biased stochastic sampling strategy during training (shifting updates toward larger configurations to ensure full parameter coverage) combined with static tensor shapes and binary masking to avoid the overhead of dynamic graph recompilation.

Datasets

The model was evaluated across several diverse benchmarks:

  • EHWGesture: A clinical gesture understanding dataset containing 9,708 samples across 11 classes, used as the primary benchmark for both gesture recognition and action quality assessment (AQA).
  • DVS128 Gesture & CIFAR10-DVS: Standard neuromorphic event-based datasets.
  • CIFAR-10 & CIFAR-100: Standard static image datasets used to demonstrate the model's generalization capabilities to frame-based data.

Key Insights and Ideas

  • Elasticity Lowers Firing Rates Directly: In standard artificial neural networks (ANNs), reducing network width only reduces parameter counts and MAC operations. In SNNs, reducing the number of active neurons directly lowers the total spike firing rate, leading to a true linear reduction in hardware energy consumption.
  • The Patch Embedding Bottleneck: The authors discovered that standard spiking transformers fail to save energy when scaled down because the input patch embedding stage dominates spike generation and remains fixed. NESTformer's elastic patch embedding solves this by scaling the input stage alongside the rest of the network.
  • Train Parallel, Deploy Sequential: The row-wise attention mechanism is mathematically equivalent to standard parallel attention. This allows developers to train the model efficiently on GPUs using parallel matrix operations, then seamlessly convert it to a sequential row-wise format for neuromorphic deployment.

Key Results

  • State-of-the-Art Accuracy: On the EHWGesture dataset, NESTformer ($g3$) achieved a peak accuracy of 75.98%, outperforming the strongest fixed baseline (QKFormer at 75.28%) and efficient CNNs like PhiNet (71.25%).
  • Massive Energy Savings: NESTformer ($g3$) consumes only 46.1 $\mu$J per inference—less than half of QKFormer's 100.9 $\mu$J. Slicing down to the ultra-low-power $g0$ configuration drops energy consumption to a mere 13.3 $\mu$J while maintaining a highly competitive 71.01% accuracy.
  • Generalization: On DVS128 Gesture, NESTformer matched the peak accuracy of Spike-Driven Transformer (99.30%) while using up to 60% less energy than other state-of-the-art architectures. On static CIFAR-100, it set a new state-of-the-art among spiking transformers at 81.30% accuracy.

Limitations and Future Work

  • GPU Slowdown during Simulation: The row-wise attention mechanism causes a 2.6× to 10.2× slowdown when simulated on standard GPUs due to the loss of Basic Linear Algebra Subprograms (BLAS) parallelization. While this does not impact native neuromorphic deployment, it increases simulation and evaluation times on traditional hardware.
  • Increased Training Steps: Training a single universal model to handle multiple granularities requires a more complex sampling strategy and roughly 50% more training steps to achieve convergence across all sub-networks compared to a single-size network.

Summary updated

BibTeX
@misc{ancilotto2026elastic,
  author = {Alberto Ancilotto and Gianluca Amprimo and Stefano Di Carlo and Elisabetta Farella},
  title = {{Elastic Spiking Transformers for Efficient Gesture Understanding}},
  year = {2026},
  eprint = {2605.13869},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.13869},
}
Figure