# Hebbian theory

Hebbian theory is a neuropsychological theory claiming that an increase in synaptic efficacy arises from a presynaptic cell's repeated and persistent stimulation of a postsynaptic cell. It is an attempt to explain synaptic plasticity, the adaptation of neurons during the learning process. Hebbian theory was introduced by Donald Hebb in his 1949 book The Organization of Behavior. The theory is also called Hebb's rule, Hebb's postulate, and cell assembly theory. Hebb states it as follows:
   Let us assume that the persistence or repetition of a reverberatory activity (or "trace") tends to induce lasting cellular changes that add to its stability. ... When an axon of cell A is near enough to excite a cell B and repeatedly or persistently takes part in firing it, some growth process or metabolic change takes place in one or both cells such that A’s efficiency, as one of the cells firing B, is increased.$^{:62}$
The theory is often summarized as "Neurons that fire together, wire together." However, Hebb emphasized that cell A needs to "take part in firing" cell B, and such causality can occur only if cell A fires just before, not at the same time as, cell B. This aspect of causation in Hebb's work foreshadowed what is now known about spike-timing-dependent plasticity, which requires temporal precedence.
The theory attempts to explain associative or Hebbian learning, in which simultaneous activation of cells leads to pronounced increases in synaptic strength between those cells. It also provides a biological basis for errorless learning methods for education and memory rehabilitation. In the study of neural networks in cognitive function, it is often regarded as the neuronal basis of unsupervised learning.

## Hebbian engrams and cell assembly theory

Hebbian theory concerns how neurons might connect themselves to become engrams. Hebb's theories on the form and function of cell assemblies can be understood from the following:$^{:70}$
   The general idea is an old one, that any two cells or systems of cells that are repeatedly active at the same time will tend to become 'associated' so that activity in one facilitates activity in the other.
Hebb also wrote:$^{:63}$
   When one cell repeatedly assists in firing another, the axon of the first cell develops synaptic knobs (or enlarges them if they already exist) in contact with the soma of the second cell.
[D. Alan Allport] posits additional ideas regarding cell assembly theory and its role in forming engrams, along the lines of the concept of auto-association, described as follows:
   If the inputs to a system cause the same pattern of activity to occur repeatedly, the set of active elements constituting that pattern will become increasingly strongly inter-associated. That is, each element will tend to turn on every other element and (with negative weights) to turn off the elements that do not form part of the pattern. To put it another way, the pattern as a whole will become 'auto-associated'. We may call a learned (auto-associated) pattern an engram.$^{:44}$
Work in the laboratory of Nobel laureate Eric Kandel has provided evidence for the involvement of Hebbian learning mechanisms at synapses in the marine gastropod Aplysia californica. Experiments on Hebbian learning mechanisms at synapses in the central nervous system of vertebrates are much more difficult to control than experiments with the relatively simple peripheral nervous system synapses such as marine invertebrates. Much of the work on long-lasting synaptic changes between vertebrate neurons (such as long-term potentiation) involves the use of non-physiological experimental stimulation of brain cells. However, some of the physiologically relevant synapse modification mechanisms that have been studied in vertebrate brains do seem to be examples of Hebbian processes. One such review indicates that long-lasting changes in synaptic strengths can be induced by physiologically relevant synaptic activity using both Hebbian and non-Hebbian mechanisms.

## Principles

From the point of view of artificial neurons and artificial neural networks, Hebb's principle can be described as a method of determining how to alter the weights between model neurons. The weight between two neurons increases if the two neurons activate simultaneously, and reduces if they activate separately. Nodes that tend to be either both positive or both negative at the same time have strong positive weights, while those that tend to be opposite have strong negative weights.
The following is a formulaic description of Hebbian learning: (many other descriptions are possible)
    $\,w_{ij}=x_{i}x_{j},$
where $w_{ij}$ is the weight of the connection from neuron $j$ to neuron $i$ and $x_{i}$ the input for neuron $i$. Note that this is pattern learning (weights updated after every training example). In a Hopfield network, connections $w_{ij}$ are set to zero if $i=j$ (no reflexive connections allowed). With binary neurons (activations either 0 or 1), connections would be set to 1 if the connected neurons have the same activation for a pattern.
When several training patterns are used the expression becomes an average of individual ones:
    $w_{ij}={\frac {1}{p}}\sum _{k=1}^{p}x_{i}^{k}x_{j}^{k},$
where $w_{ij}$ is the weight of the connection from neuron $j$ to neuron $i$, $p$ is the number of training patterns and $x_{i}^{k}$ the $k$-th input for neuron $i$. This is learning by epoch (weights updated after all the training examples are presented), being last term applicable to both discrete and continuous training sets. Again, in a Hopfield network, connections $w_{ij}$ are set to zero if $i=j$ (no reflexive connections).
A variation of Hebbian learning that takes into account phenomena such as blocking and many other neural learning phenomena is the mathematical model of Harry Klopf. Klopf's model reproduces a great many biological phenomena, and is also simple to implement.

## Relationship to unsupervised learning, stability, and generalization

Because of the simple nature of Hebbian learning, based only on the coincidence of pre- and post-synaptic activity, it may not be intuitively clear why this form of plasticity leads to meaningful learning. However, it can be shown that Hebbian plasticity does pick up the statistical properties of the input in a way that can be categorized as unsupervised learning.
This can be mathematically shown in a simplified example. Let us work under the simplifying assumption of a single rate-based neuron of rate $y(t)$, whose inputs have rates $x_{1}(t)...x_{N}(t)$. The response of the neuron $y(t)$ is usually described as a linear combination of its input, $\sum _{i}w_{i}x_{i}$, followed by a response function $f$:
    $y=f\left(\sum _{i=1}^{N}w_{i}x_{i}\right).$
As defined in the previous sections, Hebbian plasticity describes the evolution in time of the synaptic weight $w$:
    ${\frac {dw_{i}}{dt}}=\eta x_{i}y.$
Assuming, for simplicity, an identity response function $f(a)=a$, we can write
    ${\frac {dw_{i}}{dt}}=\eta x_{i}\sum _{j=1}^{N}w_{j}x_{j}$
or in matrix form:
    ${\frac {d\mathbf {w} }{dt}}=\eta \mathbf {x} \mathbf {x} ^{T}\mathbf {w} .$
As in the previous chapter, if training by epoch is done an average $\langle \dots \rangle$ over discrete or continuous (time) training set of $\mathbf {x}$ can be done:${\frac {d\mathbf {w} }{dt}}=\langle \eta \mathbf {x} \mathbf {x} ^{T}\mathbf {w} \rangle =\eta \langle \mathbf {x} \mathbf {x} ^{T}\rangle \mathbf {w} =\eta C\mathbf {w} .$where $C=\langle \,\mathbf {x} \mathbf {x} ^{T}\rangle$ is the correlation matrix of the input under the additional assumption that $\langle \mathbf {x} \rangle =0$ (i.e. the average of the inputs is zero). This is a system of $N$ coupled linear differential equations. Since $C$ is symmetric, it is also diagonalizable, and the solution can be found, by working in its eigenvectors basis, to be of the form
    $\mathbf {w} (t)=k_{1}e^{\eta \alpha _{1}t}\mathbf {c} _{1}+k_{2}e^{\eta \alpha _{2}t}\mathbf {c} _{2}+...+k_{N}e^{\eta \alpha _{N}t}\mathbf {c} _{N}$
where $k_{i}$ are arbitrary constants, $\mathbf {c} _{i}$ are the eigenvectors of $C$ and $\alpha _{i}$ their corresponding eigen values. Since a correlation matrix is always a positive-definite matrix, the eigenvalues are all positive, and one can easily see how the above solution is always exponentially divergent in time. This is an intrinsic problem due to this version of Hebb's rule being unstable, as in any network with a dominant signal the synaptic weights will increase or decrease exponentially. Intuitively, this is because whenever the presynaptic neuron excites the postsynaptic neuron, the weight between them is reinforced, causing an even stronger excitation in the future, and so forth, in a self-reinforcing way. One may think a solution is to limit the firing rate of the postsynaptic neuron by adding a non-linear, saturating response function $f$, but in fact, it can be shown that for any neuron model, Hebb's rule is unstable. Therefore, network models of neurons usually employ other learning theories such as BCM theory, Oja's rule, or the generalized Hebbian algorithm.
Regardless, even for the unstable solution above, one can see that, when sufficient time has passed, one of the terms dominates over the others, and
    $\mathbf {w} (t)\approx e^{\eta \alpha ^{*}t}\mathbf {c} ^{*}$
where $\alpha ^{*}$ is the largest eigenvalue of $C$. At this time, the postsynaptic neuron performs the following operation:
    $y\approx e^{\eta \alpha ^{*}t}\mathbf {c} ^{*}\mathbf {x}$
Because, again, $\mathbf {c} ^{*}$ is the eigenvector corresponding to the largest eigenvalue of the correlation matrix between the $x_{i}$s, this corresponds exactly to computing the first principal component of the input.
This mechanism can be extended to performing a full PCA (principal component analysis) of the input by adding further postsynaptic neurons, provided the postsynaptic neurons are prevented from all picking up the same principal component, for example by adding lateral inhibition in the postsynaptic layer. We have thus connected Hebbian learning to PCA, which is an elementary form of unsupervised learning, in the sense that the network can pick up useful statistical aspects of the input, and "describe" them in a distilled way in its output.

## Limitations

Despite the common use of Hebbian models for long-term potentiation, Hebb's principle does not cover all forms of long-term synaptic plasticity. Hebb did not postulate any rules for inhibitory synapses, nor did he make predictions for anti-causal spike sequences (presynaptic neuron fires after the postsynaptic neuron). Synaptic modification may not simply occur only between activated neurons A and B, but at neighboring synapses as well. All forms of heterosynaptic plasticity and homeostatic plasticity are therefore considered non-Hebbian. One example is retrograde signaling to presynaptic terminals. The compound most commonly identified as fulfilling this retrograde transmitter role is nitric oxide, which, due to its high solubility and diffusivity, often exerts effects on nearby neurons. This type of diffuse synaptic modification, known as volume learning, is not included in the traditional Hebbian model.

## Hebbian learning account of mirror neurons

Hebbian learning and spike-timing-dependent plasticity have been used in an influential theory of how mirror neurons emerge. Mirror neurons are neurons that fire both when an individual performs an action and when the individual sees or hears another perform a similar action. The discovery of these neurons has been very influential in explaining how individuals make sense of the actions of others, by showing that, when a person perceives the actions of others, the person activates the motor programs which they would use to perform similar actions. The activation of these motor programs then adds information to the perception and helps predict what the person will do next based on the perceiver's own motor program. A challenge has been to explain how individuals come to have neurons that respond both while performing an action and while hearing or seeing another perform similar actions.
Christian Keysers and David Perrett suggested that as an individual performs a particular action, the individual will see, hear, and feel the performing of the action. These re-afferent sensory signals will trigger activity in neurons responding to the sight, sound, and feel of the action. Because the activity of these sensory neurons will consistently overlap in time with those of the motor neurons that caused the action, Hebbian learning predicts that the synapses connecting neurons responding to the sight, sound, and feel of an action and those of the neurons triggering the action should be potentiated. The same is true while people look at themselves in the mirror, hear themselves babble, or are imitated by others. After repeated experience of this re-afference, the synapses connecting the sensory and motor representations of an action are so strong that the motor neurons start firing to the sound or the vision of the action, and a mirror neuron is created.
Evidence for that perspective comes from many experiments that show that motor programs can be triggered by novel auditory or visual stimuli after repeated pairing of the stimulus with the execution of the motor program (for a review of the evidence, see Giudice et al., 2009). For instance, people who have never played the piano do not activate brain regions involved in playing the piano when listening to piano music. Five hours of piano lessons, in which the participant is exposed to the sound of the piano each time they press a key is proven sufficient to trigger activity in motor regions of the brain upon listening to piano music when heard at a later time. Consistent with the fact that spike-timing-dependent plasticity occurs only if the presynaptic neuron's firing predicts the post-synaptic neuron's firing, the link between sensory stimuli and motor programs also only seem to be potentiated if the stimulus is contingent on the motor program.

## Incorporating Inhibitory Neurons

Recent research on Hebbian learning has incorporated the role of inhibitory neurons, which are often overlooked in traditional Hebbian models. While classic Hebbian theory primarily focuses on excitatory neurons, more comprehensive models of neural learning now consider the balanced interaction between excitatory and inhibitory synapses. Studies suggest that inhibitory neurons can provide critical regulation for maintaining stability in neural circuits and might prevent runaway positive feedback in Hebbian learning.

## Hebbian Theory and Artificial Intelligence

In AI, Hebbian learning has seen applications beyond traditional neural networks. One significant advancement is in reinforcement learning algorithms, where Hebbian-like learning is used to update the weights based on the timing and strength of stimuli during training phases. Some researchers have adapted Hebbian principles to develop more biologically plausible models for learning in artificial systems, which may improve model efficiency and convergence in AI applications.

## Hebbian Theory and Cognitive Neuroscience

Hebbian learning is increasingly being linked to cognitive processes like decision-making and social learning. Cognitive neuroscience has started to explore the intersection of Hebbian theory with brain regions responsible for reward processing and social cognition, such as the striatum and prefrontal cortex. It is hypothesized that Hebbian plasticity in these areas may underpin behaviors like habit formation, reinforcement learning, and even the development of social bonds.

## Contemporary Developments and Computational Advancements

Modern research has expanded upon Hebb's original ideas. Spike-timing-dependent plasticity (STDP), for example, refines Hebbian principles by incorporating the precise timing of neuronal spikes to Hebbian theory. Experimental advancements have also linked Hebbian learning to complex behaviors, such as decision-making and emotional regulation. Current studies in AI and quantum computing continue to leverage Hebbian concepts for developing adaptive algorithms and improving machine learning models.
A growing area of interest is the application of Hebbian learning in quantum computing. While classical neural networks are the primary area of application for Hebbian theory, recent studies have begun exploring the potential for quantum-inspired algorithms. These algorithms leverage the principles of quantum superposition and entanglement to enhance learning processes in quantum systems. Current research is exploring how Hebbian principles could inform the development of more efficient quantum machine learning models.
New computational models have emerged that refine or extend Hebbian learning. For example, some models now account for the precise timing of neural spikes (as in spike-timing-dependent plasticity), while others have integrated aspects of neuromodulation to account for how neurotransmitters like dopamine affect the strength of synaptic connections. These advanced models provide a more nuanced understanding of how Hebbian learning operates in the brain and are contributing to the development of more realistic computational models.