SpikeQ: Spike-Guided Post-Training Quantization for Spiking Neural Networks
Organizations: Monash University · National University of Singapore · Northeastern University
Abstract
On neuromorphic chips, spiking neural networks (SNNs) consume far less energy than artificial neural networks (ANNs), but the limited memory of these chips requires low-bit synaptic weights and membrane potentials. Existing post-training quantization (PTQ) methods provide them without retraining and, like those for ANNs, minimize numerical errors such as the mean squared error (MSE). In an SNN, however, a quantization error reaches later layers only through the spikes it flips. We find that errors of equal MSE can cause very different accuracy losses, whereas errors that flip the same fraction of spikes cause the same loss. We therefore propose SpikeQ, a spike-guided PTQ framework. For weights, we select the level of each weight by simulating the downstream neurons and minimizing their spike errors. For membrane potentials, most existing methods quantize the state after the reset, whereas neuromorphic chips compare the threshold with the membrane potential stored at a fixed bit width. We target this pre-fire quantization and build a reset-aware grid that places the threshold on a rounding boundary, so rounding never flips the spike at the current time step. We evaluate SpikeQ on seven benchmarks of image classification, semantic segmentation, and object detection. With 2-bit pre-fire membrane potentials, every existing grid collapses, whereas SpikeQ retains most of the full-precision accuracy. With both at 4 bits, the models stay within 2.59 points of full precision, shrink their memory footprint 7.8--7.9 times, and use 6.4--6.9 times less energy.
Figures & tables
| Method | CIFAR-10 | CIFAR-100 | ImageNet SEW-ResNet-18 | ImageNet SDT-8-384 | ||||
| W4 | W2 | W4 | W2 | W4 | W2 | W4 | W2 | |
| FP | 92.60 | 73.78 | 62.89 | 72.04 | ||||
| RTN | 92.25 | 17.59 | 70.97 | 1.00 | 36.21 | 0.10 | 40.79 | 0.12 |
| FlowQ [ 1 ] | 91.96 | 10.00 | 58.59 | 1.07 | 28.12 | 0.10 | 24.19 | 0.17 |
| GPTQ [ 9 ] | 92.09 | 89.53 | 71.48 | 50.49 | 61.59 | 13.90 | 68.65 | 4.42 |
| SBC [ 32 ] | 92.39 | 89.26 | 71.96 | 51.17 | 61.63 | 26.93 | 68.57 | 5.36 |
| Method | VOC 2012 | ADE20K | ||
| W4 | W2 | W4 | W2 | |
| FP | 70.86 | 34.91 | ||
| RTN | 68.23 | 3.49 | 32.07 | 0.12 |
| FlowQ [ 1 ] | 60.92 | 3.49 | 24.40 | 0.05 |
| GPTQ [ 9 ] | 70.64 | 52.83 | 34.46 | 16.42 |
| SBC [ 32 ] | 70.25 | 56.14 | 34.22 | 19.53 |
| Method | AP | AP 50 | ||
| W4 | W2 | W4 | W2 | |
| FP | 31.38 | 50.86 | ||
| RTN | 22.59 | 0.00 | 44.57 | 0.00 |
| FlowQ [ 1 ] | 12.98 | 0.00 | 30.40 | 0.00 |
| GPTQ [ 9 ] | 29.97 | 7.32 | 50.25 | 15.67 |
| SBC [ 32 ] | 30.03 | 10.02 | 50.16 | 20.12 |
| Method | CIFAR-10 | CIFAR-100 | ||
| V4 | V2 | V4 | V2 | |
| FP | 92.60 | 73.78 | ||
| MinMax [ 13 ] | 68.99/91.92 | 10.00/20.78 | 43.32/72.76 | 0.78/16.00 |
| MSE [ 26 ] | 81.61/92.47 | 10.00/91.10 | 69.62/73.53 | 1.00/56.27 |
| FlowQ-M [ 1 ] | 91.50/92.51 | 10.00/92.26 | 66.69/ 73.91 | 1.00/71.56 |
| SQUAT [ 35 ] | 92.06/92.37 | 10.01/90.27 | 71.00 /73.88 | 1.00/66.52 |
| Method | VOC 2012 | ADE20K | ||
| V4 | V2 | V4 | V2 | |
| FP | 70.86 | 34.91 | ||
| MinMax [ 13 ] | 0.05/62.40 | 3.49/50.10 | 0.17/24.87 | 0.12/15.84 |
| MSE [ 26 ] | 3.49/69.10 | 3.49/41.22 | 0.27/33.62 | 0.12/24.01 |
| FlowQ-M [ 1 ] | 16.88/70.29 | 3.49/68.52 | 11.07/34.02 | 0.12/33.41 |
| SQUAT [ 35 ] | 2.91/70.61 | 0.20/61.47 | 1.59/ 34.72 | 0.13/31.69 |
| Method | V4 | V2 |
| FP | 31.38 | |
| MinMax [ 13 ] | 0.79/30.97 | 0.00/26.35 |
| MSE [ 26 ] | 0.27/31.03 | 0.00/27.84 |
| FlowQ-M [ 1 ] | 28.41/31.20 | 0.13/30.84 |
| SQUAT [ 35 ] | 20.30/31.36 | 0.00/30.60 |
| PTQ4SNN-M † [ 40 ] | 28.54/31.27 | 0.32/ 31.28 |
| Setting | CIFAR | ImageNet | VOC | ADE 20K | COCO | ||
| 10 | 100 | SEW | SDT | ||||
| FP | 92.60 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 73.78 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 62.89 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 72.04 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 70.86 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 34.91 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 31.38 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} |
| W4 | 92.38 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 73.27 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 61.91 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 70.33 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 70.36 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 34.40 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 29.92 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} |
| W4V4 | 92.41 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 73.11 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 60.30 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 70.49 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 70.32 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 34.12 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 29.80 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} |
| W2 | 90.28 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 65.72 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 43.70 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 45.76 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 65.74 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 29.32 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 21.30 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} |
| W2V2 | 88.50 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 57.49 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 15.85 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 36.83 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 63.00 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 27.18 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} | 21.26 {}_{\mbox{{\color[rgb]{0.55,0.55,0.55}}}} |
| Variant | CIFAR | ImageNet | |||
| 10 | 100 | SEW | SDT | ||
| W2 | SpikeQ (Ours) | 90.28 | 65.72 | 43.70 | 45.76 |
| w/o | 89.86 −0.42 | 64.00 −1.72 | 40.25 −3.45 | 40.47 −5.29 | |
| w/o | 90.28 0.00 | 65.30 −0.42 | 42.26 −1.44 | 44.88 −0.88 | |
| Pre V2 | SpikeQ (Ours) | 91.36 | 68.60 | 48.32 | 67.87 |
| w/o anchoring | 83.32 −8.04 | 44.92 −23.68 | 0.96 −47.36 | 17.26 −50.61 | |
| W3 | CIFAR | ImageNet | VOC 2012 | ADE20K | COCO | |||
| 10 | 100 | SEW | SDT | AP | AP 50 | |||
| FP | 92.60 | 73.78 | 62.89 | 72.04 | 70.86 | 34.91 | 31.38 | 50.86 |
| RTN | 90.37 | 42.91 | 0.94 | 0.40 | 56.40 | 23.75 | 5.72 | 15.16 |
| FlowQ [ 1 ] | 85.39 | 30.23 | 0.20 | 1.55 | 9.24 | 2.28 | 0.48 | 1.31 |
| GPTQ [ 9 ] | 91.81 | 69.28 | 57.20 | 57.96 | 69.69 | 32.88 | 26.20 | 48.12 |
| SBC [ 32 ] | 91.94 | 69.34 | 57.20 | 58.31 | 69.85 | 32.96 | 26.83 | 48.22 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Operation | Energy (pJ) |
| synaptic addition, 32 bits (floating point) | 0.900 | |
| synaptic addition, 4 bits | 0.0502 | |
| synaptic addition, 2 bits | 0.0477 | |
| weight read, per bit | 0.0985 | |
| spike transmission | 0.180 | |
| membrane update, comparison, or reset, bits |
| Benchmark | Setting | FR (%) | Energy ( J) | Reduction ( ) | Share of EC (%) | Size (MB) | ||||||
| Compute | Memory | Neuron | EC | Memory | Non-spiking | Weights | Membrane | Footprint | ||||
| CIFAR-10 PreAct-ResNet-18 | FP | 20.55 | 331 | 1,227 | 2.42 | 1,560 | 78.6 | 1.9 | 42.6 | 2.13 | 44.8 | |
| W4 | 20.50 | 18.4 | 211 | 2.42 | 231 | 6.75 | 91.0 | 1.9 | 5.39 | 2.13 | 7.52 | |
| V4 | 20.51 | 330 | 1,223 | 0.14 | 1,554 | 1.00 | 78.7 | 1.9 | 42.6 | 0.266 | 42.9 | |
| W4V4 | 20.46 | 18.4 | 210 | 0.14 | 228 | 6.83 | 91.9 | 1.9 | 5.39 | 0.266 | 5.66 | |
| W2 | 20.27 | 17.3 | 136 | 2.42 | 156 | 10.00 | 87.4 | 1.9 | 2.73 | 2.13 | 4.86 | |
Spiking Neural Networks
Spiking neural networks process information through discrete, time-dependent neural events, aiming for efficient computation and biologically inspired learning.
See all 336 papers