Manuscript Offprint
arXiv:2610.22083Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ARTICLE INFO
Keywords:
Spiking Neural Networks
SNN
Spatial Pattern
STDP
Spike Timing Dependent Plasticity
Supervised Learning
Spike Encoding
Hamming Distance
ABSTRACT
Spatial encoding lets a spiking neural network classify a value without a temporal integration window, by presenting it as one pattern of simultaneous spikes, but makes classification depend on the geometry of the binary code. In standard binary, adjacent values such as 127 and 128 differ in every bit, a “Hamming cliff” that forces supervised STDP networks with homeostasis into excessive scaling and false positives. We present a controlled characterisation of this dependence rather than an application benchmark: every experiment runs on SpiNNaker hardware, in a dual-rail network with a single output neuron, and presents every value of a synthetic integer range. Gray, Thermometer and Johnson encodings all remove the cliff, but only Thermometer and Johnson preserve global semantic distance, at a width that grows linearly with the range. We introduce a family of hybrid encodings, combining a coarse magnitude code with a Gray code for fine position, that contains all three as exact limiting cases of a single parameter; a sevenfold reduction in width costs one percent of the correlation between Hamming and semantic distance. The homeostatic factor sets a Hamming radius of tolerance that the network follows exactly in 93% of conditions, and elsewhere to within one bit, so the encoding alone determines what that tolerance means: a contiguous interval for Thermometer and Johnson, wrapping at the range ends for the cyclic codes, and scattered values for Binary and Gray. Measuring the limit on simultaneous input on SpiNNaker and SpiNNaker2, we show that on SpiNNaker it is a silent software default, and that the hybrids remain within it at 1024 values where their parent codes do not. Evaluation on a downstream task, such as network-traffic classification, is left to future work.
-
By pre-processing input signals with Gray, Thermometer, Johnson and hybrid encodings before passing them to spiking neural networks running on SpiNNaker hardware, Davies et al. address the semantic-spatial disparity that causes the “Hamming cliff” in standard binary representations. Continuous semantic patterns are presented as a set of simultaneous spikes at the input layer, preserving ultra-low latency processing. Training the network on multiple continuous values under each scheme, and measuring accuracy, required homeostatic scaling and false-positive rates, shows that removing the cliff is necessary but not sufficient: Gray encoding removes it yet retains little global distance structure, whereas Thermometer and Johnson preserve semantic distance at a code width that grows with the value range. The proposed hybrid encodings contain all three as limiting cases of a single parameter, recovering most of that structure at a fraction of the width. The homeostatic factor is shown to set a radius of tolerance around each trained pattern, so that the choice of encoding alone decides which values the network treats as similar.
-
Corresponding author
sergio.davies@mmu.ac.uk (S. Davies)
https://www.mmu.ac.uk/staff/profile/dr-sergio-davies (S. Davies)
ORCID(s): 0000-0001-5330-5527 (S. Davies)
the magnitude of the stimulus (Gerstner et al., 2014). Third-generation Spiking Neural Networks (SNNs) (Maass, 1997) add time to the model, and a rate code then costs latency: to decode a value, the network must “wait and count” spikes over an integration window. It also costs energy. Event-driven neuromorphic hardware spends its energy per event rather than per clock cycle, routing every spike as a packet and processing it at each synapse it reaches (Furber et al., 2014; Davidson and Furber, 2021), so a code that spends many spikes on each value undermines both the low latency and the low power that such hardware promises (Davies et al., 2018).
Spatial encoding avoids this bottleneck by representing a value as a pattern of simultaneous spikes (Davies et al., 2025). Because neuromorphic hardware delivers information through discrete, addressable synapses, the value is first converted to a binary code word, and each bit is signalled by the presence or absence of a spike from one source (Auge et al., 2021). The input activity per decision is then fixed by the code width, and the output is delayed only by the depth of the network (Göltz et al., 2021). The conversion to binary, however, introduces a structural vulnerability, the “Hamming cliff” (Caruana and Schaffer, 1988): numerically adjacent values can have very different code words. The values 127 and 128, for instance, are 01111111 and 10000000 in 8-bit binary, so two adjacent values differ in every bit, and semantic proximity and Hamming distance (Hamming,
Davies, S. et al.: Preprint submitted to Elsevier
Page 1 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
(1950) disagree as strongly as they can. The 8-bit range is used for most of our experiments, as the widest at which every encoding compared here fits within the default input limit of first-generation SpiNNaker (Section 3.4).
In earlier work (Davies et al., 2025), we showed that an SNN trained with supervised STDP classifies a single spatial pattern accurately, but that its performance degrades when it is trained on several. Large Hamming distances between the trained patterns create “don’t care” synapses, which receive conflicting evidence from different patterns and so contribute nothing to the output; the network must then rely on stronger homeostatic scaling, which sharply increases false positives. Standard binary encoding therefore prevents the network from recognising contiguous ranges of values. This matters wherever the inputs are continuous or ordinal. In network-traffic classification, for instance, packet sizes, flow durations and inter-arrival times carry meaning in their proximity: two flows of similar duration are similar events, and an encoding that maps them to distant spatial patterns discards that information before the network sees it. Other features are cyclic: time of day is the clearest case, where 23:59 and 00:00 are adjacent, and such features need an encoding whose topology reflects that.
This paper examines spatial encodings that restructure the signal before it reaches the network, while keeping one spike per bit. The established alternatives are not equivalent: Gray encoding removes the cliff but preserves little global distance structure, whereas Thermometer and Johnson encodings preserve it at the cost of a code width that grows linearly with the value range. We introduce a family of hybrid encodings, which combine a coarse magnitude code with a Gray code for fine position; the family contains all three as limiting cases of a single parameter and trades code width against preservation of semantic distance at a favourable rate. On hardware, the homeostatic factor sets a radius of tolerance in code space around each trained code word, so the encoding alone decides which values the network treats as similar. The same analysis explains the degradation observed in our earlier work (Davies et al., 2025): the summed weights of trained code words cancel wherever they disagree, and the homeostatic gain that compensates is what admits the false positives. Because a spatial code delivers all its bits at once, its width is also bounded by the number of simultaneous input events a neuron can receive: about 255 under the default configuration of first-generation SpiNNaker, and 512 on SpiNNaker2 (Mayr et al., 2019; Gonzalez et al., 2024). The hybrid construction reduces code width by an order of magnitude. To our knowledge, this is the first systematic characterisation of how the choice of spatial code governs the homeostatic scaling, and hence the tolerance and false-positive behaviour, of supervised STDP learning on neuromorphic hardware.
The main contributions of this work are:
-
an account of how the geometry of a spatial code sets the homeostatic tolerance of a supervised STDP network (Sections 4.3.1 and 4.4);
-
a hybrid coarse–fine encoding family with Thermometer, Johnson and Gray as limiting cases (Section 3.5);
• evidence that removing the Hamming cliff is necessary but not sufficient for semantic clustering (Sections 4.1 and 4.3);
-
a characterisation of the per-neuron input limits on SpiNNaker and SpiNNaker2 (Section 3.4);
-
an exhaustive hardware evaluation of eight encodings, with code and data released (Sections 4.2–4.5).
The scope of this work is deliberately narrow: we characterise the encodings rather than evaluate them on a task. Every experiment presents every value in the range to the trained network, so the relations reported are exact over the whole input space and a relation such as the tolerance law of Section 4.4 can be checked condition by condition. A natural dataset allows neither: its values are unevenly distributed and its features correlated, so the effect of code geometry on learning would be confounded with the data. The network (a dual-rail input layer feeding a single output neuron), the learning rule and the measurement protocol are held constant, so the encoding is the only variable, and the comparison throughout is against standard binary encoding, the representation used in our prior work. How the ranking carries over to a downstream task, where feature distributions are uneven and the encodings interact with later processing, is the subject of separate work.
2. Theoretical Background
2.1. Spatial Encoding and the Hamming Vulnerability
In spatial encoding, all bits of a code word are presented to the network in the same timestep, so the network has no access to the value itself, only to which of its input synapses are active. Its response to two values therefore depends on how many bits their code words share, that is, on the Hamming distance between them. In the supervised STDP network of Davies et al. (2025), a larger Hamming distance between trained code words required a larger homeostatic scaling factor for all of them to be recognised, and the larger factor admitted more false positives. The following subsections formalise this dependence and the properties of the encodings that determine it.
2.2. Formal Definition of the Hamming Cliff
2.2.1. Notation
Let be a set of discrete semantic values. An encoding maps each value to a code word: a string of symbols, each either 0 or 1. We write for the code word of value , for the code width, that is the number of bits in every code word of a given encoding, and for the Hamming distance between two code words, the number of positions at which they differ (Hamming, 1950).
Davies, S. et al.: Preprint submitted to Elsevier
Page 2 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
A width-W code admits distinct strings, of which an encoding uses , one per semantic value; hence . Standard binary attains this minimum: taking , every available string is used, so , and each value is represented by its ordinary binary expansion. The encodings introduced below are wider and use only a small fraction of the strings available to them: Thermometer, for example, has and uses of the possible strings. The width is what the hardware must carry for each classification, and Section 3.4 shows that it is bounded.
2.2.2. Preservation of semantic proximity
Semantic proximity depends on the topology of the quantity being encoded. We therefore write for the semantic distance between two values, and consider two cases: a bounded quantity, such as a magnitude, with linear distance
and a periodic quantity, such as time of day or an angle, with circular distance
under which the extremes 0 and N - 1 are adjacent. Two values that are close under should have code words that are close in Hamming distance. We therefore say that f preserves semantic proximity under when the Hamming distance between code words grows with the semantic distance between the values they represent:
(3)
An encoding is judged against the metric of the quantity it is meant to represent: a linear code against , a cyclic code against .
2.2.3. The cliff
A Hamming cliff is a local violation of Eq. (3): two values that are adjacent under but whose code words are disproportionately far apart. Taking the smallest distance between any two distinct code words as the natural unit of comparison, f suffers from a Hamming cliff between two values i and j with when
The relation is left informal here; Section 4.1 makes it quantitative by reporting the ratio of the two sides. Under the values 0 and N - 1 are adjacent, so a code used for a periodic quantity can also have a cliff across the wraparound.
In standard binary encoding the cliff occurs at power-of-two transitions, most severely between and , where the transition costs up to W bits although the two values are adjacent and the expected distance is H = 1. For W = 8 this is the pair 127 and 128 introduced above, at a cost of 8 bits against an expected 1.
2.2.4. Consequence for the network
In an SNN trained by supervised STDP, homeostasis rescales every synaptic weight by a single common factor, chosen so that the network responds to each of the patterns it was trained on. Write for the smallest factor at which pattern causes the output neuron to fire; the factor adopted by the network is the largest of these over the trained set. grows with the number of synapses that disagree with the target pattern , because those synapses contribute nothing to the output and the remainder must compensate for their absence.
A Hamming cliff between two adjacent values therefore produces an abrupt change in the scaling they demand,
and it is this compensatory scaling that produces the instability and the false-positive activations reported by Davies et al. (2025).
2.3. Encoding Topologies
To address the Hamming cliff, we consider alternative mapping techniques that constrain the relationship between semantic and spatial distance:
• Gray Encoding: A reflected binary code where adjacent integers are represented by codewords that differ by only a single bit, ensuring minimal spatial transitions between semantically adjacent states (Gray, 1953).
• Thermometer Encoding: Maps a magnitude by progressively filling a bit-field, creating a unary representation: the value is given by the number of bits set, not by which particular bits are set (Buckman et al., 2018). Representing N values therefore requires N - 1 bits, and successive values differ in a single bit.
• Johnson (Twisted Ring) Encoding: A cyclic code in which bits are set one at a time from one end of the field and then cleared again from that same end, so that W bits generate 2W distinct states before returning to the start (Mano and Ciletti, 2012). Successive values differ in a single bit, and because the sequence closes on itself the first and last values are adjacent.
These codes are long established in digital logic. The criterion that bit-flip distance should track semantic distance is also established in the weightless neural network literature, where binary encodings for WiSARD are evaluated on exactly this basis (Kappaun et al., 2016), and unary thermometer codes are the standard solution (Bacellar et al., 2022). Codes that combine a coarse unary field with a fine binary one are likewise familiar from segmented data converters. What has not been examined is their use as spatial codes for spiking neural networks, where each bit is a discrete synapse, all bits are presented simultaneously, and homeostatic scaling determines which code words the network accepts. The contribution of this paper lies there:
Davies, S. et al.: Preprint submitted to Elsevier
Page 3 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
a coarse and fine construction whose Gray fine field is reflected in alternate blocks, so that single-bit adjacency survives every block boundary, and a quantitative account of how the topology of such a code determines both the network’s tolerance and its demands on the hardware.
2.4. Topological Analysis
The structural utility of these schemes is best understood through their distinct topological properties, as defined in digital logic theory (Mano and Ciletti, 2012). Thermometer encoding enforces linear boundary conditions on the semantic space, wherein the minimum and maximum values are maintained at maximal Hamming distance. Conversely, Johnson encoding imposes a periodic topology; by forming a ‘twisted ring’, the encoding identifies the semantic extremes 0 and N−1 as adjacent, regardless of the code width W. This cyclic property makes Johnson encoding a natural candidate for quantities with circular continuity, such as orientation, phase or time of day, whereas Thermometer encoding suits bounded magnitudes.
These schemes must, however, be distinguished by which property they preserve. All three guarantee local smoothness: values adjacent under the metric each is designed for differ in a single bit, eliminating the cliff of Section 2.2. Only Thermometer and Johnson additionally preserve global structure, each exactly under its own metric: for Thermometer and for Johnson. Gray encoding offers no such guarantee. Its reflected construction places every value a single bit from , however far apart the two are, so that the extremes 0 and differ in one bit; Hamming distance therefore carries little information about semantic separation beyond immediate neighbours.
Removing the Hamming cliff is therefore necessary but not sufficient for the clustering behaviour sought here, and Section 4.1 quantifies the gap between the two properties. These three codes are not, however, exclusive alternatives: the reflected construction of Section 3.5 interpolates between them and contains all three as limiting cases.
2.5. Relation to Other Low-Latency Representations
Spatial binary codes are one of several ways to give a spiking network a fast decision about a scalar (Auge et al., 2021). They are distinguished from the others by three properties: when the decision becomes available, how many input events it costs, and how the distance between code words relates to semantic separation (Table 1).
Latency coding, or time to first spike, represents a value by when a single spike occurs (Mostafa, 2017; Göltz et al., 2021). It is frugal in events, one per input neuron, and preserves proximity naturally, since close values fire at close times; but the decision cannot be taken until the latest spike that could carry information has had time to arrive, so its latency is bounded by the encoding window rather than by the depth of the network. Rank-order coding (Thorpe and Gautrais, 1998) reads information from the order in which a population fires. It is equally frugal, but it encodes the relative ordering of several inputs rather than the magnitude of one, and it too must wait for that order to be established. Both trade time for events. Spatial codes make the opposite trade: every bit is delivered in the same timestep, so the decision follows within a fixed number of timesteps of the input, and the cost is paid in width instead.
Population coding with Gaussian receptive fields (Bohte et al., 2002) preserves semantic proximity through overlapping graded fields, and is usually read out in time, the strength of each field becoming the latency of its spike. Binarised and presented spatially, it becomes a window of k active neurons that moves with the value, and its Hamming distance at semantic separation d is : proximity is preserved within the width of a field and lost beyond it, every pair of values further apart than k being equidistant. One-hot, or place, coding is the limiting case k = 1, in which every pair of distinct values lies at distance 2 and code distance carries no information about separation at all. A place-coded population is nevertheless the natural input layer from which a spatial code can be computed on-chip, and in a single-rail arrangement it costs only one event per value; the dual-rail wiring used here, in which every bit must be presented, removes that advantage.
The spatial codes studied in this paper differ from all of these in that distance in code space, rather than in time, carries semantic separation, and they differ from one another in how much of it survives. Thermometer and Johnson preserve it exactly and globally, where a population window preserves it only within its own width, and the hybrid construction introduced here preserves it globally at a fraction of the width. It is this global structure, rather than local smoothness alone, that homeostatic tolerance turns into a semantic interval.
3. Methods
3.1. Network Architecture
The network follows the supervised STDP arrangement of Davies et al. (2025). A code word is presented as a dual-rail spatial pattern: for each bit, one neuron fires if the bit is 1 and a second fires if it is 0, so exactly one of the two rails is active per bit and the whole code word is presented within a single simulation timestep. All neurons are leaky integrate-and-fire units with delta synapses, which deliver their current within one timestep, with the parameters listed in Table 2.
3.1.1. Training
The two rails (Fig. 1) project to a single output neuron through plastic synapses governed by a nearest-pair STDP rule, in which each pre-synaptic spike is paired only with the nearest post-synaptic spike rather than with all of them ( ms, , ). Spikes encoding a “1” are presented at 1, 26 and 56 ms and those encoding a “0” at 6, 36 and 59 ms, while a teacher neuron fires at 29 ms and drives the output neuron to fire at 32 ms. The two rails are offset from the teacher spike by different intervals: given the
Davies, S. et al.: Preprint submitted to Elsevier
Page 4 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Table 1
Low-latency input representations compared on the three properties that distinguish a spatial code. Event counts are for a scalar of levels; for the spatial codes every bit fires on one rail of its pair, so a code of width delivers events whatever its content. is the length of the encoding window, the semantic distance , and the width of a binarised receptive field.
| Representation | Decision available | Input events per value | How code distance relates to |
|---|---|---|---|
| Rate | after an integration window | many, growing with precision | graded, in spike counts |
| Latency (time to first spike) | up to , depending on the value | one per input neuron | graded, in spike times |
| Rank order | once enough of the order has arrived | one per neuron of the population | relative order across neurons, not the magnitude of one value |
| Population, Gaussian receptive fields | usually up to , as fields are read out in time | several, one per active field | preserved locally; binarised to a window of active neurons, , saturating beyond the field width |
| One-hot (place) | one timestep | none: every distinct pair at | |
| Binary | one timestep | none, with cliffs at power-of-two boundaries | |
| Gray | one timestep | local only: for | |
| Thermometer, Johnson | one timestep | exact: , linear or circular | |
| Hybrid (this work) | one timestep | global, slope , ripple at most |
Table 2
Neuron, synapse and simulation parameters. Neuron values are the sPyNNaker defaults for IF_curr_delta, as logged on the hardware.
| Parameter | Symbol | Value |
|---|---|---|
| Membrane time constant | ||
| Membrane capacitance | ||
| Resting potential | ||
| Reset potential | ||
| Firing threshold | ||
| Refractory period | ||
| Offset current | ||
| STDP time constants | ||
| STDP amplitudes | ||
| Maximum weight | ||
| Timestep | ||
| Time scale factor | ||
| Incoming spike buffer |
Scaled with code width for the output neuron (Section 3.1.3).
Allocated with 256 slots (sPyNNaker default incoming_spike_buffer_size), one of which is always kept empty. During training, 256 input events were occasionally accepted when a spike was consumed during the burst (Section 3.4).
time constants above, the nearer interval produces a large weight change and the further one a negligible change, so the STDP rule potentiates the synapses of bits matching the presented value and depresses the others. The simulator computes STDP weight changes only when a pre-synaptic

Figure 1: The network used for training. The pattern generator's two neurons fire at the times encoding a "1" and a "0" respectively, and the code word of the presented value is realised as the connectivity between them and the dual-rail encoding populations (Section 3.2). In blue the STDP-enabled synapses, whose weights begin at zero; in orange the save neuron, which triggers the deferred weight updates; in red the teacher neuron, the only source of drive to the output neuron during training. Each encoding has its own pair of encoding populations and its own output neuron, and all eight share the generator, save and teacher neurons.
spike arrives, so a save neuron fires at 65 ms; this final spike serves no purpose other than to trigger that computation and
Davies, S. et al.: Preprint submitted to Elsevier
Page 5 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks

Figure 2: The network used for testing. The teacher and save neurons are removed and the learned weights are applied as static synapses, wired reciprocally so that a bit on which two trained code words disagree contributes equal excitation and inhibition and cancels exactly (Eq. 6). In red the excitatory synapses, in blue the inhibitory ones.
make the learned weights available to be read back (Jin et al., 2010).
All synapses in the training network are excitatory, and the plastic weights begin at zero. The output neuron therefore fires solely under the teacher's drive, and the plastic synapses serve only to record the spike timings from which STDP computes the weights.
3.1.2. Testing
The teacher and save neurons are removed, the code word is presented once, and the learned weights are applied as static synapses wired reciprocally (Fig. 2): rail 1 projects excitatory weight and inhibitory weight to the output neuron, and rail 0 the converse,
Inhibition appears only in this network. A bit on which two trained code words disagree acquires equal weight on both rails and therefore contributes equal excitation and inhibition, cancelling exactly: the “don’t care” synapse of Davies et al. (2025). Classification is the firing of the output neuron within one timestep of the input, so the decision latency is fixed by the depth of the network rather than by an integration window.
Each of the eight encodings has its own dual-rail pair and its own output neuron, and all eight are trained in a single simulation; the pattern generator, save neuron and teacher neuron are shared between them.
3.1.3. Deviations from the previous work
Two parameters differ from Davies et al. (2025), both required by the wider code words used here. First, the output neuron's firing threshold is scaled with the code width. A width-W code delivers up to W potentiated synapses' worth of current in a single timestep, which for wide codes exceeds the default threshold and causes the output neuron to fire without the teacher, corrupting the learned pattern; the threshold is therefore set to twice the accumulated drive, subject to a floor at the default value.
Second, the STDP weight ceiling is reduced from 20 to 2. The simulator holds synaptic weights in a fixed-point accumulator whose scaling is fixed at run time by the largest total current that could arrive at a neuron, namely times the fan-in (van Albada et al., 2018); a larger product consumes more integer bits and leaves fewer fractional ones, coarsening the resolution. At the widest code considered the fan-in reaches 510, two rails of 255 bits, and at the default ceiling the resulting step size is comparable to the learned weight of itself, which therefore cannot be represented. Lowering the ceiling restores the fractional precision, and the learned weight is then recorded as 0.375.
Neither affects what is learned: homeostasis rescales the weights afterwards, and Davies et al. (2025) note that the STDP parameter values are of little consequence for exactly this reason. A corollary is that the absolute homeostatic factors of encodings with different widths are not directly comparable, since their thresholds differ; comparisons in Section 4 are therefore made within an encoding, or after normalisation.
3.2. Application of the Encoding
The encoding is applied as a pre-processing step rather than computed by the network. For a given value, the code word determines the connectivity: the generator neuron that fires at the “1” times (Section 3.1) connects to every bit of the code word equal to one, and the neuron that fires at the “0” times to every bit equal to zero. The network is therefore constructed anew for each value presented, and no population computes the mapping from value to code word. This matches the framing of the work as a pre-processing of the input signal, and it also removes the source-side spike load: each generator neuron emits one packet per presentation time, which the router fans out, rather than one packet per bit.
The same mapping could be computed on-chip, by a place-coded input population with one neuron per value projecting to the bits of its own code word through fixed connectivity. Such a network would present identical activity to the encoding populations, so the results reported here do not depend on which of the two arrangements is used.
3.3. Training and Testing Procedure
For each experiment a set of values is trained, one value per simulation and each on a network whose plastic weights begin at zero, and the resulting weight vectors are summed synapse by synapse, following Davies et al. (2025). This procedure makes the learned weights a linear function of the trained set; its relation to sequential learning on a single network is discussed in Section 5.1. Where a single value serves as a reference, we use , the 8-bit analogue of the code word used
Davies, S. et al.: Preprint submitted to Elsevier
Page 6 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Table 3
The five classification metrics used in Davies et al. (2025), evaluated for every experiment and tabulated in full in Appendix A.
| Metric | Formula | What it measures |
|---|---|---|
| Accuracy | the share of all values classified correctly; dominated by when few values are trained | |
| Precision | the share of accepted values that were trained | |
| Negative prediction | the share of rejected values that were untrained | |
| Sensitivity | the share of trained values that the network detects | |
| Specificity | the share of untrained values that the network rejects |
throughout Davies et al. (2025), so that results here can be compared with that work.
Homeostasis is then applied as a single multiplier on every synaptic weight. The multiplier is determined per encoding by binary search: the smallest factor at which every trained value causes the output neuron to fire. Each trained value is searched independently and the maximum taken, then rounded up to the next multiple of 0.01 so that the network does not operate exactly at the firing boundary. The search resolves the factor to 0.01, which bounds the precision of the tolerance measurements in Section 4.4.
Classification is then measured exhaustively: every value in the range is presented and the output recorded. A value is accepted when the output neuron fires for it. Accepted values that were trained are true positives () and those that were not are false positives (); rejected values are true negatives () and false negatives () respectively. Table 3 gives the five classification metrics derived from these counts. The main text reports accuracy and precision, which are the two that discriminate between encodings here; sensitivity is unity throughout, since the homeostatic search guarantees that every trained value fires, and serves as a check that training succeeded rather than as a measure of performance. The complete set is tabulated for each experiment in Appendix A.
The false-positive count follows Davies et al. (2025), but it does not distinguish two quite different outcomes. An accepted value adjacent to, or lying between, trained values is generalisation over a neighbourhood, and for an encoding that preserves semantic distance it is the behaviour sought; an accepted value far from every trained value is an error in the ordinary sense. We refer to the first as a neighbouring activation. Sections 4.2 and 4.3 report where accepted values lie as well as how many there are, so that the two can be told apart.
Several independent replicas of the testing network share each simulation, each with its own generator, rails and output neuron and injecting at a staggered time. Across the four experiments reported here, 216 trained networks were measured against every value in their range, giving 131,072 individual classifications on hardware. No result below is sampled or extrapolated.
All experiments were run on first-generation SpiNNaker hardware using the sPyNNaker implementation of PyNN (Rhodes et al., 2018; Davison, 2008), with the default incoming spike buffer, which holds 255 packets, and a time scale factor of 100, so that each 1 ms timestep spans more than a millisecond of wall-clock time; latencies are therefore reported in timesteps. The input-capacity measurements of Section 3.4 were additionally made on SpiNNaker2; every other result is from first-generation SpiNNaker. Code and results are available on GitHub (Davies et al., 2026) at the URL: https://github.com/sergiodavies/EncodedSpatialLearningCodeAndDataset.
3.4. Input Capacity and Spatial Code Width
Because all bits of a spatial code word are presented simultaneously and each bit fires on exactly one rail, a code of width delivers spike packets to its output neuron within a single timestep. Any limit on the number of packets a neuron can receive at once is therefore a limit on code width. We measured this limit on both platforms.
3.4.1. SpiNNaker
sPyNNaker places incoming packets in a circular buffer on each core, allocated with 256 slots by default, of which one is always kept empty, so that at most 255 packets can be held; packets that arrive when the buffer is full are discarded without error.
Training an output neuron on code words of increasing width under the default configuration, the number of synapses potentiated tracked the width exactly up to 255 and then stopped, at 255 or occasionally 256 when a packet was consumed during the burst, for widths of 300, 480 and 992. Raising the buffer to 1024 slots removed the limit: every synapse was potentiated at every width tested. The bound is therefore a default of the software rather than a property of the hardware. It is, however, silent: the network learns a truncated pattern while reporting no fault, and the downstream metrics remain plausible.
To see whether the limit is a fixed capacity, the measurement was repeated under the default buffer with static synapses, as used in the testing network, counting the inputs delivered from the deflection of a non-leaking membrane. Here the limit is neither fixed at 255 nor abrupt: every input arrived up to 385, and beyond that about two in five additional inputs still did. Spreading the same inputs across two and four source populations raised the point at which loss began to 426 and 435. Both observations indicate a buffer that drains while it fills: spreading the inputs spreads
Davies, S. et al.: Preprint submitted to Elsevier
Page 7 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
their arrival in time, and static synapses are cheap enough to process that the buffer empties appreciably during a burst. Plastic synapses cost more per spike, so during training it barely drains and its depth alone sets the limit. The limit was the same at every synaptic weight tested, so it is a count of events rather than of current.
3.4.2. SpiNNaker2
The same deflection measurement on SpiNNaker2 shows a different kind of limit. Every input event reaches the neuron up to 512 simultaneous inputs, and delivery stops abruptly there: 513 inputs produce the deflection of exactly 512. The limit is the same at every synaptic weight tested and does not change when the inputs are split across several source populations, so it is a count of input events per neuron rather than a bound on current or on the traffic from a single source. The measurements were made with the default configuration of py-spinnaker2; whether the limit can be configured, and whether it bounds events per timestep or connections per neuron, was not established. For spatial codes the two coincide, since every bit of a code word is delivered in the same timestep.
3.4.3. Consequences for the encodings
Since a code of width W delivers W input events, each limit bounds the range of values an encoding can represent. Under SpiNNaker's default buffer of 255 packets, Thermometer, which needs N - 1 bits, is limited to 256 values, and Johnson, which needs N/2, to 510; under SpiNNaker2's limit of 512 input events per neuron the corresponding figures are 513 and 1024. Binary and Gray need bits and are unconstrained in practice, and the hybrids lie between the two.
Neither limit is fixed: SpiNNaker's buffer can be enlarged, and SpiNNaker2's limit appears to be a property of its current software. What is fixed is the cost: a spatial code requires one packet, one buffer entry and one synaptic event per bit for every decision, so enlarging the buffer accommodates a wide code but does not make it cheaper. The experiments here use the default configuration, under which N = 256 is the widest range at which every encoding fits. This range also contains the canonical cliff, against .
3.5. Encodings Evaluated
Eight encodings are compared, all over the same values: Binary, Gray, Thermometer, Johnson, and four hybrids. Their conceptual properties are discussed in Sections 2.3 and 2.4; this section gives the constructions used in the experiments, writing v for the semantic value being encoded and W for the resulting code width. Table 4 shows the code words of the canonical cliff pair, 127 and 128, under each.
3.5.1. Binary
The standard base-2 representation, bits. Adjacent values may differ in up to 8 bits; 127 and 128 differ in all of them.
3.5.2. Gray
The reflected binary code
where is bitwise exclusive-or, again 8 bits wide. Each increment of flips exactly one bit of , so adjacent values always differ in a single bit; 127 and 128 map to 01000000 and 11000000. The guarantee is purely local: values far apart in may also be one bit apart.
3.5.3. Thermometer
A unary code of bits in which the first bits are set. Writing for the bit in position of the code word, counted from the left,
so that , a run of ones followed by a run of zeros. The Hamming distance between the code words of two values is exactly their separation, at the cost of a width linear in .
3.5.4. Johnson
A twisted-ring code of bits with distinct states. For the first bits are set; beyond that, the set bits are cleared from the same end at which they were filled, so that the code returns to all zeros after steps. Writing for the bit in position of the code word, counted from the left,
so that while the field is filling and while it is clearing. With four bits the sequence is 0000, 1000, 1100, 1110, 1111, 0111, 0011, 0001, and back to 0000. Filling and clearing must proceed from the same end: filling from one end and clearing from the other retraces earlier states and yields only distinct code words. The Hamming distance between the code words of two values is the shorter of the two distances around the ring, so the extremes 0 and are adjacent.
3.5.5. Hybrid
The hybrid encodings split a value into a coarse part and a fine part, and encode each with a different code: a unary-style code for the coarse part (Thermometer for the linear variant, Johnson for the cyclic one), which preserves distance but is wide, and a Gray code for the fine part, which is compact but preserves only local structure.
A value v is divided by the block size B, giving a block index and an offset within that block. The code word is the concatenation of two disjoint fields:
Davies, S. et al.: Preprint submitted to Elsevier
Page 8 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Table 4
Code words of the canonical Hamming cliff pair 127 and 128. Long codes are written in run-length form, denoting ones followed by zeros.
| Encoding | Width | 127 | 128 | |
|---|---|---|---|---|
| Binary | ||||
| Gray | ||||
| Thermometer | ||||
| Hybrid lin. | ||||
| Hybrid lin. | ||||
| Johnson | ||||
| Hybrid cyc. | ||||
| Hybrid cyc. |
Table 5
The linear hybrid construction at and , giving a 5-bit code: three coarse bits for the four blocks and two fine bits for the offset. For each value , is the block it falls in and its offset within that block; “refl.” is the offset after reflection, equal to in even blocks and to in odd ones. “Coarse” is the Thermometer code of and “fine” the Gray code of the reflected offset; the two concatenated form the code word. Because of the reflection the fine field runs 00, 01, 11, 10 through block 0 and back again through block 1, so that , the number of bits that change from the previous value, is one everywhere, including at the block boundaries and 12.
| refl. | coarse | fine | ||||
|---|---|---|---|---|---|---|
-
the coarse field encodes which of the blocks the value falls in, using Thermometer for the linear variant or a Johnson ring for the cyclic one;
-
the fine field encodes the offset within the block, as a -bit Gray code.
Taken naively this reintroduces a cliff at every block boundary, because the offset would jump from back to while the coarse field also changes, costing up to bits between two adjacent values. The construction therefore reflects the offset in odd-numbered blocks, , so that the offset runs forwards through one block and backwards through the next. At a boundary the two values then share the same fine field and differ only in one bit of the coarse field.
Table 5 works this through for a small case. Reading down the final column, every pair of adjacent values differs in exactly one bit, at every position in the range including the block boundaries at and 12.
The cliff pair of Table 4 behaves the same way at the scale used in the experiments: at , the value 127 sits at the reflected end of odd block 15 and 128 at the start of even block 16, so both have fine field 000 and differ in a single coarse bit.
The construction requires to be a power of two that divides , so that the fine field occupies a whole number of bits and the range splits into whole blocks; with itself a power of two, both hold for every such . The code widths are then
For the cyclic variant the coarse field is a Johnson ring of bits, which has exactly states, one per block. This requires to be even, which it is whenever , since both are powers of two. At there is a single block, the coarse field vanishes, and both variants reduce exactly to Gray. Equation (10a) gives that width directly, but a ring cannot be built over a single block, so for the cyclic variant the endpoint is stated separately. We evaluate and for both variants.
3.5.6. Limiting cases
The block size interpolates between the established encodings. At the fine field vanishes and the linear and cyclic hybrids reduce exactly to Thermometer and Johnson encoding. At the coarse field vanishes and both reduce to Gray encoding. For the cyclic variant this happens earlier, since a Johnson ring of one or two bits is itself a Gray code: from onwards the cyclic hybrid has Gray's Hamming distances exactly. We verified all four identities bit for bit over the 256 values. Thermometer, Johnson and Gray are therefore not separate proposals but points on a single continuum, with Gray the common limit of the linear and cyclic families.
Figure 3 shows the Hamming distance from the anchor value 240 to every other value. The linear family is V-shaped, reaching its maximum at the far end of the range; Thermometer is strictly monotone on each side of the anchor, while the linear hybrids follow the same ramp at slope with the fine-field ripple superimposed. The cyclic family rises to a maximum near , the point diametrically opposite the anchor on the ring, then falls back as the values
Davies, S. et al.: Preprint submitted to Elsevier
Page 9 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks

(a) Binary
(b) Gray
(c) Thermometer
(d) Johnson

(e) Hybrid lin. B=4
(f) Hybrid lin. B=8
(g) Hybrid cyc. B=4
(h) Hybrid cyc. B=8
Figure 3: Hamming distance from the anchor value 240 to every value in 0–255, under each of the eight encodings. Top row, the established codes; bottom row, the hybrids derived from them. Vertical scales differ between panels, since the code widths range from 8 to 255 bits: the comparison is of shape, not of magnitude.

(a) Binary
(b) Gray
(c) Thermometer
(d) Johnson

(e) Hybrid lin. B=4
(f) Hybrid lin. B=8
(g) Hybrid cyc. B=4
(h) Hybrid cyc. B=8
Figure 4: Hamming distance between every pair of values in 0–255, under each of the eight encodings. Thermometer is a plane rising away from the diagonal, since exactly; Johnson folds that plane into a ridge, the distance falling again beyond N/2 as the values meet around the ring. The hybrids reproduce those shapes in stepped form, the step width being the block size. Binary and Gray are flat and textured: distance is roughly constant away from the diagonal and carries little information about separation. Vertical scales differ between panels, since the code widths range from 8 to 255 bits.
approach 0, which lies only 16 steps from 240 around the ring. Gray, the limit of both families, shows no systematic trend.
3.5.7. Width and input activity
Because every bit costs one spike packet per classification, width is the number of input events per decision. On event-driven hardware the dynamic energy of a computation grows with the number of events it involves (Furber, 2012; Davidson and Furber, 2021), so width bounds the input contribution to that energy; energy itself was not measured here. Width is also the number of buffer entries each decision occupies on the receiving core (Section 3.4).
4. Results
4.1. Hamming Structure of the Encodings
Before considering network behaviour we characterise the encodings themselves, over all value pairs, shown in Figure 4. Hamming distance is the appropriate measure here because each differing bit corresponds to exactly one synapse whose contribution to the output neuron reverses, from an excitatory +w to an inhibitory -w under the reciprocal wiring of Eq. (6), so the distance between two code words is the loss of drive they produce, in units of 2w. Three measures are reported, because no single statistic captures the property at issue.
Davies, S. et al.: Preprint submitted to Elsevier
Page 10 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
4.1.1. Cliff severity
Cliff severity is the largest cost of a single semantic step, expressed in units of the smallest distance the code ever puts between two distinct values:
following Section 2.2, with adjacency taken under each encoding's own metric, so that for the ring codes the pair and 0 is included. We report it together with the proportion of adjacent pairs that cost more than one bit. Every other encoding considered has a severity of exactly 1, and none of its adjacent pairs costs more than one bit: no pair of values adjacent under its metric, including the wraparound pair of the ring codes, differs in more than a single bit, by construction.
Binary has a severity of 8, with of adjacent pairs costing more than one bit. The cliff is therefore not an isolated defect at the power-of-two boundary but the tail of a geometric distribution, in which half of all adjacent pairs cost one bit, a quarter cost two, an eighth three, and so on. Every other encoding considered has a severity of exactly 1: no pair of values adjacent under its metric, including the wraparound pair of the ring codes, differs in more than a single bit, by construction.
4.1.2. Global monotonicity
Global monotonicity is measured by Spearman's rank correlation between semantic distance and Hamming distance, taken over all pairs of values: each pair contributes one observation, its semantic distance and the distance between its code words. Spearman's coefficient is the Pearson correlation of the ranks of the two quantities (Spearman, 1904); it equals 1 when Hamming distance increases monotonically with semantic distance, 0 when the two are unrelated, and it does not assume the relation is linear, which matters because only Thermometer and Johnson make it so. Hamming distances are heavily tied, since many pairs of values sit at the same distance, so the tie-corrected form is used throughout. Each encoding is scored against its own metric (Section 2.2.2), for the ring codes and for the rest; scored against the other, Thermometer and Johnson would both fall from 1.000 to 0.747.
Global monotonicity separates the encodings that cliff severity does not. Thermometer and Johnson reach against and respectively; the four hybrids evaluated here retain between 0.980 and 0.998; Binary scores 0.323 and Gray only 0.374. Gray's reflected construction also makes it cyclic, but scored against it does barely better, at 0.392. Gray therefore removes the cliff entirely while carrying little information about semantic separation, the distinction anticipated in Section 2.4.
Table 6 traces the whole hybrid family on this measure. The exchange between width and structure is strongly nonlinear: reducing the linear variant from Thermometer's 255 bits to 34 at lowers only from 1.000 to 0.990,
Table 6
The hybrid family across block sizes at . is Spearman's correlation between Hamming and semantic distance, circular for the cyclic variant. coincides bit for bit with Thermometer and Johnson. From both variants coincide bit for bit with Gray, and their values differ only because the cyclic variant is scored against circular distance. The cyclic variant reaches Gray's Hamming distances one step earlier: at its coarse field is a two-bit Johnson ring, which is the two-bit Gray code with its bits swapped.
| B | Linear | Cyclic | equivalent encoding | ||
|---|---|---|---|---|---|
| width | width | ||||
| 1 | 255 | 1.000 | 128 | 1.000 | Thermometer / Johnson |
| 2 | 128 | 1.000 | 65 | 0.999 | |
| 4 | 65 | 0.998 | 34 | 0.996 | |
| 8 | 34 | 0.990 | 19 | 0.980 | |
| 16 | 19 | 0.956 | 12 | 0.911 | |
| 32 | 12 | 0.835 | 9 | 0.696 | |
| 64 | 9 | 0.579 | 8 | 0.392 | |
| 128 | 8 | 0.374 | 8 | 0.392 | Gray |
| 256 | 8 | 0.374 | 8 | 0.392 | Gray |
Table 7
Neighbourhood fragmentation at four radii: the mean number of disjoint runs of consecutive values in the Hamming ball around each anchor, averaged over all 256 anchors. The radius is a fraction of the code width, with a floor of one bit; for the 8-bit codes the three smaller fractions all fall below one bit, so their columns coincide. The text quotes the 10% column.
| Encoding | Radius, fraction of width | |||
|---|---|---|---|---|
| 2% | 5% | 10% | 20% | |
| Binary | 7.5 | 7.5 | 7.5 | 23.9 |
| Gray | 7.0 | 7.0 | 7.0 | 21.1 |
| Thermometer | 1.0 | 1.0 | 1.0 | 1.0 |
| Hybrid lin. B=4 | 3.0 | 3.9 | 3.7 | 3.4 |
| Hybrid lin. B=8 | 3.9 | 6.8 | 7.6 | 6.7 |
| Johnson | 1.0 | 1.0 | 1.0 | 1.0 |
| Hybrid cyc. B=4 | 3.0 | 4.0 | 4.0 | 4.0 |
| Hybrid cyc. B=8 | 4.0 | 4.0 | 7.0 | 8.0 |
whereas the last factor of four in width, from 34 bits to Gray's 8, costs almost all of the remaining structure.
4.1.3. Neighbourhood quality
Neighbourhood quality asks what a code's local region contains. Around each anchor we take the Hamming ball of radius , with a floor of one bit, meaning every code word within that many bits of the anchor, and count how many disjoint runs of consecutive values it holds; the result is averaged over all anchors. The radius is chosen to match the network's behaviour: by the tolerance law of Section 4.4, a ball of radius is what the network accepts at a gain of times its minimum. The text quotes , which corresponds to a gain of 1.25, at the low end of the range swept on hardware, where the network has only just begun to tolerate mismatch.
Davies, S. et al.: Preprint submitted to Elsevier
Page 11 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
A Hamming ball around a Gray code word contains about nine values scattered across seven disjoint runs and reaching 144 semantic units from the anchor, behaviour essentially indistinguishable from Binary. The same ball under Thermometer is a single contiguous interval. Table 7 repeats the measure at 2%, 5% and 20%, and the ordering of the encodings is the same at every radius: Thermometer and Johnson give a single run, the hybrids at most B runs, and Binary and Gray seven or more, rising above twenty at 20%.
4.1.4. Summary
Cliff severity separates Binary from everything else, but no further: all seven remaining encodings are equally clean by that measure. Global monotonicity and neighbourhood quality then separate those seven, and they do so in the same direction: Gray's Hamming balls are as fragmented as Binary's despite its perfect adjacency. Removing the Hamming cliff is therefore necessary for the clustering behaviour sought here, but it is not sufficient.
4.2. Two Trained Values
The network was trained on the anchor together with a second value , and tested exhaustively over all 256 values. Fourteen second values were used, listed in Table 8, chosen from the binary form of the anchor, . The first four, 241, 242, 244 and 248, set one of its four zero bits each, so they lie one bit from the anchor in Binary but 1, 2, 4 and 8 units from it in value. The next four, 239, 238, 236 and 232, lie at the same semantic separations below the anchor, where Binary places them up to five bits away; the two groups therefore compare equal semantic distances under very different binary Hamming distances. Five further values, 224, 192, 128, 64 and 0, extend the separation across the rest of the range, and 255 tests the top of the range.
Table 8 also shows why the sweep is informative: the same pair of values can be one bit apart under one encoding and many bits apart under another. Under Thermometer encoding the Hamming distance is the semantic separation exactly, and under the hybrids it is that separation scaled by about 1/B, with a ripple of up to bits from the fine field that dominates only at small separations. Johnson encoding gives its circular equivalent, so that the value 0, which lies 240 steps from the anchor, is only 16 bits away. Gray encoding, by contrast, stays between one and four bits across the whole range, which is the of Section 4.1 in concrete form.
Table 9 summarises the outcome and Table A.2 gives the complete metrics. The false positives are not arbitrary. If the network accepted precisely the code words lying between the two trained ones, their number would be the Hamming distance between the two trained code words minus one, . Johnson meets this exactly for all fourteen pairs, and Thermometer and the hybrids for eight to ten, exceeding it by one or two in the rest. For Thermometer trained on 240 and 0, the 239 accepted values are exactly the integers between them, consistent with the distance of 240 recorded in Table 8. They are neighbouring activations rather than errors: the network has generalised over the interval its two trained values span.
Binary does not obey the relation. At , a Hamming distance of 5, it produces 30 false positives, an excess of 26; and since 239 and 240 are adjacent, no value lies between them in the range, so none of the 30 is a neighbouring activation.
This inverts the apparent ranking by accuracy. Thermometer records the lowest mean accuracy over the fourteen pairs (0.824) precisely because it generalises over the largest contiguous intervals, while Binary’s higher figure (0.974) conceals scattered errors. Accuracy is therefore a misleading summary here, and the relation between false positives and Hamming distance is the more informative quantity.
4.2.1. A systematic effect of bit count
Under Binary, the required scaling factor varies slightly between second values at equal Hamming distance, and the variation is not noise. It depends on the number of 1-bits in the second code word and not on their position. At the second value differs from the anchor in a single bit. The four values that do so by setting one of its zero bits, 241, 242, 244 and 248, each have five set bits, and all require exactly 2.96051, although the flipped bit occupies a different position in each. The remaining one-bit neighbour, 224, clears a set bit instead and so has three, and it requires 2.95312 (the search records the factor to five decimals; the tables report it rounded up to two). At the factor rises monotonically with bit count, from 5.13955 for 0 (no set bits) through 5.18480 for 238 (six) to 5.19773 for 255 (eight). Within any Hamming-distance group the spread is at most 1.1%.
This follows from the dual-rail training protocol. Bits equal to 1 and bits equal to 0 are presented at different times relative to the teacher spike (Section 3.1), so their synapses are potentiated at different points on the STDP curve and need not acquire identical weights. A code word with more set bits therefore draws proportionally more of its drive from one rail and requires marginally more gain to reach threshold. The effect is an order of magnitude smaller than the differences between encodings reported here and does not affect any comparison, but it accounts for the residual variation within a Hamming-distance group, and it reappears in Section 4.4 where the tolerance threshold falls exactly on a boundary between Hamming distances.
4.3. Robustness as the Trained Set Grows
A contiguous cluster of values around 240 was trained, growing from one to eight members, reproducing and extending the progression of Davies et al. (2025).
Tables 10 and 11 report the results, and Table A.3 the complete metrics. Binary degrades as that work predicts, and no other encoding degrades in the same way: the few untrained values the other encodings accept lie immediately beside the trained cluster. From two trained values onward Binary produces between 24 and 46 false positives, while Gray, Johnson and three of the four hybrids accept no untrained value at any trained-set size.
Davies, S. et al.: Preprint submitted to Elsevier
Page 12 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Table 8
The fourteen second values of Section 4.2 and their Hamming distance from the anchor 240 under each encoding, with their semantic separation for comparison. The groups are the close neighbours above the anchor, those below, progressively distant values, and the top of the range. Thermometer reproduces the separation exactly and Johnson its circular equivalent; the hybrids scale it by 1/B; Binary and Gray bear no consistent relation to it. The code words of every value are listed in Table A.1.
| Second value | Semantic separation | Hamming distance from the anchor 240 | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Binary | Gray | Linear family | Cyclic family | ||||||
| anchor 240 | |||||||||
| 241 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 242 | 2 | 1 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| 244 | 4 | 1 | 2 | 4 | 2 | 2 | 4 | 2 | 2 |
| 248 | 8 | 1 | 2 | 8 | 2 | 2 | 8 | 2 | 2 |
| 239 | 1 | 5 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 238 | 2 | 4 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| 236 | 4 | 3 | 2 | 4 | 2 | 2 | 4 | 2 | 2 |
| 232 | 8 | 2 | 2 | 8 | 2 | 2 | 8 | 2 | 2 |
| 224 | 16 | 1 | 2 | 16 | 4 | 2 | 16 | 4 | 2 |
| 192 | 48 | 2 | 2 | 48 | 12 | 6 | 48 | 12 | 6 |
| 128 | 112 | 3 | 2 | 112 | 28 | 14 | 112 | 28 | 14 |
| 64 | 176 | 3 | 4 | 176 | 44 | 22 | 80 | 20 | 10 |
| 0 | 240 | 4 | 2 | 240 | 60 | 30 | 16 | 4 | 2 |
| 255 | 15 | 4 | 1 | 15 | 3 | 1 | 15 | 3 | 1 |
Table 9
Two trained values: the anchor 240 together with each of the fourteen second values of Section 4.2 and Table 8. If the network accepted exactly the code words lying between the two trained ones, the number of false positives would be , where is the Hamming distance between them. “” counts how many of the fourteen pairs meet this exactly; “excess” is the largest number of false positives above for any pair; “total ” and “mean acc.” are summed and averaged over the fourteen pairs.
| Encoding | Width | excess | total | mean acc. | |
|---|---|---|---|---|---|
| Binary | 8 | 5/14 | +26 | 93 | 0.9741 |
| Gray | 8 | 3/14 | +6 | 29 | 0.9919 |
| Thermometer | 255 | 10/14 | +2 | 630 | 0.8242 |
| Hybrid lin. | 65 | 10/14 | +1 | 155 | 0.9568 |
| Hybrid lin. | 34 | 8/14 | +1 | 81 | 0.9774 |
| Johnson | 128 | 14/14 | +0 | 303 | 0.9155 |
| Hybrid cyc. | 34 | 10/14 | +1 | 75 | 0.9791 |
| Hybrid cyc. | 19 | 8/14 | +1 | 41 | 0.9886 |
The homeostatic factor exposes the mechanism. Because the weight vectors are summed, an encoding whose trained code words reinforce coherently should require a factor of for trained values, where is the factor required by a single trained value. Thermometer, Johnson and the hybrids stay close to this, exceeding it by at most 4 to 21% depending on the encoding, whereas Binary requires up to 4.03 times that value, at . The excess is the “don’t care” cancellation of Section 3.1.2, measured directly: where trained code words disagree, their summed weights cancel, and the gain that compensates for the loss admits the false positives.
Gray, though also free of the cliff, does not stay at the coherent value: its factor rises to 1.61 times at . Its weak global structure is already costing gain, even where it has not yet cost accuracy; Section 4.5 shows the same trend at a wider range.
Where the accepted values fall matters as much as how many there are. Every untrained value accepted by Thermometer and by the linear hybrid at , the only encodings other than Binary to accept any, lies within four semantic units of the trained cluster, at a median distance of under three: these are neighbouring activations. Binary’s lie at a median of 8.9 and reach 142 units away, with only a quarter falling near the cluster, and are false positives in the ordinary sense. Where the structured encodings accept untrained values at all, they generalise over the neighbourhood of what they were taught; Binary responds to unrelated values.
Gray’s perfect accuracy here deserves comment, given its poor global structure. The trained set is a tight contiguous cluster, precisely the regime in which local smoothness suffices; Gray’s weakness appears in Section 4.2, where the trained values are far apart and its false positives are scattered. Local smoothness is enough for local clustering, but not when the network must discriminate across the range.
4.3.1. The excess is predictable
The factors of Table 10 are not only measurable but predictable from the code words alone. Write each code word as a vector , taking +1 where the bit is one and -1 where it is zero. Training on a single
Davies, S. et al.: Preprint submitted to Elsevier
Page 13 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Table 10
A contiguous cluster around 240, grown from one to eight trained values. Top: homeostatic factor. Middle: false positives over all 256 values. Bottom: the factor divided by , the value coherent summation would require – 1.00 means the summed weights reinforce perfectly, and the excess is the “don’t care” cancellation. Absolute factors are not comparable between encodings, because the output threshold is scaled with code width (Section 3.1): 8-bit codes sit near 5 and wide codes near 2 for that reason alone. Compare trends within a row, or the normalised values in the bottom block.
| Encoding | n=1 | n=2 | n=3 | n=4 | n=6 | n=8 |
|---|---|---|---|---|---|---|
| Homeostatic factor | ||||||
| Binary | 5.18 | 6.94 | 6.95 | 3.48 | 2.32 | 1.74 |
| Gray | 5.17 | 2.96 | 2.30 | 1.73 | 1.39 | 1.04 |
| Thermometer | 2.47 | 1.24 | 0.84 | 0.63 | 0.43 | 0.32 |
| Hybrid lin. B=4 | 2.15 | 1.09 | 0.74 | 0.56 | 0.38 | 0.29 |
| Hybrid lin. B=8 | 2.11 | 1.09 | 0.75 | 0.57 | 0.39 | 0.29 |
| Johnson | 2.24 | 1.14 | 0.76 | 0.58 | 0.39 | 0.30 |
| Hybrid cyc. B=4 | 2.11 | 1.09 | 0.75 | 0.57 | 0.39 | 0.29 |
| Hybrid cyc. B=8 | 2.19 | 1.16 | 0.82 | 0.62 | 0.44 | 0.33 |
| False positives | ||||||
| Binary | 0 | 30 | 46 | 28 | 26 | 24 |
| Gray | 0 | 0 | 0 | 0 | 0 | 0 |
| Thermometer | 0 | 0 | 4 | 2 | 6 | 0 |
| Hybrid lin. B=4 | 0 | 0 | 0 | 0 | 2 | 8 |
| Hybrid lin. B=8 | 0 | 0 | 0 | 0 | 0 | 0 |
| Johnson | 0 | 0 | 0 | 0 | 0 | 0 |
| Hybrid cyc. B=4 | 0 | 0 | 0 | 0 | 0 | 0 |
| Hybrid cyc. B=8 | 0 | 0 | 0 | 0 | 0 | 0 |
| Factor relative to coherent summation | ||||||
| Binary | 1.00 | 2.68 | 4.03 | 2.69 | 2.69 | 2.69 |
| Gray | 1.00 | 1.15 | 1.33 | 1.34 | 1.61 | 1.61 |
| Thermometer | 1.00 | 1.00 | 1.02 | 1.02 | 1.04 | 1.04 |
| Hybrid lin. B=4 | 1.00 | 1.01 | 1.03 | 1.04 | 1.06 | 1.08 |
| Hybrid lin. B=8 | 1.00 | 1.03 | 1.07 | 1.08 | 1.11 | 1.10 |
| Johnson | 1.00 | 1.02 | 1.02 | 1.04 | 1.04 | 1.07 |
| Hybrid cyc. B=4 | 1.00 | 1.03 | 1.07 | 1.08 | 1.11 | 1.10 |
| Hybrid cyc. B=8 | 1.00 | 1.06 | 1.12 | 1.13 | 1.21 | 1.21 |
Table 11
Semantic distance of the false positives from the trained cluster, pooled over all trained-set sizes. “within 4” is the share falling within four semantic units – the network generalising over a contiguous zone, as opposed to firing on unrelated values. Encodings with no false positives are marked “-”.
| Encoding | total | median dist. | max dist. | within 4 |
|---|---|---|---|---|
| Binary | 154 | 8.9 | 142 | 25% |
| Gray | - | - | - | - |
| Thermometer | 12 | 1.7 | 3 | 100% |
| Hybrid lin. B=4 | 10 | 2.2 | 4 | 100% |
| Hybrid lin. B=8 | - | - | - | - |
| Johnson | - | - | - | - |
| Hybrid cyc. B=4 | - | - | - | - |
| Hybrid cyc. B=8 | - | - | - | - |
value and applying the reciprocal wiring of Eq. (6) gives the output neuron a weight vector proportional to , and summing over independently trained values gives . The drive produced by a trained value is therefore the inner product
where is the Hamming distance between the two code words. Each pair contributes its full width less twice the distance between them: bits on which the two agree reinforce, and bits on which they disagree cancel.
The homeostatic factor must make every trained value fire, so it is set by the weakest of them: it is inversely proportional to the smallest such drive over the trained set, and its ratio to the coherent value is nW divided by that minimum. This requires no measurement, only the pairwise distances of the trained code words. Evaluated for the clusters of Table 10 it gives 4.00 for Binary at n = 3 against the measured 4.03, 1.60 for Gray at n = 8 against 1.61, and 1.19 for the cyclic hybrid at B = 8 against 1.21; across all forty conditions the largest discrepancy is 0.03. The prediction assumes that every bit learns a weight of the same magnitude, and the residual is consistent with the small difference between the two rails described in Section 4.2.1.
4.4. Homeostatic Tolerance and Topology
Sections 4.2 and 4.3 operate at the minimum homeostatic factor. With a single trained value the network there is an exact-match detector: every other code word differs from the
Davies, S. et al.: Preprint submitted to Elsevier
Page 14 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Table 12 Accepted sets against the predicted Hamming ball of radius , over all four targets and seven multipliers plus the minimum. “one shell more” counts cells in which the hardware accepted the next Hamming shell as well; “partial” counts cells at which the prediction falls exactly on a shell boundary.
| Encoding | W | exact | one shell more | partial |
|---|---|---|---|---|
| Binary | 8 | 31/32 | 0 | 1 |
| Gray | 8 | 31/32 | 0 | 1 |
| Thermometer | 255 | 20/32 | 12 | 0 |
| Hybrid lin. B=4 | 65 | 28/32 | 4 | 0 |
| Hybrid lin. B=8 | 34 | 32/32 | 0 | 0 |
| Johnson | 128 | 32/32 | 0 | 0 |
| Hybrid cyc. B=4 | 34 | 32/32 | 0 | 0 |
| Hybrid cyc. B=8 | 19 | 32/32 | 0 | 0 |
trained one in at least one bit and so receives less drive. To observe what the network generalises to, a single value was trained and the factor raised above that minimum by seven multipliers from 1.1 to 8, at four targets: the range ends 0 and 255, where the linear and cyclic topologies differ, and the interior values 128 and 240, where they should not. At each level all 256 values were presented, giving 256 conditions over the eight encodings, four targets and eight factor levels.
4.4.1. Tolerance is a radius in code space
A bit that disagrees with the trained code word swaps an excitatory contribution for an inhibitory , by the reciprocal wiring of Eq. (6), and so costs of drive. At a gain times the minimum, the output neuron therefore still fires for any code word within
mismatched bits of the target, where is the code width. The network should accept exactly the code words at distance or less.
The derivation uses only the code width and the reciprocal wiring of a single output neuron, so it applies to any neuron receiving a dual-rail input in this way: in a layer of neurons trained on different values, each would accept its own ball of radius about its own trained code word. Two conditions bound it. Two conditions bound it. The uniform weight assumes a single trained value; with several, the weights differ from bit to bit and the drive becomes the inner product of Eq. (12), of which Eq. (13) is the special case. What the network computes is an inner product between its input and the accumulated weight vector, and Hamming distance governs its behaviour because, when that vector is a single code word with weights of uniform magnitude, the two determine each other. The derivation also assumes that a neuron's firing depends only on its own drive, so it would not survive lateral inhibition or any competitive mechanism between output neurons. Neither case is tested here.
Table 12 compares this prediction with the hardware. The accepted set has exactly the predicted size in 238 of the 256 measured conditions. Where the accepted values were few enough to be recorded individually, agreement in size always meant agreement in content: all 140 such sets are identical to the prediction, value for value. Johnson and three of the four hybrids match in every condition.
The remaining 18 conditions depart from the prediction by at most one bit of tolerance, and always towards accepting more rather than less. In 16 of them the network also accepted the next Hamming shell, that is every code word at exactly one further bit of distance. Twelve occur in Thermometer and four in the linear hybrid at , and the cause is the resolution of the measurement rather than of the network. The minimum factor is located to within 0.01 and rounded upwards, so the gain actually applied can exceed the nominal multiple by up to , about here. By Eq. (13) this raises the effective radius by up to times that fraction: about half a bit for Thermometer at , a quarter of a bit at , and less for narrower codes. Wherever the predicted radius falls just short of an integer, that is enough to admit the next shell: the linear hybrid at departs only at , where its predicted radius is 2.95. Because the factor is rounded upwards, the error is always on the tolerant side.
The last two conditions occur where Eq. (13) evaluates to an exact integer, placing the threshold on a shell boundary: Binary at target 128 and Gray at target 255, both at tolerance, where . There the network accepts every code word within one bit of the target and seven of the twenty-eight at distance two. The seven are not arbitrary: they are precisely those code words containing the same number of set bits as the target, while the twenty-one rejected ones each contain two more. This is the asymmetry reported in Section 4.2.1. Because the two rails are presented at different times relative to the teacher spike, their synapses acquire slightly different weights, so a code word with more set bits requires marginally more gain to reach threshold. The effect is of order one percent and has no consequence except where the threshold falls exactly on a shell boundary, as it does here.
Finally, the measurement is reproducible. The target 240 trained alone in this experiment is the case of Section 4.3, and the two independent hardware runs return identical minimum factors for all eight encodings.
4.4.2. The encoding determines what the radius means
Since the gain controls a radius in code space, the semantic meaning of tolerance is fixed entirely by the encoding (Table 13).
Thermometer and Johnson accept a single contiguous interval at every tolerance and at every target, and it grows smoothly: from the target 240, the furthest accepted value lies 12 semantic units away at and 111 away at for Thermometer, and 5 then 56 for Johnson. For these encodings, raising the homeostatic factor widens the detected
Davies, S. et al.: Preprint submitted to Elsevier
Page 15 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Table 13
Homeostatic tolerance, target 240. Each cell gives the number of values accepted and, in parentheses, the number of disjoint runs of consecutive values they form; (1) is a single semantic interval. Counts are limited by the end of the range, which lies only 15 values above the target. The multiplier scales each encoding's own minimum factor.
| Encoding | ×1.1 | ×1.25 | ×1.5 | ×2.0 | ×3.0 | ×5.0 | ×8.0 |
|---|---|---|---|---|---|---|---|
| Binary | 1 (1) | 1 (1) | 9 (7) | 37 (21) | 37 (21) | 93 (35) | 93 (35) |
| Gray | 1 (1) | 1 (1) | 9 (7) | 37 (22) | 37 (22) | 93 (36) | 93 (36) |
| Thermometer | 25 (1) | 42 (1) | 58 (1) | 80 (1) | 101 (1) | 118 (1) | 127 (1) |
| Hybrid lin. B=4 | 20 (4) | 36 (3) | 52 (3) | 76 (3) | 96 (2) | 116 (3) | 124 (3) |
| Hybrid lin. B=8 | 6 (4) | 27 (5) | 44 (4) | 68 (5) | 92 (4) | 108 (4) | 116 (5) |
| Johnson | 11 (1) | 25 (1) | 43 (1) | 65 (1) | 85 (1) | 103 (1) | 113 (1) |
| Hybrid cyc. B=4 | 5 (3) | 20 (4) | 36 (4) | 60 (4) | 84 (4) | 100 (4) | 108 (4) |
| Hybrid cyc. B=8 | 1 (1) | 6 (4) | 32 (8) | 48 (8) | 80 (8) | 96 (8) | 112 (8) |
Table 14
Values accepted only by going round the end of the range, at ×2.0 tolerance, by target. Only a cyclic encoding should accept any; the interior target 128 is a control at which none should. Binary and Gray are marked n/a: their accepted sets are scattered, so a value that happens to lie nearer by wrapping reflects a stray hit, not topology.
| Encoding | 0 | 128 | 240 | 255 |
|---|---|---|---|---|
| Binary | n/a | n/a | n/a | n/a |
| Gray | n/a | n/a | n/a | n/a |
| Thermometer | 0 | 0 | 0 | 0 |
| Hybrid lin. B=4 | 0 | 0 | 0 | 0 |
| Hybrid lin. B=8 | 0 | 0 | 0 | 0 |
| Johnson | 32 | 0 | 17 | 32 |
| Hybrid cyc. B=4 | 28 | 0 | 16 | 28 |
| Hybrid cyc. B=8 | 20 | 0 | 12 | 20 |
neighbourhood around the trained value, and does nothing else.
Binary and Gray behave differently in kind. Their 8-bit code space admits only a few distinct radii, so tolerance is quantised into shells of 1, 9, 37 and 93 code words: the network accepts nothing beyond the target up to , and then nine values at once. Under Binary those nine are scattered across seven disjoint runs and reach 128 semantic units from the target, and at the 93 accepted values form 35 runs; under Gray the nine reach 225 units away. Raising the factor for these encodings admits more values, but not nearer ones.
The hybrids lie between the two. Their accepted sets grow smoothly with tolerance, as the unary codes do, but are broken into disjoint runs – at most four at and eight at . The count rises to that bound and stays there, unlike Binary's, which keeps growing, and it follows from the fine field: within a block the Gray code carries no global ordering, so the set of accepted code words crosses block boundaries unevenly.
Combining the tolerance law of Eq. (13) with the block structure of Section 3.5 gives a scaling relation. The semantic radius detected by a hybrid encoding is the product of its block size and its Hamming tolerance, , which holds in all sixty conditions where the accepted set extends beyond the trained value. Substituting the code widths of Eq. (10) and neglecting the term gives for the linear family and for the cyclic one, in which the block size cancels. The detected neighbourhood therefore depends only on the value range, the gain and the topology, and not on the width of the code used to represent it: at tolerance the furthest value accepted by Thermometer and by the linear hybrids at and lies 111, 112 and 112 units from the target, while the three codes occupy 255, 65 and 34 bits respectively. Narrowing the code therefore leaves the size of the detected neighbourhood unchanged, though, as noted above, it does cost its contiguity.
4.4.3. Topology
At the range ends the linear and cyclic families separate cleanly (Table 14). Johnson and the cyclic hybrids accept values reached only by passing the end of the range: at target 255 with ×2 tolerance, Johnson accepts 223 to 255 and 0 to 31, a symmetric interval of 32 values on either side of the target. Thermometer and the linear hybrids never do so, at any target or tolerance, and at the interior target 128 none of the structured encodings does, as expected when the range ends lie beyond reach. The topology of each code, established analytically in Section 2.4, is therefore reproduced in the behaviour of the trained network.
4.5. Extending the Range to 1024 Values
At , Thermometer would need 1023 bits and Johnson 512. Under the default configuration of Section 3.4 neither fits on SpiNNaker, and both would be silently truncated; Johnson would just fit within SpiNNaker2's limit of 512 input events. The buffer could be enlarged to accommodate them, but each decision would then occupy 1023 or 512 buffer entries and deliver as many packets. The hybrids fit within the default: 130 and 67 bits for the linear variant at and 16, and 67 and 36 bits for the cyclic. The comparison at this range is therefore with Binary and Gray, the only established codes that also fit the default, repeating the protocol of ection 4.3 around the value 960 (1111000000, the 10-bit analogue of 240). Table 15
Davies, S. et al.: Preprint submitted to Elsevier
Page 16 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Table 15
A contiguous cluster around 960 at . Thermometer (1023 bits) and Johnson (512 bits) exceed the default input capacity of Section 3.4 at this range; the comparison is with the only established codes that fit within it. Top: false positives over all 1024 values. Bottom: the homeostatic factor relative to coherent summation, .
| Encoding | Width | n=1 | n=2 | n=4 | n=8 |
|---|---|---|---|---|---|
| False positives | |||||
| Binary | 10 | 0 | 125 | 124 | 120 |
| Gray | 10 | 0 | 0 | 0 | 0 |
| Hybrid lin. B=8 | 130 | 0 | 0 | 12 | 0 |
| Hybrid lin. B=16 | 67 | 0 | 0 | 0 | 24 |
| Hybrid cyc. B=8 | 67 | 0 | 0 | 0 | 16 |
| Hybrid cyc. B=16 | 36 | 0 | 0 | 0 | 0 |
| Factor relative to coherent summation | |||||
| Binary | 10 | 1.00 | 3.36 | 3.36 | 3.38 |
| Gray | 10 | 1.00 | 1.11 | 1.26 | 1.45 |
| Hybrid lin. B=8 | 130 | 1.00 | 1.02 | 1.04 | 1.04 |
| Hybrid lin. B=16 | 67 | 1.00 | 1.01 | 1.04 | 1.08 |
| Hybrid cyc. B=8 | 67 | 1.00 | 1.01 | 1.04 | 1.08 |
| Hybrid cyc. B=16 | 36 | 1.00 | 1.02 | 1.06 | 1.10 |
summarises the outcome and Table A.4 gives the complete metrics. Every encoding trained correctly, and no trained value was missed.
Binary degrades more severely than at 8 bits. With two trained values, 959 and 960, it accepts 125 untrained values against 2 trained ones, a precision of 0.016, and its factor runs at 3.4 times the coherent value from onwards. The accepted values are the block 896 to 1022: every value whose three highest bits are 111, except 1023. This is the cancellation of Section 3.1.2 at its most visible. The two trained values lie either side of a seven-bit cliff, so the seven low-order synapses on which they disagree cancel, and the network is left detecting only the three bits they share. Its acceptances are contiguous, but their extent is set by the binary structure of the code rather than by the trained values: a block of 127 values from two.
The hybrids remain coherent, their factors within 10% of at every trained-set size, and accept no untrained value in 13 of their 16 conditions. Where they do, 12 to 24 values at a time, the accepted values arrive in short runs aligned with the block structure: for the linear hybrid at B = 16 with eight trained values, runs of four at 928–931, 944–947, 952–955, 964–967, 972–975 and 988–991. This is the fine-field fragmentation of Section 4.4 at a larger block size. All of them lie within 28 units of the cluster in a range of 1024, but only 38% fall within four units, compared with all of Thermometer's at N = 256: the hybrids generalise to the neighbourhood of the cluster, but less tightly than the unary codes they replace.
Gray again accepts no untrained value, while its factor rises steadily, from 1.11 to 1.45 times the coherent value as the cluster grows. This reproduces the trend of Section 4.3 at a wider range, and indicates that its weak global structure is consuming homeostatic margin before it produces errors.
The hybrids thus deliver at 1024 values what the unary codes deliver at 256: coherent scaling, and acceptances confined to the neighbourhood of the trained values. They do so within a default configuration that the unary codes exceed, and at roughly an eighth to a fifteenth of the width of the unary code with the same topology.
5. Discussion
The results support four main conclusions about spatial representation in the SNN architecture studied here.
First, homeostatic scaling acts in code space rather than semantic space. For a single trained pattern, increasing the gain enlarges the set of code words whose Hamming distance from the target remains within the firing threshold. Equation (13) predicts this Hamming radius from code width and gain alone, and the hardware measurements reproduce the predicted accepted set exactly in 238 of 256 conditions; of the remaining 18, sixteen admit one further Hamming shell where the predicted radius falls just short of an integer and the resolution of the homeostatic search tips it over, and two fall exactly on a shell boundary, where the small asymmetry between rail weights determines which code words fire. What this tolerance means semantically is therefore decided entirely by how the encoding embeds the underlying variable.
Second, local continuity and global distance preservation are distinct properties. Gray encoding guarantees a one-bit transition between adjacent values and so removes the Hamming cliff, but its global Hamming distance is only weakly related to semantic separation: , barely above Binary's 0.323. Thermometer and Johnson encode linear and circular distance exactly, and the hybrids retain most of this structure at much smaller widths. This explains why Gray performs well when the trained values form a compact cluster, yet needs progressively more homeostatic margin as the trained set grows, reaching 1.61 times the coherent value, whereas Thermometer, Johnson and the hybrids stay within 21%.
Third, the interaction between several learned patterns can be predicted from their code geometry. In the bipolar representation of Eq. (12), agreement between two code words reinforces the accumulated synaptic drive and disagreement cancels it, so the additional homeostatic factor required by a trained set follows from its pairwise Hamming distances, with a maximum discrepancy of 0.03 from the measured values (Section 4.3.1). The same mechanism explains the large gain that Binary encoding requires, and why its acceptances follow the bits that values share rather than their proximity: scattered across the range at 256 values, and at 1024 values the aligned block of values sharing the three highest bits of the trained values.
Fourth, semantic structure has a hardware cost. A spatial code of width delivers input events to the receiving neuron for every decision, and the number of simultaneous
Davies, S. et al.: Preprint submitted to Elsevier
Page 17 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
input events a neuron can accept bounds the usable width: about 255 under the default configuration of first-generation SpiNNaker, where wider codes are silently truncated, and 512 on SpiNNaker2 (Section 3.4). Thermometer and Johnson offer exact distance preservation at an event count that grows linearly with the number of represented values, while the block size of the hybrids controls how much global structure and neighbourhood contiguity is kept for a given width. The choice is therefore not simply between “accurate” and “compact” codes, but between combinations of semantic topology, tolerance resolution and per-decision event load. In practice, this suggests a simple rule: choose a cyclic or linear code to match the topology of the variable; use Thermometer or Johnson when the range fits within the input limit; and otherwise use the smallest block size whose width, from Eq. (10), fits within it, since smaller blocks keep neighbourhoods more contiguous.
5.1. Limitations
The evaluation uses synthetic values over a single range at a time, one network architecture, and first-generation SpiNNaker for every result except the input-capacity measurements. The experiments ran slower than real time, so the processing cost of wide codes, which would bound the rate of decisions at real time, was not measured. On SpiNNaker2 we established the limit of 512 input events per neuron but not its origin: whether it can be configured, and whether it limits events per timestep or connections per neuron, remain open. The results are also drawn from a single output neuron; the tolerance law is derived per neuron and should extend to a layer of independently trained neurons, but this is not demonstrated here.
The weight vectors for multiple trained values are obtained by training each value separately and summing, not by presenting the values sequentially or interleaved to a single plastic network. This is a deliberate idealisation: it makes the learned vector an exact linear function of the trained set, which is what allows the coherence ratios of Section 4.3 to be predicted from pairwise Hamming distances alone (Section 4.3.1). Sequential STDP would not be linear in the same way. The nearest-pair rule pairs each presentation only with its nearest post-synaptic spike, so the update a value induces depends on what has already been learned, and the weight ceiling of 2 would clip bits on which several trained values agree: at a learned weight of about 0.375 per value, synapses shared by six or more values would saturate, and the coherent scaling of would cease to hold. Whether on-chip sequential learning converges to the summed vector for small trained sets, and how it departs from it for large ones, remains to be tested.
No downstream dataset or multi-feature classification problem is evaluated, and the introduction explains why: the exhaustive protocol that makes the relations above exact is not available on a natural dataset. The consequence is that nothing here shows how the encodings behave when several features are presented together. One difficulty is already visible from the tolerance law: if features are concatenated into one code word, the Hamming distance is the sum of the per-feature distances and the tolerance radius applies to that sum, so a large deviation in one feature can be offset by exact agreement in the others. A multi-feature classifier built on these encodings would need either per-feature detectors with their own radii or a weighting across features, and the choice between them is an open design question.
The hybrids do not fully reproduce their parents' behaviour. Their accepted sets are fragmented into up to B runs by the Gray fine field, and their false positives, though confined near the trained cluster, are less tightly concentrated than Thermometer's. The block size therefore trades not only correlation but neighbourhood contiguity, and smaller blocks should be preferred where contiguity matters.
The tolerance law is exact only to the resolution of the homeostatic search: rounding the factor upwards can admit one further Hamming shell wherever the predicted radius falls just short of an integer, which occurred mostly in the widest code, and a finer search would be needed to exploit Thermometer's full precision. Finally, the hybrid construction resembles the segmented thermometer-plus-binary architectures of data-converter design, and the contribution here is the Gray fine field with reflected block ordering and its characterisation in a neuromorphic setting, rather than the two-level idea itself.
6. Conclusions
Spatial encoding removes the latency of rate coding but makes classification depend on the geometry of the code. For a dual-rail network with a single output neuron on first-generation SpiNNaker, homeostatic scaling sets a Hamming radius around each trained code word, and the encoding alone decides what that radius means: a contiguous interval of values for Thermometer and Johnson, wrapping at the ends of the range for the cyclic codes, and a scattered set of values for Binary and Gray.
The encodings commonly proposed against the Hamming cliff are therefore not equivalent. Gray removes the cliff but discards global distance structure, and pays for it in homeostatic margin as trained sets grow; Thermometer and Johnson preserve that structure at a width that grows with the value range. The hybrid construction introduced here contains all three as limiting cases of a single block-size parameter and trades width against preservation of semantic distance at a favourable rate: the cyclic hybrid at accepts no untrained value as the trained cluster grows, in 19 bits where Johnson needs 128.
Width matters because it is the number of input events paid on every decision, and both platforms bound it: on SpiNNaker by a configurable buffer of the simulation software, which by default silently truncates codes wider than 255 bits during training, and on SpiNNaker2 by a limit of 512 input events per neuron. The hybrid construction reduces width by roughly an order of magnitude while leaving the radius of the detected neighbourhood unchanged.
Future work will apply these encodings to network-traffic classification, where continuous, ordinal and cyclic
Davies, S. et al.: Preprint submitted to Elsevier
Page 18 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
features occur together, and will compute the mapping on the hardware itself rather than as a pre-processing step, so that feature values can be encoded as they arrive.
Acknowledgement
For the purpose of open access, the authors have applied a Creative Commons Attribution (CC BY) licence to any Author Accepted Manuscript version arising from this submission.
This work has been supported by the Department of Computing and Mathematics at the Manchester Metropolitan University and authorised through ethical review 93014.
Prof. Di Nuovo acknowledges the support of the UK Engineering and Physical Sciences Research Council (grant number EP/X018733/1 for the project ALDENS), and Innovate UK (grant number 10089807 for the Horizon Europe project PRIMI Grant agreement n. 101120727).
Prof. Han acknowledges the support of the UK Engineering and Physical Sciences Research Council (grants number EP/X013707/1 and UKRI3606).
The authors extend their gratitude to Prof. Steve Furber and all members, current and past, of the APT group at the University of Manchester for their invaluable support.
Data and code availability
The data and the code (Davies et al., 2026) used to generate this article are available on GitHub at the URL: https://github.com/sergiodavies/EncodedSpatialLearningCodeAndDataset.
Conflicts of interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Declaration of Generative AI and AI-assisted technologies in the writing process
During the preparation of this work the authors used Anthropic Claude in order to improve readability and language and as support for the generation of the code for the experiments. After using this tool, the authors reviewed and edited the content as needed and take full responsibility for the content of the publication.
Credit authorship contribution statement
Sergio Davies: Conceptualisation of this study, Design of the methodology, Software development, Interpretation of the results, Preparation of the article. Muhammad Aitsam: Performing experiments on SpiNNaker2, Review of the article. Morgan-Tyler Stone: Review of the article. Alessandro Di Nuovo: Review of the article. Liangxiu Han: Review of the article.
References
van Albada, S.J., Rowley, A.G., Senk, J., Hopkins, M., Schmidt, M., Stokes, A.B., Lester, D.R., Diesmann, M., Furber, S.B., 2018. Performance Comparison of the Digital Neuromorphic Hardware SpiNNaker and the Neural Network Simulation Software NEST for a Full-Scale Cortical Microcircuit Model. Frontiers in Neuroscience 12. URL: https://www.frontiersin.org/article/10.3389/fnins.2018.00291/full, doi:10.3389/fnins.2018.00291.
Auge, D., Hille, J., Mueller, E., Knoll, A., 2021. A Survey of Encoding Techniques for Signal Processing in Spiking Neural Networks. Neural Processing Letters 53, 4693–4710. URL: https://link.springer.com/10.1007/s11063-021-10562-2, doi:10.1007/s11063-021-10562-2.
Bacellar, A.T.L., Susskind, Z., Villon, L.A.Q., Miranda, I.D.S., De Araújo, L.S., Dutra, D.L.C., Breternitz, M., John, L.K., Lima, P.M.V., França, F.M.G., 2022. Distributive Thermometer: A New Unary Encoding for Weightless Neural Networks. ESANN 2022 proceedings URL: http://www.i6doc.com/en/.https://api.semanticscholar.org/CorpusID:252341963.
Bohte, S.M., Kok, J.N., La Poutré, H., 2002. Error-backpropagation in temporally encoded networks of spiking neurons. Neurocomputing 48, 17–37. URL: https://www.sciencedirect.com/science/article/pii/S0925231201006580, doi:10.1016/S0925-2312(01)00658-0.
Buckman, J., Roy, A., Raffel, C., Goodfellow, I., 2018. Thermometer Encoding: One Hot Way To Resist Adversarial Examples. URL: https://iclr.cc/virtual/2018/poster/120.
Caruana, R.A., Schaffer, J.D., 1988. Representation and Hidden Bias: Gray vs. Binary Coding for Genetic Algorithms. Proceedings of the 5th International Conference on Machine Learning, ICML 1988, 153–161URL: https://www.sciencedirect.com/science/chapter/edited-volume/abs/pii/B9780934613644500219, doi:10.1016/B978-0-934613-64-4.50021-9.
Davidson, S., Furber, S.B., 2021. Comparison of Artificial and Spiking Neural Networks on Digital Hardware. Frontiers in Neuroscience 15, 651141. URL: https://www.frontiersin.org/articles/10.3389/fnins.2021.651141/full, doi:10.3389/fnins.2021.651141.
Davies, M., Srinivasa, N., Lin, T.H., Chinya, G., Cao, Y., Choday, S.H., Dimou, G., Joshi, P., Imam, N., Jain, S., Liao, Y., Lin, C.K., Lines, A., Liu, R., Mathaikutty, D., McCoy, S., Paul, A., Tse, J., Venkataramanan, G., Weng, Y.H., Wild, A., Yang, Y., Wang, H., 2018. Loihi: A Neuromorphic Manycore Processor with On-Chip Learning. IEEE Micro 38, 82–99. URL: https://ieeexplore.ieee.org/document/8259423/, doi:10.1109/MM.2018.112130359.
Davies, S., Aitsam, M., Stone, M.T., Di Nuovo, A., Han, L., 2026. Encoded Spatial Learning Code And Dataset. URL: https://github.com/sergiodavies/EncodedSpatialLearningCodeAndDataset.
Davies, S., Gait, A., Rowley, A., Di Nuovo, A., 2025. Supervised learning of spatial features with STDP and homeostasis using Spiking Neural Networks on SpiNNaker. Neurocomputing 611, 128650. URL: https://linkinghub.elsevier.com/retrieve/pii/S0925231224014218, doi:10.1016/j.neucom.2024.128650.
Davison, A.P., 2008. PyNN: a common interface for neuronal network simulators. Frontiers in Neuroinformatics 2. URL: http://journal.frontiersin.org/article/10.3389/neuro.11.011.2008/abstract, doi:10.3389/neuro.11.011.2008.
Furber, S., 2012. SpiNNaker: Software Specification and Design. Technical Report. The University of Manchester. Manchester. URL: https://spinakermanchester.github.io/docs/SpiNNsoft_designV0.01.pdf.
Furber, S.B., Galluppi, F., Temple, S., Plana, L.A., 2014. The SpiNNaker Project. Proceedings of the IEEE 102, 652–665. URL: https://ieeexplore.ieee.org/document/6750072/, doi:10.1109/JPROC.2014.2304638.
Gerstner, W., Kistler, W.M., Naud, R., Paninski, L., 2014. Neuronal Dynamics. Cambridge University Press. URL: https://www.cambridge.org/core/product/identifier/9781107447615/type/book, doi:10.1017/CB09781107447615.
Göltz, J., Kriener, L., Baumbach, A., Billaudelle, S., Breitwieser, O., Cramer, B., Dold, D., Kungl, A.F., Senn, W., Schemmel, J., Meier, K., Petrovici, M.A., 2021. Fast and energy-efficient neuromorphic deep
Davies, S. et al.: Preprint submitted to Elsevier
Page 19 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
learning with first-spike times. Nature Machine Intelligence 3, 823–835. URL: https://www.nature.com/articles/s42256-021-00388-x, doi:10.1038/s42256-021-00388-x.
Gonzalez, H.A., Huang, J., Kelber, F., Nazeer, K.K., Langer, T., Liu, C., Lohrmann, M., Rostami, A., Schöne, M., Vogginger, B., Wunderlich, T.C., Yan, Y., Akl, M., Mayr, C., 2024. SpiNNaker2: A Large-Scale Neuromorphic System for Event-Based and Asynchronous Machine Learning. URL: http://arxiv.org/abs/2401.04491.
Gray, F., 1953. Pulse code communication.
Hamming, R.W., 1950. Error Detecting and Error Correcting Codes. Bell System Technical Journal 29, 147–160. URL: https://ieeexplore.ieee.org/document/6772729, doi:10.1002/j.1538-7305.1950.tb00463.x.
Jin, X., Rast, A., Galluppi, F., Davies, S., Furber, S., 2010. Implementing spike-timing-dependent plasticity on SpiNNaker neuromorphic hardware, in: The 2010 International Joint Conference on Neural Networks (IJCNN), Sch. of Comput. Sci., Univ. of Manchester, Manchester, UK. IEEE. pp. 1–8. URL: http://ieeexplore.ieee.org/document/5596372/, doi:10.1109/IJCNN.2010.5596372.
Kappaun, A., Camargo, K., Rangel, F., Firmino, F., Lima, P.M.V., Oliveira, J., 2016. Evaluating Binary Encoding Techniques for WiSARD, in: 2016 5th Brazilian Conference on Intelligent Systems (BRACIS), IEEE. pp. 103–108. URL: http://ieeexplore.ieee.org/document/7839570/, doi:10.1109/BRACIS.2016.029.
Linnainmaa, S., 1976. Taylor expansion of the accumulated rounding error. BIT 16, 146–160. URL: http://link.springer.com/10.1007/BF01931367, doi:10.1007/BF01931367.
Maass, W., 1997. Networks of spiking neurons: The third generation of neural network models. Neural Networks 10, 1659–1671. URL: https://linkinghub.elsevier.com/retrieve/pii/S0893608097000117, doi:10.1016/S0893-6080(97)00011-7.
Mano, M., Ciletti, M., 2012. Digital Design. Fifth ed. ed., Pearson Education. URL: https://books.google.co.uk/books?id=sRYvAAAAQBAJ.
Mayr, C., Hoeppner, S., Furber, S., 2019. SpiNNaker 2: A 10 Million Core Processor System for Brain Simulation and Machine Learning. Concurrent Systems Engineering Series 70, 277–280. URL: http://arxiv.org/abs/1911.02385, doi:10.3233/978-1-61499-949-2-277.
Mostafa, H., 2017. Supervised Learning Based on Temporal Coding in Spiking Neural Networks. IEEE Transactions on Neural Networks and Learning Systems 29, 1–9. URL: http://ieeexplore.ieee.org/document/7999227/, doi:10.1109/TNNLS.2017.2726060.
Rhodes, O., Bogdan, P.A., Brenninkmeijer, C., Davidson, S., Fellows, D., Gait, A., Lester, D.R., Mikaitis, M., Plana, L.A., Rowley, A.G.D., Stokes, A.B., Furber, S.B., 2018. sPyNNaker: A Software Package for Running PyNN Simulations on SpiNNaker. Frontiers in Neuroscience 12, 816. URL: https://www.frontiersin.org/article/10.3389/fnins.2018.00816/full, doi:10.3389/fnins.2018.00816.
Schmidhuber, J., 2015. Deep learning in neural networks: An overview. Neural Networks 61, 85–117. URL: https://linkinghub.elsevier.com/retrieve/pii/S0893608014002135, doi:10.1016/j.neunet.2014.09.003.
Spearman, C., 1904. The Proof and Measurement of Association between Two Things. The American Journal of Psychology 15, 72. doi:10.2307/1412159.
Thorpe, S., Gautrais, J., 1998. Rank Order Coding, in: Computational Neuroscience. Springer US, Boston, MA. CNS '97, pp. 113–118. URL: http://link.springer.com/10.1007/978-1-4615-4831-7_19, doi:10.1007/978-1-4615-4831-7{_}19.

Sergio Davies is a senior lecturer in AI in the Department of Computing and Mathematics at Manchester Metropolitan University. He received his Laurea (equivalent to MSc Eng) in Telecommunication Engineering from the University “Federico II” in Napoli, Italy in 2006. Following his Ph.D. in Computer Science at the University of Manchester in 2012, Sergio continued his research on spiking neural networks as a postdoc in the Human Brain Project until 2016. Transitioning to
industry, he took leadership roles in strategic advising as a consultant, and then managed various research projects covering computer hardware design, embedded systems architecture, software development and system networking. In 2019, Sergio returned to academia, initially at Sheffield Hallam University before joining Manchester Metropolitan University. His current research focuses on practical application of spiking neural networks in real-world scenarios.

Muhammad Aitsam is a Research Fellow in Artificial Intelligence and Robotics at Sheffield Hallam University, UK. He received his PhD in Computing from the same institution, where his doctoral research focused on neuromorphic computing and event-based vision for intelligent robotic systems. His research interests include neuromorphic computing, event-based vision, spiking neural networks, human-robot interaction, and interactive and autonomous robotics. Dr Aitsam has contributed to several UK and European research projects, including the EU-funded PERSEO project, the EPSRC-funded ALDENS project, and the Innovate UK-funded PRIMI project. He also contributes to the research community through peer review and programme committee activities for international conferences and journals in artificial intelligence, computer vision, neuromorphic computing, and robotics.

Morgan-Tyler Stone is a PhD candidate in the Department of Computing and Mathematics at Manchester Metropolitan University, UK. Their research investigates neuromorphic intrusion detection, using spiking neural networks on the SpiN-Naker platform to build intrusion detection systems that operate in real time at low energy cost. They received a BSc in Computer Science for Games from Sheffield Hallam University. Their wider interests include neuromorphic and edge computing, cybersecurity, and energy-efficient real-time intelligent systems.

Professor Alessandro Di Nuovo is Director of the Centre of Excellence in Artificial Intelligence and Robotics and Professor of Machine Intelligence at Sheffield Hallam University, where he has been based since 2015. He is also a Full Professor at the University of Catania, Italy, an affiliation he has held since 2024.
He obtained both his Laurea (MSc Eng) and PhD in Informatics Engineering from the University of Catania in 2005 and 2009, respectively. His research focuses on computational intelligence and its applications to cognitive modelling, human-robot interaction, computer-aided assessment of intellectual disabilities, and embedded intelligent systems.
Professor Di Nuovo has authored more than 150 scientific publications and has an extensive track record of leading interdisciplinary research and innovation in both fundamental and applied AI and robotics. His work has attracted funding
Davies, S. et al.: Preprint submitted to Elsevier
Page 20 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
from major national and international agencies, including the Engineering and Physical Sciences Research Council (EPSRC) and the European Union, as well as a range of industrial partners. His research aims to advance trustworthy, efficient, and human-centred intelligent systems with real-world impact across society and industry.

Prof. Liangxiu Han is Professor of Computer Science at Manchester Metropolitan University, UK. Her research focuses on scalable, data-driven artificial intelligence and machine learning, with applications across healthcare, precision agriculture, smart cities, cybersecurity and energy. She has extensive experience in developing AI methods for large-scale multimodal data, including imaging, sensor, geospatial, numerical and textual data. She has led and contributed to national and international research programmes funded by UKRI, NIHR, the European Union, GCRF/Newton, industry and charities, and is currently Principal Investigator or Co-Investigator on a number of research projects across these areas.
Davies, S. et al.: Preprint submitted to Elsevier
Page 21 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
A. Complete Classification Metrics
All values in the range were presented to each trained network; the five metrics are those of Davies et al. (2025).
A.1. Code words of the second values
Table A.1: Code words of the anchor 240 and of the fourteen second values of Table 8 under each encoding. Long codes are written in run-length form, denoting ones followed by zeros; the Hamming distances of Table 8 can be read off by comparing each row with the anchor.
| Value | Linear family | Cyclic family | ||||||
|---|---|---|---|---|---|---|---|---|
| Binary | Gray | Thermometer | Johnson | |||||
| 240 | 11110000 | 10001000 | ||||||
| 241 | 11110001 | 10001001 | ||||||
| 242 | 11110010 | 10001011 | ||||||
| 244 | 11110100 | 10001110 | ||||||
| 248 | 11111000 | 10000100 | ||||||
| 239 | 11101111 | 10011000 | ||||||
| 238 | 11101110 | 10011001 | ||||||
| 236 | 11101100 | 10011010 | ||||||
| 232 | 11101000 | 10011100 | ||||||
| 224 | 11100000 | 10010000 | ||||||
| 192 | 11000000 | 10100000 | ||||||
| 128 | 10000000 | 11000000 | ||||||
| 64 | 01000000 | 01100000 | ||||||
| 0 | 00000000 | 00000000 | ||||||
| 255 | 11111111 | 10000000 | ||||||
A.2. Two trained values
Table A.2: Two trained values: complete classification metrics. Anchor 240 trained together with ; is the Hamming distance between the two code words and the homeostatic scaling factor. Counts are over all 256 values.
| TP | TN | FP | FN | Acc. | Prec. | Neg. pred. | Sens. | Spec. | |||
| Binary (8 bits) | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 241 | 1 | 2.97 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 242 | 1 | 2.97 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 244 | 1 | 2.97 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 248 | 1 | 2.97 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 224 | 1 | 2.96 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 232 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 192 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 236 | 3 | 4.14 | 2 | 249 | 5 | 0 | 0.9805 | 0.2857 | 1.0000 | 1.0000 | 0.9803 |
| 128 | 3 | 4.14 | 2 | 248 | 6 | 0 | 0.9766 | 0.2500 | 1.0000 | 1.0000 | 0.9764 |
| 64 | 3 | 4.14 | 2 | 248 | 6 | 0 | 0.9766 | 0.2500 | 1.0000 | 1.0000 | 0.9764 |
| 238 | 4 | 5.19 | 2 | 240 | 14 | 0 | 0.9453 | 0.1250 | 1.0000 | 1.0000 | 0.9449 |
| 0 | 4 | 5.18 | 2 | 240 | 14 | 0 | 0.9453 | 0.1250 | 1.0000 | 1.0000 | 0.9449 |
| 255 | 4 | 5.20 | 2 | 240 | 14 | 0 | 0.9453 | 0.1250 | 1.0000 | 1.0000 | 0.9449 |
| 239 | 5 | 6.94 | 2 | 224 | 30 | 0 | 0.8828 | 0.0625 | 1.0000 | 1.0000 | 0.8819 |
| Gray (8 bits) | |||||||||||
| 241 | 1 | 2.96 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 239 | 1 | 2.96 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 255 | 1 | 2.96 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 242 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 244 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 248 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 238 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 236 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 232 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 224 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 192 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 128 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 0 | 2 | 3.45 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 64 | 4 | 5.16 | 2 | 245 | 9 | 0 | 0.9648 | 0.1818 | 1.0000 | 1.0000 | 0.9646 |
continued
Davies, S. et al.: Preprint submitted to Elsevier
Page 22 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Table A.2 – continued
| H | S | TP | TN | FP | FN | Acc. | Prec. | Neg. pred. | Sens. | Spec. | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Thermometer (255 bits) | |||||||||||
| 241 | 1 | 1.24 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 239 | 1 | 1.24 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 242 | 2 | 1.25 | 2 | 251 | 3 | 0 | 0.9883 | 0.4000 | 1.0000 | 1.0000 | 0.9882 |
| 238 | 2 | 1.25 | 2 | 251 | 3 | 0 | 0.9883 | 0.4000 | 1.0000 | 1.0000 | 0.9882 |
| 244 | 4 | 1.25 | 2 | 251 | 3 | 0 | 0.9883 | 0.4000 | 1.0000 | 1.0000 | 0.9882 |
| 236 | 4 | 1.25 | 2 | 251 | 3 | 0 | 0.9883 | 0.4000 | 1.0000 | 1.0000 | 0.9882 |
| 248 | 8 | 1.28 | 2 | 247 | 7 | 0 | 0.9727 | 0.2222 | 1.0000 | 1.0000 | 0.9724 |
| 232 | 8 | 1.28 | 2 | 247 | 7 | 0 | 0.9727 | 0.2222 | 1.0000 | 1.0000 | 0.9724 |
| 255 | 15 | 1.32 | 2 | 239 | 15 | 0 | 0.9414 | 0.1176 | 1.0000 | 1.0000 | 0.9409 |
| 224 | 16 | 1.33 | 2 | 237 | 17 | 0 | 0.9336 | 0.1053 | 1.0000 | 1.0000 | 0.9331 |
| 192 | 48 | 1.52 | 2 | 207 | 47 | 0 | 0.8164 | 0.0408 | 1.0000 | 1.0000 | 0.8150 |
| 128 | 112 | 2.19 | 2 | 143 | 111 | 0 | 0.5664 | 0.0177 | 1.0000 | 1.0000 | 0.5630 |
| 64 | 176 | 3.96 | 2 | 79 | 175 | 0 | 0.3164 | 0.0113 | 1.0000 | 1.0000 | 0.3110 |
| 0 | 240 | 21.01 | 2 | 15 | 239 | 0 | 0.0664 | 0.0083 | 1.0000 | 1.0000 | 0.0591 |
| Hybrid lin. B=4 (65 bits) | |||||||||||
| 241 | 1 | 1.09 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 239 | 1 | 1.09 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 242 | 2 | 1.11 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 244 | 2 | 1.11 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 248 | 2 | 1.11 | 2 | 253 | 1 | 0 | 0.9961 | 0.6667 | 1.0000 | 1.0000 | 0.9961 |
| 238 | 2 | 1.11 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 236 | 2 | 1.11 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 232 | 2 | 1.11 | 2 | 253 | 1 | 0 | 0.9961 | 0.6667 | 1.0000 | 1.0000 | 0.9961 |
| 255 | 3 | 1.13 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 224 | 4 | 1.15 | 2 | 251 | 3 | 0 | 0.9883 | 0.4000 | 1.0000 | 1.0000 | 0.9882 |
| 192 | 12 | 1.32 | 2 | 243 | 11 | 0 | 0.9570 | 0.1538 | 1.0000 | 1.0000 | 0.9567 |
| 128 | 28 | 1.89 | 2 | 227 | 27 | 0 | 0.8945 | 0.0690 | 1.0000 | 1.0000 | 0.8937 |
| 64 | 44 | 3.33 | 2 | 211 | 43 | 0 | 0.8320 | 0.0444 | 1.0000 | 1.0000 | 0.8307 |
| 0 | 60 | 13.90 | 2 | 195 | 59 | 0 | 0.7695 | 0.0328 | 1.0000 | 1.0000 | 0.7677 |
| Hybrid lin. B=8 (34 bits) | |||||||||||
| 241 | 1 | 1.09 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 239 | 1 | 1.09 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 255 | 1 | 1.09 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 242 | 2 | 1.12 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 244 | 2 | 1.12 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 248 | 2 | 1.12 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 238 | 2 | 1.12 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 236 | 2 | 1.12 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 232 | 2 | 1.12 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 224 | 2 | 1.12 | 2 | 253 | 1 | 0 | 0.9961 | 0.6667 | 1.0000 | 1.0000 | 0.9961 |
| 192 | 6 | 1.28 | 2 | 249 | 5 | 0 | 0.9805 | 0.2857 | 1.0000 | 1.0000 | 0.9803 |
| 128 | 14 | 1.79 | 2 | 241 | 13 | 0 | 0.9492 | 0.1333 | 1.0000 | 1.0000 | 0.9488 |
| 64 | 22 | 2.97 | 2 | 233 | 21 | 0 | 0.9180 | 0.0870 | 1.0000 | 1.0000 | 0.9173 |
| 0 | 30 | 8.91 | 2 | 225 | 29 | 0 | 0.8867 | 0.0645 | 1.0000 | 1.0000 | 0.8858 |
| Johnson (128 bits) | |||||||||||
| 241 | 1 | 1.14 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 239 | 1 | 1.14 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 242 | 2 | 1.15 | 2 | 253 | 1 | 0 | 0.9961 | 0.6667 | 1.0000 | 1.0000 | 0.9961 |
| 238 | 2 | 1.15 | 2 | 253 | 1 | 0 | 0.9961 | 0.6667 | 1.0000 | 1.0000 | 0.9961 |
| 244 | 4 | 1.16 | 2 | 251 | 3 | 0 | 0.9883 | 0.4000 | 1.0000 | 1.0000 | 0.9882 |
| 236 | 4 | 1.16 | 2 | 251 | 3 | 0 | 0.9883 | 0.4000 | 1.0000 | 1.0000 | 0.9882 |
| 248 | 8 | 1.20 | 2 | 247 | 7 | 0 | 0.9727 | 0.2222 | 1.0000 | 1.0000 | 0.9724 |
| 232 | 8 | 1.20 | 2 | 247 | 7 | 0 | 0.9727 | 0.2222 | 1.0000 | 1.0000 | 0.9724 |
| 255 | 15 | 1.27 | 2 | 240 | 14 | 0 | 0.9453 | 0.1250 | 1.0000 | 1.0000 | 0.9449 |
| 224 | 16 | 1.29 | 2 | 239 | 15 | 0 | 0.9414 | 0.1176 | 1.0000 | 1.0000 | 0.9409 |
| 0 | 16 | 1.29 | 2 | 239 | 15 | 0 | 0.9414 | 0.1176 | 1.0000 | 1.0000 | 0.9409 |
| 192 | 48 | 1.80 | 2 | 207 | 47 | 0 | 0.8164 | 0.0408 | 1.0000 | 1.0000 | 0.8150 |
| 64 | 80 | 3.00 | 2 | 175 | 79 | 0 | 0.6914 | 0.0247 | 1.0000 | 1.0000 | 0.6890 |
| 128 | 112 | 8.97 | 2 | 143 | 111 | 0 | 0.5664 | 0.0177 | 1.0000 | 1.0000 | 0.5630 |
| Hybrid cyc. B=4 (34 bits) | |||||||||||
| 241 | 1 | 1.09 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 239 | 1 | 1.09 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 242 | 2 | 1.12 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 244 | 2 | 1.12 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 248 | 2 | 1.12 | 2 | 253 | 1 | 0 | 0.9961 | 0.6667 | 1.0000 | 1.0000 | 0.9961 |
continued
Davies, S. et al.: Preprint submitted to Elsevier
Page 23 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Table A.2 – continued
| H | S | TP | TN | FP | FN | Acc. | Prec. | Neg. pred. | Sens. | Spec. | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 238 | 2 | 1.12 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 236 | 2 | 1.12 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 232 | 2 | 1.12 | 2 | 253 | 1 | 0 | 0.9961 | 0.6667 | 1.0000 | 1.0000 | 0.9961 |
| 255 | 3 | 1.15 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 224 | 4 | 1.20 | 2 | 251 | 3 | 0 | 0.9883 | 0.4000 | 1.0000 | 1.0000 | 0.9882 |
| 0 | 4 | 1.19 | 2 | 251 | 3 | 0 | 0.9883 | 0.4000 | 1.0000 | 1.0000 | 0.9882 |
| 192 | 12 | 1.63 | 2 | 243 | 11 | 0 | 0.9570 | 0.1538 | 1.0000 | 1.0000 | 0.9567 |
| 64 | 20 | 2.55 | 2 | 235 | 19 | 0 | 0.9258 | 0.0952 | 1.0000 | 1.0000 | 0.9252 |
| 128 | 28 | 5.93 | 2 | 227 | 27 | 0 | 0.8945 | 0.0690 | 1.0000 | 1.0000 | 0.8937 |
| Hybrid cyc. B=8 (19 bits) | |||||||||||
| 241 | 1 | 1.16 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 239 | 1 | 1.16 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 255 | 1 | 1.16 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| 242 | 2 | 1.23 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 244 | 2 | 1.23 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 248 | 2 | 1.23 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 238 | 2 | 1.23 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 236 | 2 | 1.23 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 232 | 2 | 1.23 | 2 | 252 | 2 | 0 | 0.9922 | 0.5000 | 1.0000 | 1.0000 | 0.9921 |
| 224 | 2 | 1.23 | 2 | 253 | 1 | 0 | 0.9961 | 0.6667 | 1.0000 | 1.0000 | 0.9961 |
| 0 | 2 | 1.23 | 2 | 253 | 1 | 0 | 0.9961 | 0.6667 | 1.0000 | 1.0000 | 0.9961 |
| 192 | 6 | 1.61 | 2 | 249 | 5 | 0 | 0.9805 | 0.2857 | 1.0000 | 1.0000 | 0.9803 |
| 64 | 10 | 2.31 | 2 | 245 | 9 | 0 | 0.9648 | 0.1818 | 1.0000 | 1.0000 | 0.9646 |
| 128 | 14 | 4.15 | 2 | 241 | 13 | 0 | 0.9492 | 0.1333 | 1.0000 | 1.0000 | 0.9488 |
A.3. Growing trained sets
Table A.3: Growing trained sets: complete classification metrics. A contiguous cluster of values around 240 is trained; is the homeostatic scaling factor. “med. ” is the median semantic distance of the false positives from the trained cluster.
| n | S | TP | TN | FP | FN | Acc. | Prec. | Neg. pred. | Sens. | Spec. | med. d |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Binary (8 bits) | |||||||||||
| 1 | 5.18 | 1 | 255 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 2 | 6.94 | 2 | 224 | 30 | 0 | 0.8828 | 0.0625 | 1.0000 | 1.0000 | 0.8819 | 8.0 |
| 3 | 6.95 | 3 | 207 | 46 | 0 | 0.8203 | 0.0612 | 1.0000 | 1.0000 | 0.8182 | 12.5 |
| 4 | 3.48 | 4 | 224 | 28 | 0 | 0.8906 | 0.1250 | 1.0000 | 1.0000 | 0.8889 | 7.5 |
| 6 | 2.32 | 6 | 224 | 26 | 0 | 0.8984 | 0.1875 | 1.0000 | 1.0000 | 0.8960 | 7.0 |
| 8 | 1.74 | 8 | 224 | 24 | 0 | 0.9062 | 0.2500 | 1.0000 | 1.0000 | 0.9032 | 6.5 |
| Gray (8 bits) | |||||||||||
| 1 | 5.17 | 1 | 255 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 2 | 2.96 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 3 | 2.30 | 3 | 253 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 4 | 1.73 | 4 | 252 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 6 | 1.39 | 6 | 250 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 8 | 1.04 | 8 | 248 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| Thermometer (255 bits) | |||||||||||
| 1 | 2.47 | 1 | 255 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 2 | 1.24 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 3 | 0.84 | 3 | 249 | 4 | 0 | 0.9844 | 0.4286 | 1.0000 | 1.0000 | 0.9842 | 1.5 |
| 4 | 0.63 | 4 | 250 | 2 | 0 | 0.9922 | 0.6667 | 1.0000 | 1.0000 | 0.9921 | 1.0 |
| 6 | 0.43 | 6 | 244 | 6 | 0 | 0.9766 | 0.5000 | 1.0000 | 1.0000 | 0.9760 | 2.0 |
| 8 | 0.32 | 8 | 248 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| Hybrid lin. B=4 (65 bits) | |||||||||||
| 1 | 2.15 | 1 | 255 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 2 | 1.09 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 3 | 0.74 | 3 | 253 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 4 | 0.56 | 4 | 252 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 6 | 0.38 | 6 | 248 | 2 | 0 | 0.9922 | 0.7500 | 1.0000 | 1.0000 | 0.9920 | 1.0 |
| 8 | 0.29 | 8 | 240 | 8 | 0 | 0.9688 | 0.5000 | 1.0000 | 1.0000 | 0.9677 | 2.5 |
| Hybrid lin. B=8 (34 bits) | |||||||||||
| 1 | 2.11 | 1 | 255 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 2 | 1.09 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 3 | 0.75 | 3 | 253 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 4 | 0.57 | 4 | 252 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
continued
Davies, S. et al.: Preprint submitted to Elsevier
Page 24 of 25
Beyond the Hamming Cliff: Compact Spatial Encodings Preserving Semantic Distance in Spiking Neural Networks
Table A.3 – continued
| n | S | TP | TN | FP | FN | Acc. | Prec. | Neg. pred. | Sens. | Spec. | med. d |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 6 | 0.39 | 6 | 250 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 8 | 0.29 | 8 | 248 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| Johnson (128 bits) | |||||||||||
| 1 | 2.24 | 1 | 255 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 2 | 1.14 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 3 | 0.76 | 3 | 253 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 4 | 0.58 | 4 | 252 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 6 | 0.39 | 6 | 250 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 8 | 0.30 | 8 | 248 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| Hybrid cyc. B=4 (34 bits) | |||||||||||
| 1 | 2.11 | 1 | 255 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 2 | 1.09 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 3 | 0.75 | 3 | 253 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 4 | 0.57 | 4 | 252 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 6 | 0.39 | 6 | 250 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 8 | 0.29 | 8 | 248 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| Hybrid cyc. B=8 (19 bits) | |||||||||||
| 1 | 2.19 | 1 | 255 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 2 | 1.16 | 2 | 254 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 3 | 0.82 | 3 | 253 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 4 | 0.62 | 4 | 252 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 6 | 0.44 | 6 | 250 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
| 8 | 0.33 | 8 | 248 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | - |
A.4. Extended range, N = 1024
Table A.4: Extended range: complete classification metrics at N = 1024. Thermometer and Johnson exceed the default input capacity at this range and are not evaluated.
| n | S | TP | TN | FP | FN | Acc. | Prec. | Neg. pred. | Sens. | Spec. | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Binary (10 bits) | |||||||||||
| 1 | 4.14 | 1 | 1023 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 2 | 6.95 | 2 | 897 | 125 | 0 | 0.8779 | 0.0157 | 1.0000 | 1.0000 | 0.8777 | |
| 4 | 3.48 | 4 | 896 | 124 | 0 | 0.8789 | 0.0312 | 1.0000 | 1.0000 | 0.8784 | |
| 8 | 1.75 | 8 | 896 | 120 | 0 | 0.8828 | 0.0625 | 1.0000 | 1.0000 | 0.8819 | |
| Gray (10 bits) | |||||||||||
| 1 | 4.14 | 1 | 1023 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 2 | 2.30 | 2 | 1022 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 4 | 1.30 | 4 | 1020 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 8 | 0.75 | 8 | 1016 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| HybridLin-B8 (130 bits) | |||||||||||
| 1 | 2.24 | 1 | 1023 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 2 | 1.14 | 2 | 1022 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 4 | 0.58 | 4 | 1008 | 12 | 0 | 0.9883 | 0.2500 | 1.0000 | 1.0000 | 0.9882 | |
| 8 | 0.29 | 8 | 1016 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| HybridCyc-B8 (67 bits) | |||||||||||
| 1 | 2.15 | 1 | 1023 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 2 | 1.09 | 2 | 1022 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 4 | 0.56 | 4 | 1020 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 8 | 0.29 | 8 | 1000 | 16 | 0 | 0.9844 | 0.3333 | 1.0000 | 1.0000 | 0.9843 | |
| HybridLin-B16 (67 bits) | |||||||||||
| 1 | 2.15 | 1 | 1023 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 2 | 1.09 | 2 | 1022 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 4 | 0.56 | 4 | 1020 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 8 | 0.29 | 8 | 992 | 24 | 0 | 0.9766 | 0.2500 | 1.0000 | 1.0000 | 0.9764 | |
| HybridCyc-B16 (36 bits) | |||||||||||
| 1 | 2.11 | 1 | 1023 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 2 | 1.08 | 2 | 1022 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 4 | 0.56 | 4 | 1020 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
| 8 | 0.29 | 8 | 1016 | 0 | 0 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | |
Davies, S. et al.: Preprint submitted to Elsevier
Page 25 of 25