Abstract
We study the problem of binary agreement in a spiking neural network (SNN). We show that binary agreement on n inputs can be achieved with
1. Introduction
In many brain areas, neurons with homogeneous properties are organized in populations. Prominent examples are columns in the visual and somatosensory cortex (Mountcastle, 1957; Hubel and Wiesel, 1962) and neurons with “memory fields” in the prefrontal cortex (Goldman-Rakic, 1995). Neuronal activity patterns in these populations are believed to represent sensory variables or memory states that are relevant for perception and behavior (Kandel et al., 1991).
Computational neuroscience often treats these activity patterns as stationary solutions to state equations, describing average values of relevant neuronal variables such as neurons’ membrane potential or firing rate (Gerstner and Kistler, 2002; Shriki et al., 2003). The stationary solutions can be spatially inhomogeneous or homogeneous. An example of a useful inhomogeneous solution is an activity pattern in which only a small group of neurons are active.
Active neurons could represent a particular value of a variable encoded in the population. Homogeneous solutions, in which all neurons act in the same way, are the building blocks of event detectors or memory units. For example, a bistable population of binary units can signal whether an event has occurred in the input.
The two general classes of solutions (inhomogeneous and homogeneous) can be mapped to classical problems in distributed computing: leader election and agreement. In the problem of leader election, each of the processing units (or processes) should eventually converge to decide whether it is a leader or not, corresponding to a stationary network state with only one active unit. Lynch et al. (2017a), see also Lynch and Musco (2018); Su et al. (2019), studied the leader-election problem (also known as Winner-Take-All [WTA]) in a biologically inspired spiking neural network (SNN) model. It has been shown that WTA has an efficient neural circuit (Lynch et al., 2017a). Later, the results were formally restated in the novel stochastic SNN model (Lynch and Musco, 2018) and generalized to solving k-WTA (Su et al., 2019).
In this article, we address the class of agreement problems that appear complementary to WTA. In binary agreement, output neurons should eventually stabilize on 1 (all output neurons fire) or 0 (no output neurons fire), and the output should be the state of at least one input neuron.
Following the approach of Lynch et al. (2017a); Lynch and Musco (2018); Su et al. (2019), we treat a neural network as a distributed system, where neurons and synapses connecting them are modeled as a graph of finite-state automata. Neurons communicate by firing in discrete pulses. Each pulse is generated in stochastic response to a sufficiently strong input over the incoming graph edges.
We show that basic binary agreement on n inputs, where any input value can be chosen as a stable output, can be achieved by using
We then prove that this is optimal for a class of biologically plausible SNNs that we call size-independent. More precisely, we assume that a network is composed of “off-the-shelf” neurons: The weights of their synapses and the activation function are constant in n, the number of input neurons. We show that any size-independent network serving n input neurons and solving a task in a large class including agreement and WTA must use
We believe that determining optimal networks implementing fundamental computing abstractions, such as leader election and agreement, may help explain how these tasks are solved in the brain. The general hypothesis of neural studies is that the brain tends to optimize information processing (Barlow, 1961), and one may expect that the network size could be a possible optimization goal.
The rest of the article is organized as follows. In Section 2, we sketch the basic definitions of the SNN model and define what it means for an SNN to solve a task and define the task of agreement. In Section 3, we describe our SNN solving agreement; in Section 4, we show that the SNN is optimal; and in Section 5, we present our experimental results. We conclude in Section 6.
2. Preliminaries
2.1. Model
An SNN is modeled as a weighted directed graph, where neurons are represented as vertices and synapses as edges. The vertices of the graph are partitioned into three subsets—input, auxiliary, and output neurons. Input neurons have no incoming edges. The bias function assigns a real number to each auxiliary and output neuron. In this article, we consider networks with the same number n of input and output neurons.
Computation on an SNN is performed in rounds. The state (we also say the firing pattern) of the network at the end of round t, denoted St, is a map of the vertices to
The evolution of the network is a Markov process—the state at time
Let
The non-input neuron m fires at time
We call
Notice that in our model, the activation function of a neuron does not depend on n. In contrast, Lynch et al. (2017a) defined the activation function as
2.2. Tasks and agreement
A task associates inputs to outputs. Formally a task is defined as a tuple
We say that the network solves the task at time T if for every input
In the task of binary agreement,
Informally, the task of agreement requires that the output neurons agree on the value of one of the input neurons. We say that O is an agreement state for a given input I if
In the WTA task,
In the rest of the article, we consider tasks defined for all system sizes, that is, for each
3. Solving Agreement
An SNN that solves the binary agreement task is depicted in Figure 1. Every input neuron ui is connected to a dedicated auxiliary neuron mi, with a positive weight

The network solving the agreement task.
Informally, every auxiliary neuron “negates” the corresponding input and inhibits the output neurons from firing. The negative weights on the outgoing synapses of auxiliary neurons ensure that, when a sufficiently large fraction of them are firing, the output neurons will stop firing. Otherwise, firing output neurons will reinforce the other output neurons, causing them to fire as well.
Informally, as the contribution to the potential from each neuron is constant, we need a linear number of auxiliary neurons: This is required to ensure that the probability of agreement does not drop as the number of output neurons increases. Indeed, as n grows, the auxiliary neurons must be able to compensate for more output neurons firing by reducing the potential. Without this, the network may get stuck at a state where all output neurons fire in each round, even if no input neurons fire.
3.1. Correctness
Now we show that the proposed SNN, indeed, solves the agreement task.
At time
and the potential of an output neuron vi is
Notice that
Let us express W as follows:
where the parameter
The following property of the activation function will be instrumental in comparing networks of different sizes.
The function
As
where c is the number of firing input neurons.
Let
Recall that the only incoming edge for an auxiliary neuron mi is
Then
As
We show first that the network, once it reaches an agreement state, stays in this state for at least n rounds with high probability.
At time
If we take
Taking
Take an SNN with
Choosing
We take into account that a network with n outputs is stable for n rounds.
The function
Thus, the network is stable for n rounds, with high probability.
We make the following observation: In the constructed network, there is a symmetry between firing and non-firing neurons. If we invert the firing pattern (each firing neuron will become non-firing and vice versa), the potential of each non-input neuron will change the sign but preserve its magnitude. Let St be a firing pattern in round t, and let
Then, we have
Given this observation, the proof for Case 2 is analogous.
The bounds imply a lower bound for the probabilities that all output neurons fire and that no output neurons fire. Note that for any choice of n, we have
Let us denote this bound by p. Notice that
Now, consider the evolution of the network from arbitrary time t to time
By Theorem 4, once the network reaches agreement state, it will remain in that state for n rounds with high probability. This proves that the network solves the agreement problem.
3.1.1. Time complexity
In Section 5, we show that our SNN with n inputs converges to an agreement state in nearly constant time; we conjecture it to be
Consider an execution of our SNN. Let
One can consider the evolution of
4. Lower Bound
We show that, under the biologically plausible assumption that neurons in the network do not have access to global network parameters (such as the size of the network), a particular class of problems defined in the SNN model, including agreement and leader election, requires weights and biases are constant (independent of n); activation as a function of the potential is independent of n;
Further, we consider networks that are size-independent, in the following sense. A network with n input neurons can be considered a composition of
Each subnetwork has a constant (in n) number of neurons.
There are n identical subnetworks
There is one fixed subnetwork M consisting only of auxiliary neurons that are not part of subnetworks Li described earlier.
Let m0 be any neuron in M. Suppose i, j, and k are three distinct integers. Let
In other words, the n identical subnetworks are indistinguishable.
A network with
Note that networks with these properties cannot have non-constant sublinear number of auxiliary neurons.
Size-independence is a biologically plausible property, as in a biological neural network each neuron can only be aware of its surroundings. A neuron does not “know” the size of the entire network, therefore its weights and activation cannot depend on n. In addition, we are interested in network properties at large scale. Special cases for specific network sizes do not make sense in this context. In the context of the problems we consider in this article, permuting the inputs should not affect the behavior of the network, which further motivates the symmetry assumptions.
(1) the number of firing neurons in Ii is at most k;
(2) for each
. Suppose that the task has a set of inputs
(one input for each system size
Then, N has
Note that from size-independence each output neuron is connected either to all other output neurons or to no other output neurons.
Notice that the only case when a size-independent network has a sub-linear number of auxiliary neurons is when its identical subnetworks
Consider the set of inputs
Let
For sufficiently large n, this probability is less than
Notice that the theorem applies to the tasks of agreement and WTA. In the agreement task, the sequence of inputs
5. Simulation
To support our complexity claims, we ran a series of simulated runs of the network described in Section 3. The source code of the simulation (in C) is available at https://gitlab.com/martinkunev/agreement-in-spiking-neural-networks.
5.1. Implementation
As the network is size-independent, we do not have to maintain all
If the subnetworks Li consist of k neurons each, at any given time there are
The essential part of the input is the number of firing input neurons. The same goes for the output. With this in mind, we design an algorithm to test the network.
Running the SNN for one round is performed by looping through the firing patterns—a firing pattern in this context is a subset of firing vertices in a subnetwork Li. The calculation of potential is identical for all subnetworks with any given firing pattern. For each subnetwork, the firing pattern on the next round is determined stochastically. As an optimization, the potential due to external edges for each neuron is precalculated since it is common to all subnetworks. The resulting simulation is described in Algorithm 1.
Assuming the number of edges in one subnetwork Li is
5.2. Benchmark
We performed tests with
0 input neurons firing
n input neurons firing
random number of firing input neurons (uniform distribution)
For every experiment, multiple iterations were run with the same input.
Handling large values of n raises several technical challenges. First, floating point numbers in C have limited precision and for big potentials, errors start accumulating while calculating the activation function. Second, while calculating whether a neuron fires, a random number generator is used to obtain a floating point number between 0 and 1 with uniform distribution. When the firing probability is very close to 0 or to 1, the random numbers must be generated with a very high precision to not skew the results. For these reasons, we chose to bound our experiments by
5.3. Results
Figures 2 and 3 depict convergence times of the network for

Results of the tests for

Results of the tests for
Mean Convergence Time and Its Variance for 1024 Tests (256 Per Input Category) for Different Values of n
Left:
Comparing the results for the two values of
6. Conclusion
We have shown that solving common problems such as agreement and WTA requires
The ideas described in this article can be further developed for solving other problems. These include multi-valued agreement (where each input can have more than two possible values) and set agreement (where the output is restricted to any element of a subset of given size, instead of a single value). It is also extremely interesting to determine conditions on the connectivity, for example, expressed as the number of synapses, necessary and sufficient to solve a given task.
Footnotes
Acknowledgments
The first version of article this has been presented at the 8th workshop on Biological Distributed Algorithms (BDA). The authors would like to thank the anonymous reviewers of BDA and JCB for their constructive reviews.
Author Disclosure Statement
The authors declare they have no competing financial interests.
Funding Information
The internship of Martin Kunev has been financially supported by the Department of Computer Science and Networking (INFRES) of Télécom Paris, Institut Polytechnique de Paris.
