Symmetries & Conservation Laws
Permutation and rescaling symmetries, and the quantities gradient flow conserves.
Swap two hidden units of a trained network, together with their weights, and nothing changes: same function, same loss, a different point in weight space. Deep networks are full of such symmetries. They make the loss landscape massively redundant, and, through an analogue of Noether's theorem, they force gradient flow to conserve quantities that shape what training finds.
What you’ll learn
- Enumerate the weight-space symmetries of MLPs (permutations, sign flips, positive rescalings, translations and scalings) and count the discrete ones.
- State what is known about identifiability for tanh and ReLU networks, and what non-identifiability implies for distances, averaging and sharpness.
- Prove that a continuous symmetry makes the gradient orthogonal to its orbit, and derive the conservation laws of gradient flow, including the balancedness of homogeneous networks.
- Quantify how finite step sizes and weight decay break these laws, and describe uses of symmetry: teleportation, weight-space networks and alignment.
The symmetries of weight space
| Symmetry | Transformation at hidden layer | Needs | Group |
|---|---|---|---|
| Permutation | , , | any elementwise | permutation matrices |
| Sign flip | negate unit 's incoming weights, bias and outgoing weights | odd , such as tanh | |
| Positive rescaling | , , , positive diagonal | for : ReLU, leaky ReLU | continuous, dimensions |
| Translation | add to the bias of the logits | a softmax output | continuous, 1 dimension |
| Scale | , , for weights feeding a normalization layer | BatchNorm or LayerNorm after the layer | continuous, 1 dimension |
| General linear | , , invertible | the identity (linear networks) | continuous, dimensions |
For a tanh network the discrete symmetries combine: each hidden layer contributes sign-and-permutation transformations, and for generic weights they give distinct weight vectors (Chen, Lu & Hecht-Nielsen, 1993). One hidden layer of 10 tanh units already gives copies of every weight vector, all with the same loss on every data set. Every minimum of the loss comes with its whole orbit.
How many weight vectors compute exactly the same function as a generic tanh network with one hidden layer of 5 units (counting the original)?
Show the answer
3840
orderings of the units, times sign patterns: . Permutations alone would give , sign flips alone ; they combine independently.
Identifiability, and what its failure implies
So for tanh networks the table is complete: the function determines the weights up to the finite group. For ReLU networks the continuous rescalings join the permutations, and Phuong and Lampert (2020) showed that for every architecture with non-increasing widths there are networks for which permutations and positive rescalings are the only function-preserving transformations; their proof reads the weights off the boundaries between the network's linear regions. Not every network is so rigid. A unit that never activates on the input domain, for example, can have any outgoing weights, and Rolnick and Kording (2020) point out that such extra symmetries occur on a set of networks of positive measure. They also showed the constructive flip side: from input–output queries alone one can often recover a deep ReLU network's architecture and weights up to its symmetries.
Non-identifiability has practical consequences:
- Distances between networks are meaningless without alignment. Two runs from different seeds can compute nearly the same function with hidden units in different orders, and averaging their weights then mixes unrelated units. Aligning permutations first is the basis of weight matching and model merging (Mode Connectivity & Permutation Symmetry).
- Sharpness is not a property of the function. Rescaling one layer of a ReLU network by and the next by leaves the function unchanged but scales the curvature in each block of weights, so a minimum can be made arbitrarily sharp without changing what it computes (Dinh et al., 2017; see Sharpness-Aware Minimization).
- Critical points come in families. Symmetric configurations, such as two units with identical weights, are fixed by some symmetries; such points are often saddles, and gradient descent from a symmetric start can never break the tie. That is why weights must start random.
A hidden ReLU unit has incoming weights , bias and outgoing weight vector . Which change leaves the network's function unchanged?
Show the answer
C.
, and halving the outgoing weights undoes the factor . The bias belongs to the pre-activation, so it scales with the incoming weights.
Noether for gradient flow
(a) Differentiate the invariance at . (b) Along gradient flow:
Translation of a parameter block (logit biases before a softmax): , so . Scale of a block feeding a normalization layer: .
Rescaling at a hidden ReLU unit: incoming weights and bias scale by and outgoing weights by . The generator is the gradient of , and (a) reads
Summing over the units of layer (rows of , entries of , columns of ) gives one law per pair of adjacent layers:
These are conservation laws in the sense of mechanics, and the analogy with Noether's theorem (continuous symmetry, conserved quantity) was developed by Kunin et al. (2021). Du, Hu and Lee (2018) proved the layer-wise law for fully connected and convolutional networks with linear, ReLU or leaky ReLU activations and drew the key consequence: layers are automatically balanced. If training starts from small weights, the differences of squared norms start near zero and stay there, while the norms themselves grow by orders of magnitude, so every layer ends up with nearly the same norm. Gradient flow cannot pile all the growth into one layer.
Linear networks have the bigger symmetry , , and the same argument conserves a whole matrix, . Arora, Cohen and Hazan (2018) started it at zero ("balanced" initialization) and showed that the end-to-end matrix then follows a preconditioned gradient flow: depth acts as a preconditioner that can accelerate convergence (Learning Dynamics of Deep Linear Networks). Are there more conservation laws than the symmetries give? Marcotte, Gribonval and Peyré (2023) characterized all functions conserved by every gradient flow of a model, through the Lie algebra generated by the model's Jacobian, and found for several ReLU architectures that the known rescaling laws are complete.
Broken conservation: step size, weight decay, noise
Training is not gradient flow. With a finite step, a penalty or a different optimizer, the conserved quantities drift, and the drift itself is informative.
Take one step and expand the squared norms of the two blocks of a rescaling symmetry, and :
The middle term vanishes by the symmetry identity, for the full gradient and equally for every mini-batch gradient, since each mini-batch loss has the same symmetry. Only a second-order term remains:
Over a time the drift adds up to about : it vanishes as at fixed . For a scale symmetry, gives : weights feeding a normalization layer grow at every step, which steadily shrinks their effective learning rate (What Weight Decay Really Does).
Weight decay adds to the flow, so : the imbalance decays exponentially. Kunin et al. (2021) combine both effects in one formula, which they found to match training of VGG-16 on Tiny ImageNet closely:
At one step of plain gradient descent with , a ReLU unit's incoming-side gradient has and its outgoing-side gradient . By how much does change?
Show the answer
0.03
. The first-order terms cancel exactly, so the law is broken only at order per step. Halving the step size quarters the drift per step and halves it per unit of training time.
Momentum, in the continuous-time model, mainly rescales time and keeps the laws; adaptive optimizers such as Adam rescale each coordinate separately, so the update is no longer orthogonal to the orbit and the laws need not hold even for small steps. The conserved and slowly drifting quantities are therefore fingerprints of the optimizer, which is one way to study what an optimizer's implicit bias is.
Putting symmetry to work
- Teleportation. Moving along an orbit changes the parameters but not the loss, and different points of an orbit can have very different gradients. Symmetry teleportation jumps along the orbit to a point with a steeper gradient, then resumes descent; Zhao, Dehmamy, Walters and Yu (2022) showed it speeds up gradient descent and AdaGrad on test functions, multilayer regressions and MNIST, and related it to second-order methods.
- Networks that read networks. Models that take another network's weights as input, to predict its accuracy, edit an implicit neural representation or generate weights, should give the same answer for every permutation of the hidden units. Navon et al. (2023) and Zhou et al. (2023) characterized the linear layers that are equivariant to these permutations and built weight-space networks from them.
- Alignment before averaging. Matching the units of two independently trained networks, and then interpolating, removes much of the loss barrier between them (Mode Connectivity & Permutation Symmetry, Model Merging & Task Arithmetic).
Key takeaways
- MLPs have weight-space symmetries: permutations per hidden layer for any activation, sign flips for odd ones, positive rescalings for ReLU, plus translations before a softmax and scalings before normalization; every minimum comes with its whole orbit.
- Tanh networks are identifiable up to permutations and sign flips (Sussmann, 1992); for ReLU networks, permutations and rescalings are the only symmetries for suitable networks but not for all.
- A continuous symmetry makes the gradient orthogonal to its orbit; when the generator is a gradient field, its potential is conserved by gradient flow. For ReLU networks, is conserved, so small initializations stay balanced.
- Finite steps break the laws only at order per step, weight decay makes imbalances decay like , and adaptive optimizers need not respect them; symmetries are used for teleportation, weight-space learning and model alignment.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
A generic tanh network has one hidden layer of 6 units. How many weight vectors compute exactly its function?
Show the answer
B.
permutations times sign patterns: .
For a hidden ReLU unit with incoming weights , bias and outgoing weights , which quantity is conserved by gradient flow on any loss?
Show the answer
C.
The rescaling symmetry's generator is the gradient of , which is therefore conserved. The bias scales with the incoming weights, so it enters with the same sign.
Gradient flow with weight decay is run on a ReLU network. What happens to a unit's imbalance ?
- It stays exactly constant, as without weight decay
- It decays as
- It grows as
- It decreases linearly to zero at
Show the answer
B. It decays as
The penalty adds to the velocity, contributing and to their derivatives, while the loss terms still cancel: . Weight decay actively balances the layers.
Two networks with the same architecture are trained from different random seeds and both reach low loss. Why does averaging their weights usually give a poor network?
- Their hidden units sit in unrelated orders, so the average combines units that compute different features
- Averaging always doubles the weights' norm
- Two minima of a nonconvex loss can never be connected by a low-loss path
- The averaged network has twice as many parameters
Show the answer
A. Their hidden units sit in unrelated orders, so the average combines units that compute different features
Permutation symmetry means the two solutions may be equivalent up to reordering, but their raw weight vectors are not aligned. Aligning the units first (weight or activation matching) often makes the average, and the straight path between the two, much better.
Further reading
- H. J. Sussmann, "Uniqueness of the weights for minimal feedforward nets with a given input-output map," Neural Networks 5 (1992).
- A. M. Chen, H. Lu & R. Hecht-Nielsen, "On the geometry of feedforward neural network error surfaces," Neural Computation 5 (1993).
- S. S. Du, W. Hu & J. D. Lee, "Algorithmic regularization in learning deep homogeneous models: Layers are automatically balanced," NeurIPS (2018).
- D. Kunin, J. Sagastuy-Brena, S. Ganguli, D. L. K. Yamins & H. Tanaka, "Neural mechanics: Symmetry and broken conservation laws in deep learning dynamics," ICLR (2021).
- M. Phuong & C. H. Lampert, "Functional vs. parametric equivalence of ReLU networks," ICLR (2020).
- S. Marcotte, R. Gribonval & G. Peyré, "Abide by the law and follow the flow: Conservation laws for gradient flows," NeurIPS (2023).