Abstract
What does a neural network compute, how is it trained, and why can a change no person would notice make it fail? A network is a composition of weighted sums and simple nonlinear functions, and the field’s history answers what that composition can represent and how to find good weights. McCulloch and Pitts (1943) showed that threshold units express logic, Rosenblatt (1958) added learning, and the 1989 approximation theorems showed that one hidden layer with a suitable nonlinear activation and a linear output can approximate any continuous function on a compact set arbitrarily well, given enough units, without saying how many that takes or how to find the weights. Backpropagation computes the gradients that guide the weight search, and convolution, gated recurrence, rectified units, dropout, residual connections and attention each improved training, overfitting control or efficiency. An attacker with access to a model’s internals can use input gradients to find small changes that flip its output, as Szegedy and Goodfellow showed.
What a network computes
Units, layers and the role of the nonlinearity
In the simplest design, a dense feedforward network, a unit takes a list of numbers x = (x₁, …, xₙ), forms a weighted sum z = w₁x₁ + … + wₙxₙ + b, and outputs f(z). The weights w and the bias b are the unit’s parameters; f is the activation function, nonlinear in most hidden units although the identity is allowed (an output unit may use it). A layer is a set of units that read the same inputs, so with W a matrix whose rows are the weight vectors, the layer’s output is f(Wx + b), applied elementwise. A network feeds the output of one layer into the next. LeCun, Bengio and Hinton describe the forward computation in these terms: at each layer the total input to a unit is a weighted sum of the outputs of the layer below, and a nonlinear function is then applied, with the rectified linear unit f(z) = max(0, z), the hyperbolic tangent and the logistic function 1/(1 + e⁻ᶻ) as the common choices.1
The nonlinearity is what makes depth useful. Two linear layers compose into one: W₂(W₁x) = (W₂W₁)x, so a stack of linear layers computes nothing a single linear layer could not; with biases included, the stack is affine, and the same collapse applies. A network with two inputs, two hidden units and one output has 2×2 + 2 weights and biases in the first layer and 2×1 + 1 in the second, nine parameters in all. The same counting scales up: the AlexNet network discussed below is reported to have 60 million parameters.2
McCulloch and Pitts: threshold logic, 1943
Warren McCulloch and Walter Pitts treated a neuron as an idealised threshold element. Their calculus rests on stated physical assumptions: neural activity is “all-or-none”, a fixed number of excitatory synapses must be active to fire a neuron, an active inhibitory synapse absolutely prevents firing at that moment, and the structure of the net does not change with time.3 The abstract states two results: the behaviour of every net can be described in propositional logic (with more complicated logical means for nets that contain circles), and for any logical expression satisfying certain conditions one can find a net that behaves as the expression describes.3
Take a unit that fires (outputs 1) when the number of active excitatory inputs reaches a threshold θ. With two excitatory inputs and θ = 2 it fires only when both are on: AND. With θ = 1 it fires when either is on: OR. Add one inhibitory input q and one excitatory input p with θ = 1, and the unit fires exactly when p is on and q is off: p AND NOT q. These three gates illustrate the building blocks that the paper composes, with a one-step delay at each stage, to prove Theorem 2, that every temporal propositional expression is realizable by a net without circles; Theorem 1 is the converse, that every such net can be described by such expressions.3 The condition on “certain” expressions is stated in Theorem 3: a sentence qualifies only if it is false when all its atomic constituents are false.3 In plain terms, an expression that would be true when every input is silent cannot be realized by such a net.
The paper also reaches computation in the Turing sense. The authors state that nets furnished with a tape and scanners compute only numbers a Turing machine can compute and can compute each of them, and that nets with circles can compute some of those numbers without a tape.3 The weights and thresholds are fixed, so nothing in the net learns; the paper handles learning by arguing that alterable synapses can be replaced by circles (Theorem 7). The paper is not neutral about biology, since its assumptions are physiological, but it limits what the formal result shows: where it replaces facilitation, extinction and learning by equivalent fixed nets, the authors write that “neither of us conceives the formal equivalence to be a factual explanation.”3
Rosenblatt: a machine that learns, 1958
Frank Rosenblatt’s perceptron has three kinds of units. Sensory points (S-units) feed association units (A-units); each A-unit fires on an all-or-nothing basis when the algebraic sum of excitatory and inhibitory impulse intensities reaches its threshold; response units (R-units) read the A-units.4 Learning happens through changes in connection strengths, with positive or negative reinforcement facilitating or hindering the formation of connections.4 The 1958 analysis is probabilistic: it asks how likely a randomly connected system is to respond correctly after exposure to stimuli. Its listed conclusions include that, in an environment of random stimuli and subject to the parametric constraints discussed in the paper, such a system “can learn to associate specific responses to specific stimuli”, that trial-and-error learning is possible with reinforcement of both signs, and that its memory is distributed, so that removing part of the association system shows up as a general deficit in all learned associations.4 Rosenblatt also marked the limit as he saw it: the recognition of relationships in space and time “seems to represent a limit to the perceptron’s ability to form cognitive abstractions.”4
A common form of the rule uses a step output ŷ = 1 if w·x + b > 0 and 0 otherwise, and a target t: w ← w + (t − ŷ)x and b ← b + (t − ŷ). Nothing changes on a correct answer. On a false negative the weights move toward the input; on a false positive they move away. Rosenblatt’s 1962 book Principles of Neurodynamics defines error-correction procedures in which no reinforcement is applied unless an error occurs, and states a “Principal Convergence Theorem” for elementary perceptrons.5 Novikoff’s 1962 proof treats a finite set of vectors that a vector separates strictly, with arbitrary starting weights, and compares two bounds after n corrections: the length grows at least in proportion to n, while the squared length grows at most linearly in n, so the number of corrections is finite.6 For the displayed rule the usual radius-margin bound assumes zero initial weights, a step size of 1, inputs augmented with a constant 1 and bounded in norm by R, and a unit-norm separator with margin γ > 0; the number of mistakes is then at most (R/γ)². For AND, the augmented inputs have R = √3, and the unit separator (2, 2, −3)/√17 gives γ = 1/√17, so the bound is 3 × 17 = 51 mistakes. The trace below makes ten.
Here is the rule learning AND from zero weights, cycling through the four inputs in the order (1,1), (0,0), (1,0), (0,1). Only the steps that change something are listed.
| Pass | Input | Target | w·x + b | Output | New w | New b |
|---|---|---|---|---|---|---|
| 1 | (1,1) | 1 | 0 | 0 | (1,1) | 1 |
| 1 | (0,0) | 0 | 1 | 1 | (1,1) | 0 |
| 1 | (1,0) | 0 | 1 | 1 | (0,1) | −1 |
| 2 | (1,1) | 1 | 0 | 0 | (1,2) | 0 |
| 2 | (1,0) | 0 | 1 | 1 | (0,2) | −1 |
| 2 | (0,1) | 0 | 1 | 1 | (0,1) | −2 |
| 3 | (1,1) | 1 | −1 | 0 | (1,2) | −1 |
| 3 | (0,1) | 0 | 1 | 1 | (1,1) | −2 |
| 4 | (1,1) | 1 | 0 | 0 | (2,2) | −1 |
| 4 | (1,0) | 0 | 1 | 1 | (1,2) | −2 |
Pass 5 makes no errors. The final unit has w = (1,2) and b = −2: it outputs 0 on (0,0), (1,0) and (0,1), where the sums are −2, −1 and 0, and 1 on (1,1), where the sum is 1.
XOR and what Minsky and Papert showed
XOR outputs 1 when exactly one input is 1. No single affine threshold unit, one that thresholds w·x + b on the raw inputs, computes it. Suppose one did: it would need b ≤ 0 for input (0,0), w₁ + b > 0 for (1,0), w₂ + b > 0 for (0,1), and w₁ + w₂ + b ≤ 0 for (1,1). Adding the middle two gives w₁ + w₂ + 2b > 0, hence w₁ + w₂ + b > −b ≥ 0, which contradicts the last condition. The positive inputs and the negative inputs cannot be separated by one line. LeCun, Bengio and Hinton put the general fact this way: since the 1960s it has been known that linear classifiers carve their input space only into half-spaces separated by a hyperplane.1
Two layers remove the problem. Let h₁ = OR(x₁, x₂) (threshold 1) and h₂ = AND(x₁, x₂) (threshold 2), and let the output unit fire when h₁ − 2h₂ ≥ 1. On (0,0) both hidden units are 0 and the output is 0. On (1,0) and (0,1), h₁ = 1 and h₂ = 0, so the output is 1. On (1,1), h₁ = 1 and h₂ = 1, giving 1 − 2 = −1, and the output is 0.
The argument above is the elementary case: one affine threshold decision on the raw inputs. It says nothing about networks with a hidden layer, which the construction just given shows can compute XOR. Bottou’s foreword to the book’s reissue says that Minsky and Papert’s analysis characterises what perceptrons can compute for specific tasks such as parity or connectedness, and that they prove no finite-order perceptron can represent the connectedness predicate; the book’s results concern restricted perceptron classes, not every layered network.7 Hornik, Stinchcombe and White write that the book “conclusively demonstrated that the simple two-layer perceptron is incapable of usefully representing or approximating functions outside a very narrow and special class”, while leaving open that multilayer networks might do better.8 Goodfellow, Bengio and Courville give the historical interpretation that the XOR failure of linear models, as pointed out by critics citing the book, caused a backlash against biologically inspired learning and the first major dip in the popularity of neural networks.9 Bottou’s foreword reports that funding was no longer forthcoming after the book; these are historical accounts, not a measured effect.
Universal approximation
The statement
Two papers published in 1989 proved approximation results for networks with one hidden layer. Cybenko’s abstract states that finite linear combinations of compositions of a fixed univariate function with affine functionals can uniformly approximate any continuous function of n real variables with support in the unit hypercube, under mild conditions on the univariate function. His Theorem 1 covers finite sums Σⱼ αⱼσ(yⱼ·x + θⱼ), with output coefficients αⱼ, for any continuous discriminatory σ, and he shows that any continuous sigmoidal σ, one whose limits are 0 and 1 at −∞ and +∞, is discriminatory.10 In the abstract’s words, “arbitrary decision regions can be arbitrarily well approximated by continuous feedforward neural networks with only a single internal, hidden layer and any continuous sigmoidal nonlinearity.”11
Hornik, Stinchcombe and White define a squashing function as a non-decreasing function Ψ from the reals to [0,1] with limit 1 at +∞ and limit 0 at −∞. Their Theorem 2.4 says that for every squashing function, every input dimension and every probability measure on the input space, single-hidden-layer networks of the form Σⱼ βⱼΨ(wⱼ·x + bⱼ) are uniformly dense on compact sets in the continuous functions and dense in the measurable functions under the metric that measures the probability of a significant difference.8 In plain terms: for any continuous target g on a compact set (a closed and bounded region) and any tolerance ε, some such network, with a linear combination at the output, stays within ε of g everywhere on that set, provided it has enough hidden units. Boundedness alone is not enough: the function 1/x on the open interval (0,1) is continuous on a bounded region but unbounded, and a network built from bounded squashing functions is bounded, so it cannot stay within a fixed tolerance of it. The measurable-function part of the theorem is a different kind of statement, since it is closeness in the metric ρ_μ, that is, convergence in probability relative to the chosen measure μ, not uniform closeness. Their abstract notes that this covers Borel measurable functions between finite-dimensional spaces.8 Their first theorem needs a continuous activation, which rules out the threshold function; for squashing functions, continuity is not necessary, so threshold units are covered by Theorem 2.4.8 Goodfellow, Bengio and Courville add that the result was later extended to a wider class of activation functions, including the rectified linear unit, citing Leshno and colleagues (1993).12
What the theorem does not say
Three omissions matter in practice. First, the theorem gives no bound on the number of hidden units. Hornik and colleagues state that their results “do not address the issue of how many units are needed to attain a given degree of approximation”, and name the growth of the unit count with input dimension as an open problem.8 Second, it says nothing about finding the weights. Goodfellow, Bengio and Courville note that learning can fail even when a representation exists, because the optimizer may not find the right parameters or may pick the wrong function by overfitting.12 Third, existence is not generalisation: a network that matches the training set at every point need not behave on unseen points, a question taken up in What can be learned from examples: a reader in learning theory from Vapnik and Valiant to double descent. Hornik and colleagues themselves attributed failures in applications to inadequate learning, too few hidden units, or a relation between input and target that is not deterministic.8 Approximation error, how closely some network in the class can match the target, is a different quantity from the generalisation error of the network that training actually returns.
Why depth helps
If one hidden layer suffices in principle, the open question is whether depth buys efficiency. Goodfellow, Bengio and Courville state that there are families of functions that a deep architecture approximates efficiently but a shallow one needs a much larger model for, with the shallow model’s hidden units exponential in the input size in many cases.12 Montúfar and colleagues proved a precise version for piecewise linear networks: functions computable by deep networks with rectifier or maxout units can have a number of linear regions that grows exponentially with depth, because each layer re-uses the computation of the layers below on many parts of the input space.13
The folding picture behind that result can be checked by hand. On [0,1] let t(x) = 2·ReLU(x) − 4·ReLU(x − ½). This equals 2x on [0,½] and 2 − 2x on [½,1], a tent with two linear pieces, built from two units. Apply t again and each piece folds into two, giving four pieces; k layers of two units each give 2ᵏ pieces. A one-hidden-layer ReLU network of m units has at most m bends, so at most m + 1 pieces, and matching 2ᵏ pieces needs at least 2ᵏ − 1 units. Twenty units arranged in ten layers produce 1,024 pieces; a single layer needs at least 1,023 units to match them. This is an elementary counting argument, consistent with the Montúfar result and not a quotation from it, and it concerns exact matching of one chosen function. Telgarsky’s depth-separation theorem is the formal version, and it concerns approximation: for any positive integer k there are networks of semi-algebraic gates (which include ReLU and maximum) with Θ(k³) layers and Θ(1) nodes per layer that networks of at most k layers, with fixed gate complexity, cannot approximate in integrated absolute error over the unit cube unless they have Ω(2ᵏ) nodes.14
The second argument is about the data. LeCun, Bengio and Hinton observe that many natural signals are compositional hierarchies: in images, local combinations of edges form motifs, motifs assemble into parts and parts form objects, with similar hierarchies from sounds to words in speech and text.1 They also state that deep nets have two exponential advantages over methods that lack distributed representations, one from generalising to new combinations of learned features (2ⁿ combinations from n binary features) and one from composing layers, and that both depend on the data-generating distribution having an appropriate componential structure.1 That condition is a hypothesis about the world, concerning generalisation on componential data, and Goodfellow, Bengio and Courville point out that nothing guarantees that the functions we want to learn have such structure.12
Training: loss, gradients and backpropagation
Loss and gradient descent
Training chooses the parameters θ (all weights and biases) to minimise a loss L(θ), a single number measuring how badly the network’s outputs on the training examples match their targets. LeCun, Bengio and Hinton describe the objective as a hilly landscape over weight space: the negative gradient points in the direction of steepest descent, and a step along it moves toward a minimum where the error is low on average.1 The update is θ ← θ − η∇L(θ), with a small step size η called the learning rate.
Stochastic gradient descent (SGD) estimates the gradient from a few examples instead of all of them. LeCun and colleagues describe it as showing the input vectors for a few examples, computing the outputs and errors, computing the average gradient for those examples, and adjusting the weights accordingly; each small set gives a noisy estimate of the full gradient, and the procedure usually finds a good set of weights surprisingly quickly compared with far more elaborate optimisation techniques.1
Backpropagation: the chain rule applied layer by layer
The loss depends on a weight in the first layer only through everything between that weight and the output. The chain rule of calculus says how to multiply the local derivatives along each path from the weight to the loss, and to add the contributions of all such paths when a unit feeds several units downstream. LeCun, Bengio and Hinton call backpropagation “nothing more than a practical application of the chain rule for derivatives”: the derivative of the objective with respect to a module’s input is computed by working backwards from its derivative with respect to the module’s output, and repeating this module by module from the output to the input.1 For a layer with total inputs z, outputs y = f(z) and weights w, their equations are: the error derivative with respect to a unit’s output is the weighted sum of the error derivatives with respect to the total inputs of the units above it; the derivative with respect to the unit’s total input is that quantity times f′(z); and the derivative with respect to a weight on the connection from unit j is the output yⱼ of the lower unit times the derivative at the upper unit’s input. At the output, with squared error E = ½(y − t)², the derivative is y − t.1
A complete pass, small enough to check by hand. Take the nine-parameter network from earlier with input x = (1, 2), two ReLU hidden units, and a linear output. The first-layer weights are W₁ = [[1, 0.5], [−1, 0.25]] with zero biases, the output weights are (1, −0.5) with zero bias, and the target is t = 0.
- Forward. The hidden totals are z = (1·1 + 0.5·2, −1·1 + 0.25·2) = (2, −0.5). After ReLU, h = (2, 0). The output is y = 1·2 − 0.5·0 = 2, and the loss is ½(2 − 0)² = 2.
- Backward from the output. ∂L/∂y = y − t = 2. The output weights get ∂L/∂w₂ = 2·h = (4, 0) and the output bias gets 2.
- Backward to the hidden layer. ∂L/∂h = 2·(1, −0.5) = (2, −1). The ReLU passes the derivative where z > 0 and blocks it elsewhere, so ∂L/∂z = (2, 0); the second unit, with z = −0.5, receives nothing.
- First-layer gradients. ∂L/∂W₁ is the outer product of (2, 0) with x = (1, 2): the first row is (2, 4) and the second row is (0, 0). The hidden biases get (2, 0).
- Check. Raising the weight W₁[1,2] (first row, second column) by 10⁻⁶ raises the loss by 4.000002 × 10⁻⁶ in a direct computation, matching the 4 above.
- Update with η = 0.1. W₁’s first row becomes (0.8, 0.1), the output weights become (0.6, −0.5), the hidden biases (−0.2, 0) and the output bias −0.2. Recomputing the forward pass: z₁ = 0.8 + 0.2 − 0.2 = 0.8, y = 0.6·0.8 − 0.2 = 0.28, and the loss is ½(0.28)² = 0.0392, down from 2.
Step 3 shows a property of rectified units that matters later: a unit whose total input is negative for a given example contributes no gradient for that example.
The idea has a history older than the 1986 paper. Goodfellow, Bengio and Courville trace efficient applications of the chain rule based on dynamic programming to control theory in the 1960s and 1970s (Kelley 1960, Bryson and Denham 1961, Dreyfus 1962 and later) and to sensitivity analysis (Linnainmaa 1976), then to neural networks (Werbos 1981), with independent rediscoveries by LeCun (1985), Parker (1985) and Rumelhart, Hinton and Williams (1986).12 LeCun, Bengio and Hinton likewise say the idea was discovered independently by several groups during the 1970s and 1980s.1 Rumelhart, Hinton and Williams’s abstract describes back-propagation as a procedure that repeatedly adjusts the weights to minimise the difference between actual and desired output vectors, with internal hidden units coming to represent important features of the task, an ability that “distinguishes back-propagation from earlier, simpler methods such as the perceptron-convergence procedure.”15 Hidden units receive their loss derivatives through the chain rule.
Adam
Kingma and Ba’s optimiser keeps exponential moving averages of the gradient (m) and of its elementwise square (v), corrects both for their bias toward zero at the start, and updates θ ← θ − α·m̂/(√v̂ + ε). Their suggested defaults are α = 0.001, β₁ = 0.9, β₂ = 0.999 and ε = 10⁻⁸.16 The abstract claims invariance to diagonal rescaling of the gradients, an idealised property, since the fixed ε in the update prevents exact invariance in general. It also claims a regret bound in the online convex optimisation framework.16 That bound has been challenged: Reddi, Kale and Kumar gave an explicit simple convex problem on which Adam does not converge to the optimum and described the problems with the earlier analysis.17 Neural-network losses are also not convex, so even a correct convex analysis would not describe the setting in which Adam is mostly used.
Initialisation
Glorot and Bengio found that the logistic sigmoid is unsuited to deep networks under random initialisation because its mean value can drive the top hidden layer into saturation, and proposed the “normalized initialization” W ~ U[−√6/√(nⱼ + nⱼ₊₁), +√6/√(nⱼ + nⱼ₊₁)], where nⱼ and nⱼ₊₁ are the sizes of the layers the weights connect, chosen to keep the variance of activations and of back-propagated gradients roughly constant from layer to layer.18 For two layers of 256 units the bound is √6/√512 ≈ 0.108.
Vanishing gradients and the rectifier
Backward through a logistic unit, a scalar contribution to the error signal is multiplied by f′(z) times a weight. Hochreiter and Schmidhuber note that the logistic function’s derivative is at most 0.25, so that factor is below 1 in magnitude when the weight’s absolute value is below 4.19 The full gradient in a layered network sums contributions over many paths and depends on products of Jacobian matrices across depth or time, so the scalar chain is an illustration and not a bound on the whole gradient. If one such scalar factor were 0.25 at each of ten layers, the product would be 0.25¹⁰ ≈ 9.5 × 10⁻⁷. The rectified linear unit f(z) = max(0, z) has derivative 1 wherever it is active. Nair and Hinton used noisy rectified linear units as approximations to stepped sigmoid units in restricted Boltzmann machines, and observed that, unlike binary units, they preserve information about relative intensities as it passes through multiple layers.20 Krizhevsky, Sutskever and Hinton report that deep convolutional networks with ReLUs train several times faster than equivalents with tanh units; in their CIFAR-10 experiment, a four-layer network reached 25% training error in one sixth of the iterations that the tanh equivalent needed.2 LeCun, Bengio and Hinton add that ReLU typically learns much faster in networks with many layers.1
Dropout
Srivastava and colleagues’ idea is to drop units, with their connections, at random during training, which prevents units from co-adapting too much; at test time the effect of averaging the exponentially many thinned networks is approximated by one network with smaller weights.21 In AlexNet each hidden neuron’s output was set to zero with probability 0.5 in the first two fully connected layers, all neurons were used at test time with outputs multiplied by 0.5, and the authors report that dropout roughly doubles the iterations needed to converge.2
Batch normalisation
Ioffe and Szegedy normalise selected activations during training using the mean and variance of the current mini-batch, then apply a learned scale and shift; at inference they use fixed population estimates of the mean and variance instead of mini-batch statistics.22 They report that it permits much higher learning rates and less careful initialisation, sometimes removes the need for dropout, and reached the accuracy of their baseline image classifier with 14 times fewer training steps; an ensemble reached 4.9% top-5 validation error on ImageNet, which they say exceeds the accuracy of human raters.22 Their explanation, that it reduces “internal covariate shift”, has been disputed (below).
Where experts disagree: local minima or saddles
Gradient descent on a non-convex loss has no general guarantee of finding a good solution, and the explanations for why it works in practice are partial. LeCun, Bengio and Hinton report that it was widely thought in the late 1990s that gradient descent would get trapped in poor local minima, and say that in practice poor local minima are rarely a problem with large networks; the landscape is instead packed with saddle points, and they state that almost all of those with few downward directions have very similar objective values, so which one the algorithm gets stuck at matters little.1 Dauphin and colleagues examine a different quantity. They argue that saddle points, surrounded by high-error plateaus, are the deeper difficulty because they slow learning dramatically and give the illusion of a local minimum, and they propose a second-order “saddle-free Newton” method to escape them.23 The first account is about the objective values at saddle points and the second about the delay in leaving them, so the claims can coexist; both are arguments from theory and experiment, not a theorem about the networks in use.
Where experts disagree: why batch normalisation helps
Ioffe and Szegedy proposed that normalisation reduces internal covariate shift, the change in the distribution of each layer’s inputs during training.22 Santurkar and colleagues report experiments in which distributional stability of layer inputs has little to do with batch normalisation’s success, and propose instead that it makes the optimisation landscape significantly smoother, giving more predictive and stable gradients.24 Each paper supports its account with its own experiments; neither establishes a general causal conclusion for all networks.
Architecture as prior knowledge
A dense layer lets every output depend on every input with its own weight, which is itself a modelling choice and not a neutral one. Each architecture below restricts that freedom to encode an assumption about the data, and the benefits of doing so are spelled out in each case.
Convolution and weight sharing
LeCun, Bengio and Hinton give the two reasons for the convolutional layer: in array data such as images, local groups of values are highly correlated and form distinctive local motifs that are easy to detect, and the statistics of images and other signals are invariant to location, so a motif that can appear in one part of an image could appear anywhere, and units at different locations should share weights.1 The text of LeCun and colleagues calls the filtering operation of a feature map a discrete convolution. The arithmetic in practice slides the filter over the input without flipping it, which is cross-correlation in the usual mathematical convention; Goodfellow, Bengio and Courville note that many libraries implement cross-correlation and call it convolution.25 For a one-dimensional input (1, 2, 3, 4, 5) and a shared three-weight filter (1, 0, −1), the output at each position is the weighted sum of three neighbours: 1 − 3 = −2, then 2 − 4 = −2, then 3 − 5 = −2. One filter of three weights measures the local slope at every position; the input rises by 1 per step, so every output is −2. Because the same filter is applied at every position, a pattern that shifts in the input produces a feature map that shifts in the same way, a property the textbook calls equivariance to translation. Exactness needs stride one and compatible boundary conditions, or positions away from the boundary; with larger strides only shifts that are multiples of the stride are comparable. Equivariance belongs to the feature map. Pooling gives local insensitivity to small shifts, and global pooling over a shift-equivariant map can give invariance under the corresponding shifts.25
The 1998 LeNet-5 paper by LeCun, Bottou, Bengio and Haffner names three ideas behind convolutional networks: local receptive fields, shared weights and spatial sub-sampling.26 Its numbers show what sharing saves. LeNet-5 takes a 32×32 image; its first layer, C1, has 6 feature maps of 28×28 units, each unit looking at a 5×5 neighbourhood. C1 has 156 trainable parameters (6 filters of 25 weights plus a bias each) and 122,304 connections (156 × 784 positions).26 A fully connected layer between the same input and output sizes would need 1,024 × 4,704 weights plus 4,704 biases, or 4,821,600 parameters, about 31,000 times as many. The whole network has 340,908 connections but only about 60,000 trainable parameters because of weight sharing, which the authors say reduces the capacity of the machine and the gap between test and training error.26 On a handwritten-digit task with 60,000 training patterns, the test error stabilised at 0.95% after about ten passes, with training error 0.35% after 19 passes, and fell to 0.8% when training data were augmented with distorted copies.26 The abstract of that paper also reports that its check-reading system was deployed commercially and read several million cheques per day, and LeCun, Bengio and Hinton say that by the late 1990s the system was reading over 10% of all cheques in the United States.261
The same arithmetic applies at larger scale. AlexNet’s input is 150,528-dimensional (224 × 224 × 3) and its first layer applies 96 kernels of size 11 × 11 × 3, which is 96 × 363 weights plus 96 biases, or 34,944 parameters.2 A dense layer of 4,096 units on the same input would have 150,528 × 4,096 + 4,096 = 616,566,784 parameters.
Recurrence and vanishing gradients
A recurrent network reads a sequence and keeps a state that is updated at each step by the same weights. LeCun, Bengio and Hinton note that once unfolded in time it can be seen as a very deep feedforward network in which all layers share the same weights, and that theoretical and empirical evidence shows it is difficult to learn to store information for very long.1 Hochreiter and Schmidhuber’s 1997 paper states the reason: with backpropagation through time, error signals flowing backward tend either to blow up or to vanish, and, in their analysis of the chain of scalar factors, the backpropagated error scales exponentially with the length of the chain when the scalar factors uniformly shrink or grow, with the individual weights helping to set those factors.19 The full expression sums over paths and involves Jacobian products, so the scalar chain shows the mechanism and not the whole gradient.
Their remedy begins from the condition for constant error flow through a single self-connected unit j: f′ⱼ(netⱼ) · wⱼⱼ = 1. Integrating shows that, for this isolated unit, f must be linear and the activation must stay constant; they enforce this with the identity function and wⱼⱼ = 1.0, and call the result the constant error carousel.19 In the implemented memory cell the state does change when gated input enters; what the original carousel preserves is a self-connection with unit derivative along which error can flow. Multiplicative gate units learn to open and close access to this constant flow. The paper reports that the method bridges time lags in excess of 1,000 steps, truncates the gradient where this does no harm, and has computational complexity of O(1) per time step and weight.19 The cell in that paper has input and output gates; the paper does not include a forget gate. The version LeCun, Bengio and Hinton describe has a self-connection of weight one that is multiplicatively gated by a unit that learns when to clear the memory.1 They also report that LSTM networks proved more effective than conventional recurrent networks, particularly with several layers per time step.1
AlexNet and the 2012 ImageNet result
Krizhevsky, Sutskever and Hinton trained a deep convolutional network with five convolutional layers, some followed by max pooling, and three fully connected layers ending in a 1,000-way softmax, with 60 million parameters and 650,000 neurons.2 On the ILSVRC-2010 test set, with 1.2 million training images, it reached top-1 and top-5 error rates of 37.5% and 17.0%; the best published results were 45.7% and 25.7%, and the best entry in the 2010 competition was 47.1% and 28.2%.2 A variant entered in ILSVRC-2012 won with a top-5 test error of 15.3%, against 26.2% for the second-best entry.2 The 15.3% came from averaging the predictions of two networks pre-trained on the larger Fall 2011 ImageNet release (15 million images, 22,000 categories) with five of the ILSVRC-trained networks. Table 2 of the paper reports validation and test figures separately: the single network of the paper’s design scored 18.2% on validation, averaging five such networks scored 16.4% on both validation and test, and the seven-network combination scored 15.4% on validation and 15.3% on test.2 The 60 million parameters belong to one network, and the winning figure is an ensemble result. Training took five to six days on two NVIDIA GTX 580 GPUs.2 LeCun, Bengio and Hinton credit the result to efficient use of GPUs, ReLUs, dropout, and the generation of extra training examples by deforming existing ones, and say it almost halved the error rate of the best competing approaches.1 LeNet-5 is a predecessor that shares the principles of local receptive fields, weight sharing and pooling; the scale of data and compute was much larger.
Residual networks
By 2015 depth was known to help, and the obstacle was getting deep networks to train. He, Zhang, Ren and Sun observed a degradation problem: as depth increases, accuracy saturates and then degrades rapidly, and the degradation is not caused by overfitting, since adding layers to a suitably deep model raises the training error.27 A deeper model that can embed the shallower model’s solution, with the added layers set to the identity mapping and the others copied, should have training error no higher; the solvers on hand were unable to find such a solution.27
Their fix changes what the layers must learn. If H(x) is the desired mapping for a few stacked layers, let the layers fit F(x) := H(x) − x and compute the block’s output as y = F(x, {Wᵢ}) + x, where the addition is a shortcut connection that carries the input forward unchanged and adds no parameters when input and output have the same dimensions; where they differ the paper’s options are a projection y = F(x, {Wᵢ}) + Wₛx or, in its first comparison, identity shortcuts with extra zero entries padded; section 4.1 compares both and says projection is not essential for addressing the degradation problem.27 In the original block a second ReLU is applied after the addition.27 With F = W₂σ(W₁x) and σ the ReLU, a block whose best action is “do nothing” only has to push its weights toward zero, which the authors argue is easier than fitting an identity with a stack of nonlinear layers.27 The Jacobian of the block’s pre-activation output with respect to x is the identity plus the Jacobian of F. That gives the gradient a direct path, but the sum of the two terms guarantees nothing about the size of the total gradient, and the paper’s stated motivation is easier optimisation of the residual, not a gradient-norm proof.
The reported results are specific. A 152-layer residual network was 8 times deeper than the VGG nets with lower complexity, reached 4.49% single-model top-5 validation error on ImageNet, and an ensemble reached 3.57% top-5 test error and won the ILSVRC 2015 classification task.27 A 34-layer residual network used 3.6 billion multiply-adds against 19.6 billion for VGG-19.27 On CIFAR-10, a 110-layer network reached 6.43% test error and a 1,202-layer network 7.93%, which is worse; the authors suggest the larger network may be unnecessarily large and overfit.27 They also say plainly that they do not know why deep plain networks have such difficulty: they conjecture exponentially low convergence rates, and describe the reason for the optimisation difficulty as a topic for future study.27
Attention and the transformer
Vaswani and colleagues’ 2017 transformer removes recurrence and convolution and builds the network from attention. Language models built on it are the subject of Next-token machines: a reader on large language models and the transformer, and the compute argument for scaling them is in Scaling laws and compute: a reader on why bigger kept working, and what it costs.
In self-attention each position produces three vectors from the same sequence by multiplying its representation by learned matrices: a query q, a key k and a value v. In encoder-decoder attention the queries come from the decoder and the keys and values from the encoder’s output. Scaled dot-product attention computes, for packed matrices Q, K, V of these vectors:
Attention(Q, K, V) = softmax(QKᵀ / √d_k) V
The dot product of a query with each key scores how well they match, the softmax turns the scores into weights that sum to 1, and the output for that position is the weighted sum of the value vectors.28 The division by √d_k addresses a numerical problem. If the components of q and k are independent random variables with mean 0 and variance 1, their dot product has mean 0 and variance d_k, so for large d_k the scores grow large and push the softmax into regions where its gradients are extremely small.28
A small case with d_k = 2. Let the query be q = (1, 0), the keys (1, 0), (0, 1) and (1, 1), and the values (1, 0), (0, 1) and (2, 2). The raw scores are 1, 0 and 1; divided by √2 they are 0.707, 0 and 0.707. Exponentiating gives 2.028, 1 and 2.028 with sum 5.056, so the weights are 0.401, 0.198 and 0.401. The output is 0.401·(1, 0) + 0.198·(0, 1) + 0.401·(2, 2) = (1.203, 1.000). The output is a blend of the three values, weighted toward the two keys that matched the query.
The paper’s model uses multi-head attention: the queries, keys and values are linearly projected h times with different learned projections, attention is applied in parallel to each projection, and the results are concatenated and projected again. With h = 8 heads, d_model = 512 and d_k = d_v = 64, the total computational cost is similar to a single head of full dimension.28 Each encoder layer has two sub-layers, multi-head self-attention and a position-wise feed-forward network (inner dimension 2,048 in the base model), with a residual connection around each sub-layer followed by layer normalisation, the same shortcut idea as in ResNet. The decoder inserts a third sub-layer that attends over the encoder’s output (encoder-decoder attention), and its self-attention is masked to prevent positions from attending to subsequent ones, so that predictions for position i depend only on known outputs at earlier positions.28 Because attention by itself ignores order, positions are injected as sinusoidal encodings added to the embeddings.28
The authors’ comparison of layer types, with n the sequence length, d the representation size and k the convolution kernel width, is what motivated the design:
| Layer type | Cost per layer | Sequential operations | Longest path between two positions |
|---|---|---|---|
| Self-attention | O(n²·d) | O(1) | O(1) |
| Recurrent | O(n·d²) | O(n) | O(n) |
| Convolutional | O(k·n·d²) | O(1) | O(log_k n) with dilated kernels; a stack of O(n/k) layers for contiguous kernels |
Unmasked self-attention, as in the encoder, lets any two positions interact in one step and parallelises across positions, at a cost quadratic in sequence length; in the decoder the mask removes the connections to later positions.28 The big model reached 28.4 BLEU on WMT 2014 English-to-German and 41.8 BLEU on English-to-French (the abstract and Table 2; section 6.1 of the paper gives 41.0); the paper calls the French score a new single-model state of the art, after 3.5 days of training on eight GPUs.28 Reverse-engineering what trained transformers compute internally is the subject of Mechanistic interpretability: a reader on features, superposition, sparse autoencoders and circuit tracing.
Security: input gradients and adversarial examples
Szegedy et al. 2013: adversarial examples
Szegedy and colleagues reported two properties of trained networks that they called counter-intuitive. The first is that, in the authors’ experiments and by the methods of unit analysis they used, there was no distinction between individual high-level units and random linear combinations of them, which they take to suggest that the space, not the individual unit, carries the semantic information.29 The second is the one that defines the field: applying “a certain hardly perceptible perturbation”, found by maximising the network’s prediction error, can make a network misclassify an image, and the authors write that it is possible to arbitrarily change the network’s prediction this way.29 They called the perturbed inputs adversarial examples.
Their search was an optimisation problem. For an image x and a target label l, minimise the norm of the perturbation r subject to f(x + r) = l and x + r staying in the valid pixel range [0,1]; they approximated the minimiser with a box-constrained L-BFGS method, since the exact problem is hard and the network is non-convex.29 For every network they studied (an MNIST classifier, QuocNet and AlexNet) they always found close, visually hard to distinguish adversarial examples.29 The examples also transferred: a relatively large fraction were misclassified by networks trained from scratch with different hyper-parameters, and by networks trained on a disjoint training set, which the authors took as evidence that the examples are not an artifact of overfitting to one model or one sample.29 Later work on features inside networks is in Mechanistic interpretability: a reader on features, superposition, sparse autoencoders and circuit tracing.
Goodfellow, Shlens and Szegedy 2014: the linearity explanation and FGSM
Szegedy’s paper described the learned input-output mapping as fairly discontinuous, which is a description of how labels change under small perturbations; Goodfellow and colleagues proposed a mechanism for the behaviour, the networks’ linear nature. Their abstract says earlier explanations focused on nonlinearity and overfitting and that they argue instead for linearity, and the text states that linear behaviour in high-dimensional spaces is sufficient to cause adversarial examples.30
The argument is one line of algebra. For a unit with weight vector w and input x, add a perturbation η to get x̃ = x + η. The activation changes by wᵀη. If every entry of η is limited to a magnitude ε (a bound on the max norm, ‖η‖∞ ≤ ε), the largest change comes from η = ε·sign(w), and it equals ε times the sum of the absolute values of the weights. If w has n entries with average magnitude m, the activation grows by ε·m·n. The bound ε stays fixed as n grows while the change in activation grows linearly with n, so in high dimensions “many infinitesimal changes to the input … add up to one large change to the output.”30 Two worked cases:
- n = 4, w = (2, −3, 1, −1), x = (1, 1, 1, 1). The activation is wᵀx = −1. With ε = 0.5, η = (0.5, −0.5, 0.5, −0.5) and wᵀη = 0.5 × (2 + 3 + 1 + 1) = 3.5, so the activation becomes 2.5 and changes sign, although no input moved by more than 0.5. These toy coordinates are unrestricted, so ε = 0.5 is illustrative, not a claim about imperceptibility.
- n = 150,528 (an ImageNet-sized input, as in AlexNet), average weight magnitude m = 0.01 and ε = 0.007: the activation moves by 0.007 × 0.01 × 150,528 ≈ 10.5. These weights are illustrative, not measured from any network.
For a deep network the gradient plays the role of w. Linearising the training cost J(θ, x, y) as a function of the input x, with the parameters θ and the target y held fixed, gives, under that linear approximation of the loss, the optimal max-norm-constrained perturbation (the paper’s own wording, “around the current value of θ”, is ambiguous, but the gradient it displays is with respect to x) η = ε·sign(∇ₓJ(θ, x, y)), which the paper names the fast gradient sign method (FGSM), and the gradient is computed efficiently by backpropagation.30 The new input is x̃ = x + ε·sign(∇ₓJ(θ, x, y)).
The paper’s figures show the scale of the effect. On GoogLeNet and ImageNet, with ε = 0.007 (which the paper’s caption says corresponds to the magnitude of the smallest bit of an 8-bit image encoding after GoogLeNet’s conversion to real numbers), an image classified “panda” with 57.7% confidence became, after the perturbation, a “gibbon” with 99.3% confidence.30 On MNIST with ε = 0.25, a shallow softmax classifier had a 99.9% error rate with an average confidence of 79.3% on the wrong labels, and a maxout network misclassified 89.4% of the adversarial examples with 97.6% average confidence; with ε = 0.1 on a preprocessed CIFAR-10, a convolutional maxout network had an 87.15% error rate and assigned 96.6% average probability to the incorrect labels.30 Wrong answers arrived with high confidence, a fact that matters when a deployed system treats confidence as a safety signal.
The same paper turned the attack into a regulariser. Training on the objective J̃ = αJ(θ, x, y) + (1 − α)J(θ, x + ε·sign(∇ₓJ), y) with α = 0.5 gave an average test error of 0.782% on permutation-invariant MNIST, and cut the error on FGSM examples from 89.4% to 17.9%.30
These papers do not reconcile the description and the mechanism. They agree on what an attacker can do.
Later attacks and defences
Carlini and Wagner (2017) examined defensive distillation, a defence reported to reduce the success rate of the attacks then known from 95% to 0.5%. They introduced three attacks, for the ℓ₀, ℓ₂ and ℓ∞ distance measures, that succeeded on distilled and undistilled networks with 100% probability, and they proposed a transferability test using high-confidence adversarial examples that also breaks the defence.31 Athalye, Carlini and Wagner then identified obfuscated gradients, a kind of gradient masking that makes iterative attacks appear to fail without making the model robust. In a case study of the nine non-certified defences accepted at ICLR 2018 that claimed white-box robustness, they found that 7 of 9 relied on obfuscated gradients, and their new attacks circumvented 6 completely and 1 partially in the original threat model each paper considered.32
Madry and colleagues formulated robustness as a saddle-point problem: minimise over the parameters θ the expected value of the maximum, over perturbations δ in an allowed set S, of the loss L(θ, x + δ, y).33 Multi-step projected gradient descent (PGD) on the loss is what they call a “universal” first-order adversary, an argument they support empirically and by conjecture, and they train networks against it.33 They found that model capacity matters, since networks need larger capacity to resist strong attacks than to classify benign examples. In their ℓ∞ threat models, with perturbation budgets ε = 0.3 on MNIST and ε = 8 on CIFAR-10 (different datasets, scales and budgets), their best MNIST model kept an accuracy above 89% against the strongest adversaries in their test suite, and their CIFAR-10 model kept 46% against a PGD adversary with the corresponding settings; against weaker black-box transfer attacks the figures were above 95% and 64%.33 These are measurements against particular attacks and do not certify robustness.
Certification is a different goal: a proof, not a test. Cohen, Rosenfeld and Kolter’s randomised smoothing converts a classifier that does well under Gaussian noise into one that is certifiably robust to ℓ₂ perturbations; on ImageNet they report a certified top-1 accuracy of 49% for perturbations of ℓ₂ norm below 0.5, and state that, at the time of writing, no other certified defence had been shown feasible on ImageNet.34 A certificate is tied to a norm and a radius, so it covers a stated set of perturbations and nothing else.
Gradient access as the attack surface
Training needs derivatives of the loss with respect to the weights, and that works because, in LeCun, Bengio and Hinton’s words, the modules are relatively smooth functions of their inputs and weights.1 The same backward computation gives derivatives with respect to the input wherever the network’s computation is differentiable (a ReLU network is piecewise differentiable), and those derivatives are what FGSM and PGD use. Availability of input gradients is a separate matter from the existence of adversarial examples: even a linear score can cross a decision boundary after a small input change, as the algebra above shows. An attacker with access to the model’s internals, meaning its architecture and weights, which may be spread across files, adapters or shards, can, for a known differentiable computation and a specified objective, compute the exact gradient; that is white-box access. Architecture and weights describe the internals but do not by themselves fix the objective or every operation, such as preprocessing, applied to deployed inputs.
Withholding the weights does not close the gap. Szegedy and colleagues’ transfer result means that examples crafted on one model often fool another.29 Papernot and colleagues turned this into a remote attack: with only the ability to observe the labels a target network returns for chosen inputs, they trained a local substitute model on synthetically generated, target-labelled inputs, crafted adversarial examples on the substitute, and found that they transferred. Against a deep network hosted by MetaMind, 84.24% of the adversarial examples were misclassified; in experiments using logistic-regression substitutes, the rates were 96.19% against the Amazon-hosted target and 88.94% against Google’s, whose underlying method the authors did not know.35 Their results show that label-only access can suffice for transfer attacks against the targets they tested; they do not show that an attacker can accurately reconstruct an arbitrary target.
Backdoors and poisoning
Adversarial examples attack a trained model at inference time. Gu, Dolan-Gavitt and Garg’s BadNets attack the training pipeline. If training is outsourced or a pre-trained model is reused, an adversary can supply a network that has state-of-the-art accuracy on the user’s training and validation samples but misbehaves on attacker-chosen inputs; their demonstration was a street-sign classifier that labels stop signs as speed limits when a sticker is attached, and in one transfer-learning experiment, in which a user downloaded a backdoored U.S. traffic-sign network and retrained its fully connected layers on Swedish signs while keeping the convolutional layers, the resulting network had 74.9% average accuracy on clean images and 61.6% on backdoored images, against 72.7% and 70.2% for a network retrained from an honest baseline.36 Clean-only evaluation can therefore miss a trigger. For how attacks on AI systems, including this class, are catalogued and what that catalogue’s evidence supports, see MITRE ATLAS: what the AI attack matrix knows, and how it knows it.
Advice for deploying or buying a neural-network security product
- What can the attacker see and send? Ask whether the model’s weights, confidence scores or only labels are exposed, and whether queries are limited. Label-only access was enough for Papernot and colleagues’ attack.35
- Which attacks were used to test it? A robustness claim measured with FGSM alone is weak evidence. Ask for results against iterative optimisation-based attacks such as PGD and also against attacks adapted to the specific defence.32 Of the nine non-certified white-box defences Athalye and colleagues studied, seven relied on obfuscated gradients, and adaptive attacks circumvented six completely and one partially; distillation went from a reported 0.5% attack success rate to 100% under Carlini and Wagner’s attacks.3231
- Against which perturbations? Every robustness number is relative to a set of allowed changes. Madry’s allowed set S, with ε = 0.3 on MNIST, and Cohen’s ℓ₂ radius of 0.5 on ImageNet are examples.3334 A vendor should state the set and explain why it corresponds to what an attacker can do to your inputs. In domains such as malware or network traffic, for example, the attacker’s constraint may be that the sample still works, which is a different threat model from a small norm.
- Where did the weights and training data come from? BadNets show that a model trained by a third party can carry a trigger that clean-only evaluation misses.36 Ask who trained the base model, who can change it, and how model files are hashed and versioned.
- Confidence alone is insufficient evidence of safety. Wrong answers on adversarial inputs came with 79.3% and 97.6% average confidence on the two MNIST models Goodfellow and colleagues tested, so for those models a high score did not indicate a trustworthy input.30 Pair the model with controls that do not share its failure modes.
- Retest after every retrain against an acceptance criterion tied to your threat model, for example a minimum accuracy under a stated attack and perturbation set. Szegedy’s examples transferred to networks trained from scratch on a disjoint training set, so transfer to separately trained models is evidence that a retrained model may share the original’s weak points.29 Test-set accuracy also carries the independent-sampling and same-distribution assumptions discussed in What can be learned from examples: a reader in learning theory from Vapnik and Valiant to double descent.
Selected reading list: fifteen papers
1. McCulloch and Pitts, “A logical calculus of the ideas immanent in nervous activity” (1943)
Claimed that all-or-none neural activity can be described in propositional logic and realised by nets, and that nets with a tape compute what a Turing machine computes. It gave the field an idealised threshold neuron with an absolute inhibitory veto. Nothing in the nets learns.3 Look at: Theorems 1 to 3. cs.cmu.edu PDF (opens in a new tab), a 1990 reprint of Bulletin of Mathematical Biophysics 5, 115–133 (1943).
2. Rosenblatt, “The perceptron: a probabilistic model for information storage and organization in the brain” (1958)
Introduced S-, A- and R-units with reinforcement-modified connections and a statistical analysis of learning. The error-correction procedure and convergence theorem are in Rosenblatt’s 1962 book, and Novikoff gave a short proof that year.456 Look at: the list of conclusions. Internet Archive snapshot (opens in a new tab); Psychological Review 65(6).
3. Rumelhart, Hinton and Williams, “Learning representations by back-propagating errors” (1986)
Described back-propagation and its ability to create useful features in hidden units, in contrast to the perceptron-convergence procedure. Earlier and independent derivations exist.15121 Look at: the abstract. Nature 323, 533–536 (opens in a new tab), 9 October 1986, DOI 10.1038/323533a0.
4. Cybenko, “Approximation by superpositions of a sigmoidal function” (1989)
Showed that finite linear combinations of a continuous sigmoidal function of affine functions of the input approximate any continuous function on the unit hypercube uniformly. It says nothing about network size or training.1110 Look at: Theorem 1. Archived Springer page (opens in a new tab); Mathematics of Control, Signals and Systems 2, 303–314, DOI 10.1007/BF02551274.
5. Hornik, Stinchcombe and White, “Multilayer feedforward networks are universal approximators” (1989)
Proved density of one-hidden-layer networks with arbitrary squashing functions, uniformly on compact sets for continuous targets and in probability for measurable ones. It lists the number of units needed as unaddressed.8 Look at: Theorem 2.4. Hosted copy of the PDF (opens in a new tab); Neural Networks 2, 359–366.
6. Hochreiter and Schmidhuber, “Long short-term memory” (1997)
Analysed vanishing and exploding error signals in recurrent networks and introduced the constant error carousel with multiplicative gates, bridging lags over 1,000 steps. Its cell has input and output gates and no forget gate.191 Look at: section 3.2.2. PDF (opens in a new tab); Neural Computation 9, 1735–1780.
7. LeCun, Bottou, Bengio and Haffner, “Gradient-based learning applied to document recognition” (1998)
Presented LeNet-5, with weight sharing giving 156 free parameters in the first layer, and a commercially deployed check reader.26 Look at: the LeNet-5 architecture figure. Author-hosted PDF (opens in a new tab) and a readable copy (opens in a new tab); Proceedings of the IEEE, November 1998, DOI 10.1109/5.726791.37
8. Krizhevsky, Sutskever and Hinton, “ImageNet classification with deep convolutional neural networks” (2012)
Won ILSVRC-2012 with a 15.3% top-5 test error from a seven-network ensemble, against 26.2% for the runner-up; the single 60-million-parameter network scored 18.2% on validation.2 Look at: Table 2 and Figure 1. Proceedings page (opens in a new tab), Advances in Neural Information Processing Systems 25.38
9. He, Zhang, Ren and Sun, “Deep residual learning for image recognition” (2015)
Named the degradation problem and addressed it with shortcuts that are identities where dimensions match, reaching 152 layers and 3.57% top-5 test error with an ensemble. The cause of plain-network optimisation difficulty was left open.27 Look at: Figure 1 and Table 4. arXiv:1512.03385 (opens in a new tab), version 1 dated 10 December 2015.
10. Vaswani and colleagues, “Attention is all you need” (2017)
Replaced recurrence and convolution with multi-head scaled dot-product attention, reaching 28.4 and 41.8 BLEU on two WMT 2014 translation tasks (41.8 per the abstract and Table 2; section 6.1 gives 41.0 for French).28 Look at: Table 1. arXiv:1706.03762 (opens in a new tab). Language models built on it are in Next-token machines.
11. Szegedy and colleagues, “Intriguing properties of neural networks” (2013)
Reported adversarial examples and their transfer across models and training sets.29 Look at: section 4. arXiv:1312.6199 (opens in a new tab).
12. Goodfellow, Shlens and Szegedy, “Explaining and harnessing adversarial examples” (2014)
Proposed linearity in high dimensions as a mechanism, gave FGSM and used it for adversarial training.30 Look at: Figure 1. arXiv:1412.6572 (opens in a new tab), ICLR 2015.
13. Kingma and Ba, “Adam: a method for stochastic optimization” (2014)
Gave an optimiser built on bias-corrected moving averages of the gradient and its square; its claimed regret bound was later challenged by a convex counterexample.1617 Look at: Algorithm 1. arXiv:1412.6980 (opens in a new tab), ICLR 2015.
14. Srivastava, Hinton, Krizhevsky, Sutskever and Salakhutdinov, “Dropout: a simple way to prevent neural networks from overfitting” (2014)
Randomly drops units during training and approximates averaging over thinned networks at test time. Ioffe and Szegedy reported that batch normalisation sometimes removes the need for it.2122 JMLR 15(56):1929–1958 (opens in a new tab).
15. LeCun, Bengio and Hinton, “Deep learning” (2015)
A review covering backpropagation as the chain rule, ReLUs, local minima and saddles, and compositional hierarchies; Dauphin and colleagues study the delay that saddles cause.123 Look at: Figure 1. Nature 521, 436–444 (opens in a new tab), 28 May 2015, DOI 10.1038/nature14539.
Conclusion
A neural network is a composition of weighted sums and activation functions. McCulloch and Pitts showed that threshold units can express logic, Rosenblatt added adjustable connections, and the 1989 theorems showed that one hidden layer with a suitable nonlinear activation and a linear output can approximate any continuous function on a compact set arbitrarily well, while leaving the number of units and the search for weights open. Backpropagation computes the gradients, through the chain rule, that stochastic gradient descent and its relatives use to search. Exact-representation and depth-separation results show that some functions need far fewer units with depth, and whether natural data have the compositional structure that would make depth help generalisation is a hypothesis.
The engineering choices that mattered in the papers reviewed were rectified units, careful initialisation, GPUs, dropout and normalisation, residual shortcuts, and architectures that encode assumptions about the data: weight sharing, which gives feature maps that shift with the input under suitable stride and boundary conditions, gates for long memory, attention for direct interaction between positions. Why training succeeds on non-convex losses, and why batch normalisation helps, are still argued.
Gradients guide training, and an attacker with access to a model’s internals can, for a known differentiable computation and a specified objective, compute input gradients. Szegedy and colleagues described how small perturbations change labels, Goodfellow and colleagues proposed linearity as a mechanism, examples transfer between models, and defences that mask gradients have repeatedly been circumvented. A buyer or deployer should ask about the attacker’s access, the attacks used in testing, the perturbation set, and the provenance of the weights.
Footnotes
- Yann LeCun, Yoshua Bengio and Geoffrey Hinton, “Deep learning”, Nature 521, 436–444, 28 May 2015, DOI 10.1038/nature14539; text read from the authors’ hosted copy. https://www.cs.toronto.edu/~hinton/absps/NatureDeepReview.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14 ↩15 ↩16 ↩17 ↩18 ↩19 ↩20 ↩21
- Alex Krizhevsky, Ilya Sutskever and Geoffrey E. Hinton, “ImageNet classification with deep convolutional neural networks”, Advances in Neural Information Processing Systems 25 (NIPS 2012), paper PDF. https://papers.nips.cc/paper_files/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10
- Warren S. McCulloch and Walter Pitts, “A logical calculus of the ideas immanent in nervous activity”, Bulletin of Mathematical Biophysics 5, 115–133 (1943); the copy read is the 1990 reprint in Bulletin of Mathematical Biology 52, 99–115. https://www.cs.cmu.edu/~./epxing/Class/10715/reading/McCulloch.and.Pitts.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
- Frank Rosenblatt, “The perceptron: a probabilistic model for information storage and organization in the brain”, Psychological Review 65(6), 1958. Internet Archive snapshot of the PDF. https://web.archive.org/web/2023/https://www.ling.upenn.edu/courses/cogs501/Rosenblatt1958.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
- Frank Rosenblatt, Principles of Neurodynamics: Perceptrons and the Theory of Brain Mechanisms, 1962, chapter 5, “The Principal Convergence Theorem”. https://gwern.net/doc/ai/nn/1962-rosenblatt-principlesofneurodynamics.pdf (opens in a new tab) ↩1 ↩2
- Albert B. J. Novikoff, “On convergence proofs for perceptrons”, presented at the Symposium on the Mathematical Theory of Automata, Polytechnic Institute of Brooklyn, 24–26 April 1962, pp. 615–622. https://cs.uwaterloo.ca/~y328yu/classics/novikoff.pdf (opens in a new tab) ↩1 ↩2
- Léon Bottou, foreword to the reissue of Marvin Minsky and Seymour Papert, Perceptrons, MIT Press, 2017. https://leon.bottou.org/publications/pdf/perceptrons-2017.pdf (opens in a new tab) ↩
- Kurt Hornik, Maxwell Stinchcombe and Halbert White, “Multilayer feedforward networks are universal approximators”, Neural Networks 2, 359–366 (1989); received 16 September 1988, accepted 9 March 1989. https://cognitivemedium.com/magic_paper/assets/Hornik.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
- Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning, MIT Press, 2016, chapter 1, “Introduction”. https://www.deeplearningbook.org/contents/intro.html (opens in a new tab) ↩
- George Cybenko, “Approximation by superpositions of a sigmoidal function”, Mathematics of Control, Signals and Systems 2, 303–314 (1989), full text, Theorem 1 and the definitions of discriminatory and sigmoidal functions. https://papers.baulab.info/papers/Cybenko-1989.pdf (opens in a new tab) ↩1 ↩2
- George Cybenko, “Approximation by superpositions of a sigmoidal function”, Mathematics of Control, Signals and Systems 2, 303–314, December 1989, DOI 10.1007/BF02551274; the abstract is the part of the paper relied on here. Internet Archive snapshot of the Springer page, 2 January 2025. https://web.archive.org/web/20250102192406/https://link.springer.com/article/10.1007/BF02551274 (opens in a new tab) ↩1 ↩2
- Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning, MIT Press, 2016, chapter 6, “Deep feedforward networks”. https://www.deeplearningbook.org/contents/mlp.html (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
- Guido Montúfar, Razvan Pascanu, Kyunghyun Cho and Yoshua Bengio, “On the number of linear regions of deep neural networks”, arXiv:1402.1869, version 2 dated 7 June 2014. https://arxiv.org/abs/1402.1869 (opens in a new tab) ↩
- Matus Telgarsky, “Benefits of depth in neural networks”, Proceedings of Machine Learning Research 49 (COLT 2016), 1–23. https://proceedings.mlr.press/v49/telgarsky16.pdf (opens in a new tab) ↩
- David E. Rumelhart, Geoffrey E. Hinton and Ronald J. Williams, “Learning representations by back-propagating errors”, Nature 323, 533–536, 9 October 1986, DOI 10.1038/323533a0; the abstract is the part of the paper relied on here. https://www.nature.com/articles/323533a0 (opens in a new tab) ↩1 ↩2
- Diederik P. Kingma and Jimmy Ba, “Adam: a method for stochastic optimization”, ICLR 2015, arXiv:1412.6980. https://arxiv.org/abs/1412.6980 (opens in a new tab) ↩1 ↩2 ↩3
- Sashank J. Reddi, Satyen Kale and Sanjiv Kumar, “On the convergence of Adam and beyond”, ICLR 2018. https://openreview.net/references/pdf?id=HJRTlSAPf (opens in a new tab) ↩1 ↩2
- Xavier Glorot and Yoshua Bengio, “Understanding the difficulty of training deep feedforward neural networks”, Proceedings of the 13th International Conference on Artificial Intelligence and Statistics (AISTATS), 2010, PMLR 9. https://proceedings.mlr.press/v9/glorot10a/glorot10a.pdf (opens in a new tab) ↩
- Sepp Hochreiter and Jürgen Schmidhuber, “Long short-term memory”, Neural Computation 9, 1735–1780 (1997). https://deeplearning.cs.cmu.edu/F23/document/readings/LSTM.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
- Vinod Nair and Geoffrey E. Hinton, “Rectified linear units improve restricted Boltzmann machines”, Proceedings of the 27th International Conference on Machine Learning, Haifa, 2010. https://www.cs.toronto.edu/~hinton/absps/reluICML.pdf (opens in a new tab) ↩
- Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever and Ruslan Salakhutdinov, “Dropout: a simple way to prevent neural networks from overfitting”, Journal of Machine Learning Research 15(56), 1929–1958, 2014. https://jmlr.org/papers/v15/srivastava14a.html (opens in a new tab) ↩1 ↩2
- Sergey Ioffe and Christian Szegedy, “Batch normalization: accelerating deep network training by reducing internal covariate shift”, arXiv:1502.03167, version 3 dated 2 March 2015. https://arxiv.org/abs/1502.03167 (opens in a new tab) ↩1 ↩2 ↩3 ↩4
- Yann N. Dauphin, Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, Surya Ganguli and Yoshua Bengio, “Identifying and attacking the saddle point problem in high-dimensional non-convex optimization”, arXiv:1406.2572, 10 June 2014. https://arxiv.org/abs/1406.2572 (opens in a new tab) ↩1 ↩2
- Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas and Aleksander Madry, “How does batch normalization help optimization?”, arXiv:1805.11604. https://arxiv.org/abs/1805.11604 (opens in a new tab) ↩
- Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning, MIT Press, 2016, chapter 9, “Convolutional networks”. https://www.deeplearningbook.org/contents/convnets.html (opens in a new tab) ↩1 ↩2
- Yann LeCun, Léon Bottou, Yoshua Bengio and Patrick Haffner, “Gradient-based learning applied to document recognition”, Proceedings of the IEEE, November 1998, DOI 10.1109/5.726791; figures taken from this readable copy of the paper. http://vision.stanford.edu/cs598_spring07/papers/Lecun98.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
- Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian Sun, “Deep residual learning for image recognition”, arXiv:1512.03385, version 1 dated 10 December 2015. https://arxiv.org/abs/1512.03385 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10
- Ashish Vaswani and others, “Attention is all you need”, arXiv:1706.03762, version 7 dated 2 August 2023. https://arxiv.org/abs/1706.03762 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8
- Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow and Rob Fergus, “Intriguing properties of neural networks”, arXiv:1312.6199, version 4 dated 19 February 2014. https://arxiv.org/abs/1312.6199 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8
- Ian J. Goodfellow, Jonathon Shlens and Christian Szegedy, “Explaining and harnessing adversarial examples”, ICLR 2015, arXiv:1412.6572, version 3 dated 20 March 2015. https://arxiv.org/abs/1412.6572 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8
- Nicholas Carlini and David Wagner, “Towards evaluating the robustness of neural networks”, arXiv:1608.04644 (cited as 2017 in later papers). https://arxiv.org/abs/1608.04644 (opens in a new tab) ↩1 ↩2
- Anish Athalye, Nicholas Carlini and David Wagner, “Obfuscated gradients give a false sense of security: circumventing defenses to adversarial examples”, Proceedings of the 35th International Conference on Machine Learning, PMLR 80, 2018; arXiv:1802.00420, version 4 dated 31 July 2018. https://arxiv.org/abs/1802.00420 (opens in a new tab) ↩1 ↩2 ↩3
- Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras and Adrian Vladu, “Towards deep learning models resistant to adversarial attacks”, arXiv:1706.06083. https://arxiv.org/abs/1706.06083 (opens in a new tab) ↩1 ↩2 ↩3 ↩4
- Jeremy Cohen, Elan Rosenfeld and J. Zico Kolter, “Certified adversarial robustness via randomized smoothing”, arXiv:1902.02918, version 2 dated 15 June 2019. https://arxiv.org/abs/1902.02918 (opens in a new tab) ↩1 ↩2
- Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z. Berkay Celik and Ananthram Swami, “Practical black-box attacks against machine learning”, arXiv:1602.02697. https://arxiv.org/abs/1602.02697 (opens in a new tab) ↩1 ↩2
- Tianyu Gu, Brendan Dolan-Gavitt and Siddharth Garg, “BadNets: identifying vulnerabilities in the machine learning model supply chain”, arXiv:1708.06733, version 2 dated 11 March 2019. https://arxiv.org/abs/1708.06733 (opens in a new tab) ↩1 ↩2
- The same paper as hosted by Yann LeCun; its text layer is damaged, so the figures were taken from the other copy. http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf (opens in a new tab) ↩
- Proceedings page for the same paper. Its abstract gives 1.3 million images and ILSVRC-2010 error rates of 39.7% and 18.9%, whereas the paper PDF gives 1.2 million images and 37.5% and 17.0%; the PDF figures are used above. https://papers.nips.cc/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html (opens in a new tab) ↩

SecSIG