The Modern Mathematics of Deep Learningexplained for non-mathematicians

Why add more layers?

One layer can combine simple clues. Can a second, third or tenth layer make some rules using fewer neurons than one very wide layer?

We will draw a line shaped like a tent roof, then use its output as the input to the same rule again. Watch how a few repeated steps create more peaks.

3.1 A rule based on distance

Approximation of radial functions · paper pp. 29–31

Why would a network need several layers? Imagine a lamp in the middle of a circular garden. The light at a flower depends only on how far it is from the lamp, not whether it is left or right.

Consider the toy rule that returns distance from the origin. Points (3, 4) and (0, 5) lie at the same radius.

At the default values, both outputs are 5 despite different positions.

Definition / paper rule

f(x)=∥x∥2=x12+x22f(x)=\|x\|_2=\sqrt{x_1^2+x_2^2}
f(3,4)=9+16=5,f(0,5)=5f(3,4)=\sqrt{9+16}=5,\quad f(0,5)=5
function distances(firstPoint, secondPoint) {
  const first = Math.sqrt(firstPoint[0] ** 2 + firstPoint[1] ** 2);
  const second = Math.sqrt(secondPoint[0] ** 2 + secondPoint[1] ** 2);
  return { first, second };
}
const result = distances([3, 4], [0, 5]);

Choose a change. Predict, then run.

Result:
Enable JavaScript to run this example.

Go deeper in Concepts paper pp. 29

A lamp and a flower

Made-up example

Explore

Find a different position with the same light as position 2.

Tap the illustration or use the buttons

Garden lampDistance 3 · light 2
Flower position

Position: 2; Distance: 3; Light: 2

For the point (3, 4), square and add: 3×3 + 4×4 = 25. Since 5×5 = 25, the square root is 5, its distance from (0, 0). The lamp activity uses a different center, at 5: flowers at 3 and 7 are both 2 units away, so they get the same light.

The paper constructs a special rule based on distance. A three-layer network can approximate it with manageable size. For a particular class of two-layer networks, comparable accuracy needs exponentially more hidden neurons: the required number can grow by repeated multiplication as the problem size grows.

This is a mathematical separation for a specially constructed target and distribution under the theorem’s assumptions. It does not say every deep network beats every shallow network.

3.2 Simple pieces, many layers

Deep ReLU networks · paper pp. 31–32

ReLU uses only straight pieces: it keeps positive values and clips negative ones. Combining several ReLU terms can make a line rise, turn and fall, like a small tent.

Combine two shifted ReLUs in the paper’s hat function, defined for inputs from 0 to 1. Try 0, 0.5 and 1.

The pieces join to make a tent. Composing such rules can produce more pieces.

From the paper

h(x)=2ϱR(x)−4ϱR(x−12),x∈[0,1]h(x)=2\varrho_R(x)-4\varrho_R(x-\tfrac12),\quad x\in[0,1]
h(0)=0,h(0.5)=1,h(1)=0h(0)=0,\quad h(0.5)=1,\quad h(1)=0
function tent(value) {
  return 2 * Math.max(0, value) - 4 * Math.max(0, value - 0.5);
}
function tentExamples(value, inputs) {
  const examples = [];
  for (const input of inputs) examples.push(tent(input));
  return { output: tent(value), examples };
}
const result = tentExamples(0.5, [0, 0.5, 1]);

Choose a change. Predict, then run.

Result:
Enable JavaScript to run this example.

Go deeper in Concepts paper pp. 31

A lamp rule

Made-up example

Explore

Find the brightest position from 0 to 4.

Tap the illustration or use the buttons

Desk lampBrightness 1Brightness ruleSlider 1
Lamp position

Position: 1; Light: 1

Try x = 0.25. The first part gives 2×0.25 = 0.5; the second sees 0.25 − 0.5 = −0.25, so ReLU makes it 0. Thus h(0.25) = 0.5. At x = 0.75, the parts give 1.5 and 4×0.25 = 1, so h(0.75) = 0.5 too. Feed 0.5 back in: h(0.5) = 1. Repeating the rule can double the number of peaks.

The lamp illustration shows a similar rise and fall on a larger scale, from 0 to 4 with a peak at 2. The paper’s tent runs from 0 to 1 and peaks at 0.5. In the next activity, the unit-interval tent is fed through itself again.

That efficiency helps certain deep networks approximate curved functions, including multiplication, by piecing together many short straight segments. It is a statement about representing a function, not automatically about finding the weights during training.

3.3 Other ways to measure possibility

Alternative notions of expressivity · paper pp. 32–34

We have measured networks by how closely they can match a target. Another way to measure their possibilities is to count how often the direction of their output curve can change.

Walk from 0 to 3, then back to 1: three steps forward and two back. Add both distances to measure the whole path, not just the distance between its ends.

The path travels 5 units even though its endpoints are only 1 unit apart.

Definition / paper rule

ℓ=∑i∣xi+1−xi∣\ell=\sum_i |x_{i+1}-x_i|
ℓ=∣3−0∣+∣1−3∣=5,∣1−0∣=1\ell=|3-0|+|1-3|=5,\quad |1-0|=1
function journey(middle, end) {
  const length = Math.abs(middle) + Math.abs(end - middle);
  return { length, netChange: end };
}
const result = journey(3, 1);

Choose a change. Predict, then run.

Result:
Enable JavaScript to run this example.

Go deeper in Concepts paper pp. 33

Fold a path

Made-up example

Explore

Make 8 straight pieces by composing folds.

Tap the illustration or use the buttons

Folded paper profile2 straight pieces←→
Folds
1

Steps: 1; Pieces: 2

One tent has two straight segments. Passing its output through the tent again gives four; doing so once more gives eight. After k compositions this constructed rule has 2^k pieces; this does not count every function a k-layer network can produce.

Each ReLU neuron changes behavior when its weighted input crosses zero. Stacking layers can split and fold the space into many regions where the network follows different straight rules.

The paper also studies how a curve drawn in input space can stretch as it passes through random layers. Such results need specific initialization assumptions; seeing a busy curve in a drawing is not itself a theorem.

Depth can represent certain complicated rules more efficiently by reusing smaller calculations. It does not grant automatic accuracy or easy training. Next we face a harder question: what if our input is a list with hundreds of coordinates?

Try the chapter quiz

1. What is network depth?

2. What does ReLU output for a negative input?

3. A drawing machine can make some shapes but not others. What does that tell us?

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.