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_tsmooths gradient direction (beta_1 = 0.9), whilev_tsmooths squared gradient magnitude (beta_2 = 0.999), dividingm_hat_tbysqrt(v_hat_t) + epsilon(epsilon = 10^-8) atalpha = 0.001. - Mandatory zero-start debiasing: dividing by
1 - beta_1^tand1 - beta_2^tcorrects zero-initializedm_0 = 0andv_0 = 0; without it,beta_2 = 0.9999causes ~100x oversized early steps and VAE divergence. - Scale invariance and soft trust region: multiplying all gradients by a constant
ccancels out (c * m_hat_t / sqrt(c^2 * v_hat_t)), while updates stay roughly bounded by|Delta_t| <= alpha(oralpha * (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.
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.
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.
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 classificationOn 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.
MNIST 2x1000 ReLU MLP vs. quasi-Newton SFO
Non-convex + noiseAdding dropout noise breaks minibatch quasi-Newton curvature estimates while Adam keeps constant per-parameter memory.
- Why SFO breaks
- Sum-of-Functions Optimizer assumes deterministic subfunctions, consumes memory linear in minibatch count, and fails to converge under dropout.
- Adam's mechanism
- First-order diagonal preconditioning uses only O(d) memory (two vectors) and smooths dropout variance through m_t and v_t.
- Measured evidence (Fig. 2)
- On deterministic L2-regularized MLPs, Adam is 5 to 10x faster per step than SFO and reaches lower cost sooner in both iterations and wall time.
- Stochastic advantage
- With dropout enabled over 200 epochs, Adam beats AdaGrad, RMSProp, SGD-Nesterov, and AdaDelta on training cross-entropy.
CIFAR-10 ConvNet (c64-c64-c128-1000) across 45 epochs
Convolutional netsBoth Adam and AdaGrad start fast in the first three epochs, then AdaGrad stalls while Adam and SGD-Nesterov finish orders of magnitude lower.
- Why AdaGrad stalls
- In CNNs, the second-moment estimate becomes a poor geometry proxy (v_hat_t drops toward zero and gets dominated by epsilon), slowing AdaGrad after epoch 3.
- Adam's mechanism
- First-moment variance reduction (m_hat_t) drives late-stage CNN convergence while v_hat_t still scales conv vs dense layers automatically.
- Measured evidence (Fig. 3)
- Over 45 epochs with dropout, Adam and SGD-Nesterov drive training cost to roughly 10^-3 to 10^-4 while AdaGrad stagnates near 10^-1 to 10^-2.
- Engineering benefit
- Removes SGD's manual per-layer learning rate tuning between weight-shared 5x5 conv filters and 1,000-unit FC layers.
Variational Autoencoder sweep over beta_2 and alpha
Bias-correction ablationRemoving bias correction turns Adam into RMSProp with momentum and causes severe instability as beta_2 approaches 1.
- Why uncalibrated RMSProp breaks
- Zero-initialized v_0 without (1 - beta_2^t) division triggers massive initial steps when beta_2 = 0.999 or 0.9999.
- Adam's mechanism
- Debiasing both moments keeps early updates inside the alpha trust region, allowing slow decay rates needed for sparse hidden units.
- Measured evidence (Fig. 4)
- Across beta_1 in {0, 0.9} and beta_2 in {0.99, 0.999, 0.9999} on a 500-unit VAE, un-debiased runs diverge at higher alpha even at 100 epochs.
- Best regime
- Smallest (1 - beta_2) values combined with bias correction delivered the lowest loss, especially late in training as units specialized.
Replacing L2 scaling with the infinity norm u_t
L-infinity extensionTaking the L_p norm limit as p -> infinity turns the second-moment EMA into a simple running maximum with no bias correction.
- Why finite L_p fails
- Generalizing v_t to p > 2 norms becomes numerically unstable for large p.
- AdaMax's mechanism
- At p -> infinity, u_t = max(beta_2 * u_t-1, |g_t|) with u_0 = 0; only m_t needs (1 - beta_1^t) debiasing.
- Strict step bound
- Update magnitude simplifies to |Delta_t| <= alpha (default alpha = 0.002), tighter than Adam's sparse-case bound.
- Temporal averaging bonus
- Section 7.2 adds an optional Polyak-Ruppert EMA over parameters theta_bar_t with the same (1 - beta_2^t) bias correction.
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.25training loss while SGD-Nesterov stalls above0.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 atbeta_2 = 0.999and0.9999. - AdaMax (
L_inf): settingu_t = max(beta_2 u_{t-1}, |g_t|)eliminates second-moment bias correction and caps every step strictly atalpha.
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.


