Visual walkthrough — AdaGrad and RMSprop
This page rebuilds the whole idea from a single blank picture: a ball rolling down a valley, one step size that cannot fit two directions, and the exact machinery that fixes it. Every symbol is earned before it appears. Parent: AdaGrad and RMSprop.
Before we touch any formula, let us agree on the picture everything lives in.
Step 1 — What a "gradient" is, as an arrow
WHAT. At our current spot (our position at step ), the gradient is an arrow that points in the direction of steepest increase of . We call it . Crucially, it is measured right where we are standing — the arrow depends on the current position , so it changes as we move.
WHY an arrow, and why this arrow. To descend, we must know which way is "downhill". The gradient is the one object that packs both direction (where the slope tips) and magnitude (how steep) into a single arrow. We step opposite to it — downhill.
PICTURE. Look at the two arrows below. The tail sits on our current position. In the steep direction the arrow is long; in the flat direction it is short.

Plain Stochastic Gradient Descent then takes this step:
- ::: our current position on axis .
- ::: the single learning rate — the same number for every axis.
- the minus sign ::: we move against the uphill arrow, i.e. downhill.
Step 2 — Why one cannot serve two directions
WHAT. Consider a valley that is steep across and gentle along (a long narrow ravine).
WHY it breaks. One multiplies both the long arrow and the short arrow. Pick large enough to make progress along the gentle floor, and the steep-across step overshoots — the ball bounces wall to wall. Pick small enough to be calm across, and along the floor you crawl. There is no single number that is both.
PICTURE. The yellow path zig-zags because the across-step is too big; the along-progress is tiny. This is the disease.

Step 3 — Measuring "how big have the gradients been" with a square
WHAT. We need a single positive number per axis that grows when its gradients are large. We build it by squaring each gradient and adding them up:
- ::: the gradient at past step , squared → always , and big gradients count extra.
- ::: add up every step from the first to now.
- the right form ::: same thing written as "yesterday's total plus today's square" — cheap to update.
- ::: we start the accumulator empty (before any gradient has arrived, there is nothing summed yet). This is why the very first divisor is only , and why in Step 4 matters on step 1.
WHY square, not absolute value. Two reasons, both visible in the figure. First, squaring makes it always positive, so it can safely act as a size. Second, squaring punishes large gradients more (a gradient of contributes , a gradient of contributes ) — exactly the directions we want to slow down. It is also smooth (differentiable), unlike the sharp corner of .
PICTURE. Bars show raw vs : the tall gradient's bar shoots up disproportionately after squaring.

Step 4 — Turning that "size" into a step: divide by
WHAT. We now shrink the step of a busy axis by dividing by its accumulated size. AdaGrad's update:
WHY and not itself? This is a units argument, and the picture makes it concrete. carries units of . If we divided by , we would over-cancel and the step would collapse far too fast. Taking brings the divisor back to the same units as , so the ratio is well-scaled — roughly "how many typical-gradients big is today's gradient". That is exactly the balanced quantity we wanted.
PICTURE. The curve falls off gently; plunges. Gentle is what keeps learning healthy early on.

Step 5 — The fatal flaw: only grows, so the step dies
WHAT. is a sum that never decreases — starting from , every step adds a non-negative . So climbs forever, and the effective rate .
WHY this is fatal in deep learning. In convex or sparse problems (e.g. NLP embeddings) a decaying rate is fine — you settle near the answer and stop. But deep nets train for hundreds of thousands of steps. Long before the end, the step has shrunk to a micro-step in every direction: the network stops learning. AdaGrad arrests itself.
PICTURE. For a constant gradient , , so the effective rate is — a curve visibly sagging toward the floor.

Step 6 — RMSprop: forget the old, remember the recent
WHAT. We keep the "divide by root of squared-gradient size" idea, but we stop summing forever. Instead of a sum we keep a running average that fades old values, called an exponentially weighted moving average (EWMA):
- ::: our current estimate of the recent mean-square gradient on axis .
- ::: the decay (memory length), typically . Large = long memory.
- ::: keep of the old estimate — the past fades but is not erased.
- ::: mix in of today's fresh square.
- ::: we also start this estimate empty — the same convention as .
WHY this fixes the death. Because old squares are multiplied by again and again (), their weight decays geometrically to nothing. The estimate no longer piles up without bound — it settles to the recent mean-square. So the divisor stops growing, and the effective rate stays alive.
PICTURE. The weight given to the gradient from steps back is — a decaying staircase. Old bumps are forgotten.

WHY the is still earned here. In Step 4 we introduced to survive at start-up. RMSprop's divisor can also dip near zero — precisely when an axis's recent gradients are tiny. Without that would blow the step up to infinity, so the same guard is kept, doing the same job.
Step 7 — RMSprop stays alive: the steady state
WHAT. Feed a constant gradient into the EWMA (starting from ) and watch where it lands after the early bias fades.
WHY it settles — line by line. "Steady state" means the estimate has stopped changing: the value this step equals the value last step, so we may call both simply . Substituting that single symbol into the update gives
Why we can write one on both sides: that is exactly what "settled / no longer changing" means. Now solve for :
So the settled estimate is exactly the true mean-square — the fading average lands on the honest recent size, no bigger, no smaller.
WHY it matters. With , , so the effective step — constant forever, never zero.
PICTURE. AdaGrad's curve () sinks; RMSprop's curve starts a touch high (the early bias) then flattens onto a stable plateau. Same input, two fates.

The one-picture summary
Everything in one frame: SGD's one step size fails in the ravine → measure recent gradient size per axis → divide by its square root. AdaGrad measures with a growing sum (sinks to zero); RMSprop measures with a fading average (holds a healthy plateau). RMSprop + a momentum term is exactly the Adam Optimizer.

Recall Feynman retelling of the whole walkthrough
You are rolling a ball into a bowl in the dark; the height of the bowl is the loss (how wrong the network is), and all you feel is the slope under the ball (the gradient arrow), measured right where the ball sits. If the bowl is a narrow ravine — steep across, gentle along — one step size can't win: big enough to move along means bouncing off the walls; small enough to be calm means crawling. So we give each direction its own step size. To decide it, we square each slope we've felt (squares are always positive and punish big slopes more), start a tally at zero, and use the square root of the tally as a "typical size" to divide by — big divisor means small step, exactly for the busy directions. AdaGrad divides by the root of the sum of all squares — but a sum only grows, so eventually every step becomes a micro-step and the ball stops. RMSprop divides by the root of a fading average instead: it keeps mostly the recent slopes and forgets old ones. It too starts its tally at zero, so its very first steps are a little too big, but that bias fades fast — and after that the divisor settles instead of exploding, so the ball keeps rolling at a steady pace all the way down.
Recall
AdaGrad divisor vs RMSprop divisor? ::: AdaGrad: (grows, dies). RMSprop: (bounded, survives). Why not ? ::: Units — matches the units of , giving a well-scaled step; over-shrinks. What do the accumulators start at? ::: Both and (empty). Steady-state RMSprop step for constant ? ::: , so effective step .
Connections
- Stochastic Gradient Descent — the one- baseline we improved.
- Momentum — averages the gradient itself (first moment); here we average its square (second moment).
- Adam Optimizer — RMSprop + momentum + bias correction (fixes the start-at-zero bias of Step 6).
- Exponentially Weighted Moving Averages — the fading-memory engine of Step 6.
- Learning Rate Schedules — hand-designed decay, an alternative to adaptivity.
- Vanishing and Exploding Gradients — per-axis scaling tames wildly different gradient sizes.