Adam Optimizer
Training & InferenceAn adaptive learning rate optimization algorithm that maintains per-parameter learning rates based on first and second moment estimates of gradients.
The automatic transmission of optimizers - it adjusts the learning rate for each parameter so you do not have to tune it manually.
Adam, short for Adaptive Moment Estimation, is a first-order optimizer that changes the step size separately for every trainable parameter. It combines momentum, which smooths the direction of recent gradients, with RMSprop-style scaling, which reduces the step taken in dimensions where squared gradients have been consistently large. The result is a useful default for many neural-network training jobs, especially when gradients are noisy or sparse.
How Adam updates a parameter
For a gradient g_t at step t, Adam keeps two exponential moving averages. The first moment is m_t = beta1 * m_(t-1) + (1 - beta1) * g_t; the second moment is v_t = beta2 * v_(t-1) + (1 - beta2) * g_t^2. Because both averages start at zero, Adam applies bias correction before updating the parameter: theta_t = theta_(t-1) - learning_rate * m_hat_t / (sqrt(v_hat_t) + epsilon). The first moment supplies momentum, while the second moment acts like a per-parameter normalization term.
The familiar starting values are a learning rate around 1e-3, beta1=0.9, beta2=0.999, and a small epsilon. They are starting points, not universal laws. A learning rate that is too large can make loss explode; one that is too small can make training appear stuck. Learning-rate warmup, decay, or a schedule tied to the training budget is often more important than changing the beta values.
When Adam is a good fit
Adam is convenient for models with parameters on very different scales, sparse features, or a training loop where a carefully tuned SGD schedule is not yet available. It often reaches a useful training loss quickly and is easy to combine with gradient clipping, mixed precision, and learning-rate schedulers. For large language models and many modern deep-learning systems, Adam-family optimizers remain common because they are stable across a wide range of architectures.
The AdamW distinction
Adam is not automatically the best optimizer for final generalization. Its adaptive updates can produce a different tradeoff between training loss and validation performance than well-tuned SGD, and the way classic Adam applies L2 regularization is not the same as decoupled weight decay. AdamW applies weight decay separately from the gradient update and is usually the safer choice when weight decay is part of the training recipe. Always compare validation metrics, not just how quickly the training loss falls.
Practical checklist
Start with a reproducible baseline, log the learning rate and gradient norms, and evaluate on a held-out validation set. If training is unstable, lower the learning rate or use warmup before changing the optimizer. If validation quality stalls while training quality keeps improving, tune regularization, data, and the schedule rather than assuming that more Adam steps will solve the problem.
References & Resources
Last updated: August 13, 2026