Gradient Descent

Gradient descent updates parameters in the direction that locally decreases a loss. It is the basic optimization idea behind most neural network training.

The update is:

where are parameters, is the learning rate, and is the gradient.

More generally, training updates an objective :

and the update is:

where is empirical risk, is a regularizer, and controls regularization strength.

The local geometry of the loss is controlled by Jacobian and Hessian information: gradients give first-order direction, while Hessian curvature affects stability and step size.

This geometry is often described as the Loss landscape. Gradient descent only uses first-order local information, so the same update rule can behave differently in flat, sharp, noisy, or badly scaled regions.

Direction and Step Size

For a small perturbation , first-order approximation gives:

Choosing gives:

This explains why the negative gradient is locally downhill. It does not guarantee global improvement when the step is too large, gradients are noisy, or the objective is non-convex.

With mini-batches, the gradient is estimated from a batch :

Then the practical update is:

possibly after gradient clipping, mixed-precision scaling, distributed averaging, or optimizer-specific transformations.

Failure Modes

  • Overshooting: is too large, so loss oscillates or diverges.
  • Slow progress: is too small or curvature is badly scaled.
  • Bad gradient estimate: masking, padding, sampling, or distributed averaging changes .
  • Train-only improvement: training loss decreases while validation loss or target metric does not.
  • Resume drift: optimizer, scheduler, scaler, or random sampler state is not restored.

Checks

  • Is the gradient computed from the intended loss and valid examples only?
  • Is the learning rate schedule stable?
  • Are gradients clipped, accumulated, synchronized, or scaled?
  • Does lower training loss improve validation performance?
  • Is the x-axis counted in optimizer steps, samples, tokens, or epochs?
  • Is the same update boundary used across compared runs?
  • Are optimizer and scheduler states restored when resuming?