Hyperdimensional Computing with Spiking-Phasor Neurons
Jeff Orchard, Russell Jarvis

TL;DR
This paper explores implementing Vector Symbolic Architectures using spiking neurons to leverage neuromorphic hardware for efficient cognitive computing tasks.
Contribution
It introduces a novel approach to run VSA algorithms on spiking neuron substrates suitable for neuromorphic hardware.
Findings
Demonstrates feasibility of VSA on spiking neurons
Achieves efficient spatial reasoning and symbol binding
Reduces energy consumption compared to traditional methods
Abstract
Vector Symbolic Architectures (VSAs) are a powerful framework for representing compositional reasoning. They lend themselves to neural-network implementations, allowing us to create neural networks that can perform cognitive functions, like spatial reasoning, arithmetic, symbol binding, and logic. But the vectors involved can be quite large, hence the alternative label Hyperdimensional (HD) computing. Advances in neuromorphic hardware hold the promise of reducing the running time and energy footprint of neural networks by orders of magnitude. In this paper, we extend some pioneering work to run VSA algorithms on a substrate of spiking neurons that could be run efficiently on neuromorphic hardware.
Click any figure to enlarge with its caption.
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsFerroelectric and Negative Capacitance Devices · Advanced Memory and Neural Computing · Advanced Materials and Mechanics
\correspondance
\extraAuth
Hyperdimensional Computing with Spiking-Phasor Neurons
Jeff Orchard 1,∗, Russell Jarvis 2
Abstract
Vector Symbolic Architectures (VSAs) are a powerful framework for representing compositional reasoning. They lend themselves to neural-network implementations, allowing us to create neural networks that can perform cognitive functions, like spatial reasoning, arithmetic, symbol binding, and logic. But the vectors involved can be quite large, hence the alternative label Hyperdimensional (HD) computing. Advances in neuromorphic hardware hold the promise of reducing the running time and energy footprint of neural networks by orders of magnitude. In this paper, we extend some pioneering work to run VSA algorithms on a substrate of spiking neurons that could be run efficiently on neuromorphic hardware.
1
\helveticabold
2 Keywords:
VSA, hyperdimensional computing, phasor, spiking, neuromorphic, resonate-and-fire
3 Introduction
Vector Symbolic Architectures (VSAs) offer a way to represent symbols (such as objects or properties) using high-dimensional vectors. Also called Hyperdimensional (HD) computing, these vectors can be combined in different ways to produce other vectors in the same vector space. Amazingly, those new vectors can still be decomposed into their constituent vectors. Hence, a VSA forms a type of compositional language over a set of symbols (called a vocabulary), and is proposed as the key to modelling cognitive processes in the brain (Gayler, 2003). For a survey of VSA approaches, see (Schlegel et al., 2022).
VSAs offer a facility to model cognitive processes within a neural-network substrate. Some implementations use artificial neurons (Pale et al., 2022), and some use spiking-neuron models (Stewart et al., 2011a; Frady et al., 2018). However, the dimensionality of these vectors can be quite large.
Neuromorphic hardware offers a computing platform that can run neural networks at a fraction of the energy cost and running time, compared to other hardware (Thakur et al., 2018). The prospect of running VSA algorithms on neuromorphic hardware seems like an ideal pairing.
To take full advantage of neuromorphic hardware, a spiking VSA needs to be developed. In this paper, we extend the work of Frady and Sommer (2019), and implement a full VSA suite in spiking neurons.
3.1 Vector Symbolic Architectures
A Vector Symbolic Architecture (VSA) is a vector space paired with a small collection of operations: similarity , binding , unbinding , bundling , permutation , and clean-up.
The similarity operation measures how “close” two vectors are. In a VSA, randomly-chosen, high-dimensional vectors tend to yield a similarity close to zero. For example, consider a vector space , and two random vectors, . We would expect that , while .
Binding combines two vectors to get another vector that is not similar to either of the two. Thus, if , then and . Unbinding does the opposite of binding, so that .
Bundling creates a vector that is still somewhat similar to the two constituent vectors. If , then , though it will likely not be close to 1. This corruption comes from the fact that some information is lost in the bundling operation. How much is lost depends on the vector space, the specific bundling operation, and how many vectors were bundled together.
Permutation jumbles a vector – in a reversible way – so that the resulting vector is dissimilar from the original. Thus, if , then , but yields back.
Finally, clean-up takes a vector and restores it to the closest match in the VSA’s vocabulary. The clean-up is helpful because the operations of binding, bundling, etc., tend to corrupt the vectors, and noise can accumulate. Using the noisy vectors in further operations could start to affect their proper function and produce unpredictable behaviours. The clean-up operation can undo that corruption and the clean vector can be used with greater confidence.
3.2 Fourier Holographic Reduced Representation
Fourier Holographic Reduced Representation (FHRR) is a VSA that uses complex-valued unitary vectors to encode symbols. Let be a complex vector. The vector is unitary if for . Using exponential notation, we can write as , where is the phase of the complex number. FHRRs are related to Holographic Reduced Representations (HRRs) (Plate, 1995). If the vectors in the FHRR exhibit conjugate symmetry (so that ), then taking the inverse Fourier transform of yields a real-valued vector, .
Binding: In an FHRR, the binding operation is done using element-wise multiplication, the Hadamard product. Since the elements of the FHRR vectors are unit-modulus complex numbers, multiplying them is equivalent to adding their phases,
[TABLE]
The inverse operation of unbinding is elementwise division (or multiplication by the conjugate), as in
[TABLE]
Similarity: If and are vectors in an FHRR, then their similarity, , is computed using the complex inner product, , where is the conjugate of of .
Bundling: In most VSAs, including FHRR, the bundling operation is simply vector addition. Consider adding two unit-modulus complex numbers, . The resulting complex number will have a phase of , but will probably not be unit-modulus. In the FHRR, the modulus is ignored, and only the phase is kept. Discarding the modulus is a source of information loss, and is one of the reasons that bundling has limitations.
Permutation: Permutation is done by literally permuting the vector elements. If is a permutation matrix, then , and .
Clean-up: In an FHRR, clean-up is often done either by an attractor network (in which the vocabulary vectors are fixed points) (Frady et al., 2018; Frady and Sommer, 2019; Frady et al., 2022), or by an associative memory (Stewart et al., 2011b).
Fractional Binding: The FHRR has an additional operation that is not present in all VSAs. Consider binding a vector with itself, yielding . In the FHRR, is the Hadamard product, so you can write that as , where the exponent is applied elementwise. But now one can contemplate using non-integer exponents, such as , or . This is called fractional binding, or Fractional Power Encoding (FPE) (Plate, 1995; Frady et al., 2022). If one of the elements of our unitary vector is , with , then raising that vector to the exponent yields a vector with the element . In other words, the fractional power encoding of is the same as multiplying the phase by .
4 Methods
As pointed out in (Frady and Sommer, 2019), the phase of a phasor can be represented by the timing of a spike within a cycle. For example, the phase of the complex number can be represented as a spike occurring 0.25 seconds into a cycle that has a period of 1 second, since the ratio . We will call these neurons spiking phasors. In a periodic spiking system, the phase angle, , and the spike offset, , are directly related by the spiking frequency, Hz, according to
[TABLE]
Thus, converts the spike time, , to phase angle . Throughout this paper, we will tend to use phase angles when we refer to spike times, but with the understanding that they are isomorphic to each other.
In the following sections, we describe a series of neuron models that perform the spike-timing computations that correspond to the basic FHRR vector operations.
4.1 Phase-Sum Neuron Model
Recall that binding two unitary vectors involves taking a Hadamard product of the form , which is . Thus, binding in the FHRR is the same as phase summation. In this section, we describe a model for a spiking neuron such that the phase of its spikes occur at the sum of the phases of the incoming spikes.
Firstly, this neuron (and most other neuron models we will describe) has an integrator variable, , that simply keeps track of the global phase. Recall that these spiking phasor networks are synchronized to a global cycle. If we make follow the differential equation
[TABLE]
then , signifying the end of the cycle, at which point is reset back to 0. The value of indicates the phase of the global cycle. The phases of all spiking neurons in the network are with respect to this global cycle.
Let us denote the phases of the incoming spikes as and , each in the range . Without loss of generality, assume that . Figure 1 shows two neurons projecting to a phase-sum neuron, as well as the timeline showing that the phase-sum neuron fires a spike at phase .
The general idea behind the phase-sum neuron is that it has an integrator that counts up from the beginning of the cycle until the arrival of the first spike. After the first spike, it holds the integrated value until the arrival of the second spike, at which point it counts down (integrates down) until it reaches 0.
In actuality, the phase addition is accomplished using a combination of two integrators111It can be done with just one integrator, except when the phase sum is greater than one period, and the computations for adjacent periods overlap.. Internal variables and act as timers. At the beginning of the cycle, . As time progresses, increases according to the differential equation until the first spike arrives. At the first spike, we set , and is held constant as time continues, with . When the second spike arrives, starts to decrease, following . Once , a spike is generated. This process is illustrated in Fig. 2(a). The algorithm for the phase-sum model is articulated in Algorithm 1.
If the sum of the phases is greater than the period of the global cycle, then the computations for adjacent cycles overlap; has to start counting before has reached 0. This scenario is shown in Fig. 2(b). This overlap is why we use two integrators, instead of one, allowing to start timing the arrival of the first spike while is still finishing the calculation from the previous cycle.
4.2 Phase-Subtraction Neuron Model
In the FHRR, unbinding is the same as binding, but by the conjugate of the vector; this is accomplished by a Hadamard product of the form , which is . Hence, unbinding is the same as subtracting phases. The phase-subtraction neuron computes the time that elapses from when the spike arrives from to when the spike arrives from . This is the only neuron model for which the incoming synapses have to be distinguished from each other; this is a natural consequence of the fact that unbinding is not a commutative operation.
Similar to the phase-sum model, the phase-subtraction model has a global-cycle integrator, . It also has two other integrators that work together to generate a spike at phase .
When the spike arrives from , the variable is set to 0, and starts integrating according to . When the spike arrives from , a threshold variable is set, , essentially recording the elapsed time between the two spikes. Note that this process might span across two adjacent periods of the global cycle. In parallel, the integrator is set to 0 at the start of each global cycle, and then increases according to . When reaches the threshold, , the neuron spikes. These processes are depicted in Fig. 3.
4.3 Phase-Multiplication Neuron Model
Fractional binding is accomplished by multiplying the phase. We can encode the value in the complex number using . If the phase of the input spike was , then the phase of the resulting spike is . Note that the input phases are interpreted in the range instead of . For example, if , and , then the resulting spike will occur earlier in the cycle.
This neuron model has a baseline cycle integrator, . Similar to how the phase is centred on 0, the cycle integrator goes from to (instead of 0 to 1), but reaches 0 at the same time as the global cycle. Its evolution is governed by the differential equation . Another integrator, , also starts the cycle at , and increases, governed by .
When a spike arrives (from the single input neuron), the threshold is set to . The neuron generates a spike when . This process is illustrated in Fig. 4.
4.4 Phase-Averaging Neuron Model
In the FHRR, bundling is done by adding the vectors. However, adding unitary vectors usually does not result in a unitary vector. To convert the resulting vector to a unitary vector, the modulus information is discarded. However, the phase still contains some information that can be used.
When adding two complex numbers with the same modulus, the phase of the resulting complex number is the average of the input phases. If the input spikes arrive at 0.2 s and 0.5 s, then the spike of the bundling neuron should occur at 0.35 s. Care should be taken to interpret the incoming phases in the range , rather than , so that it yields phases closer to 0.
The resulting complex number has to be represented using a spiking phasor neuron, so only the phase of the complex sum is encoded in the neuron.
The time of the average phase is determine using two integrators. Let be an integrator that starts integrating after the arrival of the first spike, and be an integrator that starts after the second spike. These integrators reach a value of 1 after one period of the baseline cycle (just as its next spike arrives from the same input neuron). Hence, can be thought of as a count-down integrator, essentially tracking the time until the arrival of the next input spike. The midpoint between the 2 spikes is the time when , or . But since the furthest apart two spikes can be is half a cycle, then half of that must be less than of a cycle. Hence, the phase-averaging spike should not be more than cycle from either of the incoming spikes. Using this logic, the phase-averaging neuron spikes when
[TABLE]
4.5 Permutation
This is simple; we just re-order the vector components (neurons), usually by circularly shifting all the vector components of by 1 (so that ). This new (shifted) vector, , is almost orthogonal to the original, , with a cosine similarity close to zero (). Recall that their phases are chosen randomly. Hence, the product of the vector with its shifted counterpart will yield complex numbers with phases that are uniformly distributed. Adding up all those components will – on average – be close to zero.
The inverse operation is just as easy. Simply shift the elements back to their original positions.
4.6 Clean-Up Memory
The clean-up memory consists of 2 populations, and , each containing resonate-and-fire (RF) neurons. The goal of the clean-up memory is to have the neurons in converge to the nearest vector in the vocabulary. Suppose the vectors in our VSA are -dimensional, so that the population has RF neurons. That population projects to , which is a population of RF neurons, where is the number of patterns we have in our vocabulary. The connection-weight matrix, , between and contains the vocabulary vectors, one pattern in each column. The input to can be thought of as , where is the unitary complex vector representing the spiking phases of the neurons in . This input is like taking the dot-product of with each vocabulary vector. If is close to the vector with index , then we would expect the input to to be larger than the input to the other hidden neurons. In this sense, each neuron in represents one of the vocabulary vectors. Importantly, this complex matrix-vector product is implemented using scalar weights and spike delays, as described in (Frady and Sommer, 2019).
The neurons in all inhibit each other; each time a neuron spikes, it sends strong, inhibitory input to all the other neurons in . Because of this mutual inhibition, the population tends towards a winner-takes-all (one-hot) state.
Finally, projects back to using connection weights . That is, each time a neuron in spikes, it sends to a weighted copy of the pattern it represents (again, using scalar weights and synaptic delays).
5 Experiments
We implemented the spiking neuron models in the Brian2 (Stimberg et al., 2019). We then tested our spiking-phasor VSA framework on a number of tasks, two of which we describe here.
5.1 State Transition Model
Figure 5 illustrates 3 basic states of a stopwatch, Cleared, Ticking, and Paused. The stopwatch also has 2 buttons, one labelled “R”, which stands for Reset/Record, and one labelled “S”, which stands for Start/Stop. Pressing these buttons can cause the state to transition to a different state. For example, when the stopwatch is in the Cleared state and the S button is pressed (Start), the stopwatch moves to the Ticking state. And when in the Ticking state, pressing the R button keeps it in the Ticking state (to Record a time stamp).
If we represent each of the 3 states with vectors, denoted , , and , and the two actions as vectors, denoted and , then we can encode a state transition as a vector. For example, a vector that represent the transition from Cleared to Ticking when the S button is pressed can be constructed using . Binding with the vector indicates that the resulting state is Ticking. We can then query using a vector of the form , which asks, “What state will the stopwatch be in if it is in the Cleared state and we press the S button?” The resulting vector will be close to , a permuted version of . We unpermute it using to get the resulting vector .
There are 6 different state transitions, in total. We can bundle all 6 into a single vector using
[TABLE]
where the symbol represents bundling, simple vector addition in the case of an FHRR.
We created a 100-dimensional VSA and randomly chose vectors to represent the states and actions, . Each random vector was constructed by randomly choosing 100 phase angles uniformly from the interval . The vector was created by adding together the complex-valued vectors in (1).
A population, , was used to store . Each of the 100 neurons in was firing at the baseline frequency of 10 Hz. The phases of the elements of were used to set the spike timing of the 100 neurons in . Figure 6 shows the full network, consisting of a total of 705 spiking neurons. The user chooses the state and action, and the output is read from the clean-up memory.
The results of the stopwatch state transition network are shown in Fig. 7. In all cases, the network produced the correct state with a confidence in excess of 99%.
5.2 Spatial Memory Model
The second experiment involves encoding objects and their locations. For this experiment, we will use Spatial Semantic Pointers (SSPs), made possible using fractional exponents in the FHRR. As described in section 4.3, we can raise our FHRR vectors to fractional exponents, and thereby encode that exponent in the resulting vector. This method has been used to encode spatial position (Frady et al., 2018; Lu et al., 2019; Dumont and Eliasmith, 2019).
We randomly generated some 200-dimensional unitary vectors to represent the properties Square, Circle, Red, and Blue. These vectors were generated by randomly sampling 200 phases from a uniform distribution over . In addition, we used the same method to create another random vector, , to represent a spatial axis. Then we computed a vector that contained multiple objects at different positions,
[TABLE]
The vector represents a red square at location 1.85, and a blue circle at location -0.65.
We queried by unbinding it from , essentially asking “What is at location 1.85?” The output from the unbinding was fed into the clean-up memory. The state of the neurons in were compared to the vocabulary vectors, which included: Square, Circle, Red, Blue, , , RedSquare, BlueCircle, RedCircle, BlueSquare. The closest vocabulary vector was RedSquare, with a similarity of 0.999.
We also queried by unbinding it from RedSquare, and BlueCircle, essentially asking “Where is the red square?”, and “Where is the blue circle?”
[TABLE]
The resulting populations of spiking neurons were converted to complex vectors and their similarity was calculated against a range of SSPs of the form , for . Figure 8 plots the similarity over this range of values. The entire neural network, including all 3 queries, was implemented using 3,406 spiking neurons.
6 Conclusions
This paper describes our method for implementing FHRR using spiking-phasor neurons and simple integrator neurons. It extends the ideas proposed in (Frady and Sommer, 2019) to operators other than binding. The various vector operations have fairly straight-forward implementations, using integrators to compute the required spike times.
The functionality of these spiking FHRR methods was demonstrated on two tasks, a finite state-transition model, and a spatial memory.
A number of open questions stem from this work. Recall that this spiking-phasor implementation of FHRR does not model the modulus of the complex numbers, just the phase. Thus, all modulus information is discarded. This information loss is particularly relevant after a bundling operation, where the theoretical result would not be unit-modulus, but encoding using spiking-phasor neurons necessitates unit-modulus. It would be interesting to investigate the impact of this loss of information more carefully. For example, what impact does the order in which vectors are added to a bundle have? Can the vectors be chosen in a way that minimizes this loss?
Another direction of further development is a clean-up memory for SSPs. As with any vector in a VSA, sequential binding, bundling, and unbinding deposits noise. This is just as true for an SSP. The clean-up memory proposed in this paper works for a discrete set of vocabulary vectors. In contract, an SSP lies on a 1-dimensional manifold in the vector space, parameterized by the exponent. There is no specific vector to converge to. Instead, a clean-up memory for an SSP would enforce constraints on the phases in the SSP, in a way that pushes the vector back onto the 1-D manifold. This type of coupling has been demonstrated (Ji, 2014), though not on spiking-phasor neurons.
Finally, we plan to implement these methods to run them on a neuromorphic platform. Options include porting our code to Lava to run on the Loihi chip (Davies et al., 2021), or on an FPGA platform (Wang et al., 2014).
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Davies et al. (2021) Davies, M., Wild, A., Orchard, G., Sandamirskaya, Y., Guerra, G. A. F., Joshi, P., et al. (2021). Advancing neuromorphic computing with Loihi: A survey of results and outlook. Proceedings of the IEEE 109, 911–934
- 2Dumont and Eliasmith (2019) Dumont, N. and Eliasmith, C. (2019). Accurate representation for spatial cognition using grid cells. In Joint International Conference on Cognitive Science
- 3Frady et al. (2018) Frady, E. P., Kanerva, P., and Sommer, F. T. (2018). A framework for linking computations and rhythm-based timing patterns in neural firing, such as phase precession in hippocampal place cells. In Conference on Cognitive Computational Neuroscience . 1–5
- 4Frady et al. (2022) Frady, E. P., Kleyko, D., Kymn, C. J., Olshausen, B. A., and Sommer, F. T. (2022). Computing on functions using randomized vector representations (in brief). In ACM International Conference Proceeding Series . 115–122
- 5Frady and Sommer (2019) Frady, E. P. and Sommer, F. T. (2019). Robust computation with rhythmic spike patterns. Proceedings of the National Academy of Sciences of the United States of America 116, 18050–18059
- 6Gayler (2003) Gayler, R. W. (2003). Vector symbolic architectures answer Jackendoff’s challenges for cognitive neuroscience. In Joint International Conference on Cognitive Science . 133–138
- 7Ji (2014) Ji, X. (2014). Generalized Strategies for Path Integration using Neural Oscillators . Master’s thesis, University of Waterloo Thesis
- 8Lu et al. (2019) Lu, T., Voelker, A. R., Komer, B., and Eliasmith, C. (2019). Representing spatial relations with fractional binding. In Proc. of the Cognitive Science Society
