Why deep networks can stop learning: vanishing gradients

During training, the error signal (the gradient) travels backwards from the output to the first layer. At every layer it gets multiplied by that layer's slope. With the old sigmoid activation, the slope is at most 0.25, so after many layers the signal shrinks to almost nothing and the early layers stop learning. This is the vanishing gradient problem. Modern networks use ReLU (slope 1 for active neurons) and other tricks, so the signal survives.

Everyday analogy

A game of Chinese whispers in a long line: if each person passes on only a quarter of what they heard, the message is lost long before it reaches the start of the line.

Example

Train a 10-layer network both ways: with sigmoid, the first layers barely change and the network learns slowly; with ReLU, every layer keeps learning.

Learning signal reaching each layerLayer 10100%Layer 850%Layer 625%Layer 412%Layer 26%Layer 13%
The learning signal shrinks as it travels back through each layer, so the first layers barely learn.

How much of the learning signal reaches each layer (simplified)

LayerWith sigmoid (× 0.25 each layer)With ReLU (× 1 for active neurons)
Layer 10 (next to the output)100%100%
Layer 925%100%
Layer 86%100%
Layer 60.4%100%
Layer 1 (the first layer)about 0.0004%: almost nothingstill strong

Real networks are more complex, but this is why the switch to ReLU, along with techniques like residual connections and normalisation, made very deep networks (and today's LLMs) possible.

Try it yourself

About 5 min

Watch a signal fade

  1. Start with the number 1.
  2. Multiply it by 0.5 ten times (a calculator helps) and write each result.
  3. Now multiply 1 by 1.0 ten times and compare.

What you should see: With 0.5 the signal almost disappears after 10 layers. That is the vanishing gradient problem.

Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.

Build it for real · guided projectTeach a neural network to read handwritingAbout 60 min · Copy-paste code · step by step
Test what you learned

Take a quick quiz, or look up any word in the glossary.