The Modern Mathematics of Deep Learningexplained for non-mathematicians

Finding better settings

We know how a gradient tells weights which way to move. But when a network has many weights, the surface of possible losses can twist, flatten and contain several valleys.

This chapter asks why training often makes progress anyway, and why adding many neurons can sometimes make the search easier to analyze.

5.1 The shape of training loss

Loss landscape analysis · paper pp. 39–41

Training changes the network settings to reduce loss, a number that measures mistakes. For one weight w, draw its value across a page and its loss L(w) upward. The slope tells us how loss changes when w changes a little: a positive slope means increasing w raises loss. With many weights, the gradient collects these slopes; backpropagation calculates them by working backward through the network.

A hidden neuron multiplies inputs by weights, adds a bias, then applies a rule called an activation. ReLU is an activation that replaces negative numbers with zero. The output adds the neurons’ results after multiplying each by an output weight.

The two hidden neurons contribute 3 and 0 to the output.

From the paper

Φ(x,θ)=∑j=1nθj(2)ϱ(⟨θj(1),[x;1]⟩)\Phi(x,\theta)=\sum_{j=1}^{n}\theta^{(2)}_j\varrho(\langle\theta^{(1)}_j,[x;1]\rangle)
Φ(2)=3ReLU⁡(2−1)+2ReLU⁡(−2+1)=3\Phi(2)=3\operatorname{ReLU}(2-1)+2\operatorname{ReLU}(-2+1)=3
function networkOutput(x) {
  return { output: 3 * Math.max(0, x - 1) + 2 * Math.max(0, -x + 1) };
}
const result = networkOutput(2);

Choose a change. Predict, then run.

Result:
Enable JavaScript to run this example.

Go deeper in Concepts paper pp. 40 (5.1)

A flower-counting dial

Made-up example

Explore

Find the lowest loss among the six marked integer settings.

Tap the illustration or use the buttons

Error landscapeSetting 4 · error 1.2Actual flowers3 flowersMachine guess≈4.095Flowers
Dial setting

Current: 4; Error: 1.2

In the formula x is the input, θ holds weights and biases, n counts hidden neurons, and ρ is the activation. The notation [x; 1] appends 1 to the inputs. Multiplying that 1 by the bias and adding it includes the bias in the same weighted sum. Changing θ changes the loss and traces a landscape of possible losses.

In a flat place, nearby changes barely affect loss. A valley bottom is a local minimum: nearby settings do not have lower loss. A saddle can be a bottom in one direction but a top in another. The paper asks why training often finds useful settings despite these shapes. Some results connect wide networks by paths where loss rises very little.

Other arguments compare simplified loss landscapes with models from statistical physics, which studies how many interacting parts behave together. Those comparisons need assumptions about the landscape that practical networks may not satisfy. A local minimum need not be the lowest loss among all possible settings.

5.2 When parameters move only a little

Lazy training and provable convergence of stochastic gradient descent · paper pp. 41–44

It sounds as though a network must move its weights far to learn something new. Surprisingly, for certain very wide networks, the many weights can each move only a little and still change the output enough.

Try the simpler rule f(w) = w² near w = 2. At 2 the result is 2² = 4; at 2.1 it is 2.1² = 4.41. We can estimate the change using the slope at 2.

The nearby straight-line estimate is 4.4; the exact answer is 4.41.

From the paper

Φlin(⋅,θ)=Φ(⋅,Θ0)+⟨∇θΦ(⋅,Θ0),θ−Θ0⟩\Phi^{\mathrm{lin}}(\cdot,\theta)=\Phi(\cdot,\Theta_0)+\langle\nabla_\theta\Phi(\cdot,\Theta_0),\theta-\Theta_0\rangle
w=2,Δ=0.1:flinear=4.4,f=4.41w=2,\quad \Delta=0.1:\quad f_{\rm linear}=4.4,\quad f=4.41
function linearApproximation(weight, change) {
  const linear = weight ** 2 + 2 * weight * change;
  const exact = (weight + change) ** 2;
  return { linear, exact };
}
const result = linearApproximation(2, 0.1);

Choose a change. Predict, then run.

Result:
Enable JavaScript to run this example.

Go deeper in Concepts paper pp. 24

Small prediction changes

Made-up example

Explore

Predict how many 0.1 corrections take a guess from 2 to 3.

Actual flowers3 flowersMachine guess?0 small adjustments
Corrections

Input: 2; Corrections: 0.1

Start with 2² = 4. The slope at 2 is 4, so for a change of 0.1 the estimated change is 4×0.1 = 0.4. Adding it gives 4.4, close to the exact 2.1² = 4.41. Why? For a small change Δ, (2 + Δ)² = 4 + 4Δ + Δ²; the estimate leaves out the small Δ². In the network formula Θ₀ is the starting setting, θ is the new setting, and the gradient lists the starting rate of change for each parameter.

The paper uses this local straight-line approximation for a network near its starting weights. For sufficiently wide networks with suitable initialization and other stated assumptions, researchers can show that this approximation remains useful during training.

In these special regimes, gradients can be strong enough to reduce training loss reliably without weights traveling far. That helps explain some convergence results; it does not prove all networks train successfully or that tiny weight changes always generalize.

For some networks with many neurons and carefully chosen starting weights, small changes help explain steady training progress. Other networks can behave differently. Next we ask how the arrangement of connections can help the calculation.

Try the chapter quiz

1. What is a loss?

2. A loss depends on a dial. What does a gradient indicate?

3. Many model components each change only a little. What can their combined change do?

An independent educational explanation of The Modern Mathematics of Deep Learning — Julius Berner, Philipp Grohs, Gitta Kutyniok, Philipp Petersen. Examples use invented numbers unless a measured dataset is credited.