Skip to content

Research preprint · Open academic deposit

Two margins, opposite directions

Why trained spiking networks tolerate low precision — even as training collapses their internal margin. Both findings hold at once, and understanding why changes which quantity has to be measured to judge an embedded network.

Paper
“Internal Margins Collapse, Decision Margins Grow: Why Trained Spiking Networks Tolerate Low Precision”
Research
Independent · EventCompute
Status
Published · DOI · preprint, not peer-reviewed
Protocol
Reduced pilot, CPU only
Seeds
5 · 16 checkpoints per seed (epochs 0 to 15)
Data
SHD — 1,500 train, 800 test
Licence
CC BY 4.0 · DOI 10.5281/zenodo.21750036

The apparent paradox

It is commonly observed that a trained spiking network keeps working well once quantised to low precision. The usual conclusion is that training makes the network robust to quantisation.

This work shows that the opposite happens inside the network — and that the two findings are compatible because they do not concern the same quantity. The hypothesis tested is precise: does training compress the internal margin of hidden neurons — the one that governs exact spike identity — while the decision margin widens at the same time?

The starting point is a measured relation. On 300 configurations of independent LIF neurons (6 dynamics × 10 time constants × 5 seeds, Q4 to Q24 against float64), the minimum precision that keeps spikes bit-identical is well predicted by the internal margin: R² = 0.896 on data held out from the fit (unseen time constants and an unseen dynamics class), mean error 1.50 bits. The memory time constant is statistically detectable but adds almost nothing (R² +0.003): this is a margin-dominated relation, not a two-factor law. Applied as is to trained networks, where the internal margin collapses, this relation predicts severe fragility. That prediction is wrong, and the paper explains why.

The two margins, defined

Decision marginThe gap between the winning class and the runner-up, aggregated over the whole time window. It grows with training.
Internal marginThe distance separating each hidden neuron from its firing threshold. It collapses with training.

The second is the quantity one would naturally instrument: the closer a neuron sits to its threshold, the smaller the rounding error needed to flip its firing — and thereby to change, in cascade, the spikes that follow. The first concerns what the network decides. A flipped spike does not necessarily change the decision: that is the whole point of the paper, which shows that, in the setting tested, it is the decision margin that tracks functional robustness.

What the measurement shows

Two margins, opposite directionsTwo distinct scales: two charts, never two axes on one frameDecision marginepoch 0 – 0.0000 (mean of 5 seeds)epoch 1 – 0.3767 (mean of 5 seeds)epoch 2 – 0.4647 (mean of 5 seeds)epoch 3 – 0.6887 (mean of 5 seeds)epoch 4 – 1.0002 (mean of 5 seeds)epoch 5 – 1.1100 (mean of 5 seeds)epoch 6 – 1.2708 (mean of 5 seeds)epoch 7 – 1.6593 (mean of 5 seeds)epoch 8 – 1.7330 (mean of 5 seeds)epoch 9 – 1.8180 (mean of 5 seeds)epoch 10 – 1.9425 (mean of 5 seeds)epoch 11 – 1.9472 (mean of 5 seeds)epoch 12 – 2.1063 (mean of 5 seeds)epoch 13 – 2.1290 (mean of 5 seeds)epoch 14 – 2.2285 (mean of 5 seeds)epoch 15 – 2.3355 (mean of 5 seeds)epoch 0epoch 150.000 → 2.336Mean internal marginepoch 0 – 0.2192 (mean of 5 seeds)epoch 1 – 0.1672 (mean of 5 seeds)epoch 2 – 0.1242 (mean of 5 seeds)epoch 3 – 0.1018 (mean of 5 seeds)epoch 4 – 0.0858 (mean of 5 seeds)epoch 5 – 0.0753 (mean of 5 seeds)epoch 6 – 0.0596 (mean of 5 seeds)epoch 7 – 0.0406 (mean of 5 seeds)epoch 8 – 0.0257 (mean of 5 seeds)epoch 9 – 0.0143 (mean of 5 seeds)epoch 10 – 0.0073 (mean of 5 seeds)epoch 11 – 0.0035 (mean of 5 seeds)epoch 12 – 0.0007 (mean of 5 seeds)epoch 13 – 0.0009 (mean of 5 seeds)epoch 14 – 0.0009 (mean of 5 seeds)epoch 15 – 0.0004 (mean of 5 seeds)epoch 0epoch 150.219 → 0.000Mean of 5 seeds. Training widens the decision margin and compresses the internal margin.
Figure 1The two quantities over the same epochs, in two separate charts – never two vertical axes on one frame, which would suggest a common scale. On the left, the decision margin goes from 0 to 2.34. On the right, the mean internal margin collapses from 0.219 to 0.0004, a division by 548.
source: metrics_by_epoch.csv (data file deposited with the paper) – mean of 5 seeds, 16 points per seed

The contrast is striking. While the network learns — its mean accuracy rising from 4.6% at epoch 0 to 67% at epoch 15, according to the same data file — two opposite things happen under the hood: the verdict becomes ever more clear-cut, and each neuron sits ever closer to its threshold. The internal margin ends at 0.0004, essentially glued to the threshold.

The correlations, quantified

These trends are not qualitative; they are measured. Here are the correlations between training progress and each quantity, then between each margin and the accuracy measured after Q8 quantisation:

Measured relation Correlation Reading
Epoch ↔ decision margin +0.96 it grows with training
Epoch ↔ mean internal margin −0.90 it collapses with training
Decision margin ↔ Q8 accuracy +0.95 they rise together: the margin aligned with functional robustness
Mean internal margin ↔ Q8 accuracy −0.96 it collapses while Q8 accuracy rises: a misleading proxy for risk

The last two rows have to be read together. The correlation between the internal margin and Q8 accuracy is negative: the internal margin collapses while Q8 accuracy improves with training. If the internal margin governed functional robustness, the two would fall together; they move in opposite directions. In this setting, it is the decision margin (+0.95) that tracks functional robustness. This ordering is an association observed in the protocol tested; the paper does not present it as a general law.

The resolution also qualifies the starting relation: the margin that matters is the one attached to the property being guaranteed. For exact spike identity it is the internal margin (hence R² = 0.896 on independent neurons); for the decision it is the decision margin. Using the first to predict the second is exactly what would produce a false alarm.

Key point

A trained network that tolerates low precision owes it, in this setting, to its decision margin, which widens while the internal margin collapses (a 548-fold division). Judging its robustness on the internal margin, the quantity one would naturally instrument, would have predicted a fragility that does not occur.

The concrete, methodological consequence: to judge whether a network suits embedded deployment, measure the margin that belongs to the property to be preserved — the distance to threshold of hidden neurons for spike identity, the decision margin for the decision. Whether this holds for other tasks and architectures is untested.

The real cost at low precision

How much does quantisation actually cost, precision by precision? I evaluate the same network at six levels, at the 80 training checkpoints (5 seeds × 16 epochs), without retraining. Comparing untrained and trained checkpoints shows where fragility appears.

What “Qk” means in this paper

In the trained-network experiments, “Qk” denotes weight-only rounding to the nearest multiple of 2−k; the network then runs in a float64 datapath (membrane potentials, accumulation, thresholds and spike decisions are not quantised). This is post-training quantisation of the parameters, not fixed-point arithmetic. On the same SHD benchmark, a full integer datapath loses 24.6 accuracy points (77.3% in float64 against 52.74% at Q16.16, measured in companion paper D). The two measurements do not conflict, but no precision called “free” here may be read as a statement about fixed-point deployment.

Accuracy gap introduced by quantisationThe same network, evaluated at six precisions – before and after training0.700.520.350.170.00Q2 untrained – gap 0.0000Q2 trained – gap 0.6210Q2Q4 untrained – gap 0.0000Q4 trained – gap 0.1467Q4Q6 untrained – gap 0.0000Q6 trained – gap 0.0215Q6Q8 untrained – gap 0.0000Q8 trained – gap 0.0127Q8Q12 untrained – gap 0.0000Q12 trained – gap 0.0045Q12Q16 untrained – gap 0.0000Q16 trained – gap -0.0003Q16Before trainingAfter training
Figure 2Before training (epoch 0), the accuracy gap is zero at every precision, from Q2 to Q16 — a statement about accuracy only, not about identity of predictions, spikes or states. At the final trained checkpoint, the gap appears and grows as precision falls: 0.62 at Q2, 0.15 at Q4, 0.02 at Q6, then 0.013 at Q8 (0.024 at the worst checkpoint) and almost nothing beyond. The transition is observed between Q4 and Q6.
source: cross_precision.json – 80 checkpoints, 5 seeds x 16 epochs
See the data
Precision Untrained gap Mean gap (80 checkpoints) Max gap
Q2 0.000 0.430 0.646
Q4 0.000 0.119 0.268
Q6 0.000 0.013 0.066
Q8 0.000 0.000 0.024
Q12 0.000 −0.001 0.013
Q16 0.000 0.000 0.005

The cautious reading: in this protocol, the accuracy gap was zero at the untrained checkpoints. That is an observation about the points measured, not a demonstration that quantisation is free in general, nor that fragility is entirely caused by training.

Two evaluations of the same network give two Q8 figures, and both should be quoted. The five-seed evaluation of the final model gives a gap of 0.12% ± 0.61%, within between-seed variability; the re-evaluation of all 80 checkpoints gives 1.3% at the final checkpoint and 2.4% at the worst. Both agree: the Q8 gap stays below 3%.

A negative result, reported as such: the quantisation-aware training (QAT) recipe tested brings no mean improvement at Q8 across five unpaired seeds (0.34% ± 0.59% against 0.12% ± 0.61%, marginally worse). This is a descriptive comparison with no statistical test: it establishes neither an absence of effect nor that QAT is useless in general.

Three simulated arithmetic profiles

Beyond the trained network, a sweep of 400 network configurations under three simulated arithmetic profiles shows an analogous pattern: spikes diverge, but the decision holds. The mechanism is not established there: no margin is measured in that sweep, and these are different networks from the trained one.

Three simulated arithmetic profiles (400 configurations)Spike agreement versus final-decision agreement100%75%50%25%0%Q32 strict – spikes 100.00%Q32 strict – decision 100.00%Q32 strict≈ float64Q16 strict – spikes 85.25%Q16 strict – decision 99.75%Q16 strictembeddedQ8/Q24 accum. – spikes 49.75%Q8/Q24 accum. – decision 98.25%Q8/Q24 accum.trade-offSpike agreementDecision agreementCommercial chip names are withheld for lack of an exact data path.
Figure 3The Q32 profile is bit-identical to the float64 reference, for spikes and decisions alike. The Q16 profile keeps only 85.25% of spike trains – but 99.75% of decisions (one spike train in seven differs, 399 decisions in 400 hold). The trade-off profile (storage on a Q8 grid, accumulation on a 24 fractional-bit grid) drops to 49.75% identical spike trains, and still holds 98.25% of decisions.
source: hardware_profiles_summary.json – simulated arithmetic profiles, n = 400
Emulation scope

These three profiles are simulated in software; no chip was measured. The third is an emulation: Python floating-point values rounded after each operation, with weights, drive, decay, threshold and stored state on an 8 fractional-bit grid and intermediate accumulation on a 24 fractional-bit grid. It is neither a signed 24-bit integer datapath nor a model of a named chip.

Scope and limitations

Limitations of the study

  • Reduced pilot protocol, CPU only, a single dataset (SHD), a single three-layer architecture, five seeds, one QAT recipe. No general causal attribution — only an association measured within this protocol: both margins are consequences of the same training run, and I never intervene on one while holding the other fixed. The experiment that would settle it (margin-regularised retraining) exists here only at one seed per setting: it remains exploratory.
  • Scope of “Qk”: in the trained-network experiments only the weights are rounded, in a float64 datapath. These figures must not be read as fixed-point deployment, which costs 24.6 points on the same benchmark (paper D).
  • The margin–precision relation (R² = 0.896) is established on independent neurons only; it is consistent with the trained-network results but not validated on them. Only spike identity is well predicted; the rate (R² = 0.350) and decision (R² = 0.251) contracts remain poorly explained.
  • The Q4–Q6 fragility threshold is an observation in this domain, not a law: nothing here licenses the claim that spiking networks need at least Q6, nor extrapolating below Q6 what is observed from Q8 to Q16.
  • The 80 checkpoints are 5 repeated trajectories, not 80 independent observations. Correlations and trends are descriptive.
  • An unsupervised local-learning baseline (STDP) was planned and not implemented: it requires a radically different training loop. The control actually carried out is the untrained/trained comparison.
  • No hardware measurement: no area or energy saving is claimed. The hardware motivations cited are conditional.
  • The absence of an accuracy gap does not mean identity of predictions, spikes or internal states. Each statement names the quantity measured.
  • The Q8 storage profile with a 24 fractional-bit accumulator is not a 24-bit data path.