Codependent excitatory and inhibitory plasticity accounts for quick, stable and long-lasting memories in biological networks

The brain’s functionality is developed and maintained through synaptic plasticity. As synapses undergo plasticity they also affect each other. The nature of such “codependency” is difficult to disentangle experimentally, because multiple synapses must be monitored simultaneously. To help understand the experimentally observed phenomena, we introduce a framework that formalises synaptic codependency between different connection types. The resulting model explains how inhibition can gate excitatory plasticity, while neighbouring excitatory-excitatory interactions determine the strength of long-term potentiation. Furthermore, we show how the interplay between excitatory and inhibitory synapses can account for the quick rise and long-term stability of a variety of synaptic weight profiles, such as orientation tuning and dendritic clustering of co-active synapses. In recurrent neuronal networks, codependent plasticity produces rich and stable motor cortex-like dynamics with high input sensitivity. Our results suggest an essential role for the neighbourly synaptic interaction during learning, connecting micro-level physiology with network-wide phenomena.

T he remarkable property of synapses to change -synaptic plasticity -is thought to be the brain's fundamental mechanism for learning, and it has generated a large body of theoretical and experimental work [1][2][3][4] . Based on Hebb's postulate and early experimental data, theories have focused on the idea that synapses change solely based on the activity of their preand postsynaptic counterparts [5][6][7][8][9][10][11][12] , defining synaptic plasticity as predominantly a local process that is controlled by global modulatory signals. However, experimental evidence 13-22 has pointed towards learning mechanisms that act non-locally at the mesoscale, taking into account the activity of multiple synapses and synapse types nearby. For example, excitatory synaptic plasticity (ESP) has long been known to rely on intersynaptic cooperativity by way of elevated calcium concentrations from the activation of multiple presynaptic excitatory synapses [17][18][19][20] . Interestingly, GABAergic, inhibitory synaptic plasticity (ISP) has also been shown to depend on the activation of neighbouring excitatory synapses: ISP is blocked when excitatory synapses are deactivated 13,14 , and the magnitude of the changes depends on the ratio of local excitatory and inhibitory currents (EI balance) 13 . Finally, inhibitory currents can affect ESP, either flipping the direction of efficacy changes according to the absence or presence of inhibitory currents in the vicinity of the synapse 15,16 , or maximising ESP during local disinhibition 23 caused by modulatory inputs 24 . Longterm potentiation (LTP) at excitatory synapses has also been shown to depend on the distance and timing between successive LTP inductions of neighbouring excitatory synapses 25 . Moreover, Hebbian LTP has been shown to trigger long-term depression (LTD) at neighbouring synapses 21 through a heterosynaptic plasticity mechanism. There is currently no unifying framework to incorporate these experimentally observed interdependencies at the mesoscopic level of synaptic plasticity.
Existing models typically aim to explain, e.g., how cell assemblies are formed and maintained 26, 27 . In these studies, local plasticity rules are typically complemented with non-local processes such as normalisation of excitatory synapses 27 , or mod- * Correspondence: everton.agnes@gmail.com; 19th October 2022 ulation of inhibitory synaptic plasticity by the average network activity 10 , for stability. Moreover, intricate spatiotemporal dynamics, such as the activity patterns observed in motor cortex during reaching movements 28 , can only be reproduced when inhibitory connections are optimised (i.e., hand tuned) by iteratively changing the eigenvalues of the connectivity matrix towards stable values 29 , or learned by non-local supervised algorithms such as FORCE 30,31 . However, models that rely on connectivity changes triggered by non-local quantities are usually based on the optimisation of network dynamics [29][30][31] , and often don't reflect biologically relevant mechanisms (but see Kirchner and Gjorgjieva 32 ).
In order to fill the theoretical gap in non-local, mesoscopic synaptic plasticity rules, we introduce a new model of codependent synaptic plasticity that takes into account the direct interaction between different neighbouring synapses. Our model can account for a wide range of experimental data on excitatory plasticity and receptive field plasticity of excitatory and inhibitory synapses, and makes predictions for future experiments involving multiple synaptic stimulation. Furthermore, it provides a mechanistic explanation for experimentally observed synaptic clustering and for how dendritic morphology plays a role to facilitate the emergence of single (clustered) or mixed (scattered) feature selectivity. Finally, we show how naïve recurrent networks can grow into strongly connected, stable and input sensitive circuits showing amplifying dynamics.

Results
We developed a general theoretical framework for synaptic plasticity rules which accounts for the interplay between different synapse types during learning. In our framework, excitatory and inhibitory synapses change according to the functions φ E (E, I; PRE, POST) and φ I (E, I; PRE, POST), respectively (Fig. 1A). The signature of the codependency between neighbouring synapses is given by E and I, which describe the recent postsynaptic activation of nearby excitatory and inhibitory synapses, respectively. The activity of the synapse's own pre-and postsynaptic neurons, i.e., the synapse's local activity, is described by the variables PRE and POST, respectively.
In our model, the explicit regulation of plasticity via excitatory and inhibitory currents can alter amplitude, and direction, of synaptic change ( Fig. S1A-C). The classic frequencydependent protocol 17 , for example, has different effects when neighbouring excitatory and inhibitory synapses are simultaneously activated (Fig. 2D,E), highlighting the different roles of neighbouring excitation and inhibition. In contrast, in the traditional spike-6,10 or voltage-based 7 learning rules, neighbouring activation do not affect plasticity as long as it does not influence pre-and postsynaptic spike patterns or the mean postsynaptic membrane potential, i.e., due to balanced excitatory and inhibitory currents (Fig. S2). Moreover, the set-point for the total excitatory current onto a dendritic branch, which emerges from the combination of the Hebbian-LTP and heterosynaptic terms, inherent to our rule (see Fig. 1C, red circle), is determined by the ratio between the learning rate of these two mechanisms (Fig. 2F). The total excitatory current received by a neuron, established by this set-point, is independent of initial excitatory weights and inhibitory input strength (Fig. 2G). With the same amount of excitation -given by the set-point - Bottom: A population of 800 excitatory (plastic synapses) and 200 inhibitory (static synapses) neurons connected to a postsynaptic neuron (used in panels F to I). B, Changes in excitatory synapses, ∆w E , as a function of the postsynaptic depolarisation for a 10-ms pre-before-post protocol at 50 Hz. Experimental data points from mouse visual cortex 18 . C, Changes in excitatory synapses, ∆w E , as a function of spike frequency for a spike-timing dependent plasticity protocol with pre-before-post (10 ms) and postbefore-pre (−10 ms). Experimental data points from rat visual cortex 17 . Error bars indicate SEM. D, Same as panel C for different firing-rates of neighbouring excitatory and inhibitory afferents (colour coded). Plot shows changes in synaptic weight of a single connection while the other two (excitatory and inhibitory) are kept fixed. Excitatory and inhibitory weight of neighbouring synapses were chosen to keep the initial (before plasticity) excitatory and inhibitory currents balanced, and thus same average membrane potential for the same input frequency. E, Weight change as a function of input frequency (from neighbouring excitatory and inhibitory synapses; y-axis), and frequency of pairs of spikes (x-axis). Arrows indicate constant input frequencies used in panel D. F-H, Total excitatory current (after learning) as a function of the heterosynaptic learning rate (panel F), initial excitatory weights (panel G), and inhibitory weights (panel H). I, Firing-rate of the postsynaptic neuron after learning of excitatory synapses for different inhibitory weights for the same simulations in panel H. the more inhibition a neuron receives, the lower its firing-rate (Fig. 2H).
EI balance and firing-rate set-point. The dynamics of traditional spike-based plasticity rules can be approximated by the firing-rate of pre-and postsynaptic neurons 8,26 . In these types of models, stable postsynaptic activity may be achieved if synaptic weights change towards a firing-rate set-point 8,10 that controls the dynamics such that excitatory weights increase when the postsynaptic firing-rate is lower than the setpoint and decrease otherwise 10,26 . In the same vein, inhibitory weights decrease for low postsynaptic firing-rates (below the set-point) and increase for high firing-rates 8,37 . When both excitatory and inhibitory synapses are plastic (Fig. 3A), the fixed-points from both rules must match to avoid a competition between synapses (Fig. 3B) that would result in synaptic weights to either diverge or vanish (Fig. 3C). Codependent inhibitory plasticity does not have such a problem because there is no firing-rate set-point. Instead, it acts explicitly on excitatory and inhibitory currents (see Fig. 1F,G, and Methods; Fig. S1D), allowing various stable activity regimes for a postsynaptic neuron while avoiding competition with excitatory plasticity (Fig. 3D). A state of global balance between excitation and inhibition, defined by average balance with unspecific correlation between excitation and inhibition for specific input directions (e.g., sound frequency 23 ), naturally arises. The complementary spike-based component of codependent inhibitory plasticity (see Fig. 1E) is necessary for the development of a state of detailed balance, defined by correlated excitatory and inhibitory currents for each input direction.
Receptive field plasticity. Sensory neurons have been shown to respond more strongly to some features of the stimuli than others, which is thought to facilitate recognition, classification, and discrimination of stimuli. The shape of a neuron's response profile, i.e., its receptive field, is a result of its input connectivity 23 . Receptive fields are susceptible to change when an animal learns 38 , with strong evidence supporting receptive field changes as a direct consequence of synaptic plasticity 39 .  Firing-rate set-point from excitatory synaptic plasticity (ESP) is higher than the one from inhibitory synaptic plasticity (ISP). Bottom: Firingrate set-point from ISP is higher than the one from ESP. The interval between the set-point is defined as ∆r. C, Combination of excitatory 10 and inhibitory 8 spike-based rules. Top: Firing-rate of a postsynaptic neuron receiving excitatory and inhibitory inputs. Red and blue lines indicate the firing-rate set points imposed by the excitatory 10 and inhibitory 8 spike-based learning rules, respectively. The parameters of the learning rules were chosen so that the set-points coincide during the first and third quarters of the simulation. During the second and fourth quarters of the simulation, the set-point imposed by the excitatory spike-based learning rule is increased and decreased, respectively. Middle: Ratio between excitatory and inhibitory currents. Bottom: Average excitatory (red) and inhibitory (blue) synaptic weights of input neurons normalised to initial value. D, Same as panel C for the combination of excitatory spike-based 10 and codependent inhibitory synaptic learning rules. The blue line in the middle panel indicates the balance set-point imposed by the codependent inhibitory synaptic plasticity. During a "learning window", indicated by the shaded area and * , all inhibitory afferents are down-regulated. The sequential activation of excitatory input groups (Fig. S3A) in the absence of inhibition establishes a receptive field profile. C, Continued simulation from panel B. Weights are stable until inhibition is down-regulated for a 200-millisecond window, indicated by the shaded area and * , during which the green pathway (#4) is activated (Fig. S3B). Consequently, the preferred input pathway switches from #6 (pink) to #4 (green). D, Snapshots of the average synaptic weights for the different pathways before (top), immediately after plasticity induction (middle), and at the end of the simulation as indicated by the symbols in panel C. E, Experimental data 23 shows receptive field profiles of excitatory and inhibitory inputs before (top), as well as 30 minutes (middle) and 180 minutes (bottom) after pairing of non-preferred tone and nucleus basalis activation. Error bars indicate SEM.
To assess the functional consequence of codependent plasticity, we studied its performance in receptive field formation for both excitatory and inhibitory synapses jointly. We simulated a postsynaptic LIF neuron receiving inputs from 8 pathways (see Methods) that represent, e.g., different sound frequencies 23 (Fig. 4A). In this scenario, inhibitory activity acted as a gating mechanism for excitatory plasticity, by keeping the learning rate at a minimum when inhibitory currents were high (see Fig. 1D). Excitatory input weights could thus only change during periods of presynaptic disinhibition, i.e., the learning window (Fig. S3), and were otherwise stable (Fig. 4B,C). In our simulation, we initially set all excitatory weights to the same strength. A receptive field profile emerged at excitatory synapses after a specific sequence of strong stimulation of pathways during the first learning window. The acquired excitatory receptive profile remained stable (static) for hours after the learning period (Fig. 4B, top). Inhibitory synapses changed on a slower timescale (Fig. 4B, bottom) and, due to the spike-timing dependence of codependent ISP, developed a co-tuned field with the excitatory receptive field (Fig. 4D, top). Inspired by experimental work 23 , we then briefly activated a non-preferred pathway during a period of disinhibition (Fig. 4C, top), altering the tuning of excitatory weights and making the previously non-preferred pathway preferred (Fig. 4D, middle). This change in tuning happened thanks to the Hebbian component of the codependent excitatory plasticity rule that induced LTP in the active pathway, and the heterosynaptic plasticity component triggering LTD in pathways that were inactive during the learning window. As before, inhibitory weights were reshaped by codependent ISP to a co-tuned field with the most recent excitatory receptive field (Fig. 4C, bottom), reaching a state of detailed balance 3 (Fig. 4D, bottom). Changes in both excitatory and inhibitory inputs due to codependent plasticity thus reproduced experimental results in rat auditory cortex 23 (Fig. 4E) without external control.
The formation of stimulus-tuned excitation and co-tuned inhibition was only successful when the learning rules were codependent, and the learning rate of inhibitory plasticity was slow. When excitatory and inhibitory plasticity operated at similar time scales, inhibitory plasticity prevented excitatory weights to change during disinhibition (Fig. 5A, top), because any externally induced decrease in inhibition (disinhibition) was quickly compensated for by inhibitory plasticity (Fig. 5A, bottom). When we reduced the level of codependency, excitatory weights varied wildly, because the modulatory control of inhibitory currents over excitatory plasticity did not effectively decrease the learning rate of excitatory plasticity (Fig. 5B, top). Although a preferred input signal could be momentarily established after the learning window (Fig. 5B, top), the new preference was soon lost because baseline levels of inhibition were not blocking ongoing excitatory plasticity. Inhibitory plasticity quickly compensated the induced disinhibition during the learning period (Fig. 5B, bottom), but inhibitory weights remained unspecific, i.e., without developing a receptive fieldlike profile.
Dendritic clustering with single or mixed feature selectivity. The dendritic tree of neurons is a intricate spatial structure that can achieve complex neuronal processing in single neurons that is impossible in single-compartment neuron models 40 . To assess how our learning rules affected the dendritic organisation of synapses, we attached passive dendritic compartments to the soma of our model. Dendritic membrane potentials could be depolarised to values well above the somatic spiking threshold depending on their proximity, i.e., electrotonic distance, to the soma (Fig. 6A). These super-threshold membrane potential fluctuations gave rise to larger NMDA and GABA A current fluctuations in distal dendrites (Fig. 6B). Like in the single compartmental models, when excitation and inhibition were unbalanced (i.e., when receiving uncorrelated inputs), distal dendrites could undergo fast changes due to the currentinduced high learning rates for excitatory plasticity (Fig. 6B, thick red line). However, when currents were balanced (i.e., when receiving correlated excitatory and inhibitory inputs), larger inhibitory currents gated excitatory plasticity off despite strong excitation, effectively blocking excitatory efficacy changes in these compartments (Fig. 6B, thick blue line). Additionally, the larger distance to the soma, and its consequently weaker passive coupling (Fig. 6C), meant that distal dendrites had a smaller influence on the initiation of postsynaptic spikes.
As a consequence of these two effects -location dependent learning-rates and influence on somatic spike initiation -syn-  Fig. 4B, but with larger learning rate of inhibitory plasticity (increased by 1000-fold). Evolution of excitatory (top) and inhibitory (bottom) weights. The shaded area and * indicate the learning window, when all inhibitory afferents are downregulated. Excitatory input groups are activated at a specific order for receptive-formation during the learning window (Fig. S3A). B, Simulation similar to Fig. 4B, but with weak inhibitory control over excitatory plasticity. The learning window is set between t = 10 and t = 10.1 seconds with the same levels of disinhibition and excitatory activation sequence as in panel A. Baseline levels of inhibitory currents do not block excitatory plasticity, and thus excitatory weights continuously change.
apses developed differently according to their somatic proximity ( Fig. 6D) and according to the activity of their neighbouring inputs. When the majority of excitatory inputs onto a dendritic compartment were co-active, i.e., originated from the same source (representing same stimulus feature such as sound frequency 23 ), their co-active synapses were strengthened, creating a cluster of similarly tuned inputs onto a compartment (Fig. 6D, middle). Uncorrelated, independently active excitatory synapses weakened and eventually faded away (Fig. 6D, middle). In contrast, when more than a certain number of excitatory inputs were independent, co-active synapses decreased in weight and faded, while independently active excitatory synapses strengthened (Fig. 6D, right). The number of co-active excitatory synapses necessary for a dendritic compartment to develop single-feature tuning varied with somatic proximity, and whether excitation and inhibition were matched (Fig. S4). Notably, in the balanced state, substantially more coactive excitatory synapses were necessary to create clusters at distal than at proximal dendrites ( Fig. 6E), because only large groups of co-active excitatory synapses could initiate LTP-inducing pre-before-post spike pairs. Thus, single-feature selectivity 41,42 or mixed selectivity 43 emerged in our model depending on the branch architecture of the dendritic host structure similar to what has been observed experimentally 44,45 ( Fig. 6F).

Transient amplification in recurrent spiking networks.
Up to this point we explored the effects of codependent synaptic plasticity in a single postsynaptic neuron. However, recurrent neuronal circuits typically amplify instabilities of any synaptic plasticity rules at play 10,47 . We thus investigated codependent plasticity in a recurrent neuronal network of 1250 spiking neurons (see Methods; Fig. 7A). In our model, excitatory and inhibitory codependent plasticity allowed the network to self-stabilise in a high-conductance state 48 , with low effective neuronal membrane time-constants (Fig. 7B, left), and strong excitatory connections that were precisely balanced by equally strong inhibition (Fig. 7B, middle, and Fig. S5). Remarkably, the network exhibited a wide distribution of baseline firing-rates ( Fig. 7B, right), similar to what has been observed in cortical recordings in vivo 49 . To investigate the dynamic behaviour of the network in response to perturbations, we first analysed the learned connectivity matrix of the network with regard to the weights of incoming and outgoing synapses, to identify the neurons which affect the network most strongly (see Methods; Fig. 7C). Next, we delivered step-like stimuli to these neurons, to simulate a large sensory stimulus propagating to other neurons of the network (Fig. 8A,B). We observed several types of responses, ranging from minimal deflections in firing rate to large transient responses, either during the delivery of the stimulus, or in response to its termination. To further quantify these responses, we calculated the average and the 2 -norm of the population (Fig. 8B). Both these measures confirmed that the network was in a regime of 'transient amplification' 29,50,51 , i.e., a highly responsive state thought to underlie computation-  46 . D, Schematic of the synaptic organisation onto a dendrite (left). Each line represents a synapse, with co-active synapses bearing the same colour. Examples of clustering of co-active (middle) or independent (right) synapses resulting in single or mixed feature selectivity, respectively, at the level of the dendrite. Line length indicates synaptic weight in arbitrary units. E, Clustering index as a function of the size of co-active input group for distal (orange) and proximal (yellow) dendrites with independent (top) and matching (bottom) excitatory and inhibitory inputs. Clustering index is equal to 1 (respectively −1) when only co-active (respectively independent) synapses survived and 0 when all synapses survived (see Methods). F, Clustering index (colour-coded) as a function of the size of co-active input group (x-axis) and the distance from the dendrite to the soma (y-axis) for independent (top) and matching (bottom) excitatory and inhibitory inputs. Dark green indicates single feature selectivity while brown indicates mixed feature selectivity. through-population-dynamics 52 (Fig. 8B). The trajectory of the population dynamics in principle component space showed reliable network wide activity patterns ( Fig. 8C) that could be used to control the activity of a readout network with two output units to draw digits (Fig. 8D).

Discussion
In this paper we introduced a general framework to describe synaptic plasticity as a function of local pre-and postsynaptic interactions, including the modulatory effects of nearby synapses. We built the excitatory and inhibitory plasticity rules according to experimental observations, such that the effect of neighbouring synapses could gate, control, and even invert the direction of efficacy changes 13-20,25 . Importantly, excitatory and inhibitory plasticity were constructed such that they strove towards different fixed points (constant levels of excitatory currents for excitatory plasticity and EI balance for inhibtory plasticity), thus collaborating without mutual antagonism. In our model, inhibition played an important role in controlling excitatory plasticity, allowing us to make several predictions. First, during periods of disinhibition, inhibitory plasticity has to be slower than excitatory plasticity. A reduction in the amplitude of inhibitory currents directly increased the learning rate of excitatory plasticity, thus allowing for a quick (re-)arrangement of excitatory weights. This effect was prevented if inhibitory weights could immediately increase to compensate the disinhibitory effect, establishing a limit for how fast inhibitory synapses can change. Second, inhibitory control over excitatory plasticity has to be relatively strong. The mechanism that allows excitatory weights to quickly reorganise during periods of disinhibition was also responsible for long-term stability of such modifications when inhibitory activity was at baseline levels. Without strong control, excitatory weights constantly changed due to pre-and postsynaptic activity, drifting away from the synaptic weight pattern estab-lished during the period of disinhibition. Finally, our model also predicts that dendrites on which synaptic contacts of both excitatory and inhibitory presynaptic neurons have uncorrelated activity should likely form a connectivity pattern reflecting single-feature selectivity. In this scenario, the initial connectivity pattern will reflect whether a dendritic region may respond to only a few or many input features.
In our model, neighbouring excitatory influence on synaptic plasticity was driven by slow, NMDA-like, excitatory currents, which were required to elicit LTP at excitatory synapses. As a direct consequence, the same pattern of pre-and postsynaptic spike times could produce distinctly different weight dynamics depending on the levels of postsynaptic depolarisation (due to an increase in excitatory currents through NMDA channels caused by the release of the magnesium block 53 ). However, an increase in excitatory activity can lead to a rise in the amplitude of excitatory currents (thus also eliciting stronger LTP), even without depolarisation of the postsynaptic neuron (when, e.g., inhibition tightly balances excitation). Postsynaptic membrane potential and presynaptic spike patterns thus independently control the LTP component of excitatory plasticity in our model. This is in line with cooperative view on synaptic plasticity 20 , and experimental findings showing that high-frequency stimulation, which usually elicits LTP, produce LTD when NMDA ion channels are blocked 54 . Further experimental data is necessary to disentangle the specific role of excitatory currents and postsynaptic firing frequency in shaping excitatory synaptic plasticity, and thus unveiling the precise biological form of codependent plasticity.
The set-point dynamics for excitatory currents can be interpreted as a mechanism that normalises excitatory weights by keeping their total combined weights within a range that guarantees a certain level of excitatory currents, similarly to homeostatic regulation of excitatory bouton size in dendrites 55 . Our rule accomplishes this homeostatic regulation through a local combination of Hebbian-LTP and heterosynaptic weakening, similarly to what has been reported in dendrites of visual cortex of mice in vivo 21 . Our results show how such plasticity can develop a stable, balanced network that amplifies particular types of input, generating complex spatiotemporal patterns of activity. These networks developed such that they emulate motorlike outputs for both average and single trial experiments 28,56 without specifically being tuned for it. In our simulations, the phenomenon of transient amplification emerged as a result of the network acquiring a stable high conductance state. This state was established by an autonomous modification of excitatory weights towards a set-point for excitatory currents, balanced by inhibition due to the modification of inhibitory weights towards a regime of precise balance.
Our set of codependent synaptic plasticity rules integrates a number of previously proposed rules that rely on spike times 6,8,10 , synaptic current 9,57 with implicit voltage dependence 7,58 , heterosynaptic weakening 10 , and neighbouring synaptic activation 32,57 in a single theoretical framework. In addition to amplifying correlated input activity by way of controlling the efficacy of a synapse, each of the mechanisms in these previous models may replicate a different facet of learning. For example, spike-based plasticity rules can maintain a set of stable firing-rate set-points 8,10,26,27 . Rules based on local membrane potentials 7 , on the other hand, are ideal for spatially extended dendritic structure, making it possible to detect localised activity, and allowing a spatial redistribution of synaptic weights to improve, for example, associative memory when multiple features are learned by a neural network 58   calcium-influx related models 9 are ideal to incorporate information about presynaptic activation, explaining the emergence of binocular matching in dendrites 57 . Neighbouring activation models 32 emulate neurotrophic factors that influence the emergence of clustering of synapses during development.
We have unified these disparate approaches in a fourvariable model that accounts for the interplay between different synapse types during learning and captures a large range of experimental observations. We have focused only on two types of synapses, i.e., excitatory-to-excitatory and inhibitoryto-excitatory synapses in an abstract setting, but the simplicity of our model allows for the adaptation of a larger number of synaptic types, including, e.g., modulatory signals present in three-factor learning rules 59 . Faithful modelling of a broader range of influences will require additional experimental work to monitor multi-cell interactions by way of, e.g., patterns of excitatory input with glutamate uncaging 60 or all optical intervention in vivo 61,62 . Looking at synaptic plasticity from a holistic viewpoint of integrated synaptic machinery, rather than as a set of disconnected mechanisms, may provide a solid basis to understanding learning and memory. [11] B Confavreux, F Zenke, E J Agnes, T Lillicrap, and T P Vogels, "A metalearning approach to (re)discover plasticity rules that carve a desired function into a neural network," Advances in Neural Information Processing Systems 33, 16398-16408 (2020).

Methods of
Codependent excitatory and inhibitory plasticity accounts for quick, stable and long-lasting memories in biological networks Everton J. Agnes and Tim P. Vogels

Neuron model
Point neuron. In the simulations with a postsynaptic neuron described by a single variable (point-neuron) we used a leaky integrate-and-fire (LIF) neuron with after-hyperpolarisation (AHP) current and conductance-based synapses. The postsynaptic neuron's membrane potential, u(t), evolved according to a first-order differential equation, where τ m is the membrane time constant (τ m = RC; leak resistance times membrane capacitance), u rest is the resting membrane potential, g AHP (t) is the conductance of the AHP channel with reversal potential E AHP , I ext (t) is an external current used to mimic experimental protocols to induce excitatory plasticity, and g X (t) and E X are the conductance and the reversal potential of the synaptic channel X, respectively, with X = {AMPA, NMDA, GABA A }. Excitatory NMDA channels were implemented with a nonlinear function of the membrane potential, caused by a Mg 2+ block, whose effect was simulated via the function where a NMDA and b NMDA are parameters. The AHP conductance was modelled as where τ AHP is the characteristic time of the AHP channel and S post (t) is the spike train of the postsynaptic neuron, where t * k,post is the time of the kth spike of the postsynaptic neuron, and δ(·) is the Dirac's delta. The synaptic conductance was modelled as dg where τ X is the characteristic time of the neuroreceptor X. The sum on the right-hand side of Eq. S5 corresponds to presynaptic spike trains weighted by the synaptic strength w j (t). The presynaptic spike train of neuron j was modelled as where t * k, j is the time of the kth spike of neuron j. The postsynaptic neuron elicited an action potential whenever the membrane potential crossed a spiking threshold from below. We simulated two types of threshold: fixed or adaptive. Fixed spiking threshold. A fixed spiking threshold was implemented as a parameter, u th . When the postsynaptic neuron's membrane potential crossed u th from below, a spike was generated and the postsynaptic neuron's membrane potential was instantaneously reset to u reset , and then clamped at this value for the duration of the refractory period, τ ref . All simulations with a single postsynaptic neuron were implemented with a fixed spiking threshold. Adapting spiking threshold. For the simulations of the recurrent network we used an adapting spiking threshold, u th (t). When the postsynaptic neuron's membrane potential crossed u th (t) from below, a spike was generated and the postsynaptic neuron's membrane potential was instantaneously reset to u reset without any additional clamping of the membrane potential (the refractory period that results from the adapting threshold is calculated below). Upon spike, the adapting spiking threshold, u th (t), was instantaneously set to u * th , decaying back to its baseline according to where τ th is the decaying time for the threshold variable, and u 0 th is the baseline for spike generation. The maximum depolarisation of the membrane potential is linked to the reversal potential of NMDA, and thus the absolute refractory period can be calculated as which is the time the adapting threshold takes to decay to the same value as the reversal potential of the NMDA channels. Fig. S6 shows an example of two states that arise from the combination of an adapting threshold and NMDA currents.
Two-layer neuron. The two-layer neuron was simulated as a compartmental model with a spiking soma that receives input from N B dendritic branches. The soma was modelled as a LIF neuron, and the dendrite as a leaky integrator (without generation of action potentials). Somatic membrane potential evolved according to The soma of the two-layer neuron was similar to the point neuron (Eq. S1), however, synaptic currents were injected on the dendritic tree, which interacted with the soma passively through the last term on the right-hand side of Eq. S9, J i being the conductance that controls the current flow due to connection between the soma and the ith dendrite. In Eq. S9, u i (t) is the membrane potential of the dendritic branch i. When the somatic membrane potential, u soma (t), crossed the threshold, u th , from below, the postsynaptic neuron generated an action potential, being instantaneously reset to u reset , and then clamped at this value for the duration of the refractory period, τ ref .
Dendritic compartments received presynaptic inputs, as well as a sink current from the soma. The membrane potential of the ith branch, u i (t), evolved according to the following differential equation, Variables g X,i (t), with X = {AMPA, NMDA, GABA A }, were simulated following Eq. S5. Spikes were not elicited in dendritic compartments, but due to the gating function H NMDA (u) and the absence of spiking threshold, voltage plateaus occurred naturally when multiple inputs arrived simultaneously on a compartment (Fig. 6A). We simulated two compartments with the same coupling with the soma, J i : one whose synapses changed according to the codependent synaptic plasticity model, and one with fixed synapses that acted as a noise source.
Coupling strength as function of electrotonic distance. The crucial parameter introduced when including dendritic compartments was the coupling, J i , between soma and the dendritic compartment i. Steady changes in membrane potential at the soma are attenuated at dendritic compartments, and this attenuation has been shown to decrease with distance. Without synaptic inputs, and steady membrane potential at both soma and dendritic compartments, Eqs. S9 and S10 are equal to zero, which results in where a i is the passive dendritic attenuation of the dendritic compartment i, withū soma being a constant steady-state held at the soma, andū i being the resulting steady-state at the dendritic compartment i. The attenuation is a function of distance as follows, where d * is a parameter we fitted from experimental data from Gulledge and Stuart 46 (Fig. 6C). We used this fitted parameter in Eq. S11 to approximate the distance to the soma in Fig. 6F according to the soma-dendrite coupling strength used in our simulations.

Codependent synaptic plasticity model
The codependent plasticity model is a function on both spike times and input currents. We first describe how synaptic currents are accounted and then how excitatory and inhibitory plasticity models were implemented. We defined a variable E i (t) to represent the process triggered by excitatory currents at the ith dendritic compartment. We considered NMDA currents, which reflect influx of calcium into the postsynaptic cell, as the trigger for biochemical processes that are represented by the state of E i (t). Its dynamics is described by where τ E is the characteristic time of the excitatory trace and is the excitatory current flowing through NMDA channels. Inhibitory inputs contributed to the plasticity model through a variable I i (t). For the inhibitory trace, we used GABA A currents, which reflect influx of chloride, as the trigger of the process described by I i (t). The inhibitory trace evolved as where τ I is the characteristic time of the inhibitory trace, c GABA A ,i is the inhibitory current described as The index i is not taken into account for simulations with point-neurons. Notice that both E i (t) and I i (t) are in units of voltage because the conductance is unit-free in our neuron model implementation (Eq. S1). Codependent excitatory synaptic plasticity. The codependent excitatory synaptic plasticity model is a spike-timing-dependent plasticity (STDP) model regulated by excitatory and inhibitory inputs through E i (t) and I i (t). The weight of the jth synapse onto the ith dendritic branch, w ij (t), changed according to where A LTP , A het and A LTD are the learning rates of long-term potentiation, heterosynaptic plasticity and long-term depression, respectively. The additional parameter I * defines the amount of control that inhibitory activity imposes onto excitatory synapses. Variables S post (t) and S j (t) represent the postsynaptic and presynaptic spike trains, respectively, as described above for the neuron model (Eqs. S4 and S6). The trace of presynaptic spike train is represented by x + j (t), and the traces of postsynaptic spike train (with different time scales) are represented by y E post (t) and y − post (t). They evolve in time according to For values of inhibitory trace larger than a threshold, I i (t) > I th , we effectively blocked excitatory plasticity to mimic complete shunting of back-propagating action potentials 35 . We implemented maximum and minimum allowed values for excitatory weights, w E max = 1 and w E min = 10 −6 , respectively. Codependent inhibitory synaptic plasticity. Similar to the excitatory learning rule, the codependent inhibitory synaptic plasticity is a function of spike times and synaptic currents. The weight of the jth inhibitory synapse onto the ith dendritic compartment, w i j (t), changes over time according to a differential equation given by Parameters η and α control the learning-rate and the balance of excitatory and inhibitory currents, respectively. Variables y post (t) and x j (t) are traces of pre and postsynaptic spike-trains, respectively, to create a symmetric STDP-like curve, with dynamics given by dy post (t) The STDP window is characterised by the time constant τ iSTDP . We implemented maximum and minimum allowed values for inhibitory weights, w E max = 7 and w E min = 10 −6 , respectively. Experimental fit - Fig. 2B,C. We fitted two data sets with the codependent excitatory synaptic plasticity model to asses its dependency on voltage, i.e., membrane potential, and on the frequency of pre-and postsynaptic spikes. We used the same number of pre-and postsynaptic spikes for all our simulations (based on the original experiments). Postsynaptic spikes were induced by the injection of a current pulse, I ext (t) = 3 nA, for the duration of 2 ms.
For Fig. 2B, additional to the current injected for spike generation, we also injected a constant external current to depolarise the neuron's membrane potential. The protocol consisted in pre-and postsynaptic spikes with 10 millisecond interval, pre-beforepost, firing at 50 Hz. The more depolarised the membrane potential, the bigger the effect of the NMDA currents, and therefore more LTP was induced.
The protocol for Fig. 2C consisted on pre-and postsynaptic spikes with either +10 milliseconds (pre-before-post) or −10 milliseconds interval (post-before-pre) in varying firing-rates: 0.1, 10, 20, 40, and 50 Hz. The increase in presynaptic firing-rate caused an increase in NMDA currents which led to strong LTP induction.
Fitting of both protocols was done with brute force parameter sweep on four parameters: A LTP , A het , A LTD , and τ E .
Stability. The codependent plasticity model has a rich dynamics that involves changes in synaptic weights due to pre-and postsynaptic spike times, as well as synaptic weight and input currents. In this section we briefly analyse the fixed-points for input currents and synaptic weights for general conditions of inputs and outputs.
Considering separated dendritic compartments we can write the average change in weights (from Eq. S18, ignoring inhibitory inputs) as where · t is the average over a long time window, i.e., longer than the timescale of the quantities involved. In Eq. S27 we take into consideration that presynaptic spike times are not influenced by postsynaptic activity, and thus the average of the products in the last term on the right-hand side of Eq. S26 is the equal to the product of the averages. Additionally, we assume no strong correlations between E i (t) and S post (t) due to the small fluctuations of the variable E i (t). Correlations between pre-and postsynaptic spikes govern the LTP term, and thus cannot be ignored. They also depend on the neuron model, and amount of inhibition a compartment is receiving.
We can conclude from Eq. S27 that the weights from silent presynaptic neurons will vanish due to the heterosynaptic term. In our model, these weights can only vanish in moments of disinhibition, when the inhibitory control over excitatory plasticity is minimum.
For our analysis, we consider that all neurons of the network have nearly stationary firing rates without strong fluctuations. Therefore, the spike trains can be rewritten as average firing rates, and the traces from the spike trains become where ν j is the average firing rate of neuron j. The same is valid for the postsynaptic neuron's firing rate, as well as all other traces.
We first consider the outcome of the excitatory plasticity rule when LTD is not present, A LTD = 0, which informs us on steadystate for excitatory currents as a competition between LTP and heterosynaptic plasticity only. In this case, the steady-state of the system is given by This is also the maximum value for excitatory currents for when LTD is present, as LTD can only decrease synaptic weights. Notice that this fixed-point depends on both pre-and postsynaptic firing-rates, and thus an extra step in necessary to find the fixed-point. For a recurrent network, we can assume that ν j = ν post and thus Notice that the maximum excitatory current onto a neuron embedded in a recurrent network is independent on firing-rate of preand postsynaptic neurons.
To have an idea of the contribution of LTD for the excitatory inputs, we used a variant of the model in which LTD does not depend on the weight, w ij (t), and heterosynaptic plasticity does not depend on the postsynaptic trace, y E post = 1. We thus find that In Fig. 2F we simulated this version of the model with constant presynaptic firing-rate, ν j , and plotted the theory as Eq. S32. To test the effect of input firing-rate and LTD with weight dependency, we simulated the protocol as in Fig. 2F, but with different levels of excitatory input, LTD, and inhibitory gating (Fig. S7). These simulations (Fig. S7) show that, although the input has an effect on the fixed-point of excitatory currents, this effect is minimal compared to the effect of the learning-rates.
Applying the same idea to the codependent inhibitory synaptic plasticity model, we get the following average dynamics for the inhibitory weight connecting presynaptic neuron j and the dendritic compartment i, where I i = I i (t) t . From Eq. S34, we get the steady-state for the inhibitory learning rule, which results in the balance between excitation and inhibition given by α, Synaptic changes for simple spike patterns and fixed excitatory/inhibitory input levels. From Eq. S18 and Eq. S22 we calculated changes in excitatory and inhibitory synapses for simple spike patterns (Fig. S1). We considered fixed excitatory and inhibitory inputs, E and I, respectively, and calculated changes in a given excitatory synapse as where ∆t LTP is the interval between pre-and postsynaptic spikes (pre-before-post), ∆t het is the interval between two consecutive postsynaptic spikes, and ∆t LTD is the interval between post-and presynaptic spikes (post-before-pre). In a similar fashion, we calculated changes at a given inhibitory synapse as where ∆t is the interval between pre-and postsynaptic spikes, being positive for pre-before-post and negative for post-before-pre spike patterns.

Inputs
Single output neuron (feedforward network). Presynaptic spike trains for single neurons were implemented as follows. A spike of neuron j occurs in a given time-step of duration ∆t with probability p j (t) if there was no spike elicited during the refractory period beforehand, τ E ref for excitatory and τ I ref for inhibitory inputs, respectively, and zero otherwise. For a constant probability p j (t) = p j the mean firing-rate, ν j , is therefore Different simulation paradigms (or tests) are defined by the input statistics, which are described below. When pathways are included, the probability of having a presynaptic spike changes over time to create correlations between different presynaptic inputs.
Constant firing-rate - Fig. 2F-I, Fig. 3, and Fig. S7. When constant background firing-rate was simulated, presynaptic neurons fired action potentials with probability p j = 5 × 10 −5 for excitatory and p j = 10 −4 for inhibitory neurons, resulting in ν j ≈ 4.88 Hz for excitatory and ν j ≈ 9.51 Hz for inhibitory neurons, considering that simulations were implemented with a time step ∆t = 0.1 ms and that refractory periods were τ E re f = 5 ms and τ I re f = 2.5 ms. Constant firing-rate - Fig. 2D,E and Fig. S2. To explore how neighbouring neurons would affect plasticity at a given synapse we simulated the same protocol from the frequency-dependency experiment 17 (Fig. 2C) with the addition of one excitatory and one inhibitory presynaptic neuron active with different firing-rates (Fig. 2D,E). These extra synapses were kept fixed during the simulation and simulated without refractory period (τ E re f = τ I re f = 0), and we tested different firing-rates (from 0 to 200 Hz). We simulated the codependent excitatory plasticity rule with (Fig. 2D,E and Fig. S2A) and without (Fig. S2B) inhibitory gating, and compared with spike-based 6,10 (Fig. S2C) and voltage-based 7 (Fig. S2D) learning rules (described below). Variable firing-rate (pathways) for receptive-field plasticity - Fig. 4, Fig. 5, and Fig. S3. For correlated inputs (defined as pathways), we generated spike trains using an inhomogeneous Poisson process. A pathway is defined as a group of 100 excitatory and 25 inhibitory afferents (spike trains of presynaptic neurons) with two components: a constant background firing-rate and a fluctuating firing-rate taken from an Ornstein-Uhlenbeck (OU) process as described below. The background firing-rate for all 800 excitatory and 200 inhibitory afferents was given by a probability of p bg j = 2 × 10 −4 for excitatory and p bg j = 4 × 10 −4 for inhibitory afferents, with respective background firing-rates of ν bg j ≈ 1.98 Hz and ν bg j ≈ 3.96 Hz for excitatory and inhibitory presynaptic neurons, respectively, considering a time step ∆t = 0.1 ms and refractory periods of τ E re f = 5 ms and τ I re f = 2.5 ms. The fluctuating firing-rate of the pathway µ was created from an OU process. We used an auxiliary variable, y µ (t), that followed stochastic dynamics given by dy µ (t) where τ OU is the time-constant of the OU process, and ξ µ (t) is a random variable drawn from a Gaussian distribution with Agnes & Vogels (2022) zero-mean and unitary standard deviation. The fluctuating firing-rate was then defined as where ν * = 250 Hz is the amplitude of the fluctuations and [·] + is a rectifying function. The probability of a spike generated because of the fluctuating firing-rate is thus p µ j (t) = ∆tν µ (t). The probability of a presynaptic afferent j belonging to pathway µ due to both background and fluctuating firing-rate was given by In Fig. 4 we have two learning windows: first to learn the initial receptive field profile (Fig. 4B), and later to learn the new configuration of the receptive field profile (Fig. 4C). During both learning periods, we set the firing-rate of all inhibitory neurons to 40% of background firing-rate, and the inactive excitatory pathways to background firing-rate. The first learning period lasts 1.1 seconds and has the following sequence of activation of excitatory groups: 0.5 seconds for pathway number 6, followed by 0.2 seconds of pathway number 7, 0.2 seconds of pathway number 5, 0.1 seconds of pathway number 4, and finally 0.1 seconds of pathway number 8 (Fig. S3A). The second learning period lasts 0.2 seconds and we only activated pathway number 4 (Fig. S3B). Activation of a pathway consisted in increasing the firing-rate probability to p j = 0.01, resulting in a firing-rate of ν µ ≈ 60 Hz. Variable firing-rate (pathways) for dendritic clustering - Fig. 6 and Fig. S4. To explore the clustering effect on dendritic compartments we divided the input spikes in pathways to have co-active or independent presynaptic afferents. We used the same implementation as for the Variable firing-rate (pathways) for receptive field plasticity above, but we changed the number of afferents per group in both excitatory and inhibitory presynaptic inputs. A dendritic compartment received 32 excitatory and 16 inhibitory afferents. In Fig. 6E, Fig. 6F, and Fig. S4 we used two conditions: independent E & I, and matching E & I. In both cases, the number of excitatory afferents following the same fluctuating firing-rate was increased from 1 (0% co-active group size) to 32 (100% co-active group size), while the remaining excitatory afferents had independent fluctuating firing-rates. For independent excitatory and inhibitory inputs (independent E & I), all 16 inhibitory afferents followed independent fluctuating firing-rates. For matching excitatory and inhibitory inputs (matching E & I), 8 inhibitory afferents followed the same fluctuations in firing-rate as the co-active excitatory group (of different sizes), while the other 8 inhibitory afferents were independent. Recurrent network. The simulation with the recurrent network had two parts, the learning period with both excitatory and inhibitory plasticity active, and the recall period without plasticity mechanisms active. Learning period. During the beginning of the learning period of T = 10 hours (Fig. S5) we kept the network receiving a minimum of external input to avoid inactivity. The implementation of presynaptic spike train was as follows. In the beginning of the simulation (first 1 hour of simulated time), each excitatory neuron of the network received a spike train from one external source with constant probability p = 0.01 (time step ∆t = 0.1 ms) to mimic 100 presynaptic afferents firing at 1 Hz. We decreased the probability p = 0.001 for another 1 hour of simulated time, and then set it to zero. External inputs only affected AMPA conductances to keep the external influence on the network's dynamics minimal. Recall period. To elicit transient amplification, we selected specific neurons to receive external input based on the resulted weight matrix and the neurons' baseline firing-rate. Before and after stimulation, no external input was implemented, meaning that the network was in a state of self-sustained activity. During the stimulation period, network neurons were stimulated with presynaptic spikes with a constant firing-rate with different amplitudes for each of the 5 conditions shown in Fig 8. We ordered excitatory and inhibitory neurons according to their baseline firing-rate multiplied by total output weight (from maximum to minimum values), ν bg j N E i=1 w ij for excitatory and ν bg j N i=1 w ij for inhibitory neurons, where N E is the total number of excitatory neurons, and N is the total number of neurons in the recurrent network. We assumed that the bigger the baseline firing-rate multiplied by the output weight, the bigger the neuron's influence on the rest of the network.
Considering the the order of maximal (max) to minimal (min) influence we used the following patterns of stimulation. For condition #1, external firing-rate was decreased from p E max = 0.1 to p E min = 0 for excitatory neurons, and followed the opposite order for inhibitory neurons. For condition #2, external firing-rate was increased from p E max = 0 to p E min = 0.1 for excitatory neurons, and followed the same order for inhibitory neurons. For condition #3, external firing-rate was decreased from p E max = 0.1 to p E min = 0 for excitatory neurons, and followed the same order for inhibitory neurons. For condition #4, external firing-rate was increased from p E max = 0 to p E min = 0.1 for excitatory neurons, and followed the opposite order for inhibitory neurons. For condition #5, external firing-rate was chosen randomly from a uniform distribution between p E max = 0 and p E min = 0.1 for excitatory neurons, and similarly for inhibitory neurons. Notice that the pattern of stimulation that activated excitatory and inactivated inhibitory neurons with large impact on the network (condition #1), amplification was the largest amongst the conditions, and when the pattern of stimulation was random (condition #5) the resulting network dynamics had minimum amplification (Fig. 8A,B). Fig. 6E,F. We defined the clustering index as

Clustering index for dendritic dynamics -
where w co-active is the average of the weights from the co-active excitatory group, and w independent is the average of the weights from all independent groups after learning (see individual weight dynamics in Fig. S4). When c cluster = 1 the excitatory weights from the co-active group survived after learning, and independent ones vanished, while for c cluster = −1 the opposite happened.
Both co-active and independent groups survived after learning when c cluster ≈ 0.

Training an output to draw digits
We connected all excitatory neurons of our recurrent network to a two-layer network of nonlinear units. The second layer was connected to two nonlinear readouts that represented movement in the horizontal x(t) and vertical y(t) directions of a 2D plane. The dynamics of the ith unit of the first layer (total number of units N 1 = 50) was simulated as where W ij is the connection between neuron j from the network and the ith unit from the first layer and r j (t) is the average firing-rate of neuron j (over 50 trials, see below). The dynamics of neuron j for an individual trial is given by The firing-rate, r i (t), is the spike train of neuron i (Eq. S6) filtered twice (double exponential filter) with the time constant τ r = 10 ms. As input to the first layer we used r i (t) which is the average of r i (t) over 50 random trials out of 500 that were simulated. The second layer received input from the first layer, and the dynamics of the ith unit (total number of units N 2 = 25) of the second layer was simulated as The two readouts were simulated as The time-course of the simulation was divided into 35 bins of equal interval (∆T = 30 ms), and the period after the stimulus onset was used to train the output weights to draw five digits: 0, 2, 4, 6, and 8, for the five different conditions from Fig. 7 that resulted from distinct patterns of stimulation. Each training epoch (single digit presentation) was simulated with the average firing-rate of 50 trials, randomly selected out of 500 to account for the large trial-to-trial variability of the spike patterns of each trial, mimicking a larger network in which groups of 50 neurons have a similar activity pattern. We used the same activity patterns fed to the two-layer network, r i (t), to compute the principal components shown in Fig. 8C. All the weights were trained using gradient descent to minimise the square error between output and the drawing. Fig. 8D shows the average 2D trajectory for each digit in thick line, and 10 individual epochs in red lines. We did not perform any benchmark test as this is beyond the scope of this paper.

Comparison to other learning rules
We used spike-based learning rules to explore the balancing mechanisms of the codependent inhibitory synaptic plasticity rule (Fig. 3). Additionally, we compared the excitatory codependent synaptic plasticity model with a spike-and a voltage-based learning rule when extra excitatory and inhibitory inputs are received by the postsynaptic neuron (Fig. S2).
Spike-based plasticity rules. We implemented spike-based learning rules that have been developed to impose a set-point for postsynaptic neurons. In Fig. 3C, we combined excitatory and inhibitory spike-based plasticity rules to show how they can destructively compete when their firing-rate set-points do not match. In Fig. 3D, we combined an excitatory spike-based plasticity rule with the codependent inhibitory synaptic plasticity rule to show how the competition is not present when the plasticity rules dynamics follow fixed-points for different quantities -here ESP imposes a firing-rate set-point while ISP imposes an input currents set-point. We also compared the spike-based excitatory plasticity rule to the codependent excitatory plasticity rule for the same protocol in Fig. 2C, but adding activity of an excitatory and an inhibitory neuron with different firing-rates (Fig. S2C).
Spike-based excitatory plasticity rule. The excitatory plasticity rule was based on Pfister and Gerstner 6 and Zenke et al. 10 . We used a modified version from Zenke et al. 10 to create a stable-fixed point for the postsynaptic firing-rate. The weight from neuron j to neuron i changes according to where A pre , A LTP , and A LTD , are the learning rates for the neurotransmitter induced plasticity, long-term potentiation, and longterm depression, respectively. The spike train of pre-and postsynaptic neurons, S j (t) and S i (t), respectively, are defined by Eq. S6 and Eq. S4. The traces x + j (t), y i (t), and x − i (t) followed the same dynamics described in Eq. S19, with time constants τ + , τ y , and τ − , respectively. The learning rule described by Eq. S48 has a stable fixed-point for low postsynaptic firing-rate. The stable firing-rate set point was given by To change the firing-rate set-point during the simulation in Fig. 1F, we changed A pre , keeping all the other parameters fixed. Spike-based inhibitory plasticity rule. The spike-based inhibitory plasticity rule was based on Vogels et al. 8 . This inhibitory plasticity rule follows a Hebbian-like shape that imposes a postsynaptic firing-rate set-point by balancing excitation and inhibition. An inhibitory weight from neuron j to neuron i evolved as where η is the learning rate, x j (t) and x i (t) are traces of pre-and postsynaptic spike trains, respectively, and they evolve with the same time constant τ iSTDP . This learning rule is known to result in a stable firing-rate set-point for postsynaptic neurons given by Voltage-based excitatory plasticity rule. We also compared the codependent excitatory synaptic plasticity model with a voltagebased model for a frequency dependent protocol 17 when additional presynaptic activity is included (Fig. S2D). The excitatory weight of the connection from neuron j to neuron i changed according to where A LTP and A LTD are the learning rates for LTP and LTD, respectively, x j (t) is the trace of the presynaptic spike train, θ + is the voltage threshold for LTP, θ − is the voltage threshold (for the voltage low pass-filter) for LTP and LTD. The trace of the presynaptic spike train is given by where τ x is the time constant for the trace. The voltage-based learning rule depends on the low-pass filter of the membrane potential, which creates a dependency on the recent history of membrane potential. There are two low-pass filters in the voltage-based model: one for LTP, u + i , and one for LTD, u − i , with dynamics given by where τ + and τ − are the time constants for the voltage low-pass filters for LTP and LTD, respectively. To account for the plasticity inducing effects of the action potential, we modified the LIF neuron model so that it had a short depolarised period corresponding to the action potential. Following the implementation from the subsection Point neuron -Fixed spiking threshold, when the membrane potential crossed the threshold, u th from below, the membrane potential was instantaneously set to u AP = 30 mV, and it was then clamped at this voltage for the duration of the action potential τ AP = 2 ms. After the duration of the action potential, the membrane potential was instantaneously reset to u volt reset = −52 mV.

FIG. S4. Evolution of synaptic weights connected to dendritic compartments for matched and independent E & I. A,
Weights of co-active (green) and uncorrelated (grey) excitatory inputs with size of co-active excitatory group and distance of dendritic compartment from the soma indicated by gs and d, respectively. B, Weights of co-active (green; same activity pattern as co-active excitatory group) and uncorrelated (grey) inhibitory inputs. Size of co-active inhibitory group was kept fixed at half of the inhibitory population. C, Same as panel A, but when inhibitory inputs are independent of excitatory ones. D, Same as in panel B, but with no correlation between excitatory and inhibitory inputs.