Spending Bits Where Spikes Flip: Mixed Precision for Multiplication-Free Attention

Spiking Transformers replace the expensive multiplications of ordinary attention with additions. Their activations are binary "spikes" (0 or 1), so multiplying by an activation reduces to either adding a number or skipping it. That makes them attractive for low-power chips. Their weights still take up memory, though, and when those weights are compressed to very few bits, accuracy collapses unevenly. Experiments on the Quantized Spike-driven Transformer show the attention block degrading far faster than the rest of the network. Yet that work, BESTformer, and SpikingBERT all assign the same bit-width to every layer.

The standard fix in ordinary networks is mixed precision: rank layers by how sensitive the loss is to perturbing them, then give more bits to the fragile ones. The usual ranking signal is loss curvature, as in HAWQ. That signal assumes a smooth loss surface. In a spiking network, quantization error does damage mainly by pushing a neuron's internal voltage across its firing threshold, which flips a spike on or off. We propose to measure sensitivity by counting and pricing those flips. We also propose to measure cost in the currency that actually matters on addition-only hardware: memory traffic plus the number of accumulate operations. Giving an attention operand more resolution multiplies the additions required, so it is not a free choice.

Core Claim

In multiplication-free attention, two quantities decide where precision should go. The first is the expected loss caused by threshold flips that quantization induces. The second is the price of each precision choice in accumulate operations and memory. Neither quantity resembles the curvature-and-bit-count pair used for ordinary networks.

We claim that a spike-flip sensitivity score, paired with an addition-count cost model, can make three kinds of decisions jointly: weight bit-widths per module, membrane-state bit-widths, and the resolution of the query, key and value operands (binary, ternary, or multi-bit). The resulting models should be more accurate than uniform low-bit spiking Transformers at equal memory and equal additions.

The distinguishing ingredient is the joint allocation over operand resolution. A²OS²A showed that attention can stay addition-only with a binary query, a real-valued key and a ternary value, but it fixed that recipe by hand. BESTformer binarized everything and fell to 63.46% on ImageNet. No work searches the space between these two extremes using a measured sensitivity.

Research Program

Sensitivity estimator. For a module $m$ quantized to $b$ bits, we score the expected loss change as

$$ S_m(b) \;=\; \sum_{n \in m} p_n(\theta)\,\mathbb{E}\big[\,|\delta u_n(b)|\,\big]\,\Delta L_n . $$

The terms are defined as follows:

  • $n$ ranges over the neurons fed by module $m$.
  • $p_n(\theta)$ is the empirical density of neuron $n$'s membrane voltage at its threshold $\theta$, pooled over calibration inputs and timesteps.
  • $\delta u_n(b)$ is the voltage perturbation that $b$-bit weight rounding injects into that neuron.
  • $\Delta L_n$ is the loss change caused by flipping that neuron's spike. We estimate it by direct flip interventions on a small calibration set, with a gradient-based approximation as a cheaper fallback.

The form comes from a first-order event argument. A small perturbation flips a spike only when the voltage lies within $|\delta u|$ of threshold, and that happens with probability of roughly $p_n(\theta)|\delta u|$.

The score captures what PTQ4SNN observes but does not model at module level: small errors near threshold propagate non-linearly across timesteps. PTQ4SNN ranks membrane channels by firing rate combined with a perturbation score. We replace firing rate with the density at threshold, because a neuron that fires constantly can still be robust to small perturbations. The same score extends to membrane-state precision by treating membrane rounding as $\delta u$ directly.

Cost model. Each choice is priced in two parts:

  • Memory bits. This covers weight bits plus membrane-state bits.
  • Accumulate operations. A multi-bit spike operand is executed as several binary passes. These are the "virtual timesteps" of IE-LIF neurons in the Quantized Spike-driven Transformer. Raising a query or value operand from binary to $k$ levels therefore scales its additions by roughly the number of passes, weighted by the measured spike sparsity.

This pricing makes the allocator weigh operand resolution against weight precision honestly. The alternative accounting would pretend multi-bit attention is free.

Allocation and training. We solve a small integer program for each budget, choosing a precision for every module and operand to minimize $\sum_m S_m$ subject to memory and addition budgets. This follows the formulation HAWQ uses with Hessian scores. We then fine-tune with quantization-aware training, using the same fine-grained distillation the Quantized Spike-driven Transformer uses, so that gains are not confused with a better training recipe. Modules are grouped along two lines:

  • by the detector/writer split of NSDS, separating query-key projections from value-output projections, and feed-forward inputs from feed-forward outputs;
  • by depth.

Baselines

Naive reference: uniform quantization. This is the Quantized Spike-driven Transformer recipe: uniform weight bits, IE-LIF neurons and fine-grained distillation. It is the strongest existing low-bit spiking Transformer.

It reports 80.3% ImageNet-1K top-1 at 4-bit weights and 75.0% at 2-bit weights. We will retrain it on the same backbone, data and epochs using our pipeline, and report both our reproduction and the published number. Beating it means a higher top-1 at an average weight budget of 2 bits, with equal or fewer total additions. The decisive comparison is above 75.0% at that budget.

Extreme end: uniform 1-bit. BESTformer reports 63.46% ImageNet top-1 at 5.57MB. Here beating means substantially exceeding its accuracy at matched model size.

Membrane quantization. For post-training membrane quantization, the reference is PTQ4SNN. It reports 75.16% ImageNet top-1 for SDT-8-768 at 4-bit weights and 4-bit average membrane precision, a 0.74% drop from floating point. We will run our allocator in post-training mode on that same backbone and require higher accuracy at the same average membrane precision.

Competing sensitivity metrics. Three alternatives replace our score inside the identical allocator, with an identical training budget:

  • curvature computed through surrogate gradients, either as a HAWQ-style eigenvalue or the Hutchinson trace used in Hessian Aware Quantization of SNNs;
  • data-free kurtosis plus singular-value scores from NSDS;
  • PTQ4SNN's firing-rate score.

Ablations of the key ingredients. Two ablations isolate what is new. The first keeps our sensitivity score but prices choices in bits only, which removes the addition-count cost. The second fixes query, key and value at the A²OS²A recipe and allocates only weights, which removes the operand search.

Why not just…?

Why not just give attention more bits than everything else, by hand? This is the most serious threat. The observation that attention is fragile, from the Quantized Spike-driven Transformer, already suggests this rule. We include it as a baseline: attention projections at 4 bits, the rest at the bit-width that matches the total budget.

If it matches our method within noise at every budget, the honest conclusion is that module type explains nearly all the sensitivity, and our contribution shrinks to the operand-resolution findings. We expect the hand rule to fail at budgets of 1.5 bits and below. In that regime the choice among query, key, value, depth and membrane precision matters, and the rule is silent about all of them.

Why not just apply HAWQ with surrogate gradients? It may work. Hessian Aware Quantization of SNNs found depth-wise sensitivity spanning orders of magnitude on a 3-layer network. The concern is that surrogate curvature measures a smoothed loss the hardware never runs, so its ranking may not match real flip damage. The rank-correlation check below settles this directly. If surrogate curvature correlates with measured damage as well as our score does, we will adopt it as the cheaper estimator and credit it accordingly.

Why not just quantize uniformly and lean harder on distillation or more timesteps? The Quantized Spike-driven Transformer already does uniform quantization with distillation and still loses about 5 points going from 4 to 2 bits. BESTformer's distillation does not prevent its cliff. Extra timesteps multiply additions and latency; Spikformer reports 70.14% at one timestep versus 74.81% at four. Because our cost model counts virtual and real timesteps as additions, "more timesteps" is simply one point in our search space. If uniform weights with extra passes win at equal addition count, the allocator will choose that, and we will report it.

Proposed Experiments

Backbones. The main backbone is the Quantized Spike-driven Transformer. We also run the Spike-driven Transformer and an A²OS²A variant.

Benchmarks. These are ImageNet-1K, CIFAR-100, CIFAR10-DVS and ADE20K. The last tests whether the allocation transfers to dense prediction, where the Quantized Spike-driven Transformer reports 40.5% mIoU.

Metrics. We report:

  • top-1 accuracy or mIoU;
  • model size;
  • theoretical energy, using the same accounting as the cited papers;
  • total accumulate operations;
  • Pareto curves over average weight budgets of 1.25, 1.5, 2, 3 and 4 bits.

First decisive check: ranking. Before any training, we quantize one module at a time to 1 and 2 bits and measure the actual loss increase. We then compute the Spearman rank correlation between that measured damage and each candidate score: flip-based, surrogate curvature, kurtosis-structure, and firing rate. Our score must rank modules better for the method to have a reason to exist.

Second decisive check: the hand rule. We compare against the hand rule at budgets of 1.5 bits and below, where the operand search is expected to matter.

Third decisive check: operand allocations. We record which query, key and value resolutions the allocator chooses, and test whether the chosen non-symmetric recipes outperform both full binarization and the fixed A²OS²A recipe at equal additions. Recovering most of the gap between BESTformer's 63.46% and the roughly 78% of hybrid models, at close to 1-bit memory, would be the headline result. Failing to do so would show that the operand space offers less than Gap 3 in the literature suggests.