KatInterview

Which Fix Fails to Cure Vanishing Gradients in Deep Nets?

Machine LearningModel answer
MediumModel answerMachine Learningdeep-learningvanishing-gradientsbackpropagation

Last updated

Pick the option that does not reliably address vanishing gradients in a deep network and justify it, while assessing how the other three techniques work and where they fall short.

You are training a deep feed-forward network and notice that the early layers barely update, while the layers near the output learn normally. Training loss plateaus well above where it should be.

Four changes are proposed:

  1. Add skip (residual) connections between layers.
  2. Switch to an activation function such as ReLU.
  3. Increase the learning rate.
  4. Insert batch normalization between layers.

Tasks

  • Identify which one is not a reliable remedy for vanishing gradients.
  • Explain the mechanism behind your choice, using how gradients flow backward through the network.
  • For each of the other three, explain how it helps and what its limitations are (it may help without being a guaranteed cure).

Hints

Hint 1

Write the gradient reaching an early layer as a product of per-layer Jacobians and activation derivatives. What happens to this product when each factor is smaller than 1 in magnitude?

Hint 2

The learning rate multiplies the gradient. Ask whether scaling a quantity can fix the fact that its magnitude differs by orders of magnitude between layers, and what else a larger step size might break.

Hint 3

For the other three options, ask what each does to the per-layer factor in that product: give it a path with derivative near 1, avoid saturation, or keep pre-activations in a well-scaled range.