Synaptic balancing: A biologically plausible local learning rule that provably increases neural network noise robustness without sacrificing task performance

We introduce a novel, biologically plausible local learning rule that provably increases the robustness of neural dynamics to noise in nonlinear recurrent neural networks with homogeneous nonlinearities. Our learning rule achieves higher noise robustness without sacrificing performance on the task and without requiring any knowledge of the particular task. The plasticity dynamics—an integrable dynamical system operating on the weights of the network—maintains a multiplicity of conserved quantities, most notably the network’s entire temporal map of input to output trajectories. The outcome of our learning rule is a synaptic balancing between the incoming and outgoing synapses of every neuron. This synaptic balancing rule is consistent with many known aspects of experimentally observed heterosynaptic plasticity, and moreover makes new experimentally testable predictions relating plasticity at the incoming and outgoing synapses of individual neurons. Overall, this work provides a novel, practical local learning rule that exactly preserves overall network function and, in doing so, provides new conceptual bridges between the disparate worlds of the neurobiology of heterosynaptic plasticity, the engineering of regularized noise-robust networks, and the mathematics of integrable Lax dynamical systems.


Introduction
As any neural circuit computes, it is subject to additional fluctuations either within the circuit or from other brain regions [1][2][3][4], and these fluctuations can impair performance [5][6][7][8]. The fundamental puzzle we address is what kind of plasticity rule can make the dynamics of a neural circuit more robust to such fluctuations in a manner that: (1) works for any task; (2) is completely agnostic to the learning rule used to solve a task; and (3) does not impair network performance after a task is learned. Our main contribution is the discovery of a plasticity rule that provably accomplishes all of three objectives for any nonlinear recurrent neural network with a homogeneous nonlinearity, such as the commonly studied rectified linear function. Furthermore, our plasticity rule is biologically plausible and computable using only information that is locally available at each synapse and its adjacent neurons. Finally, at a mathematical level our plasticity rule connects to the theory of integrable dynamical systems [9][10][11] and heat diffusion, while experimentally, its features are similar to observed aspects of heterosynaptic plasticity [12][13][14][15][16].
The key idea behind our learning rule is to exploit a many-to-one mapping between patterns of synaptic strength and the task, or the temporal input-output map implemented by a recurrent neural network. Indeed, modern neural network models of animal behavior typically possess a large number of tunable parameters-far more than necessary to perform a given simple behavior. In this overparameterized regime, it has been observed across multiple behaviors and organisms that many distinct model configurations are able to generate equivalent levels of task performance [17,18]. This observation has spurred theoretical and numerical investigations into specific means by which a task may constrain network connectivity and function [19][20][21][22][23]. However, the complex, nonlinear nature of many classes of network models in neuroscience-notably recurrent neural networks (RNNs)-has made it difficult in many cases to obtain a precise theoretical characterization of the space of synaptic patterns that all map to the same task [24].
Besides a theoretical interest in formally characterizing equivalence classes of synaptic weights that solve the same task, we are also motivated by a complementary biological question: how might neural systems actually implement local plasticity rules which take advantage of network overparameterization to maintain desirable functional properties, including task performance, in the presence of internal and external sources of variation? Studies of homeostatic plasticity in cortical circuits have shed light on synaptic mechanisms thought to maintain stable computation, including synaptic scaling, heterosynaptic plasticity, and other compensatory processes [13,[25][26][27][28]. However, a fundamental neuroscientific question remains: can such local homeostatic or compensatory plasticity rules operate in such a way so as not to impair task performance, while still accruing some other additional benefit?
In this work, we provide insights into both the nature of overparameterization in recurrent neural networks and how local plasticity rules might exploit this overparameterization to specifically improve network robustness without impairing task performance. First we precisely characterize the equivalence classes of synaptic weights that all solve the same task in nonlinear recurrent networks with homogenous nonlinearities. Using this characterization, we derive a simple associated plasticity rule that locally modifies synaptic weights while remaining within these equivalence classes. Intriguingly, we find our theoretically derived plasticity rule resembles experimentally observed heterosynaptic plasticity rules.

Outline of this paper
The structure of this paper is as follows. First, we introduce the nonlinear recurrent network model and a transformation of network weights that exactly preserves task performance. Second, we formalize a notion of noise robustness in recurrent networks and show that this quantity is convex with respect to the coordinates of the task-preserving transformation. We then derive a dynamical transformation of the network, called synaptic balancing, which maximizes robustness while exactly maintaining task performance, and which is implementable entirely by local update rules. We next show that synaptic balancing is exponentially stable in any recurrent network which does not contain irreducible feedforward structure. Subsequently, we introduce several generalizations of our model and show that synaptic balancing is an instance of a broader class of integrable dynamical systems on synaptic weight matrices known as Lax dynamical systems. These dynamical systems lead to isospectral flows on matrices that preserve all eigenvalues of the matrix.
Turning to the behavior of synaptic balancing alongside task-relevant learning dynamics, we then prove that a broad class of regularized networks naturally approaches the equilibrium of our rule throrightugh training. We conversely show empirically that our rule is able to improve the task performance of trained networks in previously unseen noisy regimes.
Finally, we address the role of synaptic balancing as a candidate local plasticity rule for maintaining stable network computation in neural circuits. We present exact and approximate solutions to the trajectory of synaptic balancing, deriving a formal connection between synaptic balancing and heat diffusion in a network. In closing, we draw a connection between synaptic balancing and experimentally observed patterns of heterosynaptic plasticity in cortical synapses.

A task-preserving transformation defines a manifold of equivalent recurrent networks
In this section, we first describe a class of nonlinear recurrent neural networks that has been extensively studied in diverse contexts [6,7,19,23,24,[29][30][31]. We then describe a natural symmetry acting on the weight space of these neural networks that exactly preserves the entire temporal mapping of input to output trajectories. Since the input-output mapping determines the task a neural network performs, the action of this symmetry enables us to traverse the manifold of weight configurations that preserve the task performed by any neural network.
Recurrent network model. Consider a recurrent rate network of N neurons with an N × N synaptic weight matrix J, such that neuron j is connected to neuron i with synaptic weight J ij . The vector of neural activity x 2 R N and readout vector y evolve under a time-varying external input u as Here τ is a fast timescale of neural dynamics, ϕ is a typically nonlinear scalar function applied element-wise to x, and the tuple W ¼ ðW in ; J; W out Þ is the weight configuration which parameterizes the network. We assume for simplicity that neural activity is initialized at the origin and runs until some time T. The dynamics of the full network, and in particular the output trajectory y(t), are a deterministic function of the input trajectory u(t) and the weight configuration W. More formally, the input-output map F RNN computed by the network is the map from input to output trajectories under a particular weight configuration: In this work, we introduce a model of synaptic updates whose properties are well behaved when ϕ is a homogeneous function; that is, when ϕ(αx) = αϕ(x) for all x 2 R and a 2 R þ . Common activation functions which satisfy this condition include the linear (ϕ(x) = x) and rectified linear (ϕ(x) = max(0, x)) units. In the main text of this paper we assume that ϕ is homogeneous, however, in S1 Appendix. 4 we give an extension to the more general class of positively homogeneous nonlinearities, which satisfy ϕ(sx) = s k ϕ(x), for any s > 0 and k 2 R.
Task-preserving transformation. We now describe a symmetry in weight space that exactly preserves the map (3). Indeed, the observation that many distinct weight configurations may yield quantitatively similar network behavior is widespread both in neuroscience, where simulations of the crustacean stomatogastric ganglion found a range of synaptic strengths producing a given network output [17], and in machine learning, in which non-convex cost functions possess many roughly equivalent local minima [19,32]. In the class of networks we study, part of the degeneracy between weights and a given task originates from a symmetry in weight space that exactly preserves the deterministic input-output map computed by the network. Intuitively, this symmetry scales neurons' inputs while reciprocally scaling their outputs, such that the overall function computed by each neuron remains intact.
More precisely, consider a map π, parameterzied by h 2 R N , which takes as input a weight configuration W ¼ ðW in ; J; W out Þ, and produces as an output the weight configuration Here H denotes the diagonal matrix diag{h}. It is worth emphasizing some basic properties of the transformation π h . The sign of synapses is preserved, and synapses which are initially zero remain so. Thus, the transformation does not modify the basic wiring diagram of the network-for example by creating or removing synapses, or changing excitatory to inhibitory synapses and vice versa. Rather, it scales the strength of existing synapses by a positive quantity. In addition π h acts on the recurrent weight matrix J through a similarity transformation. Thus the entire eigenspectrum of the recurrent weight matrix is conserved under this map.
However, π h satisfies an additional important condition: it exactly preserves the entire input-output output map of the network. For this reason, we refer to π h as the task-preserving transformation. More formally, for any (finite) value of h, This claim is summarized in Fig 1, which shows in panels a-f that while the dynamics of the hidden units for two networks related by the task-preserving transformation are different, the output trajectories agree. Eq (5) is proved in the following proposition. Proposition 1 (Task-preserving transformation). The transformation (4) exactly preserves the input-output relationship of the neural dynamics (1). Given two networks receiving the same time course of inputs u(t) and with weight configurations W 0 and W ¼ p h ðW 0 Þ respectively, then: 1. If x 0 (t) is the time course of hidden unit neural activity under W 0 , then e −H x 0 (t) is the time course of hidden unit neural activity under W.
2. If y 0 (t) is the time course of output neural activity under W 0 , then y 0 (t) is also the time course of output unit neural activity under W.
The proof of proposition 1 is straightforward and can be found in S1 Appendix 1.
Given an initial weight configuration W 0 , we define the task-preserving manifold of W 0 to be the manifold of weight configurations accessible from W 0 by the task-preserving transformation, i.e., the orbit of W 0 under the symmetry π h : fp h ðW 0 Þ : h 2 R N g. The vector h provides a set of coordinates on this manifold. When referring to the task-preserving manifold we implicitly assume there exists some reference weight configuration W 0 at which h = 0.

A measure of robustness to noise in neural activity
We have shown that every weight configuration on the task-preserving manifold computes the same deterministic input-output map. However, biological systems are inherently noisy [1], and it has been found that cortical spike trains vary at the sub-millisecond level across trials with identical inputs [2][3][4]. Interestingly, even two networks which compute the same deterministic input-output map may exhibit differing responses to neural noise. In Fig 1, we give an example of two networks which perform identically in the deterministic setting but which respond differently when noise is injected to hidden units.

PLOS COMPUTATIONAL BIOLOGY
In this section we introduce a quantitative notion of a network's robustness to noise, which we call sensitivity. This function describes the degree to which noise in neural activity may interfere with the underlying computation of the network. We connect our notion of sensitivity to the gain of neurons in the network and show that the sensitivity is well-behaved on the task-preserving manifold; in particular, that it possesses a convex geometry in the coordinates h.
Robustness of neural dynamics to random perturbations. A recurrent network whose dynamics are easily perturbed by small variations in neural activity is unlikely to perform a task robustly in the presence of neural noise. To capture this notion, we consider the magnitude of the response to a small, isotropic Gaussian perturbation d � N ð0; ε 2 IÞ to the neural dynamics (1), averaged over the distribution of states X visited by the network during a task: where for simplicity we have dropped from f an explicit dependence on the weights W. We define the sensitivity of a network to be the first-order approximation of this quantity, where the approximation is made via Taylor expansion of f about x. Networks with lower sensitivity are less easily pushed away from their original trajectories and are therefore more likely to be robust to noise while performing tasks, as is illustrated in Fig 1(g)-1(j). In this paper, robustness refers to S −1 , the reciprocal of sensitivity.
In the case of the neural dynamics (1), the Jacobian matrix takes the form, This expression makes use of the gain, ϕ 0 (x i ), of neuron i. With respect to the distribution of neural activity X, the gain has first and second moments for each neuron i. We may rewrite the definition of sensitivity (6) using the Jacobian of the neural dynamics (7) in terms of the moments (8) to obtain The sensitivity, then, can be succinctly written as a function of the recurrent weights and the moments of the neural gains. However, because the moments μ and σ 2 are defined as an average over the distribution of network states that depends-generally intractably-on the weights themselves, sensitivity is not, as it may appear, a straightforward quadratic function of J. We next show that, perhaps surprisingly, sensitivity turns out to be well behaved as a function on the task-preserving manifold.
Sensitivity is a convex function on the task-preserving manifold. Because networks attaining weight configurations of lower sensitivity might see improved task performance in noisy environments (as in Fig 1), it is useful to analytically characterize how S varies as a function of network weights. We have just mentioned the complications of studying this question in general. Here, we find that S becomes tractable when we consider its variation on the taskpreserving manifold, parameterized by the coordinates h. In particular, we show that S is convex with respect to h. Proposition 2. When considered as a function on the coordinates h of the task-preserving manifold, the sensitivity S is a convex function for some constants fc 0 ij g N i;j¼1 , p, and S const , where c 0 ij � 0 for all i, j. Proof. Assume there is some original network W 0 ¼ ðW in;0 ; J 0 ; W out;0 Þ, whose distribution of neural activity is X 0 , and whose gains have moments fm 0 i g N i¼1 and fðs 0 i Þ 2 g N i¼1 . Consider a transformed network W ¼ p h ðW 0 Þ, with analogous quantities X, fm i g N i¼1 , and fs 2 i g N i¼1 . From (4), the recurrent connectivity of the transformed network is J ij ¼ J 0 ij e h j À h i . The sensitivity of the transformed network in terms of the task-preserving transformation is obtained by plugging this J ij into (9): For convexity, it is sufficient to show that the moments of the gain, μ i and s 2 i , are constant with respect to the task-preserving transformation; i.e., that m i ¼ m 0 i and s 2 i ¼ ðs 0 i Þ 2 for each neuron i. From Prop. 1, the transformed neural activity can be written in terms of the original rates as x i ¼ e À h i x 0 i for all t > 0. By assumption, ϕ satisfies ϕ(αx) = αϕ(x), and therefore ϕ 0 (αx) for each neuron i. Therefore the moments of the gains are constant with respect to h. We conclude that (11) takes the form of (10), where the constants are c 0 (10) is a positive linear combination, with constant coefficients, of exponentiated linear functions of h (which are convex), then it is in turn a convex function of h [33, ch. 3].
Other notions of robustness. Our definition of sensitivity (6) is chosen to emphasize the aspect of recurrent networks which is typically most crucial to task performance; that is, the neural dynamics. However, there are other notions of robustness which are useful to mention. Here we briefly address how the task-preserving transformation (4), parameterized by h, interacts with several additional relevant notions of sensitivity.
First, consider the sensitivity S u!y of the output trajectory {y(t)} to fluctuations in the input trajectory {u(t)}. In our analysis, no choice of h can affect this quantity, precisely because the task-preserving transformation exactly preserves the input-output map. Put differently, this notion of sensitivity is intrinsic to the function being computed, not to the manner in which the recurrent network computes it.
Second, consider the sensitivity S x!y of the output trajectory {y(t)} to fluctuations in the time course of neural activity {x(t)} (Fig 1(i) and 1(j)), and respectively, the sensitivity S u!x of neural activity {x(t)} to fluctuations in the input trajectory {u(t)}. These sensitivities can be individually minimized by taking h ! −1 to minimize the norm of W out and, respectively, h ! 1 to minimize the norm of W in . The resulting tradeoff between S x!y and S u!x is separate from the problem of minimizing our choice of S, and it may be solved independently of the method we now present. In what follows, we will present a local learning rule that maximizes the robustness of the neural dynamics. We will further show that these dynamics will never result in the case of h or any of its elements becoming ±1.

A local learning rule maximizes robustness while preserving task performance
We have introduced the task-preserving manifold as the set of weight configurations accessible by a symmetry transformation which preserves a given deterministic input-output map. We have also shown that the sensitivity of neural dynamics to small perturbations in activity-the generally intractable quantity S-is well behaved when constrained to the task-preserving manifold. A simple question emerges: how might networks traverse the task-preserving manifold to maximize robustness while preserving underlying task performance? To address this question, we derive gradient descent dynamics that maximize network robustness in the coordinates of the task-preserving manifold. We find, perhaps surprisingly, that these dynamics are wholly implementable by biologically plausible local computations within neurons and synapses.
From (10), the problem of maximizing robustness S −1 is equivalent to that of minimizing the total cost: where c ij is the synaptic cost with p = 2, and in the second line we have rewritten the synaptic costs in terms of the initial cost c 0 ij ¼ ðs 0 i Þ 2 jJ 0 ij j p and the coordinates h, obtained by writing out (13) in terms of the task- . We call the network connected if the directed graph whose edge weights are given by the initial synaptic cost matrix C 0 is connected. We assume, without loss of generality, that the network is connected (if not, a similar theory applies to each connected component separately).
We turn to deriving synaptic dynamics that transforms h over time so as to maximize robustness on the task-preserving manifold. Until now we have treated the vector h as a free coordinate on the task-preserving manifold. Henceforth we consider it as a function of time, initializing at the origin and evolving under gradient descent on the total cost. Similarly, we now view W ¼ ðW in ; J; W out Þ ¼ p h ðW 0 Þ as a time-varying weight configuration, with initial value W 0 corresponding to h = 0.
Let the time derivative of h be denoted by _ h ¼ g, which we refer to as the neural gradient vector. The dynamics of gradient descent on C with respect to h is given by where g � Oð1Þ is the descent rate. We assume a separation of timescales, such that neural dynamics (1) are much faster than the weight dynamics (15). The synaptic costs (13) obey where δ is the Kronecker delta. In the present regime where g � Oð1Þ and p � Oð1Þ, we are free to adopt throughout γp = 1 for notational convenience. Using this, we evaluate the right hand side of (15) via (12) and (16) to find, Finally, to see how synaptic strengths are updated, we differentiate the task-preserving trans- Eqs (17) through (20), along with the definition of synaptic costs (13), are self-contained and collectively comprise the dynamics of our proposed update rule, which we call synaptic balancing. Interestingly, we find that synaptic balancing is entirely implementable by local computations in a network. First, costs (13) are computed at the synapse as a product of the square of the synaptic weight and the presynaptic average gain. Second, neural gradients (17) are computed centrally in the neuron by aggregating and comparing the costs of incoming and outgoing synapses. Third, synaptic weights (18) are updated in proportion to the difference between the presynaptic and postsynaptic neural gradients.
In this scheme we assume that the synaptic weights, synaptic costs, and neural gradients can be represented as biophysical quantities inside neurons and synapses. We suppose, as depicted in Fig 2, that in one direction a neuron traffics its gradient from the soma to incoming and outgoing synapses, and, in the other, it traffics synaptic costs from synapses to the soma. Finally, we assume that each synapse is able to measure and store certain statistics of presynaptic activity, namely, the average presynaptic gain. This assumption is in line with other models of synaptic plasticity which introduce some form of leaky integration of neural activity, e.g. the sliding threshold of the BCM rule [34, p. 288].
Notably, although the coordinates h and the task-preserving transformation π h are of instrumental value in deriving and analyzing our rule, the biological procedure just described implements synaptic balancing without an explicit representation of h.
Next, we study the equilibrium state of synaptic balancing and offer a simple condition under which an equilibrium exists, thereby guaranteeing the stability of our rule.

Strongly connected networks attain balanced equilibrium
Synaptic balancing asymptotically converges to a global minimum on the task-preserving manifold, by construction, because it is gradient descent on the convex function C. However, a global minimum may not exist at any finite value of the task-preserving manifold coordinates h. For example, the convex function f(h) = e h on the real line possesses no global minimum at finite h, and the asymptotic convergence of gradient descent is not assured. It is therefore important to establish the criteria under which we expect synaptic balancing to stably converge to a (finite) minimizer h � . To do this, we provide two simple criteria: first, a balance condition which describes the set of equilibria of synaptic balancing, and second, a strongly-connected condition which implies the existence of an equilibrium on the task-preserving manifold that attains exponential convergence.
A weight configuration globally minimizes the total cost on the task-preserving manifold if and only if it satisfies the balance condition X for each neuron k. To see this, observe that because the total cost C is convex and differentiable as a function of h, a coordinate h � achieves a global minimum if and only if @C @h ðh � Þ ¼ 0, which, from (15), holds if and only if g = 0. Solving for g = 0 in (17) yields the balance condition (21).
It is because of (21) that we use the term balancing to describe our rule: the total cost is minimized, and a weight configuration is a stable fixed point of the weight dynamics (18), if and only if the total synaptic costs of each neuron's incoming and outgoing synapses are equal. It  (13). Neuron k receives signals of incoming synaptic cost c kj and outgoing synaptic cost c ik (teal arrows from synapses to soma) and computes the difference g k as in (17). The signal g k then propagates outwards (purple arrows from soma to synapses) to modify the strength of incoming and outgoing synaptic connections, as in (18), such that the total incoming and total outgoing costs are eventually balanced in every neuron.
https://doi.org/10.1371/journal.pcbi.1010418.g002 PLOS COMPUTATIONAL BIOLOGY remains unclear, however, whether the balance condition (21) is attainable in every case, or put differently, whether synaptic balancing is stable from every initial condition.
We now state a simple topological criterion which (we will show) implies the stability of synaptic balancing. A recurrent network is said to be strongly connected if between every pair of neurons i and j there exists a path of synapses, each with positive synaptic cost, from i to j. Conceptually, this condition simply means that the recurrent connectivity does not possess any embedded directed acyclic structure, such as purely feedforward connections.
With regard to biology, it is of course generally challenging to show that any given biological network is strongly connected. With that said, we believe that the highly recurrent nature of the central nervous system suggests that this assumption may not be far from reality in certain cortical regions. Long-range feedback projections as well as local recurrence in cortex suggest that non-negligible sub-networks of neurons participating in, for example, the ventral visual stream are indeed strongly connected [35,36]. Such networks are strong candidates for synaptic balancing.
Mathematically, it is known that the connected components of any balanced matrix, i.e., a matrix satisfying (21), are strongly connected [37], and that, conversely, such matrices may be made balanced through a positive diagonal similarity transformation [38].
Before formally describing the stability of our rule, we make the preliminary observation that the synaptic costs in (14) are invariant under the transformation h 7 ! h + b1, for b 2 R. Therefore the gradient of the total cost C is perpendicular to the all ones vector 1, and gradient descent on C does not explore that direction: From (17) Assuming as before that h 0 = 0, synaptic balancing exclusively yields solutions that satisfy We may now connect these remarks to our weight dynamics, showing that synaptic balancing converges exponentially to a balanced configuration whenever the initial cost matrix is strongly connected. In the first case of a single feedforward connection, a stable equilibrium is not reached at any finite h. In the second case of recurrent connections but asymmetric initial synaptic costs, the network converges to a stable equilibrium at finite h and positive total cost C, with symmetric final costs. A short proof is provided in the following proposition.
Proposition 3. In a strongly connected network, synaptic balancing converges to a globally exponentially stable equilibrium, which is the unique solution to (22) and (21) on the task-preserving manifold.
Proof (Sketch). Because synaptic balancing does not increase the total cost C = ∑ ij c ij (12), and because the synaptic costs are nonnegative, we have that c ij � C 0 along the trajectory of synaptic balancing for all i, j. If c 0 ij > 0, then since c ij ¼ c 0 ij e pðh j À h i Þ (14), it follows directly that e h j À h i � ðC 0 =c 0 ij Þ 1=p < 1. If c 0 ij ¼ 0, then an "indirect" upper bound for e h j À h i is obtained by collapsing the direct upper bounds along a path of positive synaptic costs from j to i: In the case of a single intervening neuron k, for example, By the strong connectedness assumption, such a path exists between every i and j, so we may in this way obtain upper bounds on h j − h i , and therefore on |h j − h i |, for all i, j. Combined with the constraint ∑ i h i = 0 (22), it follows that h is contained in a compact set over the trajectory of synaptic balancing. We conclude that the minimizer of C, a convex function of h, is attained in this set. To show that the minimizer is unique and globally exponentially stable, it is sufficient to show that under strong connectedness, C is strongly convex on the sublevel set of C 0 . This is shown in S1 Appendix 2 with a more detailed proof. In summary, synaptic balancing consists of local synaptic updates which are stable in any recurrent network that does not possess directed acyclic structure. By minimizing a convex cost on the task-preserving manifold, the rule maximizes the robustness of neural dynamics to noise while maintaining underlying task performance. In the following section we will mention a few useful generalizations of our model.

Generalizations and a connection to Lax dynamical systems
We have derived synaptic balancing as gradient descent on a behaviorally-relevant convex function-the sensitivity of the network to neural noise-and characterized the stability and equilibria of the rule. We now observe that our framework for synaptic balancing admits several generalizations: first, a broader class of synaptic costs, of which sensitivity is a particularly salient example, and second, a yet more general class of matrix-valued dynamical systems known as Lax dynamics, which have found widespread applications in fields from physics [9] to optimization and numerical linear algebra, where they are known as isospectral flows [10,11].
A general class of well-behaved synaptic costs. The expression for synaptic costs (13) was derived to maximize robustness by minimizing the behaviorally relevant sensitivity function (6). Generally, however, the framework presented here admits a broad class of synaptic cost functions. If the total cost is the sum of synaptic costs, as in (12), then the synaptic cost c ij may be an arbitrary fixed function of J ij . Importantly, the stability of the resulting weight dynamics, and the optimality of any equilibria, are not guaranteed in general.

PLOS COMPUTATIONAL BIOLOGY
A sensible class of synaptic costs which are convex in h are the power-law costs where α ij � 0 for all i, j, and p > 0. This definition includes sensitivity (13) as a special case, with a ij ¼ s 2 j and p = 2. Other costs of the power-law form include the ℓ 1 and ℓ 2 matrix penalties studied in statistics and machine learning [39,Ch. 3.4]. Notably, the power-law costs (23): i) obey (14), ii) correspond to neural gradients of the form (17), and iii) inherit the stability result of Prop. 3, extending the findings of this work to a broader class of cost function. Robustness, specifically, is only maximized with the particular choice of costs (13).

Synaptic Lax dynamics.
A yet further generalization of our synaptic update framework dispenses with a cost function entirely. A Lax dynamical system is an evolution on an N × N matrix A such that where k : R N�N ! R N�N is a matrix-valued function which depends on time only through its argument A, and [�, �] denotes the Lie bracket, which is defined as An important property of Lax dynamics is that the evolution of A takes the form of a timevarying similarity transformation. To see this, consider the N × N matrix K which evolves in time according to _ K ¼ KkðAÞ; Kð0Þ ¼ I:

It is straightforward to show that K(t) is nonsingular for all t and that the similarity transformation
is the unique solution of (24). As a consequence, Lax dynamical systems conserve the entire spectrum of the matrix A and are sometimes referred to as isospectral flows. Synaptic balancing is a specific instance of Lax dynamics. We may rewrite (18) as noting that the elements of g depend on time only through a dependence on the elements of J. Thus this dynamics is a special case of the general definition (24). The Lax dynamics of synaptic balancing (25) encompass a very general form of task-preserving local learning rule. If the neural gradient g k is allowed to depend arbitrarily on the incoming and outgoing weights of neuron k, then synaptic Lax dynamics remains confined to the task-preserving manifold and is fully locally computable in the sense of Fig 2. Further, all quantities which are conserved on the task-preserving manifold-including the spectrum of the recurrent weight matrix and the product of synaptic weights along every directed closed loop-are conserved by the synaptic Lax dynamics as well.
Synaptic Lax dynamics, if chosen in such a way to be stable, might be used to regulate any number of structural properties of the network. Any equilibrium of the synaptic Lax dynamics satisfies the equality condition g i = g j for all pairs (i, j), which generalizes the balance condition (21). For choices of neural gradient for which this equilibrium is attainable and stable, the synaptic Lax dynamics offer a flexible framework for adapting network weights without affecting task performance. For example, [40] studies the problem of stably balancing the maximum incoming and outgoing synaptic strengths, and [41] studies the problem of balancing the incoming and outgoing products of synapses. Each of these aims could be implemented by the synaptic Lax dynamics through proper choice of g k . Our work unifies these efforts under a general framework of continuous-time weight dynamics (25), and, unlike previous approaches, derives from functional considerations a particular form of neural gradient that provably minimizes a behaviorally-relevant cost function on the task-preserving manifold.

Regularized networks are nearly balanced
Our focus so far has been on establishing theoretical links between the balance condition, noise-robust computation and the proposed local plasticity rule. We now turn to studying the interaction of these concepts with other forms of plasticity, such as task-relevant learning. In this section we present evidence that commonly studied classes of network are, in fact, generically in the vicinity of equilibrium, and that the balance condition (21), far from being an obscure edge case of network configurations, is in some sense a generic state. In particular, we find that the balance condition is approximately attained by any learning algorithm minimizing a very general class of regularized loss functions.
Recall that we denote by F RNN ðWÞ the input-output map of the network (3), which takes input trajectories {u(t)} to output trajectories {y(t)} and which is parameterized by the weight configuration W ¼ ðW in ; J; W out Þ. Consider an arbitrary loss function L on the input-output map F RNN . We are not concerned with the particular functional form of L-just that it depends on the weight configuration only through the input-output map. For example, the loss might measure the performance of the network on some task, with weight configurations that attain lower loss achieving better task performance.
We consider a regularized loss function L reg which is the sum of the loss L and elementwise regularization of the recurrent weight matrix: where p, α ij > 0 for all i, j. The expression for L reg encompasses both ℓ 1 and ℓ 2 regularization of the recurrent weight matrix, for example, by setting p = 1 and p = 2 respectively. Proposition 4. Suppose L reg has a local minimum at the weight configuration W � . Then W � satisfies the balance condition (21), with synaptic costs c ij = α ij |J ij | p .
Proof. We provide a proof by contradiction. Assume that there exists a weight configuration W 0 which is a local minimum of L reg but which is not an equilibrium of synaptic balancing.
Let h(t), t � 0, describe the trajectory of synaptic balancing initialized at W 0 , with synaptic costs c ij = α ij |J ij | p . Because synaptic balancing preserves the input-output map F RNN , the loss function LðF RNN ðp hðtÞ ðW 0 ÞÞÞ is constant as a function of t, i.e.,

d dt
LðF RNN ðp hðtÞ ðW 0 ÞÞÞ ¼ 0: Because we have assumed that W 0 is not an equilibrium of synaptic balancing, the total cost C = ∑ ij α ij |J ij | p is strictly decreasing at t = 0, i.e., d dt Cðp hðtÞ ðW 0 ÞÞ < 0: Combining (27) and (28) for all t and in particular, t = 0. Thus, L reg is a decreasing function on the trajectory of synaptic balancing initialized at W 0 , and W 0 is not a local minimum of L reg . We conclude that every local minimum of L reg satisfies the balance condition (21). An inverse result-that in unregularized networks trained with gradient descent, the initial (generally nonzero) neural gradients are exactly conserved by training-has been noted in, e.g., [42,43].
In practice, numerical optimization algorithms for network training terminate before achieving true local minima, so we do not expect every network trained with regularization to exactly exhibit the balance condition (21). In Fig 4a we show, however, that trained, ℓ 2 -regularized networks exhibit neural gradients that are substantially lower than would be attained by chance, under random perturbation of rows of the weight matrix.
In understanding these results, the reader should keep in mind that under our terminology, a network may be balanced with respect to one cost function (say, the ℓ 2 cost), but not balanced with respect to another cost function (say, the robustness cost). Similarly, the form of regularization that is used during training affects the balance properties of the local minimum  in panel a). The original and balanced networks are run on the CDI task at varying levels ε of Gaussian noise injected into hidden dynamics. For each network pair the ratio is plotted of task loss of the balanced network to that of the original network, as a function of ε. As dynamics become more noisy, the performance of the original networks (as measured by loss on the task) degrades faster than that of the corresponding balanced networks. Inset: total cost C of the original vs. balanced networks (12). https://doi.org/10.1371/journal.pcbi.1010418.g004

PLOS COMPUTATIONAL BIOLOGY
reached; a network trained with ℓ 2 regularization need not satisfy the robustness balance condition.
Nonetheless, we have showed that any regularized network will become exactly balanced (in some sense) through training. This observation suggests that attaining the equilibrium condition of synaptic balancing is not only functionally desirable from a robustness standpoint but also is a generic consequence of learning rules which optimize a loss function of the form (26).

Balancing empirically improves task performance
To experimentally measure the effect of synaptic balancing on task performance, we trained networks via gradient descent on a context-dependent integration task modeled after [23]. This process yielded a trained network which adequately performed the task. We applied synaptic balancing to the trained network, using the robustness cost function (13), and stored the equilibrium weight configuration as our balanced network. We simulated the trajectories of the original (trained) versus balanced network and observed task performance while varying the levels of additive Gaussian noise in the neural dynamics (1). Details of the task and network training are provided in S1 Appendix 5.
As expected, both the original and balanced networks perform identically in the absence of noise, due to the task-preserving nature of synaptic balancing. We also found that the task performance, as measured by the trial-averaged task loss on held-out test data, deteriorated in both the trained and balanced networks as the noise level increased. However, this deterioration was noticeably attenuated in the balanced networks, and trained networks that had not been balanced proved more sensitive to higher levels of Gaussian noise. The decay in relative performance of original versus balanced networks is illustrated across several network instantiations in Fig 4b. The improvement exhibited by the balanced network is remarkable in part because synaptic balancing does not make use of a task-specific error signal, but merely uses summary statistics of the average neuronal gain during the task. These results confirm that in networks which are already performing a task, the variability of neural responses can be suppressed simply by shifting synaptic weights towards a balanced configuration via the task-preserving transformation. As noted above, this task preserving transformation can be implemented by local synaptic learning rules that require no knowledge of the task.

Exact and approximate trajectories of synaptic balancing
We have shown that the ordinary differential Eq (18) is a member of a widely studied class of dynamical systems called Lax dynamics. In the interest of better understanding the action of our dynamics on the recurrent weight matrix as a whole, we now turn to closed-form solutions to (18) that specify the evolution of synaptic balancing over time. When the network has just two neurons, our solution is exact; in general, we derive a quadratic approximation taking the form of a heat equation.
Exact trajectory with two neurons. In a two-neuron network, the balancing dynamics admit an exact analytical solution for the time course of the synaptic costs c 12 and c 21 , when these costs take the power-law form (23). If both initial synaptic costs are positive, we find that they evolve as If just a single initial synaptic cost is positive-suppose it is c 12 -then it evolves as while c 21 is fixed at zero. In agreement with Prop. 3, the latter case suffers from unbounded growth of the input and output weights over time as J 12 ! 0, and there is no stable equilibrium of the dynamics. The trajectories in (29) and (31) are illustrated in panels (g-h) of Fig 3. Approximate trajectory via the heat equation. Except in the two-neuron scenario, we are not aware of a general analytic solution to the trajectory of synaptic balancing. Here we show that a closed-form approximate solution is attainable in general, however, shedding light on the macroscopic patterns of weight modification that synaptic balancing induces in a network. Our approach is to consider the time evolution of the neural gradients, which we tie to solutions of the heat equation on a graph. This then yields a closed-form approximate local solution for the trajectory of the coordinates h.
The time evolution of the neural gradients (17) is given by Since h evolves under gradient descent (15), the Jacobian of the dynamics of h is a sign-flipped version of the Hessian of the cost function (12), A short calculation via (16) finds the Hessian to be where L takes the form of a Laplacian matrix corresponding to a graph with edge weights given by what we call the conductance matrix � C, which has ijth element and which is evidently symmetric. Explicitly, the Laplacian L has elements drawn from � C as follows: Combining (32), (33) and (34), and maintaining γ = p −1 as before, the time derivative of the neural gradients is Eq (37) is the heat equation of the graph corresponding to L, in analogy to the heat equation in continuous environments [44]. This suggests an intuitive physical description, and approximate mathematical solution, of the evolution of neural gradients. Since L is itself time-varying, the dynamics (37) do not admit a straightforward exact solution. However, in the vicinity of a weight configurationW , we may take L to be fixed atL to obtain a closed-form expression which approximates the exact solution to (37). This corresponds to gradient descent dynamics on the quadratic Taylor approximation of C in h evaluated atW . Under fixedL, (37) is a (time-invariant) linear dynamical system, and the solution at time t may be expressed in terms of the heat kernel e À pLt : where g 0 denotes the neural gradient at time t = 0, and λ i , v i denote the ith eigenvalue and eigenvector ofL. The sum is taken over all i such that λ i is positive, since if λ i = 0 for some i then v i is an indicator vector of a connected component, which must be orthogonal to any realizable neural gradient g 0 . Integrating (38) yields a closed-form approximate expression for the evolution of the coordinates h on the task-preserving manifold: where we have chosen boundary conditions such that h(0) = 0. As t ! 1, the network reaches an equilibrium h ! h � , given by The notationL y denotes the Moore-Penrose pseudoinverse ofL. To illustrate these concepts, Fig 5 shows how a 12-neuron, ring topology network, redistributes synaptic cost by synaptic balancing dynamics in response to a perturbation of a single synaptic cost (a-b), as well as the evolution of h in the Laplacian matrix eigenmode basis (c-d).
The approximate closed-form dynamics derived in this section, and especially the role of the Laplacian matrix L, help shape intuition about the behavior of our rule: Neural gradients diffuse in a network akin to heat diffusing on a graph, with higher spatial-frequency modes of the graph decaying more quickly than lower spatial-frequency modes. As shown in Fig 5(d), numerical simulations verify that the quadratic approximate dynamics presented here accurately describe synaptic trajectories near equilibrium.
General bounds on equilibrium cost. We have provided exact and approximate closedform dynamics of synaptic balancing. To complement these results, we now turn to results on the optimal value of the cost function, stated in terms of the initial cost matrix C 0 .
Proposition 5. Suppose synaptic costs are of the power-law form (23). Then given initial neural gradients g 0 and initial total cost C 0 , the minimum total cost C � on the task-preserving manifold is bounded above by and below by whereĉ ij ¼ ffi ffi ffi ffi ffi ffi ffi ffi c 0 ij c 0 ji q for all i, j, as in (30).
A proof is given in S1 Appendix. Intuitively, the upper bound (41) says that the greater the initial deviation from the balance condition (in the form of large neural gradients), the greater the guarantee that synaptic balancing will improve the total cost. The lower bound (42) says that the more symmetric the initial cost matrix, the less that synaptic balancing is able to improve the costs.
Recall that in a two-neuron network, the equilibrium cost matrix is symmetric (29). In fact, we find that symmetry is preferred by synaptic balancing, and the equilibrium cost matrix will be symmetric in any circumstance in which symmetry is attainable on the task-preserving manifold. If C 0 is the initial matrix of synaptic costs, and C 0 is positive diagonally symmetrizable, then the minimum is attained at the cost matrixĈ ¼ e À H � C 0 e H � , whose i, jth element is the geometric mean of initial costs (30), and equality is attained in (42).
As an example of symmetric equilibrium beyond the case of N = 2, consider a rank-one network whose initial costs factor as C 0 = ab T . This network is strongly connected only if every It is not just symmetric matrices which are fixed points of synaptic balancing: all normal matrices-including symmetric matrices as a special case-are equilibria of our rule, i.e., they satisfy the balance condition (21). This more general result is shown in S1 Appendix.
In purely linear networks, arbitrary similarity transformations of the recurrent matrix-not just positive diagonal transformations-are task-preserving. The positive diagonal similarity transformation (4), then, will generically not achieve the optimal sensitivity among task-equivalent linear networks. It would be interesting to explore how optimizing over similarity transforms involving all invertible matrices might perform relative to our purely diagonal similarity transformation. However, we note that such an optimization will not generically lead to a biologically plausible local learning rule.

Synaptic balancing predicts heterosynaptic plasticity
Previous sections demonstrated that the balance condition (21) is not only functionally useful for noise robustness but also in a sense generic in trained, regularized recurrent networks. These findings suggest that synaptic balance may be a widespread phenomenon, with many networks attained through regularized training naturally exhibiting the equilibrium condition of synaptic balancing (21). In a biological context, where we hypothesize that synaptic balancing would continually operate alongside other weight dynamics, we predict that the network is generically in a state fluctuating around the balance condition. For example, fast-acting, inherently unstable plasticity rules-Hebbian or otherwise-might temporarily bring synapses and firing rates away from equilibrium, while synaptic balancing slowly tunes the network in response to those modifications, so that the balance condition is always approximately maintained.
This suggests that synaptic balancing might most commonly play a role in fine-tuning networks that are already in the vicinity of a balanced equilibrium. To explore this scenario in a specific, experimentally testable regime, we consider the response of synaptic balancing to a single synaptic potentiation or depression near equilibrium, as depicted for a ring network case in Fig 5. Synaptic perturbations induce compensatory heterosynaptic plasticity. Suppose the that network begins at an initial equilibrium configuration W �i satisfying the balance condition (21), and that a perturbation is applied. Specifically, let the i, jth synapse (i 6 ¼ j) be instantaneously modified by a small factor η � 0 while every other synapse is unchanged. Call the perturbed weight configuration W 0 . Then If η > 0, this perturbation corresponds to synaptic potentiation of J ij , and if η < 0, it corresponds to synaptic depression. By first-order expansion of the power-law synaptic costs (23), we have that the costs adjust as Plugging the perturbed synaptic costs (44) into the expression for the neural gradient (17), and using that the network was initialized at equilibrium, i.e. that g �i k ¼ 0 for all k, we have, Finally, by plugging (43) and (45) into (18), the learning rule becomes, to first order, This rule predicts that a perturbation from equilibrium at a single synapse from j to i will lead to multiplicative plasticity at the outgoing and incoming synapses of both neurons. Specifically, if J ij is potentiated, i.e., if η > 0, then the response of synaptic balancing is potentiation of the presynaptic neuron's incoming synapses (J jl ) and of the postsynaptic neurons' outgoing synapses (J ki ), as well as depression of the presynaptic neuron's outgoing synapses (J kj ) and the postsynaptic neuron's incoming synapses (J il ). Following the perturbation from the initial equilibrium configuration W �i , the system will relax under synaptic balancing to a final equilibrium configuration W �f (Fig 5(a) and 5(b)). To calculate the change in synaptic strength of neuron ij from its initial equilibrium to its final equilibrium value, we plug the value of g 0 from (45) into (40) to find where e k is the kth standard basis vector of R N , and we adopt the Laplacian matrix corresponding to the perturbed weight configuration W 0 . Writing the task-preserving transformation (47), then the log change in synaptic weight, normalized by the perturbation η, is where R 0 ij ¼ ðL y Þ ii þ ðL y Þ jj À 2ðL y Þ ij � 0 is the resistance distance (alternately called effective resistance) between neurons i and j, on the graph whose edges have conductances � C 0 . Resistance distance generalizes to arbitrary graphs the formulas for resistance in series and parallel, and R ij is greater where the paths of conductivity between neurons i and j are fewer or weaker [45]. We may interpret (48) to mean that synaptic balancing counteracts a potentiation or depression of J ij by a factor equal to the fraction of overall conductance between neurons j and i that is attributable to the synaptic cost c 0 ij , versus to other paths of synaptic costs in the network.
Slow, compensatory, and network-wide heterosynaptic plasticity. We have described synaptic balancing near equilibrium as a slow, compensatory mechanism that adjusts a neuron's input and output synapses in response to a single potentiation or depression, in a manner closely resembling known phenomena of heterosynaptic plasticity [12,13]. Here we discuss experimental evidence in connection with the predictions of synaptic balancing.
Studies inducing Hebbian plasticity at one or more target synapses have repeatedly observed compensatory heterosynaptic modification at nearby synapses on the same dendrite [14-16, 46, 47]. For example, two-photon in vivo imaging of synaptic spines revealed that heterosynaptic depression of inputs to mouse V1 layer 2/3 pyramidal neurons follows functionally induced potentiation (LTP) of synapses on the same dendrite-a result exactly predicted by Eq (46).
Our specific predictions about the magnitude and direction of heterosynaptic effects also find experimental support. Eq (46) predicts heterosynaptic modifications that are multiplicative, with the change in weight proportional to the original size of the synapse, and independent of the synapse's sign (i.e., inhibitory or excitatory). Patch-clamp recordings of synapses in cortical slice after induction of spike-timing-dependent Hebbian plasticity in paired synapses matched the multiplicative principle, with the heterosynaptic effect applying more strongly to the initially larger unpaired synapses than to the initially smaller ones [16]. The same work found that heterosynaptic effects could be explained solely in terms of the absolute strengths of the paired and unpaired synapses: both E and I synapses experienced compensatory heterosynaptic depression when the paired synapse was potentiated, and both E and I unpaired synapses experienced compensatory potentiation when the paired synapse was depressed.
Our rule may be distinguished from existing concepts of compensatory heterosynapstic plasticity [13,28] through a further prediction, to our knowledge not yet experimentally explored: in response to the potentiation of a single neuron's inputs, not only do input synapses experience heterosynaptic depression, but also output synapses experience potentiation. This concept is demonstrated in Fig 5 for a 12-neuron ring network that experiences an instantaneous synaptic perturbation.
Mechanisms supporting the input-synapse half of our conjectured balancing dynamics are well studied. In addition to the known heterosynaptic effects already mentioned, neurons are known to multiplicatively and bidirectionally scale all incoming synapses through synaptic scaling [25,26,48,49]. While the particular homeostatic trigger posited by synaptic scalingdeviations from a set-point firing rate-differs from the trigger considered in our model, synaptic scaling lends evidence to the hypothesis that a neural mechanism exists to distribute a negative feedback signal to incoming synapses and induce coordinated compensatory plasticity, such as is predicted by synaptic balancing.
This work introduces a new view on the possible functional roles of compensatory heterosynaptic plasticity. Existing literature has largely focused on the important role it may play in constraining the inherent instability of Hebbian plasticity [12,13,28,50]. In our model, the role of heterosynaptic plasticity is to maintain a functional state of noise robustness even as other learning processes homosynaptically modify synapse strength. We believe that these traits are suitably thought of as a novel model of homeostatic plasticity: one whose aim is to maintain, through negative feedback, the functionally-relevant balance condition (21).

Network training details
We constructed a context-dependent integration task with three input variables: the context a and two signals s (1) and s (2) . Each variable was encoded as a pair of indicator-style inputs, yielding six dimensions of network inputs. Each pair (a 1 , a 2 ), ðs ð1Þ 1 ; s ð1Þ 2 Þ, and ðs ð2Þ 1 ; s ð2Þ 2 Þ independently took the value (0, 1) or (1, 0), plus Gaussian noise, for the duration (T = 50) of each trial. Three Boolean variables corresponded to eight total trial conditions. The task target z (also encoded as indicator variables z 1 , z 2 ) was the integral of the noisy signal over time, as gated by the context: for i = 1, 2. Networks of the form (1), with rectified linear activation functions, were initialized with i.i. d. weights J ij � N ð0; N À 1 Þ and were trained via gradient descent to minimize an objective consisting of the squared-error loss function ∑ i,t (y i (t) − z i (t)) 2 , plus a regularization term l P ij J 2 ij . Networks in Fig 4, with N = 256 neurons, learned the task after being trained with a fixed learning rate of 0.003 for 1,600 training iterations.
Average gains fs 2 j g N j¼1 were calculated across conditions and trials on a separate trial dataset not used in the training or evaluation of the network. The balanced network was taken to be the final time step of a numerical solution to the ODE (18), using neural gradients (17) and synaptic costs (13), with the original (trained) network as initial condition . Fig 4b was attained by running the original and balanced networks with varying levels of additive Gaussian noise injected into the recurrent neural dynamics.

Discussion
Lastly, we would like to discuss some important observations, consequences, and limitations of this work. One particularly notable drawback of this work is the lack of any theoretical guarantees of improvement in the robustness to noise of the output trajectory {y(t)} to fluctuations in either the input trajectory or the internal units. Instead, we study the sensitivity of the neural dynamics to noise in the internal units, a quantity that is generally considered crucial to task performance but allows us to study noise robustness in a task-agnostic way. This paper has intentionally focused on the case of recurrent networks, where task performance is dominated by the compounded dynamics of the recurrent matrix feeding into itself over time. In the limit of large trial time, we postulate that it is these recurrent dynamics which contribute most essentially to task performance. In this light, we believe the apparent feedforward structure of W in ! J ! W out distracts from the essential computations at hand. In other words, since noise in the recurrent dynamics leads to compounding errors over time, we expect that the sensitivity of the neural dynamics S x!x (using the notation of section) matters more than S x!y in the limit of large trial time.
As we show that regularized networks lead to more balanced solutions, one may ask if a biological system would be better off implementing a form of regularization rather than our local synaptic update rule. Synaptic balancing explores a limited manifold with N degrees of freedom, where the underlying input-output function is fixed. In contrast, network training may optimize over the entire input, recurrent, and output matrices. Even highly regularized loss functions, which effectively constrain the degrees of freedom available to the optimization, allow the network to optimize over different input-output functions. Our analysis of synaptic balancing as a dynamical system reveals a connection between learning in noise-robust systems and heterosynaptic plasticity. This connection is new to our knowledge and merits further investigation. Furthermore, we believe our learning rule will be significantly better than weight decay after a task is learned and no more training data for that task is arriving to further maintain task performance (i.e. our memory of how to ride a bike when we haven't ridden a bike in some time). If we use weight decay in the post learning regime, then weight decay will clearly destroy task performance (we will forget how to ride bikes during periods when we are not riding bikes). In contrast, a task-preserving plasticity rule, such as synaptic balancing, would move trained circuits to solutions that are more robust to internal noise even when the task is not actively being trained without destroying any learned information (causing us to forget how to ride a bike).
Lastly, the crucial aspects of synaptic balancing that it provably preserves the exact inputoutput relation and to do so explores a limited manifold with N degrees of freedom has consequences for the efficacy of this synaptic update rule for high-dimensional networks. We show in appendix Fig 1 that the relative reduction in total cost (a proxy for sensitivity on the taskpreserving manifold) decreases with the rank of the initial synaptic weight matrix. It is possible that this effect of modest improvements for high-dimensional networks could be mitigated by relaxing this requirement slightly, and transforming the network in a way that only approximately preserves the task. Perhaps an approximate rule inspired by this work could result in larger improvements in robustness as a function of initial rank, while any damage done to the task performance could be corrected with a small amount of retraining. We believe this would be an interesting future research direction.

Summary
In this work, we introduced a positive diagonal similarity transformation of the recurrent weight matrix that preserves task performance in nonlinear recurrent networks with homogeneous nonlinearities. We showed that a simple class of cost functions, notably including the sensitivity of the neural dynamics to noise, are convex in the coordinates of the symmetry. From this observation, we derived a local learning rule-synaptic balancing-that globally maximizes network robustness whenever the recurrent network is strongly connected.
We found that the synaptic cost matrix is balanced at equilibrium, and that this balance condition arises at every local minimum of a very general class of regularized loss functions. To further understand how synaptic balancing dynamics shape network connectivity in the vicinity of equilibrium, we approximated the dynamics of our rule through a heat equation and described the diffusion of synaptic modifications throughout the network according to its Laplacian eigenmodes. We found that near equilibrium, synaptic balancing is well summarized as slow, compensatory, and heterosynaptic, and that experimental evidence of heterosynaptic plasticity is consistent with our predictions.
Overparameterization in neural network models may be linked to the biological processes which sustain task performance under noisy conditions-a possibility known to experimental neuroscience for some time [51]. Here, we have provided a concrete, analytically tractable example of this concept, in which an identifiable symmetry in network parameterization gives rise to a corresponding local process for maintaining stable task performance. We hope that this work may provide a fruitful framework for future research relating homeostatic processes to the mathematical structures underpinning neural network redundancy.