The Vanishing Gradient Problem
Training a deep network is like a game of telephone; the error signal (gradient) gets weaker as it's passed back through layers. This happens in deep networks using sigmoid or tanh activations.
WHY IT EXISTS: Deep neural networks learn by propagating an error signal from the final layer all the way back to the first. This process, backpropagation, uses the chain rule of calculus, which involves multiplying gradients from each layer. If these gradients are consistently small numbers, their product shrinks exponentially, causing the signal to disappear.
THE MENTAL MODEL: Think of training a deep network like a game of telephone. The last person in line (the output layer) detects an error and whispers a correction to the person before them. That person relays the message backward, and so on. With each step, the message (the gradient) gets a little distorted and fainter. By the time it reaches the first few people (the input layers), it's too quiet to understand, so they don't change their behavior.
HOW IT WORKS: During backpropagation, the update for a weight in an early layer is proportional to the product of derivatives from all subsequent layers. Activation functions like the hyperbolic tangent (tanh) or sigmoid have derivatives in the range [0, 1]. Multiplying many numbers in this range results in an exponentially smaller value. Consequently, the gradients for the earliest layers become so small they effectively vanish, and those layers stop learning.
WHEN TO USE IT: This is not a technique to use, but a problem to be aware of. It's most prominent in very deep feed-forward networks or in Recurrent Neural Networks (RNNs) unrolled over many time steps. It is particularly triggered by using saturating activation functions like sigmoid and tanh, whose derivatives are small across most of their domain.
WHEN NOT TO USE IT: The problem is less severe in shallower networks. Modern architectures actively mitigate it. For example, using non-saturating activation functions like ReLU (Rectified Linear Unit), whose derivative is a constant 1 for positive inputs, prevents the signal from shrinking. Another solution is architectural, like the residual connections in ResNets which create a 'shortcut' for the gradient to bypass layers, allowing it to flow more freely.
ONE CANONICAL EXAMPLE: Imagine a 20-layer network using the tanh activation function. The derivative of tanh is always ≤ 1. To update a weight in the first layer, backpropagation multiplies at least 19 of these derivative values. Even if each derivative is a relatively high 0.5, the resulting gradient for the first layer is scaled by 0.5^19, a number close to zero. The resulting weight update is minuscule, and the layer effectively stops training.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.