Consider momentum with coefficient : and . Without a spike the gradient is 1 at every step. At step 1 a spike adds to the gradient, so and for every .
Derive a closed form for . Show that the spike's contribution to is , and that this contribution decays geometrically. Then compute the excess velocity over the no-spike run after 5 steps and after 10 steps, for and , to four decimal places. Explain what the result says about reading a loss spike from the loss curve, connecting sections 20.5 and 20.6.
This tier asks for a derivation, so there is no automatic checker. Write your answer, then open the worked solution and compare.
Worked solution
Unrolling gives With and for , split the sum: The baseline is a finite geometric series, . The spike appears once, at step 1, and every later step multiplies its contribution by , so its contribution at step is .
For and :
- At step 5, the baseline is , and the spike contributes . The total is 7.3756, and the excess over the no-spike run is 3.2805.
- At step 10, the baseline is , and the spike contributes . The total is 8.4503, and the excess is 1.9371.
The excess falls by a factor of 0.9 per step, so it halves in about steps. After 20 steps it is , and after 40 steps it is . Section 20.5 gives momentum its memory; section 20.6 says a loss spike's cause is not visible in the loss alone. Put together, the optimizer carries the spike for many steps after the loss looks healthy again. A curve that recovers therefore does not show that the cause has gone, and the gradient norm, which section 20.6 logs before changing a hyperparameter, is the measurement that shows whether the state is still disturbed.