Adam optimizer

Adam is a standard algorithm for training neural networks that gives every parameter its own step size, based on running averages of its recent gradients; its variant AdamW is the usual choice for training large language models.

Training a neural network means nudging its parameters, step by step, in whatever direction reduces its error. Plain stochastic gradient descent moves every parameter by its gradient multiplied by one shared learning rate. Adam, published by Diederik Kingma and Jimmy Ba in December 2014 and presented at ICLR 2015, keeps two running averages for every parameter: one of its recent gradients and one of its recent squared gradients. Dividing the first by the square root of the second gives each parameter its own effective step size, roughly the same whether its gradients are large or small, and smaller when they are noisy or keep changing sign.

The authors described it as simple to implement, efficient and needing little tuning, and suited to noisy or sparse gradients and objectives that shift during training. Those properties made it a default choice across deep learning.

The version used for language models is AdamW. In November 2017 Ilya Loshchilov and Frank Hutter showed that the usual way of adding weight decay, a penalty that keeps parameters small, did not work as intended with Adam. They separated the weight decay from the gradient step, which improved how well Adam-trained models generalised. The method was presented at ICLR 2019 and built into PyTorch and TensorFlow.

Technical reports usually state the settings. Meta's LLaMA, in February 2023, used AdamW with beta values of 0.9 and 0.95, weight decay of 0.1, a cosine learning-rate schedule and 2,000 warm-up steps; DeepSeek-V3, in December 2024, used the same betas and weight decay. The two running averages mean Adam stores two extra numbers for every parameter, a real memory cost at the scale of billions of parameters, which is why DeepSeek kept them in the lower-precision BF16 format.

AdamW now has challengers. Muon, an optimizer based on orthogonalising each weight matrix's update, was tested at scale in a February 2025 paper that reported about twice the computational efficiency of AdamW under compute-optimal training. Kimi K2, a model with 1 trillion total parameters released in July 2025, was trained on 15.5 trillion tokens with MuonClip, an extension of Muon, and its developers reported no loss spikes.

Common questions

What is the Adam optimizer?

Adam is an algorithm that decides how to adjust a neural network's parameters during training. It tracks running averages of each parameter's gradients and squared gradients and uses them to give every parameter its own step size. It was published in 2014 and became one of the most common optimizers in deep learning.

What is the difference between Adam and AdamW?

AdamW changes how weight decay, a penalty that keeps parameters small, is applied. In the original approach the penalty was mixed into the gradient and then rescaled by Adam, which weakened it. AdamW applies it separately, which improves how well models generalise, and it is the version most language models are trained with.

Why does Adam use so much memory?

For every parameter it stores two extra values, the running averages of the gradient and the squared gradient. For a model with hundreds of billions of parameters that is a lot of additional memory, so labs often store these values in lower precision.

Is anything replacing AdamW?

Muon is the most prominent challenger. A February 2025 paper reported roughly twice the compute efficiency of AdamW, and the 1 trillion parameter Kimi K2 model was trained in 2025 with MuonClip, a version of Muon. AdamW remains common in published training recipes.

Finding more

Search for "Adam optimizer explained", "AdamW weight decay" or "Muon optimizer" to follow both the standard method and its challengers. The original papers on arXiv and the training sections of model technical reports, which list optimizer settings, are the most reliable sources. Deep learning framework documentation, such as PyTorch's, explains each setting in practical terms.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.