Most deep learning runs still start with Adam because Diederik P. Kingma and Jimmy Lei Ba solved two problems that broke earlier adaptive optimizers at once: handling sparse gradients like AdaGrad without letting step sizes decay to zero, and handling non-stationary objectives like RMSProp without exploding on early zero-initialized steps. Published at ICLR 2015, Adam computes an individual learning rate for every parameter from two running moments of its gradients, divided through a debiasing schedule that stabilizes training from step one.

By tracking both the mean (m_t) and uncentered variance (v_t) of gradients, Adam forms a coordinatewise signal-to-noise ratio that automatically shrinks updates when gradients oscillate and resists rescaling of the loss. Yet the paper also flags exact assumptions, including convex step-decay conditions and L2 regularization interactions, that later shaped AdamW and large-scale ZeRO optimizer sharding.

  • Two exponential moments per weight: m_t smooths gradient direction (beta_1 = 0.9), while v_t smooths squared gradient magnitude (beta_2 = 0.999), dividing m_hat_t by sqrt(v_hat_t) + epsilon (epsilon = 10^-8) at alpha = 0.001.
  • Mandatory zero-start debiasing: dividing by 1 - beta_1^t and 1 - beta_2^t corrects zero-initialized m_0 = 0 and v_0 = 0; without it, beta_2 = 0.9999 causes ~100x oversized early steps and VAE divergence.
  • Scale invariance and soft trust region: multiplying all gradients by a constant c cancels out (c * m_hat_t / sqrt(c^2 * v_hat_t)), while updates stay roughly bounded by |Delta_t| <= alpha (or alpha * (1 - beta_1) / sqrt(1 - beta_2) under extreme sparsity).
  • Beats quasi-Newton SFO under noise: on MNIST MLPs, Sum-of-Functions Optimizer (SFO) is 5 to 10x slower per step, needs memory linear in minibatch count, and fails to converge under dropout, where Adam excels.
Inside one Adam step: two moments, bias correction, and SNR scaling
1. Update biased moments
Both buffers start at zero and decay exponentially per step t.
First moment (mean): m_t = beta_1 m_t-1 + (1 - beta_1) g_t
Acts like momentum over raw gradients (beta_1 = 0.9), preserving sign and filtering minibatch jitter.
Second moment (scale): v_t = beta_2 v_t-1 + (1 - beta_2) g_t^2
Tracks uncentered variance (beta_2 = 0.999), ignoring sign so oscillating slopes stay penalized.
2. Correct zero-start bias
Prevents artificially tiny v_t from blowing up step 1.
Debiased estimators: m_hat_t = m_t / (1 - beta_1^t), v_hat_t = v_t / (1 - beta_2^t)
At t = 1, 1 - beta_2^1 = 0.001; dividing restores the true second-moment scale instead of underestimating sqrt(v_1) by 31.6x.
3. Apply SNR update
Automatic step annealing when gradient direction gets noisy.
Parameter step: theta_t = theta_t-1 - alpha * m_hat_t / (sqrt(v_hat_t) + epsilon)
Invariant to diagonal gradient scaling c and approximates preconditioning by the square root of the inverse diagonal Fisher matrix.

Algorithm and derivation from Kingma and Ba (2015), Algorithm 1 and Sections 2 through 3.

Two moments, one trust region

Standard stochastic gradient descent multiplies every coordinate by the same global learning rate alpha. That breaks down as soon as coordinates live on different scales: rare word embeddings receive sparse bursts of large gradients while dense weights receive steady small updates, and convolutional filters see vastly different gradient magnitudes than top-level dense classifiers. Tuning one global alpha means either stalling the slow coordinates or overshooting the noisy ones.

Adam keeps two scalar histories per weight: m_t estimates the first raw moment E[g_t], and v_t estimates the second raw moment E[g_t^2] (the uncentered variance). The paper calls the ratio m_hat_t / sqrt(v_hat_t) the signal-to-noise ratio (SNR). Because |E[g]| / sqrt(E[g^2]) <= 1 by Cauchy-Schwarz, the SNR stays naturally bounded. When a coordinate sees consistent gradients pointing in one direction, |m_hat_t| approaches sqrt(v_hat_t) and the step size reaches nearly the full hyperparameter alpha (typically 0.001). When gradients flip signs across minibatches or near an optimum, m_hat_t cancels toward zero while v_hat_t stays high, shrinking the effective step automatically.

Just as useful for tuning, the update is invariant to positive diagonal gradient rescaling. Multiplying a parameter’s gradients by 100 scales m_hat_t by 100 and v_hat_t by 10,000, so sqrt(v_hat_t) scales by 100 and the ratio stays identical (ignoring epsilon). Furthermore, the step magnitude has two tight theoretical bounds (epsilon = 0): |Delta_t| <= alpha * (1 - beta_1) / sqrt(1 - beta_2) in the extreme sparsity edge case where a gradient was zero everywhere until step t (for defaults, roughly 3.16 * alpha), and |Delta_t| <= alpha otherwise. That establishes an approximate trust region around the current parameter vector, making alpha = 0.001 a reliable starting scale across radically different architectures.

Why initialization bias correction and decay matter

Initializing m_0 = 0 and v_0 = 0 creates a hidden trap when decay rates sit close to 1. Expanding the recursion v_t = beta_2 v_{t-1} + (1 - beta_2) g_t^2 shows E[v_t] = E[g_t^2] * (1 - beta_2^t) + zeta, where zeta = 0 when the second moment is stationary. At t = 1 with beta_2 = 0.999, v_1 captures only 0.001 of g_1^2. Taking the square root makes the denominator sqrt(0.001) = 0.0316 times its true magnitude. Without dividing v_t by (1 - beta_2^t), the optimizer takes a step 31.6 times larger than alpha on step 1 (or 100 times larger at beta_2 = 0.9999), right when random weights sit on the steepest cliffs.

Why earlier optimizers stall or diverge where Adam holds steady
AdaGrad (sum g_i^2)

Matches Adam on sparse IMDB BoW, but stalls far behind on CIFAR-10 CNNs after early epochs while Adam keeps descending.

RMSProp (no debiasing)

Zero-start v_0 = 0 without 1 - beta_2^t blows up early steps at beta_2 = 0.9999, destabilizing VAE training.

Quasi-Newton SFO

5 to 10x slower per step than Adam, uses memory linear in minibatches, and fails to converge with dropout noise.

Comparisons from Kingma and Ba (2015), Sections 5 and 6.

This exact difference separates Adam from RMSProp and AdaGrad. Section 5 proves that AdaGrad is the limiting case of Adam when beta_1 = 0, beta_2 approaches 1 from below, and alpha_t = alpha / sqrt(t): with bias correction included, lim_{beta_2 -> 1} v_hat_t = (1/t) sum_{i=1}^t g_i^2, recovering AdaGrad cleanly. Remove the bias-correction denominator, as RMSProp does, and letting beta_2 approach 1 produces infinite bias and diverging steps.

In practice, the authors also give a faster reformulation (Section 2) that fuses the two debiasing scalars into one per-step learning rate factor: alpha_t = alpha * sqrt(1 - beta_2^t) / (1 - beta_1^t), followed by theta_t = theta_{t-1} - alpha_t * m_t / (sqrt(v_t) + epsilon_hat). That keeps every tensor operation untouched while preserving the exact initial warmup schedule on alpha_t.

Experimental benchmarks and extensions

Kingma and Ba stress-tested Adam across convex sparse features, stochastic regularized MLPs, convolutional networks, and generative VAEs, and derived an L_inf extension called AdaMax. Switch through the five cases below to see where each design piece earns its keep.

Five tests that separate Adam from SGD, AdaGrad, RMSProp, and SFO

Select an experiment or variant (or use Left and Right arrow keys) to inspect why competing optimizers broke and what Adam measured.

IMDB 10,000-dim bag-of-words with 50% dropout

Convex classification

On sparse text features, SGD with Nesterov momentum lags behind while Adam matches AdaGrad's fast descent.

Why SGD-Nesterov breaks
Uniform global steps move too slowly along rare-word coordinates that only receive non-zero gradients occasionally.
Adam's mechanism
With 1/sqrt(t) step decay matching Section 4 theory, v_hat_t stays small on rare coordinates and scales their effective learning rates up.
Measured evidence (Fig. 1)
Over 160 passes on 10,000-dim IMDB BoW + 50% dropout, Adam and AdaGrad drop training NLL below 0.25 while SGD-Nesterov stalls above 0.35.
MNIST convex check
On dense 784-dim MNIST logistic regression, Adam matches SGD-Nesterov and converges faster than AdaGrad over 45 epochs.

Source: Kingma and Ba (2015), Sections 6 and 7.

If you prefer the short version without clicking through the tabs, here are the five takeaways from Adam’s experiments and extensions:

  • Sparse text features: on 10,000-dimensional IMDB bag-of-words with dropout, Adam matches AdaGrad below 0.25 training loss while SGD-Nesterov stalls above 0.35.
  • Stochastic MLPs: quasi-Newton SFO collapses under dropout noise and costs 5 to 10x more per iteration, whereas Adam needs only two vectors per parameter.
  • Convolutional nets: on CIFAR-10, AdaGrad stalls after three epochs as its denominator degrades, while Adam’s first moment carries it down alongside tuned SGD-Nesterov.
  • Cold-start stability: on VAEs, stripping (1 - beta_2^t) bias correction causes severe divergence at beta_2 = 0.999 and 0.9999.
  • AdaMax (L_inf): setting u_t = max(beta_2 u_{t-1}, |g_t|) eliminates second-moment bias correction and caps every step strictly at alpha.

Caveats and modern context

Three caveats keep the 2015 paper grounded in what it actually proved versus what had to be fixed later. First, the convergence proof in Section 4 relies on strict convex assumptions that real deep learning training violates. Theorem 4.1 proves O(sqrt(T)) regret only for convex functions f_t, with a 1/sqrt(t) decaying learning rate alpha_t, exponentially decaying momentum beta_{1,t} = beta_1 * lambda^{t-1}, and beta_1^2 / sqrt(beta_2) < 1. Later analysis (most famously Reddi et al., 2018) constructed simple online convex problems where constant-hyperparameter Adam fails to converge because old large gradients decay out of v_t too quickly.

Second, standard L2 weight decay interacts badly with Adam’s adaptive denominator. When weight decay is folded into the loss gradient g_t, coordinates with historically large gradients get their decay term divided down by sqrt(v_hat_t), weakening regularization unevenly across weights. Decoupling the penalty into a direct weight-shrink step (now universal as AdamW) fixed that interaction in transformers and vision models.

Third, Adam’s “little memory requirement” looks very different at billion-parameter scale. Storing FP32 m_t and v_t adds 8 bytes per parameter on top of weights and gradients, making optimizer state the dominant memory consumer in large language model clusters. Modern stacks work around this via mixed-precision training, ZeRO state sharding, or low-rank/8-bit optimizer states, while keeping learning-rate warmup schedules in part because early-step curvature and Adam’s second-moment variance can still spike in deep pre-norm transformers.

For engineers training models today, Adam’s core insight remains intact: separate gradient direction from gradient scale, keep both moments debiased from step one, and check whether weight decay is decoupled (AdamW) and whether optimizer state memory fits your cluster budget before touching hyperparameters.