Foundations to Frontier
Tests
B. Statistical Learning Theory › B4 Theory of deep learning

Depth vs Width: Expressivity

Why deep networks? Some functions that a deep network computes with a handful of neurons per layer need exponentially many neurons in a shallow one. This topic proves Telgarsky's depth separation with the sawtooth (composed tent maps), counts linear regions of ReLU networks (one hidden layer gives at most a hyperplane-arrangement count, while depth multiplies), surveys other separations (Eldan–Shamir, polynomials) and width lower bounds (narrow nets of width ≤ d can't be universal). The research exercise shows the other side: random networks typically realize only about as many linear regions as they have neurons, whatever their depth (Hanin–Rolnick).

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Folding paper

Fold a strip of paper in half, then in half again, and again. After 10 folds it has over a thousand layers, from just 10 simple actions. A deep network can do the same: each layer “folds” its input, and folds compound. A shallow network can only add pieces side by side, so matching 10 folds would take over a thousand of its pieces. Depth multiplies complexity, while width only adds it.

Depth multiplies, width adds
8 neurons in 4 layers: 16 linear pieces · a one-hidden-layer net with 8 neurons: at most 9 (dashed: its best try through 10 knots)
Each tent layer folds the interval in half, so k layers fold it 2ᵏ times: exponential pieces from linear neurons. To match that, a shallow network needs 2ᵏ units (Telgarsky's depth separation). But this is the best case: a randomly initialized deep net of the same size typically has about as many pieces as neurons (switch to "random"), and training rarely creates exponentially many. Depth's advantage is real but has to be earned.
Why engineers care

Depth explains why compact deep networks fit onboard hardware yet represent complex perception and control functions. The flip side matters too: a network’s theoretical capacity is far from what training actually uses, which affects verification. Counting linear regions bounds the cost of exactly verifying a ReLU controller.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Each extra layer can…
  2. 2. A shallow network adds pieces…
  3. 3. Do random deep networks usually use their full exponential capacity?

Level 1: Beginner

★★☆☆☆ Basic⏱ 25 minSecondary-school mathematics: arithmetic and elementary algebra.

The tent map is one ReLU layer

T(x)=2 relu(x)−4 relu(x−12)={2xx≤122−2xx≥12on [0,1].T(x) = 2\,\mathrm{relu}(x) - 4\,\mathrm{relu}(x - \tfrac12) = \begin{cases}2x & x\le\tfrac12\\ 2 - 2x & x\ge\tfrac12\end{cases}\quad\text{on }[0, 1].

Composing k copies, T(k)=T∘⋯∘TT^{(k)} = T\circ\cdots\circ T, gives a sawtooth with 2k−12^{k-1} teeth and 2k2^k linear pieces, using only 2 neurons per layer (2k in total).

Shallow networks count pieces additively

A one-hidden-layer ReLU net on a 1-D input with N units has at most N + 1 linear pieces. So representing T(k)T^{(k)} exactly needs at least 2k−12^k - 1 units: exponentially more than the deep net’s 2k.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Linear pieces of T∘T∘T:
  2. 2. Max pieces of a 1-D shallow net with 48 units:
  3. 3. Neurons used by the depth-10 sawtooth:

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

Telgarsky’s depth separation

For every k there is a function computed by a ReLU net with O(k³) layers and O(1) width per layer, such that any net with O(k) layers needs Ω(2k)\Omega(2^k) units even to approximate it in L1L^1 to constant accuracy. The proof shows that a net with few pieces crosses ½ few times, so it must be far from a function that oscillates 2k2^k times.

Counting regions in higher dimensions

  • One hidden layer, n units on Rd\mathbb R^d: at most ∑i=0d(ni)\sum_{i=0}^d\binom ni regions (a hyperplane arrangement), which is polynomial in n.
  • L layers of width n: up to roughly (n/d)d(L−1)nd(n/d)^{d(L-1)}n^d (Montúfar et al., 2014), exponential in depth.

Other separations and limits

  • Eldan–Shamir: a radial function in Rd\mathbb R^d is easy for 3 layers but needs exp(d) width with 2 layers.
  • Width lower bound: ReLU nets of width at most d (the input dimension) are not universal, while width d + 1 suffices with unlimited depth (Hanin–Sellke; Lu et al.).
  • Multiplication and high-degree polynomials are much cheaper with depth.
🐍 Exercise 1: the sawtooth separation
Build the tent map as a 2-unit ReLU layer, compose it, count linear pieces for depth 1–8, then fit the depth-6 sawtooth with shallow piecewise-linear functions of N equal pieces (least squares) and find how many units a shallow net needs.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Regions of 3 lines in general position in the plane:
  2. 2. ReLU nets of width ≤ d on d-dimensional input are…
  3. 3. Eldan–Shamir separates…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Proof that shallow nets can’t follow the sawtooth

Let g be piecewise linear with p pieces. On each piece, g − ½ changes sign at most once, so g crosses ½ at most p times. T(k)T^{(k)} crosses ½ exactly 2k2^k times, alternating above and below. If p≪2kp\ll2^k, then on most of the 2k2^k intervals between crossings, g sits on one side of ½ while T(k)T^{(k)} spends a triangle of area Θ(2−k)\Theta(2^{-k}) on the other side. Summing gives an L1L^1 error bounded below by a constant. ∎

Why typical networks are simpler

Hanin and Rolnick (2019): for networks at (and after) standard initialization, the expected number of regions along a line, per unit length, is about the total number of neurons, independent of depth. Exponential region counts need finely tuned weights like the tent map’s. Expressivity is an upper bound, not what gradient descent delivers by default.

📝 Quick check (Level 3)
0/3 answered
  1. 1. A function with p linear pieces crosses ½ at most…
  2. 2. Hanin–Rolnick: typical regions per unit length scale with…
  3. 3. The sawtooth needs carefully chosen weights because…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Depth, measured

Exercise 1. The tent compositions have exactly 2, 4, 8, …, 256 pieces for depth 1–8. Fitting the depth-6 sawtooth (12 neurons) with N equal pieces gives RMSE 0.2888 for N = 8, 16 and 32, no better than the constant ½ (0.2888). At N = 63 it is 0.213, and at N = 64 it is exact (7 × 10⁻¹⁶). A shallow net needs 64 units where the deep one used 12.

Exercise 2: what random networks do. With 48 He-initialized neurons split over depth 1–12, the mean number of regions on [−3, 3] is 48.2, 47.6, 49.4, 39.6, 50.2, 41.0 and 31.2. That is about the neuron count, and it doesn’t grow with depth (very deep, narrow nets even lose some to dead units). The hand-built sawtooth nets reach 16, 256 and 1024 regions at depth 4, 8 and 10 with only 2 neurons per layer: 20 times more than any random net here, with fewer neurons.

🐍 Exercise 2 (research): linear regions of random vs hand-built networks
Count linear regions along a line through activation-pattern changes for random ReLU nets with a fixed neuron budget at different depths, and for the hand-built sawtooth net. Compare typical with best-case expressivity.

Depth in AI, robotics and aerospace

  • Architecture choices: deep, moderately wide networks are the norm for perception and control.
  • Verification cost: exact ReLU verification (MILP and reachability) scales with the number of regions, which is usually far below the worst case.
  • Hierarchical features: depth composes features (edges → parts → objects), a structural prior beyond raw expressivity.
  • Embedded inference: compact deep networks beat wide shallow ones for the same latency budget.

References

  1. M. Telgarsky (2016). “Benefits of depth in neural networks.” COLT.
  2. G. Montúfar, R. Pascanu, K. Cho, Y. Bengio (2014). “On the number of linear regions of deep neural networks.” NeurIPS.
  3. R. Eldan, O. Shamir (2016). “The power of depth for feedforward neural networks.” COLT.
  4. B. Hanin, D. Rolnick (2019). “Complexity of linear regions in deep networks.” ICML.
  5. Z. Lu, H. Pu, F. Wang, Z. Hu, L. Wang (2017). “The expressive power of neural networks: a view from the width.” NeurIPS.