Deep Learning Optimizers: Step Size, Momentum, and Convergence in Practice

    This article explains how optimizers control training through step size, momentum, scale adaptation, and matrix-level preconditioning. It compares plain SGD, Heavy Ball, and adaptive methods, discusses their memory and convergence trade-offs, and shows how optimizer state interacts with batch size, mixed precision, and parallelism. It also covers metrics to monitor, a practical debugging order, and selection guidance for different parameter and data regimes.

    Optimizers are the navigation policy inside the training loop. The loss function gives the current “height,” the gradient points toward the steepest local descent direction, and the optimizer decides where to move next, how far to move, and whether to retain historical velocity. As models grow larger, batches shrink, and loss landscapes become more rugged, this decision can matter more than fine details of the network architecture in determining whether training converges on schedule.

    Three Decisions the Optimizer Actually Makes

    The first decision is step size: the learning rate and its schedule. If the step is too large, updates overshoot valleys, loss oscillates, and training may diverge. If the step is too small, parameters barely move and compute is wasted on flat regions. A good strategy is not a single global constant. It moves somewhat faster where curvature is low and gradient directions are consistent, and it slows down automatically where curvature is high or the optimizer is approaching a narrow valley.

    The second decision is direction correction. Using only the current gradient treats parameters as a massless point that can accelerate or stop instantly. In a long, narrow canyon, gradient components against the walls can be large while the component along the valley floor is small. Plain stochastic gradient descent then bounces between walls and makes slow effective progress. Adding inertia lets historical direction participate in the current step, reducing lateral oscillation while preserving longitudinal momentum.

    The third decision is scale adaptation. Gradient magnitudes can differ by orders of magnitude across parameters. Embedding layers, normalization layers, and attention projections do not have the same sensitivity. If every parameter shares the same absolute step size, some dimensions may already oscillate while others barely move. Adaptive methods scale the step for each dimension using historical gradient statistics, which is essentially diagonal preconditioning.

    From Steepest Descent to the Heavy Ball

    The simplest stochastic gradient descent uses only the current mini-batch gradient. The update can be written as the parameter minus the learning rate times the gradient. It is simple to implement and memory-efficient, and with sufficient noise and a well-chosen learning-rate decay it often generalizes well. However, it is sensitive to ill-conditioned curvature.

    The Heavy Ball method explicitly adds the previous velocity to the update. It first decays the old velocity by a momentum coefficient, then adds the current gradient, and finally uses that velocity to update parameters. The physical intuition is that a particle has mass and does not reverse direction completely because of a single lateral gradient. The momentum coefficient is often close to 1, meaning longer velocity memory. If it is too large, the optimizer can overshoot narrow valleys, which appears as periodic loss spikes.

    In practice, keep three points in mind. Momentum and learning rate are coupled: higher momentum increases the effective step size, so the base learning rate often needs a slight reduction. Momentum can amplify unstable gradients early in training, so a short learning-rate warmup can help. If loss shows regular sawtooth behavior while the gradient norm is not exploding, suspect excessive momentum or an overly aggressive learning-rate schedule before changing the model.

    What Adaptive Scaling Solves and What It Costs

    Beyond momentum, maintaining first- or second-order gradient statistics per coordinate can shrink steps in dimensions with large gradients and relatively enlarge steps in dimensions with small gradients. This can significantly improve convergence for sparse features, embedding tables, and early training in deep networks.

    The costs are also clear. These statistics require extra state on the same order as the parameters, and memory pressure grows linearly with the number of optimizer states. When the optimizer over-adapts to noisy gradients, late-training steps may become too small, training loss may fall slowly, and validation improvement may stall. If bias correction, weight decay, and adaptive learning rates are implemented incorrectly together, decay can be canceled by step scaling, or some layers can become nearly frozen. Adaptive optimizers are therefore not automatically stronger. They trade memory and late-step decay for robustness to scale differences.

    From an engineering perspective, separate weight decay from the gradient conceptually. One approach applies decay to parameters independently of gradient statistics, then applies the adaptive update. This prevents decay strength from growing unexpectedly when a dimension’s gradient becomes small. Whichever form is used, the configuration should state clearly whether decay acts on parameters or gradients, so behavior does not drift when implementations change.

    Matrix-Level Updates: More Than Coordinate Scaling

    Per-coordinate adaptation is equivalent to diagonal preconditioning. When the singular directions of a weight matrix have very different curvature, scaling each element may still concentrate update energy in a few directions while other directions learn too little. A further approach organizes updates at the matrix level: form the momentum-adjusted matrix gradient, then orthogonalize or spectrally normalize it so major directions receive more balanced step sizes while norm explosion is suppressed.

    These methods are usually “heavier” than pure element-wise adaptation. Orthogonalization involves matrix factorization or iterative approximation, and both computation and communication are expensive. Relative to parameter count, however, the extra state can sometimes be smaller than maintaining multiple full moment estimates. This approach suits wide networks dominated by matrix parameters. For large numbers of small vector parameters, the benefit is often unclear, and lightweight update rules may remain sufficient.

    Do not treat it as a universal accelerator. Orthogonalization changes the geometry of the update, so learning-rate ranges from element-wise methods cannot be copied directly. Re-run a small learning-rate grid search and monitor the ratio of update norm to parameter norm for each parameter group. If one group’s ratio is consistently an order of magnitude higher than the others, the step size or preconditioning is too strong.

    Working with the Training Loop

    An optimizer cannot be tuned independently of batch size, gradient accumulation, mixed precision, and parallel partitioning. Larger batches reduce gradient variance, so the learning rate can often be increased slightly, but not by linear extrapolation. Gradient accumulation changes the effective batch size; momentum remembers the accumulated update, not each micro-batch. Under mixed precision, a scale factor that is too small can cause gradient underflow and pollute optimizer statistics, while one that is too large causes overflow. Monitor whether the scale factor stays pinned at its maximum or falls back frequently.

    Data parallelism synchronizes gradients between steps. Momentum and moment estimates are local state and must align strictly with parameter versions. Changing the learning rate mid-run, altering momentum, or reloading incomplete state can produce non-reproducible loss curves. With pipeline or tensor parallelism, optimizer-state sharding must match parameter sharding so that a shard is not updated twice.

    Metrics and Debugging Order

    At minimum, log training and validation loss, global gradient norm, global parameter norm, update norm for each parameter group, learning rate, and the magnitude of optimizer state, such as mean moment estimates. Before divergence, training usually shows a gradient-norm spike or a runaway update-to-parameter ratio before loss immediately becomes NaN.

    Debug from low cost to high cost: confirm loss and label scales, freeze the learning rate for a short control run, remove momentum or adaptive terms and fall back to a plain update, then restore them group by group. If only certain parameters, such as normalization layers or biases, are unstable, give that group a separate learning rate instead of lowering the global rate by another order of magnitude. Gradient clipping can limit single-step shocks, but when it masks a pathology, validation performance may worsen. Set the clipping threshold from percentiles of the unclipped gradient rather than hard-coding a value by intuition.

    Selection Guidance

    When data is large, implementation simplicity matters, and generalization is the priority, stochastic gradient descent with momentum and a clear learning-rate schedule remains a strong baseline. When parameter scales differ widely and embedding or sparse updates are prominent, adaptive scaling can save tuning time. When matrix parameters dominate and diagonal adaptation shows late-step collapse, evaluate matrix-level orthogonalization or spectrally normalized updates, and budget separately for their compute and learning-rate search.

    Whatever the choice, treat the optimizer as an experimental factor equal to model architecture: fix random seeds, record state-dict versions, group learning rates and decay, and judge whether a step is reasonable by update norms rather than final loss alone. Only then do step size, inertia, and scale adaptation become a reproducible training control surface rather than a slogan.