Stable Lifelong Learning: Spiking neurons as a solution to instability in plastic neural networks

Synaptic plasticity poses itself as a powerful method of self-regulated unsupervised learning in neural networks. A recent resurgence of interest has developed in utilizing Artificial Neural Networks (ANNs) together with synaptic plasticity for intra-lifetime learning. Plasticity has been shown to improve the learning capabilities of these networks in generalizing to novel environmental circumstances. However, the long-term stability of these trained networks has yet to be examined. This work demonstrates that utilizing plasticity together with ANNs leads to instability beyond the pre-specified lifespan used during training. This instability can lead to the dramatic decline of reward seeking behavior, or quickly lead to reaching environment terminal states. This behavior is shown to hold consistent for several plasticity rules on two different environments across many training time-horizons: a cart-pole balancing problem and a quadrupedal locomotion problem. We present a solution to this instability through the use of spiking neurons.


Introduction
The extraordinary behaviors produced by biological neural networks are primarily enabled by the persistent intra-lifetime modifications that occur based on accumulated experience. These modifications, called neural plasticity, underlie the foundations of memory, behavioral adaptation, and learning [1,2,3,4,5]. While there are many types of neural plasticity, including structural, connective, and homeostatic, synaptic plasticity has played a particularly central role [6]. Synaptic plasticity describes when changes in efficacy occur on the connections between neuronal axons and dendrites -the synapse. These changes develop through the interaction between synaptically connected neurons together with chemical signals diffused throughout the brain. This process is thought to underlie the capacity for both learning and incorporating experience into persistent memories [7,6].
In the field of Artificial Intelligence (AI), the primary focus of research with ANNs has been on discovering static solutions, where the synaptic weights remain constant throughout the lifetime of the organism. Inspired by the biological brain, a rich history of work has demonstrated the design of ANNs together with synaptic plasticity [8,9,10,11,12,13], referred to as Plastic Artificial Neural Networks (PANNs). These networks have shown impressive capabilities in their ability to generalize to novel environmental circumstances, recover from limb damage, enhance memory [11,14,5]. However, the methods used in these works are trained and operated across finite time horizons. These time horizons generally span a matter of seconds in simulation time, and the ability for these plastic ANNs to generalize beyond the trained time horizon has yet to be examined.
In this work we show that several variants of plasticity in ANNs have difficulty generalizing beyond their initial training time horizon on both tasks of stability and in maintaining reward-driven behavior. Trained under the same conditions, plastic SNNs are shown to generalize to indefinite timespans, demonstrating that SNNs are significantly more stable in the presence of plasticity. This stability is shown to hold across multiple plasticity rules on the same tasks that the plastic ANN failed to generalize to. arXiv:2111.04113v1 [cs.NE] 7 Nov 2021 2 Background

Synaptic Plasticity
A set of learning rules are introduced which control the modification of weights through local activity between neurons. These synaptic learning rules are often designed through evolutionary algorithms, genetic algorithms, and more recently, backpropagation [9,10,8,15]. A particularly influential class of synaptic learning rules are Hebbian learning rules, which are guided by the statement: "neurons that fire together wire together." This theory claims that an increase in synaptic strength emerges from repeated interaction between pre-and post-synaptic neurons. Hebbian learning theory poses as a framework for explaining associative learning, as well as a basis for learning without feedback or reinforcement signals, which is known as unsupervised learning [16,17].
Here we consider the general form of Hebbian plasticity. Let N (l) ∈ R equal the number of neurons in layer (l) ∈ R, W (l) (t) ∈ R N (l) ×N (l−1) represent the synaptic weights between layer (l) and (l − 1) at discrete time t ∈ N, and x (l) (t) ∈ R N (l) ×1 the post-synaptic activity of layer (l) where x (0) (t) is the environment observation-input at time t.
We define the forward pass of stimuli x (l−1) (t) at layer (l − 1) through the synaptic weights W (l) (t) as follows, for an arbitrary non-linear function σ(·). Additionally, we define the synaptic weight update as, Here, ∆(·) describes a local synaptic update function using pre-synaptic input x (l−1) (t), post-synaptic output x (l) (t), and a set of update parameters L.

Linear Plasticity
Among the simplest plasticity rules is the linear Hebbian plasticity rule. With this rule, the co-activation between synapses and weight changes share the following relationship: In this equation, the pre-and post-synaptic activity, x (l−1) (t) and x (l) (t), are multiplied resulting in a co-activation matrix, . This matrix is then element-wise multiplied by a learning rate matrix, α (l) ∈ R N (l) ×N (l−1) , which serves to regulate the rate with which weights are updated. The co-activation matrix follows from Hebbian theory in that large co-activations, which correspond to high-activity between neurons, also result in larger weight changes between them.

Oja's Rule
Inheriting the principle that co-activation produces synaptic change from Hebbian learning, Oja's rule provides built-in stability and correlative capabilities by balancing synaptic potentiation and depression [18]. The primary principle behind Oja's rule is that "forgetting" occurs proportional to both the weight value and the square of the post-synaptic activity.
Oja's rule is defined by the following equation: The role of α (l) is the same as in Equation 3, and serves as learning rate for each synapse. Differing however, on the right-hand side of the equation W (t) (l) is multiplied by the post-synaptic activity, x (l−1) , which is subtracted from the pre-synaptic trace x (l−1) . This quantity is then multiplied again by the post-synaptic activity, x (l) . This modification penalizes unbounded growth, and acts as a regulatory mechanism for the synaptic weights.

ABCD Plasticity
While the simple Hebbian and Oja's plasticity rules are effective models of synaptic plasticity, often greater flexibility in learning representation is desirable. ABCD plasticity enables greater representation by combining learned terms for neural co-activations, pre-synaptic activity, and post-synaptic activity [19].
The dynamics of ABCD plasticity is as follows: In these equations, each synaptic weight in layer l, W (l) i,j , has five corresponding plasticity parameters, A i,j , resulting in an evolved set of five R N (l) ×N (l−1) matrices which govern the dynamics of the network's intra-lifetime learning. A w as the learning rate. In addition, the initial value of the synaptic weights, W (l) (t = 0), are learned. Other initial weight conditions, such as random weights, may be used, however co-evolving the plasticity terms and weights enables the evolutionary dynamics to develop either primarily static-weight or highly-plastic networks which exhibits the relative importance of the learned plasticity.
Notice that Equation 7 is the same as the right-hand side of the simple Hebbian rule in Equation 3. In this way, ABCD is capable of encapsulating the dynamics of the linear Hebbian rule with additional complexity.

STDP
Perhaps one of the most successful methods for describing the plasticity occurring in the brain is Spike-Timing Dependent Plasticity (STDP) [20,21]. In the brain, neuronal spikes are often precisely timed in relation to certain events, which is one of the most attractive aspects that STDP is able to capture in learning. A synapse which models STDP is modified in relationship with the precise spike timing of the pre-and post-synaptic neurons.
Presented in the following equation is a simple variant of STDP: In this equation, ∆W (l) j is determined by the relationship between the pre-and post-synaptic firing times, t post i ∈ R t pre j ∈ R P (x) across all firing times that occurred N ∈ N. P (x) in Equation 12 denotes the STDP function, which takes the distance between spike times, t post i − t pre j , and returns exponentially decaying values scaled by A +,− ∈ R and τ +,− ∈ R based on whether the post-spike arrives after the pre-spike, x ≥ 0, or the pre-before post-spike, x < 0.
One issue with this model, however, is that iterating through all previous spike times for new activity is expensive. In practice, this model can be implemented as an online rule using synaptic traces: Here, the role of each variable is the same as in Equations 11-12. The primary difference is that synaptic traces are introduced, x and y respectively, which accumulate an exponentially decaying history of the synapse spiking activity.

Spiking Neurons
Spiking neural networks more closely resemble biological neural networks in that information is transmitted asynchronously through sparse binary signals [22]. In the biological brain, these signals are emitted through electrical "spikes" down axonal connections to connected neurons. These electrical spikes are integrated into the neuron's electrical storage system as membrane potential, and once the membrane potential reaches a critical threshold, it emits its own spike. While the magnitude of these spikes are largely identical across neurons, variation in signal strength, whether producing potentitation or depression, is a product of the size and strength of the synaptic terminal connecting neurons [23]. This is largely where the idea of "weights" in artificial and spiking neural network arise from. Like the biological neuron, in addition to emitting binary spikes, spiking neurons also have internal membrane potential which is used to decide whether or not to send a spike. Once the membrane reaches a particular threshold, a spike is emitted, and the membrane potential resets. This behavior can be modelled in various ways, several of which are presented below.

Integrate-and-Fire
One of the earliest, and arguably the simplest, neuron models is the integrate-and-fire, which is also referred to as the perfect integrate-and-fire, or the non-leaky integrate-and-fire. In this model, incoming activity is integrated and stored over time, and a binary-valued signal of one is emitted when the membrane potential is greater than a given threshold V th ∈ R, and zero otherwise. This neuron model assumes perfect insulation in that membrane potential does not passively return to a fixed-point over time. The membrane potential dynamics are as follows: where V m (t) ∈ R is the membrane potential at time t, τ m ∈ R is the membrane time constant, R m ∈ R is the current resistance, and I(t) ∈ R is the input current at time t.
Once the membrane potential crosses its spiking threshold V th ∈ R the neuron emits a spike and the membrane potential resets to a baseline value, or resting potential, which is typically set to zero.

Leaky Integrate-and-Fire
The Leaky Integrate-and-Fire (LIF) neuron model is derived from the integrate-and-fire model, however, with the addition of a decay, or "leak," component on the membrane potential. The leak slowly over time brings the membrane potential back to its resting equilibrium. In terms of biology, this mechanism is a product of passive ion diffusion through the neuron membrane which does not act as a perfect source of insulation. This passive diffusion is thought to add beneficial dynamic complexity for learning.
The LIF membrane potential dynamics can be modelled as follows: where V m (t) is the membrane potential at time t, τ m is the membrane time constant, R m is the current resistance, v rest ∈ R is the membrane resting potential, and I(t) is the input current at time t. Like the integrate-and-fire, the LIF emits a spike and the membrane potential resets to v rest once a fixed-valued potential threshold V th is surpassed.
One disadvantage of the neuron model's simplicity is that it does contain adaptive parameters that change the neuron's behavior over time, and thus can not accurately describe "in-vivo" experimentally measured spiking activity [24]. Despite this, the LIF neuron model remains the most utilized model in both learning experiments and neuromorphic hardware implementations likely due to its balance between computational simplicity and dynamic complexity.

Evolutionary Strategies
The initial parameter vector of size M ∈ R, θ t ∈ R M , represents values which are to be modified across generations on an evolutionary timescale, as opposed to intra-lifetime modifications. To begin the evolutionary cycle, θ t is either randomly initialized or set to zero and a population of N random noise vectors, v i,t ∈ R M , are sampled from a random distribution with a standard deviation σ ∈ R to create a population of individuals p i,t = θ t + v i,t , where i indexes an individual in the population, and t ∈ N, the evolutionary time-step. Each individual is then evaluated over the course of a lifetime using an environment defined reward, r i,t ∈ R. Using the corresponding information, and a learning rate α ∈ R, parameters are updated as follows: There are numerous advantages in using evolutionary optimization over alternative methods. Due to the independent nature of individual evaluation, evolutionary methods are well suited for distributed computation enabling a much shorter training time in comparison to backpropagation-based methods. In addition, these methods, as a product of not using backpropagated gradients, do not perform backpropagation through time, and hence time-dependent parameters, like synaptic plasticity, do not require immense compute time. Particularly in the context of synaptic plasticity, some situations display evolutionary algorithms outperforming gradient-based approaches in both learned performance and in training time [25,26].
The lifetime of an individual, along with the evaluation reward, is heuristically defined. Since creating the next population of individuals requires the parent population to have finished evaluation, and hence their lifetime, often the lifetime of each individual is hard-limited to a truncated lifespan called the "time-horizon." Evolutionary strategies methods have the advantage of being a "black box" optimization method, meaning optimization occurs without higher-order information, only observing the function input and output pairs. This is particularly desirable in the setting of Reinforcement Learning, as its black box nature enables it to be invariant to action and reward frequency, tolerant of long time horizons, and not requiring the need for value function approximation [26].

Simple Balancing Problem
Among the simplest of control problems is the discrete-action cart-pole balancing task (Figure 1). In this problem, a pole is situated at the center of a cart which lies on a track. Force may be applied to the cart left or right, and the objective is for the pole to retain an upward position. If the pole falls beyond a certain angle, the simulation is terminated, and the "lifespan" of the task is cut short. Additionally, to prevent the simulation from running indefinitely, a maximum lifespan is specified which is deemed as the time horizon. The time horizon is necessary for most modern learning schemes, since comparison between multiple lifetimes, often called rollouts, is necessary for the algorithm to update parameters. The time horizon is of great importance especially for dynamical models because it determines how long the model is expected to perform a given task, and the learned parameters are optimized specifically for this time duration.
While the Cart-Pole task does not necessarily require intra-lifetime learning, and can be solved without adaptation, it is precisely for this reason that it serves as a quality example. Problems necessitating lifelong learning often require both stability and adaptivity, and ideally, the distinction between such should not require a great deal of manual design. As in, adaptive models, such as plasticity, should provide the capacity for handling both tasks which require adaptivity and those which require stability. Of course most problems belong on a scale for either, however, it is often in the extremes that underlying issues unveil themselves in full honesty. Oja's rule (Equation 4) typically operates with real numbered activity, and hence to allow for an adequate comparison between the ANN and SNN with Oja's rule, the SNN Oja's update rule uses spiking activity averaged across several timesteps to produce a rate-based value instead of updating with binary spikes (Equation 19).
For the feedforward networks, there were two fully-connected hidden layers of 32 neurons. The recurrent networks had the same structure, but with recurrent connections on both hidden and the output layers. The hidden layers of the ANNs used a hyperbolic tangent activation function, which maps incoming activity between -1 and 1. The network topology was identical across all CartPole experiments for ANNs and SNNs. Figure 2 displays the average post-training lifespan over the trained time horizon for the ANN with Oja's and ABCD plasticity. Figure 2 is fit with a linear regression curve to demonstrate the predicted average lifespan based on the trained time horizon. The regression curve fit for the plastic RNNs are shown in the Appendix. In both the feedforward and recurrent networks, the ABCD rule was more stable, providing a predicted expected lifespan of x14.78 beyond the training time horizon for the feedforward, and x1.29 for the recurrent. Oja's rule only enables a x1.44 and x1.04 for feedforward and recurrent respectively. The recurrent networks were remarkably less stable in both instances for the ANN, and the feedforward networks were not shown to be capable of finding a stable solution even after training on an extended time horizon from the original 200 timesteps to 3000.
In the plastic SNNs, a linear curve does not suffice to model the expected lifespan, as after any training time horizon beyond 400 timesteps the network is capable of balancing indefinitely 1 . This stable behavior holds for both the plastic feedforward and recurrent SNNs. Additionally, the training time needed to attain an "indefinite" balancing lifespan was consistent for both the STDP and Oja's rule, even when Oja's rule used a rate-based representation of pre-and post-synaptic activity.

Quadrupedal Locomotion
In [19], plastic ANNs were shown to be impressively capable of generalizing beyond what had occurred during training time. In one experiment, several limbs of a quadruped ( Figure 4) were disabled randomly during training, whereas others were kept functional. The limbs which remained functional during training time served as a "training set," so that several disabled limbs could be examined as a "testing set" after training to determine whether generalization within intra-lifetime learning was actually occurring. Indeed, it was shown that locomotion progressed acceptably on one of the  two testing set limbs, with a rapid recovery in performance when disabled mid-locomotion. However, the functionality of the quadruped beyond the initial training time horizon was never considered in their results. This section replicates these experiments without damaged morphology, and observes the long-term stability of these solutions both in terms of qualitative behavior and obtained reward.  In this experiment, the Ant quadrupedal locomotion environment ( Figure 4) is trained with the same parameters and algorithm 2 as in [19]. The Ant environment differs from CartPole in that there is no natural definition of "lifespan;" the simulation never officially finishes execution unless a time horizon is instantiated. In [19], the ability to retain positive reward-driven behaviors was considered to be generalizing across disabled limbs, and hence generalization was measured with reward over time. Considering that, to measure generalization across time, the ability to retain reward-driven behavior beyond the training time horizon is examined.
Much like in the CartPole experiment, this experiment considers the training of plastic networks across several different time horizons; in this case, a time horizon of 250, 500, and 1000. The ABCD-plasticity rule used in [19] is applied to both the ANN and SNN, where, for the SNN, the pre-and post-synaptic activity uses rate-based spiking activity like in Equation 19. Surprisingly for the SNN, the average performance within the time horizon on each training is slightly lower than the ANN. However, generalization to time is significantly better, with there being little degradation in reward accumulation after the end of the trained time horizon. Each of the three networks demonstrate the capability to continue performing locomotion without functional deterioration; however, this generalization is shown to improve with a larger time horizon.
In the 250 timestep network training, the reward accumulation slows down over time, but generally continues upward.
In the 500 timestep network, it follows a linear upward trend up until around 2000 timesteps, where it follows a slower upward linear trend. Finally, in the 1000 timestep network, as far as it was observed, obtained a linear upward trend in performance, indicating strong generalization to time beyond the training time horizon.

Discussion
Synaptic plasticity is a powerful mechanism for unsupervised learning in neural networks, inspired by learning processes in the biological brain [1,2,3,4,5]. This process has been incorporated into spiking and artificial neural networks to enable intra-lifetime learning [8,9,10,11,12,13]. However, in this work it was shown that plastic ANNs struggle to generalize their behavior beyond the training time horizon. SNNs on the other hand are shown to effectively generalize Figure 6: Reward accumulation over time for three ABCD-plastic SNNs trained on Ant quadruped for three different training time horizons. All of the networks retain stable increase in reward beyond the training time horizon, which becomes more stable with a longer horizon.
to time on a cart-pendulum task requiring fine-tuned stability, and on a quadrupedal locomotion task where forward progress is rewarded. In the cart pendulum task, ANNs were evaluated with Oja's plasticity and ABCD plasticity rules, and the training time horizon was shown to have a linear relationship with the the average lifespan. SNNs evaluated with Oja's rule and STDP were shown to have lifespan divergence around a 400 timestep time horizon, where behavior generalized to time and the network was capable of balancing the pole indefinitely. In the quadrupedal locomotion task, plastic ANNs were shown to degrade in performance the moment after the time horizon was reached, whereas SNNs were shown to continue improving in performance.
Spiking neural networks have the additional advantage of possibly being used together with neuromorphic hardware, which increases the energy efficiency of deployed networks by orders of magnitude compared with ANNs [27]. Often the capability for incorporating plasticity can be designed into neuromorphic hardware, which further reinforces the benefits of plastic SNNs for use in application. It will likely be necessary for robotic applications of plastic SNNs to demonstrate generalization to time, as the majority of modern learning algorithms require a finite time horizon which is not representative of the application time that the robotic learner will be used for in the real world. In many scenarios, the target application time will be indefinite, and long-term stability will not only be desirable, but necessary.