LearnBenchStart learning →

AI Research Scientist · Optimization Algorithms & Schedules

Adam optimizer

Real lesson card · Page 1 of 4

Adam optimizer

First and second moment estimates

For each parameter, Adam keeps two running averages of its gradients: mtm_t, an exponentially-decayed mean (first moment), and vtv_t, an exponentially-decayed mean of squared gradients (second moment, uncentered variance). Both update every step: mt=β1mt1+(1β1)gtm_t=\beta_1 m_{t-1}+(1-\beta_1)g_t, vt=β2vt1+(1β2)gt2v_t=\beta_2 v_{t-1}+(1-\beta_2)g_t^2.
Example
If a parameter’s gradient is consistently 0.4, mtm_t drifts toward 0.4 while vtv_t drifts toward 0.16, tracking direction and typical magnitude separately.

Recall check from the same lesson

Because Adam divides by the bias-corrected second moment, a parameter whose gradient is mostly zero (sparse) gets a proportionally larger effective step on the rare occasions it does receive a nonzero gradient, compared to a parameter with the same-magnitude but constantly-present gradients.

Sources

· Editorial policy

One sitting · 20–30 minutes

A focused session on your AI Research Scientist interview

LearnBench starts from what you already know — skip what you have, master what you’re missing.

Start now

More Optimization Algorithms & Schedules questions