Tiny crafted vs. large random: why direction matters more than size

In the paper’s Figure 7, MNIST digits buried in heavy random noise are still read correctly much of the time, while adversarial digits that look almost untouched are always misread. The two kinds of change differ not in how big they are, but in which way they point. Below: the same comparison at every size, the arithmetic of high dimensions behind it, and the paper’s bound on how much each layer can stretch a change.

1. Error rate as the change grows, random vs. along the gradient

networkloading digits and networks…
Error rate against the size of the changeThe fraction of 200 test digits the network gets wrong after adding a change of each size: Gaussian noise, and a change of the same size along the gradient of the loss.

2. The arithmetic of many dimensions

number of inputs n784
Aligned versus random changes in n dimensionsFor a linear unit w·x with n inputs, the change in its output when every input moves by epsilon: in the direction of sign(w), and in random directions.

3. How much can each layer stretch a change? (the paper’s Section 4.3)

Part 1. For each size σ (the root-mean-square change per pixel, the paper’s distortion measure), every test digit gets either Gaussian noise of that size, clipped to the 0–1 pixel range, or a change of the same length pointing straight down the gradient of the loss for its true label: one gradient computed through the network to the input, scaled to length σ·√784. The gradient direction is only the first step of a real attack (the paper’s search does better), and it already needs a change many times smaller than noise to do the same damage.
Part 2. A unit computes w·x. Move every input by ±ε. If the signs are random, the changes wiε mostly cancel and the total grows only like ε√n. If every sign agrees with sign(wi), nothing cancels and the total is εΣ|wi|, which grows like εn. The ratio grows like √n: about 22 for MNIST, about 310 for a 224×224 color image. So a change too small to see on any one pixel can move the unit a lot, if it is aligned. This is the “linear explanation” of Goodfellow et al. 2015, and it is why a random perturbation is nearly useless: in n dimensions a random direction is almost perpendicular to any given one, with |cos| around 1/√n, which answers Tianyu’s question. The network’s sensitivity is very uneven across directions, and the gradient is how you find the sensitive ones.
Part 3. Szegedy et al. bound how far a change can travel. A layer with weights W can stretch a change by at most its largest singular value ‖W‖; a sigmoid can shrink it but never stretch it by more than its largest slope, 1/4; so the whole network can stretch a change by at most the product. A large product does not prove a network is unstable (the bound may be loose), but it shows there is room: the largest-stretch directions exist, and gradient search finds them. The paper computed these bounds for the convolutional layers of AlexNet (Table 5) and suggested regularizing them; later work on Lipschitz and spectral-norm regularization took up that idea. Sai asked whether depth makes this worse: the bound is a product over layers, so it can grow with depth, though the measured stretch need not.