Mean vs. RMS: the diagnostic behind Adam

A synthetic gradient stream. When it flips sign often, the mean cancels toward zero while the RMS does not — that gap is exactly what Adam watches to decide when to slow down.

A live bar chart of a synthetic gradient stream, with its running mean and RMS drawn as reference lines.
drift 0.00 flip freq 1.20 noise 0.40 β 0.95
β sets how much past the two EMAs keep: small β forgets quickly and tracks the recent stream, β near 1 averages over a long window. The hats mark bias correction — each EMA is divided by 1−βt, so both read correctly from the very first sample. Adam's step is proportional to mean/RMS.