Convolution, Recurrence and Normalisation
Equivariance as the defining property of convolution, the Fourier view, the vanishing-gradient computation for RNNs, and the LSTM gating equations derived from it.
Convolution is forced by equivariance
For signals on (cyclically indexed),
Let denote the shift .
Let be linear. Then
Key idea
Convolution is not a clever choice of architecture; it is the only linear map commuting with translation. So a designer who wants translation equivariance has no freedom at all in the linear part — the weight sharing in a CNN is a theorem, not a heuristic. This is the template for the whole geometric-deep-learning programme: fix a symmetry group, and the equivariant linear maps are forced. Cohen and Welling carry this out for rotations and reflections.
Let be the discrete Fourier transform. Then
Equivalently: the Fourier basis diagonalises every convolution operator simultaneously, with eigenvalues .
Stacking convolutions of kernel size with stride gives receptive field — linear in depth. Using dilation at layer gives receptive field — exponential in depth.
Pooling and stride have the same effect by a different mechanism: they reduce spatial resolution so that a fixed kernel covers a larger fraction of the original input. Note that pooling also destroys equivariance and replaces it with approximate invariance — a max over a window is unchanged by small shifts within the window, which is what is wanted at the output but not in the middle.
Recurrence and the vanishing gradient
with output and loss .
where . Consequently
If the gradient vanishes exponentially in ; if it explodes.
Key idea
For , , so stability requires exactly — a measure-zero condition. Either the gradient dies and the network cannot learn dependencies beyond a few dozen steps, or it explodes and training diverges. Gradient clipping addresses the explosion (it bounds the step, at the cost of biasing the direction); nothing about a vanilla RNN addresses the vanishing.
The LSTM equations are
Along the cell-state path,
(ignoring the indirect dependence through ). With this product is for any .
Key idea
Compare the two propositions. In a vanilla RNN the gradient is a product of matrices , whose norm is generically and cannot be controlled per time step. In an LSTM the cell-state gradient is a product of diagonal matrices with entries in , and each entry is learned. Setting gives an identity path — the "constant error carousel" of the original paper — so the network can learn which information to preserve and for how long. The gating is not a heuristic addition; it is the minimal modification that turns an uncontrollable matrix product into a controllable scalar one.
The GRU makes the same move with fewer parameters, coupling the input and forget gates:
so the Jacobian along the state path is . Residual connections in a transformer are the same idea again with the gate fixed at : .
Normalisation
For a pre-activation , both compute ; they differ in what the statistics are computed over:
- Batch norm: per feature, averaged over the batch. Depends on other examples; requires running statistics at inference.
- Layer norm: per example, averaged over features. Independent of the batch, which is why it is used in transformers and in any setting with variable-length sequences or batch size one.
- RMS norm: layer norm without mean subtraction, .
If with the empirical mean and standard deviation of , then replacing by for leaves unchanged. Consequently the gradient with respect to satisfies
so the effective step size scales as relative to the direction of .
This is a genuine and often-overlooked consequence: with normalisation, the norm of a weight matrix has no effect on the function, only on the effective learning rate. Weight decay in a normalised network therefore acts purely as a learning-rate schedule, which explains several otherwise puzzling empirical observations about the interaction of weight decay and learning rate.
Empirical observation — a regularity seen in experiments. No theorem on this page establishes it in general.
Batch norm reliably accelerates training and permits larger learning rates. The original explanation — that it reduces "internal covariate shift" — has been directly challenged.
What this does not say
Santurkar et al. ran the decisive experiment: they injected non-zero-mean, time-varying noise after batch norm layers, deliberately restoring covariate shift, and the training speed-up persisted. So covariate shift reduction is not the mechanism, or at least not the whole one.
Their proposed alternative is that batch norm makes the loss landscape smoother, with smaller and more predictable gradient and Hessian norms along the training path, which permits larger stable steps. They provide supporting measurements and some analysis in restricted settings. Other proposed mechanisms include the scale-invariance effect above and an implicit regularisation from batch noise.
The state of knowledge: batch norm works, the original explanation is wrong, and there are several partial explanations with supporting evidence and no consensus. This is a good example of a case where the engineering is far ahead of the theory, and of why it is worth labelling such claims as empirical rather than presenting a plausible story as established.
Problems
Translation-equivariant linear maps are convolutionsProof · Intermediate · 30 min Convolution diagonalises in the Fourier basisProof · Intermediate · 30 min Receptive field growth with depth and dilationNumerical · Beginner · 15 min The RNN gradient is a repeated matrix productProof · Intermediate · 30 min The LSTM cell-state JacobianProof · Advanced · 30 min Normalisation makes weights scale-invariantProof · Advanced · 30 minReferences
- PaperYann LeCun and collaborators (1989). Backpropagation Applied to Handwritten Zip Code Recognition
- PaperSepp Hochreiter and Jürgen Schmidhuber (1997). Long Short-Term Memory
- PaperRazvan Pascanu, Tomas Mikolov and Yoshua Bengio (2013). On the difficulty of training Recurrent Neural Networks
- PaperSergey Ioffe and Christian Szegedy (2015). Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift
- PaperShibani Santurkar, Dimitris Tsipras, Andrew Ilyas and Aleksander Mądry (2018). How Does Batch Normalization Help Optimization?
- PaperTaco S. Cohen and Max Welling (2016). Group Equivariant Convolutional Networks
These works are cited as sources to read, not reproduced. All exposition, examples and problems on this site are written independently; where an argument is standard, the citation points to a canonical treatment.
Results stated on this page
- TheoremTranslation-equivariant linear maps are exactly convolutionsproof includedEquivariance is not a property convolution happens to have; it characterises convolution completely.
- TheoremConvolution theoremproof includedConvolution becomes pointwise multiplication in the Fourier basis, which diagonalises every convolution at once.
- PropositionReceptive field growthproof includedStacked convolutions grow the receptive field linearly, dilation grows it exponentially.
- PropositionThe RNN gradient is a product of recurrent Jacobiansproof includedBackpropagation through time multiplies the same matrix T times, so the gradient decays or explodes exponentially in the sequence length.
- PropositionThe LSTM cell state has an additive path with Jacobian equal to the forget gateproof includedGating replaces a matrix product by a product of scalars in (0,1), which is what makes long-range gradients survivable.
- Empirical observationWhy batch normalisation helps is not settledThe original internal-covariate-shift explanation has been challenged; smoothing of the loss landscape is the leading alternative.
Problems (6)
All problems- Normalisation makes weights scale-invariantProofAdvanced⏱ 30 min
- Convolution diagonalises in the Fourier basisProofIntermediate⏱ 30 min
- Translation-equivariant linear maps are convolutionsProofIntermediate⏱ 30 min
- The LSTM cell-state JacobianProofAdvanced⏱ 30 min
- Receptive field growth with depth and dilationNumericalBeginner⏱ 15 min
- The RNN gradient is a repeated matrix productProofIntermediate⏱ 30 min
Papers that use this mathematics
ImageNet Classification with Deep Convolutional Neural Networks
Alex Krizhevsky, Ilya Sutskever, Geoffrey E. Hinton · 2012
Deep Residual Learning for Image Recognition
Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun · 2016
Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift
Sergey Ioffe, Christian Szegedy · 2015
Attention Is All You Need
Vaswani, Shazeer, Parmar, Uszkoreit, Jones, Gomez, Kaiser, Polosukhin · 2017
Mastering the game of Go without human knowledge
David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton and others · 2017
Mastering the game of Go with deep neural networks and tree search
David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot and others · 2016
Human-level control through deep reinforcement learning
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski and others · 2015