An optimizer is the part of training that actually changes the model. After each batch, backpropagation works out the gradient: how the loss would change if each weight moved a little. The optimizer takes those gradients and decides the update. Every optimizer is a variation on gradient descent, stepping each weight a little way downhill, but they differ in how they size and steer those steps.
The family
- SGD: move each weight against its gradient, scaled by one global learning rate. Simple, and still competitive when well tuned.
- Momentum: keep a running average of past gradients, so steps build speed in consistent directions and damp out zig-zags.
- Adaptive methods such as AdaGrad, RMSProp and Adam: track statistics of each weight’s gradients and give each weight its own effective step size. Adam combines momentum with per-weight scaling, and it and its close variant AdamW are the usual defaults for training large neural networks.
What it costs
Optimizers are not free. Adam keeps two extra numbers for every parameter, running averages of its gradient and of its squared gradient, so its state takes about twice the memory of the weights themselves. For very large models that overhead shapes how training is split across machines.
The catch
No optimizer is best everywhere. The same model can converge, stall or diverge depending on the optimizer, its learning rate and the schedule that changes that rate over time. In practice the three are chosen together and tuned as a set, which is why published training recipes spell out all of them.