Lesson 11.1 · 7 min read · about 50 min to master at a very slow pace
Depth versus Width
More layers or more units per layer? How depth and width differ in expressive power, parameter count and trainability, and why most successful networks are deep rather than very wide.
Two ways to add capacity
| More depth (layers) | More width (units per layer) | |
|---|---|---|
| Expressive power | Builds hierarchical, compositional features; some functions need far fewer units when built deep | More features at the same level of abstraction; a shallow net may need exponentially many units for the same function |
| Parameters | Grow roughly linearly with the number of layers | Grow with the product of adjacent widths: doubling two adjacent layers quadruples their weights |
| Training | Harder: vanishing or exploding gradients, more sequential computation | Easier to optimise, highly parallel |
| Main risk | Optimisation difficulty | Overfitting from sheer parameter count |
Why depth usually wins
The universal approximation theorem says one wide hidden layer can represent any continuous function, but possibly with an enormous number of units. Composing layers lets a network reuse intermediate features (lesson 3.3), so it represents structured functions such as images, speech and language much more efficiently. In practice, depth often contributes more to useful expressive power than width.
Making depth trainable
- ReLU activations, to avoid vanishing gradients (Section 4).
- Careful initialisation and normalised inputs.
- Batch normalisation and residual (skip) connections, which let very deep networks train well (beyond this course).
A balanced answer
"Depth gives hierarchical features and can be exponentially more efficient than width, but is harder to optimise. Width is easier to train but adds parameters fast and risks overfitting. Modern networks are deep, with ReLU, normalisation and residual connections to keep them trainable."
Stuck? Common doubts
Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.
First passSo should I always make my network as deep as possible?
No. Extra depth only helps if the problem has structure to exploit and you can train it. For small tabular datasets, two or three hidden layers are usually plenty; deeper networks mostly add training trouble and overfitting risk. Let validation performance decide.
First passHow do I answer a "trade-offs between depth and width" question?
Use the layout two options × two criteria (power, cost) + a verdict.
| Deeper (more layers) | Wider (more neurons per layer) | |
|---|---|---|
| Power | Features of features: edges → shapes → objects | More features at the same level |
| Efficiency | The same function with far fewer neurons | May need exponentially more neurons |
| Training | Harder: vanishing gradients (eased by ReLU, batch norm, residual connections) | Easier and more stable |
| Speed | Slower: layers run one after another | Faster on GPUs: a layer's neurons run in parallel |
| Risk | Both add parameters, so both can overfit | |
Link it to the universal approximation theorem: one wide layer is enough in theory, but the theorem says nothing about how many neurons that takes. Verdict: depth gives more power per parameter, so modern networks go deep and use ReLU, batch norm and residual connections to keep them trainable.
Memory line: "Deep is efficient but hard to train. Wide is easy to train but wasteful."
Cheatsheet
Depth vs width
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.