Foundations to Frontier
Tests
E. Deep Learning › E3 Optimizers (one page each)

RMSProp

RMSProp divides each parameter's step by a moving root-mean-square of its recent gradients: AdaGrad with a fading memory, so the effective learning rate no longer decays to zero. Proposed by Hinton in a 2012 lecture, it became a standard optimiser for recurrent networks and reinforcement learning and is the second-moment half of Adam. This page covers the update, its decay rate, the missing bias correction, the centred variant and its relation to AdaGrad and Adam. In the exercises you verify its limiting step and its inflated first step, then test the textbook claim that RMSProp beats AdaGrad when the target drifts: with learning rates tuned, AdaGrad did not stall and RMSProp's short memory made it the noisiest of the three methods.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

AdaGrad that forgets

AdaGrad’s per-parameter learning rates only ever shrink, because it adds up every squared gradient it has seen. RMSProp keeps a moving average instead, so old gradients fade away. Each parameter’s step is the learning rate times its gradient divided by the typical recent gradient size. Steps stay roughly the size of the learning rate, large or small gradients alike, and the method keeps adapting as training moves into new regions.

Optimizer lab: RMSProp versus plain gradient descent
RMSProp: final loss 0.023 (target reached at step 45) · gradient descent: final loss 2.2e-9 (step 22)
Orange: the chosen optimizer; grey dashed: plain gradient descent with the same learning rate. Darker shading means higher loss. On the ill-conditioned bowl, raise κ and watch gradient descent zig-zag across the narrow direction; on the saddle it stalls near the flat start; on the plateau its gradients are tiny. Adaptive methods rescale each direction; momentum methods build speed along consistent directions. The target is 1% of the starting loss (for the saddle, a loss below −0.2; its minima are at −0.25).
Why engineers care

RMSProp trained DeepMind’s Atari DQN agents and many recurrent networks, and it is the default in some reinforcement-learning codebases. Its normalised steps make training robust to wildly different gradient scales across layers, as in policies and value functions for control. Its behaviour explains half of Adam.

📝 Quick check (Level 0)
0/3 answered
  1. 1. RMSProp replaces AdaGrad's sum with…
  2. 2. RMSProp's steps are roughly…
  3. 3. RMSProp was first presented in…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Update: v ← β₂v + (1 − β₂)g², then w ← w − ηg/(√v + ε). The standard β₂ is 0.9 (Hinton) or 0.99 (PyTorch default α = 0.99).
  • Example with v = 1, g = 2, η = 0.1, β₂ = 0.5: v = 2.5, step 0.2/√2.5 ≈ 0.126.
  • Constant gradient: v → g², so the step tends to η·sign(g), the learning rate per coordinate, independent of the gradient’s size.
  • First step: starting from v = 0, the first v is (1 − β₂)g², so the first step is η/√(1 − β₂), ten times η for β₂ = 0.99. Adam’s bias correction (E3-7) fixes this; plain RMSProp does not.
  • Centred RMSProp: also track m = E[g] and divide by √(v − m²), the gradient’s standard deviation, rather than its RMS.
📝 Quick check (Level 1)
0/3 answered
  1. 1. RMSProp's limiting step under a constant gradient is…
  2. 2. Its first step with β₂ = 0.99 is about…
  3. 3. Centred RMSProp divides by…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

RMSProp in code

Exercise 1.

  • With v = 0 and g = 3, η = 0.01, β₂ = 0.99, the first step is 0.1: ten times the learning rate.
  • After many identical gradients, the step settles at exactly η·sign(g).
  • For gradients with mean 0.2 and standard deviation 1, the centred version’s denominator estimates the standard deviation (about 1.0).

Practice.

  • Typical η is 10⁻³ to 10⁻⁴. ε (10⁻⁸ in PyTorch, sometimes 10⁻⁶ or larger) also caps the step when gradients are tiny.
  • With momentum (PyTorch’s momentum argument), RMSProp is close to Adam without bias correction.
  • The inflated first steps can destabilise the start of training. A short learning-rate warm-up (E3-20) is a common remedy.
  • TensorFlow’s and PyTorch’s RMSProp place ε differently (inside or outside the square root), which matters when gradients are tiny.
torch.optim.RMSprop(params, lr=1e-3, alpha=0.99, eps=1e-8, momentum=0.0, centered=False)
🐍 Exercise 1: RMSProp's steps
Implement RMSProp and centred RMSProp; check the inflated first step, the limiting step under a constant gradient, and the centred denominator.
📝 Quick check (Level 2)
0/3 answered
  1. 1. PyTorch calls RMSProp's decay rate…
  2. 2. A common remedy for inflated first steps is…
  3. 3. RMSProp with momentum is close to…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Sign-like updates. Since RMSProp divides the gradient by its recent RMS, the step’s size is roughly constant and its direction is close to the gradient’s sign per coordinate. With β₂ → 0 it becomes signSGD (E3-16’s Lion is a modern sign method). This makes it robust to gradient scale, but it also means the step does not shrink near the optimum unless the gradient’s sign starts fluctuating: the noise in the sign sets the noise floor.

Memory length. The average spans about 1/(1 − β₂) steps.

  • A short memory (0.9) adapts quickly to changes in gradient scale but gives a noisy denominator.
  • A long memory (0.999) is smooth but slow to adapt.
  • AdaGrad is the infinite-memory limit, with a 1/√t decay built in.

On convex problems with persistent noise, AdaGrad’s decay is a feature: it averages away noise, as exercise 2 shows.

Convergence. RMSProp has no general convergence guarantee. Reddi, Kale and Kumar (2018) showed that exponential moving averages of squared gradients can fail to converge even on simple convex problems, which motivated AMSGrad (E3-9). In practice, with small learning rates and schedules, it works well on many non-convex problems.

📝 Quick check (Level 3)
0/3 answered
  1. 1. RMSProp with β₂ → 0 becomes…
  2. 2. AdaGrad corresponds to RMSProp with…
  3. 3. Non-convergence of moving-average methods was shown by…

Level 4: Expert

★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.

Does RMSProp really beat AdaGrad under drift?

History.

  • G. Hinton, with N. Srivastava and K. Swersky (2012), proposed RMSProp in the Coursera course Neural Networks for Machine Learning.
  • A. Graves (2013) used a centred variant for handwriting generation.
  • V. Mnih et al. (2015) trained DQN with RMSProp.
  • S. Reddi, S. Kale and S. Kumar (2018) showed non-convergence examples for moving-average methods.

Exercise 2. Online linear regression (10 weights), one example per step. After 20 000 steps the true weights jump to new values. Each method’s learning rate is tuned on a grid to give the lowest error averaged over the whole stream, and all chosen rates lie inside their grids. The table reports the steady-state error (mean squared distance to the true weights over the 2000 steps before the jump), the steps needed after the jump to return below twice that level, and the error averaged over the whole stream.

method best η steady-state error steps to recover mean error
SGD 0.03 0.0182 128 0.0365
AdaGrad 1.0 0.0119 214 0.0469
RMSProp, β₂ = 0.99 0.03 0.0608 200 0.0991
RMSProp, β₂ = 0.999 0.01 0.0184 386 0.0634

A second seed gave the same ordering (mean errors 0.045, 0.059, 0.100, 0.067).

  • AdaGrad did not stall. With its rate tuned, it recovered in about 200 steps and had the lowest steady-state error: its 1/√t decay averages the noise away, which is what a stationary noisy regression needs.
  • RMSProp was the noisiest method. Its normalised, sign-like steps do not shrink near the optimum, so with a short memory (0.99) its steady-state error was five times AdaGrad’s. A longer memory (0.999) cut the noise but slowed recovery to 386 steps.
  • SGD recovered fastest and had the lowest overall error on this well-scaled problem.
  • The textbook advantage did not appear here. RMSProp’s benefits show up with badly scaled or changing gradient magnitudes and non-convex training (RNNs, reinforcement learning), not in a well-scaled linear regression with a single jump.
🐍 Exercise 2 (research): does RMSProp really beat AdaGrad under drift?
Track the weights of an online linear regression whose true weights jump after 20 000 steps, with tuned SGD, AdaGrad and RMSProp (β₂ = 0.99 and 0.999); compare steady-state error, recovery time and average error.

RMSProp in AI, robotics and aerospace

  • Reinforcement learning for control and robotics (DQN, A3C variants) has long used RMSProp.
  • Recurrent models of sensor sequences benefit from its robustness to gradient-scale differences across time and layers.
  • Online adaptation: where data drift is expected, compare optimisers on tracking error after realistic changes rather than assuming any one adapts best.

References

  1. T. Tieleman, G. Hinton (2012). “Lecture 6.5 — RMSProp: divide the gradient by a running average of its recent magnitude.” COURSERA: Neural Networks for Machine Learning.
  2. A. Graves (2013). “Generating sequences with recurrent neural networks.” arXiv:1308.0850.
  3. V. Mnih et al. (2015). “Human-level control through deep reinforcement learning.” Nature 518.
  4. S. J. Reddi, S. Kale, S. Kumar (2018). “On the convergence of Adam and beyond.” Proc. ICLR.