When the Membrane Grid Is the Surrogate: Learning Membrane Bit-Widths in Spiking Networks

Spiking neural networks (SNNs) are networks whose neurons emit all-or-nothing pulses. Each neuron keeps a running internal voltage, called the membrane potential, and fires when that voltage crosses a threshold. Two things make these networks hard to compress well.

First, the firing rule is a step function, so its true gradient is zero almost everywhere. Training therefore substitutes a hand-picked smooth "surrogate" derivative in the backward pass. Second, on real hardware the membrane potential must be stored and rewritten at every time step. That makes it a major memory and data-traffic cost. PTQ4SNN measured roughly an 8x traffic reduction just from quantizing it. Today, choosing per-channel membrane precision is done only after training, with heuristic scores.

This note starts from a simple observation. Suppose a membrane potential is quantized to a grid of step size $\Delta$ with random rounding. Then the probability that a neuron fires, as a function of its unquantized voltage, is a linear ramp of width $\Delta$ around the threshold. The ramp's derivative is exactly the rectangular surrogate of width $\Delta$.

So in a network with quantized membranes, the surrogate gradient is not a free heuristic. It is the true gradient of the expected forward pass, and its width is set by the membrane bit-width. This lets us make membrane bit-widths trainable parameters that receive real gradients through the threshold. We can then optimize them end to end against a hardware cost that counts spike operations and membrane storage.

Core Claim

Coupling the surrogate width to the membrane quantization step, per channel, should do three things. It should give a differentiable, training-time allocation of membrane bits that beats post-training allocation at matched hardware cost. It should remove the need to separately tune a surrogate shape. And it should reveal which channels need precision for a principled reason: channels whose voltages crowd near threshold flip spikes under coarse rounding. A fixed, decoupled surrogate cannot see this effect.

Mechanism

Write the leaky integrate-and-fire update with a quantized carried state. The next voltage is $V[t] = \beta V_q[t-1] + I[t] - V_{th} s[t-1]$. Here $\beta$ is the leak factor, $I[t]$ the synaptic input, $V_{th}$ the threshold, and $V_q$ the membrane as stored at precision $b_c$ for channel $c$.

The step is $\Delta_c = R_c / 2^{b_c}$, where $R_c$ is a learned clipping range. Train with stochastic rounding, which is equivalent in distribution to adding uniform noise $u \sim U(-\Delta_c/2, \Delta_c/2)$ before the threshold. The expected spike is then

$$\mathbb{E}[s[t]] = \mathrm{clip}\!\left(\frac{V[t]-V_{th}}{\Delta_c} + \tfrac{1}{2},\, 0,\, 1\right),$$

This expression is differentiable in both $V[t]$ and $\Delta_c$. Its derivative in $V$ is $1/\Delta_c$ on the band $|V - V_{th}| < \Delta_c/2$ and zero elsewhere. Its derivative in $\Delta_c$ is nonzero exactly for voltages inside the band. As a result, the gradient on a channel's bit-width measures how much task loss depends on voltages that coarse rounding would push across threshold.

At high precision the band becomes tiny and gradients would vanish. To prevent this, we convolve with a small base surrogate of width $w_0$, shared across all channels. The effective width then grows smoothly with $\Delta_c$ instead of equalling it exactly. This base width is the one knob we must ablate honestly.

Bit-widths are relaxed to continuous values, following the fractional bit-widths of FracBits, which interpolates between neighbouring integer precisions. They are rounded to $\{2,4,8\}$ at the end. Weight bit-widths are learned the same way, using standard straight-through quantization.

The objective is task loss plus $\lambda$ times a hardware cost. The cost has two parts. The first is Bit-SynOps, defined in LitE-SNN as expected spike count times fan-out times weight bits. The second is membrane traffic, $\sum_c T \cdot b_c$ per inference, where $T$ is the number of time steps. Both parts are differentiable because the expected spike count is differentiable.

To avoid tuning $\lambda$ by hand, we enforce a target budget with a dual variable. This is the constrained formulation that Resource Constrained Model Compression via Minimax Optimization for Spiking Neural Networks used for sparsity; here it is applied to precision. ImageNet-scale training uses the spatial-only gradient of SLTT, which cut memory from 28.41 GB to 8.47 GB. Whether its assumption survives quantized recurrent state is itself something we check.

Relation to Prior Work

Three papers supply the gap. PTQ4SNN quantizes membranes to 2, 4, or 8 bits per channel, but it does so after training. Its importance score combines firing rate with measured perturbation loss. We instead learn the allocation during training, and our score comes from the gradient rather than from a heuristic.

LitE-SNN searches weight bits and time steps under a Bit-SynOps penalty. However, it leaves membranes at full precision and treats the surrogate as a fixed heuristic. We add membranes to the search space and tie the surrogate to their precision.

Hessian Aware Quantization of Spiking Neural Networks motivates the problem. It showed that layer sensitivity varies by orders of magnitude in a small SNN. Its allocation, though, is manual and covers weights only.

That line of work also warns us away from a design. With the piecewise-linear surrogates common in SNN training, second derivatives of the surrogate vanish. Curvature-based allocation in the style of HAWQ therefore measures properties of the chosen surrogate more than of the network. Our approach uses no second-order information for this reason.

The ANN methods Bayesian Bits and EdMIPS learn activation bit-widths with continuous relaxations. They have no threshold downstream of the quantized state, and so no analogue of the coupling we exploit. STBP reported that surrogate shape matters little for first-order training. That finding does not undercut us. Our claim is that surrogate width should be set by the precision, not that shape matters.

Research Program

We will build the coupled quantized neuron as a drop-in layer for SEW-ResNet and Spike-driven Transformer backbones. We will then train with learned per-channel weight and membrane bits under the dual-constrained budget. After training, we switch to deterministic rounding at integer bit-widths and measure the train-to-deploy gap. That gap is the most likely failure point.

The analysis has two parts. First, we test whether learned membrane bits correlate with the fraction of each channel's voltages that fall near threshold. Second, we test whether that correlation beats the firing-rate score PTQ4SNN uses. Energy estimates use the same simulated accounting style as prior work. We will not claim results on physical neuromorphic chips.

Baselines

The naive reference points are two. One is the full-precision SNN. The other is uniform W4/M4 quantization-aware training with a standard fixed-width rectangular surrogate. Both are trained with identical epochs, data augmentation, and time steps.

The strongest existing method is PTQ4SNN. It reports 75.16% ImageNet top-1 for SDT-8-768 at W4/M4, a 0.74% drop from floating point. It also reports a 1.00% drop on CIFAR10-DVS. We will rerun it on our own floating-point checkpoints so that all methods start from the same weights. To beat it, we must exceed its accuracy at equal or lower membrane traffic and Bit-SynOps. That requires sweeping our budget to trace a Pareto curve rather than reporting one point.

The second strong competitor is PTQ4SNN's allocation followed by quantization-aware fine-tuning at that fixed allocation. It gets the same number of fine-tuning epochs as our method's training after initialization. This separates the value of learning the allocation from the value of simply training after quantizing.

The third competitor is Bayesian Bits gates placed on SNN weights and membranes with a fixed surrogate. This is the obvious "combine prior methods" system.

For weight-only comparison at small scale, we use LitE-SNN as reported: 95.60% on CIFAR-10 at 3.6MB, and 94.14% on Google Speech Commands at 0.3MB with 37M Bit-SynOps.

The key ablation keeps everything identical, including the noise-injected forward pass and learned bits. The only change is that the surrogate width is frozen at a constant instead of tracking $\Delta_c$. If this ablation matches the full method, the central claim is false.

Why not just…?

Why not just use PTQ4SNN and stop? Post-training allocation cannot move weights to compensate for coarse membranes. WinQ documents that quantization degrades sharply below 4 bits, which is exactly where 2-bit membranes live. The file gives no PTQ4SNN results at aggressive 2-bit-heavy budgets. Our Pareto sweep will show whether the advantage appears only there, which is what we expect.

Why not just fine-tune after PTQ4SNN's allocation? This is the real threat. Much of the gain from end-to-end training may come from training at all, not from learning where bits go. The fixed-allocation fine-tuning baseline settles this directly. If it matches us, we will report that the allocation is not the bottleneck and redirect the work toward the surrogate coupling alone.

Why not just apply Bayesian Bits or EdMIPS with a standard surrogate? Such a system does give bit-width gradients. With a decoupled surrogate, however, the gradient on membrane precision ignores spike flips near threshold, because the surrogate does not depend on the quantization step. The frozen-width ablation and the Bayesian Bits baseline together test whether that blindness costs accuracy at matched budget.

Why not just use a uniform low-bit network? Twin Network Augmentation reached 72.03% on CIFAR-100 with uniform ternary weights. It does not quantize membranes, though. The per-layer sensitivity gaps found by Lui and Neftci suggest uniform membrane precision wastes bits. The uniform W4/M4 baseline tests this.

Proposed Experiments

Development starts on CIFAR-10, CIFAR-100, CIFAR10-DVS, and DVS128 Gesture with SEW-ResNet backbones. We then scale to ImageNet-1K with SDT-8-768 so we can compare directly with PTQ4SNN, and add Google Speech Commands for comparison with LitE-SNN. Metrics are top-1 accuracy, Bit-SynOps, membrane bits moved per inference, and model size. We report three seeds for the small datasets.

Four decisive checks follow. The first is the frozen-width ablation described above. The second is the gap between stochastic-rounding training accuracy and deterministic integer-bit inference accuracy; a gap above one point would undermine deployability. The third is whether learned membrane bits track near-threshold voltage mass better than firing rate does, measured by rank correlation with per-channel accuracy loss from ablating that channel's precision. The fourth is whether SLTT-style training on our quantized recurrent state matches full backpropagation through time on CIFAR10-DVS. If it does not, our ImageNet numbers must be read as a lower bound.