Capped at Three

BackpropagationHard+30 XP+30

Capped at Three

A model has been training calmly until one weight, www, lands somewhere very steep. For this problem, treat the loss as depending on that weight alone:

L(w)=5w2,dLdw=10wL(w) = 5w^2, \qquad \frac{dL}{dw} = 10wL(w)=5w2,dwdL​=10w

The lowest loss is at w=0w = 0w=0. The weight is currently w=1w = 1w=1, and it is trained by gradient descent with learning rate 0.30.30.3:

w←w−0.3 gw \leftarrow w - 0.3\, gw←w−0.3g

where ggg is the gradient used for the update.

With plain gradient descent, g=10wg = 10wg=10w and the weight goes 1,−2,4,−8,16,…1, -2, 4, -8, 16, \dots1,−2,4,−8,16,… Each update overshoots further than the last, flipping sign and growing, and the run is heading for NaN.

The team switches on gradient clipping with a limit of 333. Before every update, if ∣g∣>3|g| > 3∣g∣>3 the gradient is replaced by 333 with the same sign, so a gradient of 101010 becomes 333 and a gradient of −7-7−7 becomes −3-3−3. If ∣g∣≤3|g| \le 3∣g∣≤3 it is left exactly as it is. The loss, the learning rate and the starting point w=1w = 1w=1 all stay the same.

With clipping on, what does www do in the long run?

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.

Select all that apply.