Introduction
Large Language Models (LLMs) have revolutionized artificial intelligence but remain computationally expensive, hindering deployment on edge devices. Spiking Neural Networks (SNNs) offer a biologically inspired, energy-efficient alternative by using discrete binary "spikes" for communication. However, SNNs face significant challenges in spatial redundancy and temporal latency. This paper introduces a novel framework to jointly optimize both dimensions for Spiking LLMs.
The Spatio-Temporal Bottleneck
SNNs typically suffer from two primary inefficiencies:
- Spatial Redundancy: A vast number of parameters and neurons may contribute minimally to the final output.
- Temporal Latency: SNNs process data over multiple timesteps. While more timesteps generally improve accuracy, they significantly increase latency and energy consumption.
Proposed Framework: Two-Stage Pruning
The researchers developed a comprehensive framework for SpikingBERT that operates in two distinct stages: post-training pruning and fine-tuning.
Stage 1: Post-Training Pruning
In the initial stage, the model undergoes spatial and temporal analysis without retraining. Spatial pruning utilizes the Fisher Information Matrix (FIM) and Average Spiking Rate (ASR) to identify and remove "lazy" neurons and attention heads that do not significantly impact the loss function. Simultaneously, temporal pruning employs Principal Component Analysis (PCA) to determine the optimal number of timesteps for each layer, assigning fewer steps to layers with simpler dynamics.
Stage 2: Fine-Tuning and Optimization
The second stage involves retraining the model with a computational cost penalty integrated into the loss function. This encourages the network to minimize accumulation operations (ACs) while maintaining accuracy. Key innovations in this stage include:
- Adaptive Thresholding: Neuron firing thresholds become learnable parameters, allowing the model to self-optimize its sparsity.
- Extreme Quantization: Weights are quantized to 1-bit using knowledge distillation from a full-precision teacher model.
- Sequential Retraining: The authors found that applying spatial pruning before temporal pruning yields superior results compared to simultaneous optimization, which often leads to suboptimal local minima.
- Stochastic Spike Generation: To manage memory during multi-timestep processing, the framework samples spikes based on the ASR of preceding layers, avoiding the need for massive spike histories.
Experimental Results
The framework was evaluated on the General Language Understanding Evaluation (GLUE) benchmark, including tasks such as MNLI, QNLI, and SST-2.
Latency and Efficiency
The results demonstrate a dramatic reduction in latency. For the MRPC dataset, the baseline of 110 timesteps was reduced to just 17.48 timesteps with minimal accuracy loss—a nearly 6x speedup. Computational efficiency also improved significantly; for example, the normalized compute factor for SST-2 dropped from 0.241 to 0.023.
Accuracy Retention
Despite the aggressive 1-bit quantization and pruning, the models maintained performance within 1-2% of the SpikingBERT baseline. In specific tasks like QQP, the pruned model even slightly outperformed the original.
Conclusion
This work presents the first framework to jointly explore spatial and temporal pruning for Spiking LLMs. By demonstrating that these two dimensions are synergistic, the researchers have paved the way for deploying high-performance language models on resource-constrained hardware. Future work will focus on extending this framework to decoder-only architectures and validating performance on physical neuromorphic hardware.
Summary updated