Answers · The mathematics underneath
Why is the negative gradient the direction of steepest descent?
In shortA unit step goes downhill fastest when it points directly opposite the gradient, because the dot product with the gradient is then as negative as it can be.
The negative gradient is the steepest descent direction because, among all unit steps, it gives the largest first-order decrease in the function. That fact is a dot-product inequality, not an extra geometric intuition: it follows from writing the change per unit step as the gradient dotted with the step direction and then choosing the direction that makes that dot product as negative as possible.
Subtracting , dividing by , and letting shrink leaves . That number is the rate of change of per unit distance travelled along . The gradient is fixed once is fixed; the only thing you choose is , and the only thing affects is that one dot product. If you double the step, the change roughly doubles; if you halve it, the change roughly halves. That linearity is what makes direction and distance separable: direction chooses the dot product, distance chooses the multiplier.
Put the angle into the dot product. For any two vectors, , and for a unit vector this is . The gradient's length is whatever the function is doing at ; the cosine is the part you control. The cosine is smallest at , where it equals , so the largest decrease per unit step is , reached by . No other direction reaches it, because at that angle alone.
The angle version also explains a familiar fact: directions at right angles to the gradient have , so they change not at all to first order. Those are the tangent directions to the contour through . The negative gradient is not just downhill; it is the unique direction that gets the full first-order decrease, not merely a share of it.
- how much a unit step in the direction u can change the function
- the ceiling on that change. The second factor is one for a unit direction, so the ceiling is set by the gradient alone, and it is unreachable by any direction that is not parallel to it
What steepest secretly assumes
The natural guess is that the negative gradient is an intrinsic fact about the function, independent of how steps are measured. The proof does not support that: it used the ordinary Euclidean length when it set . That is a choice. The coordinates of a step are model parameters, and a change of in a first-layer weight is not automatically the same size as a change of in a final bias. If length is measured by a positive definite matrix , so that a unit step means , the same argument gives a different winner. The mathematical statement is that steepest is relative to a norm, and the gradient is the steepest direction only for the Euclidean norm.
The gradient still carries the function's first-order information, but decides what counts as far. Take to be the Hessian and the rule becomes Newton's method. Take diagonal, built from a running average of squared gradients, and the rule is very close to Adam. These are not escapes from steepest descent. They are steepest descent under a different ruler, which is why the same proof keeps reappearing with a new matrix in place of the identity.
Downhill is not the way home
Even with the Euclidean ruler, the theorem is about an infinitesimal step, not about where the minimum lives. Take , whose minimum is at the origin and whose contours are ellipses stretched ten to one. At the point , the gradient is . The straight-line direction to the minimum is .
The negative gradient there is , of length . The homeward direction is , of length . Their dot product is , so the cosine of the angle between them is , and the angle is about degrees. The steepest direction is nearly perpendicular to the direction that would actually reach the minimum.
If the step is finite, the discarded term can overtake the first-order term, so a step along the negative gradient need not decrease at all. The theorem is airtight for a Euclidean unit step in the limit of an infinitesimal step; relax either condition and the negative gradient is no longer the whole answer.
Worth keeping
- At a point, the rate of change per unit distance in a chosen direction is the gradient dotted with that unit direction.
- The negative gradient is the unique best first-order direction because the dot product is most negative when the step is antiparallel to the gradient.
- Steepest descent depends on the ruler used to measure step length; under a metric given by a positive definite matrix, the steepest direction is proportional to minus the inverse metric times the gradient.
Where this goes next
This question is one step of The Mathematics of Gradient Descent, a course that works through its subject from the beginning. The page that teaches this part of it is The Steepest Direction, and it reads the whole way through whether or not you have an account.
What an account changes is the practice: problems standing under every idea, marked with a reason rather than a tick, in a copy of the course that is yours.
Read that pageThe whole courseOther questions people ask about this
- How does momentum stop the steps from cancelling each other out?Momentum keeps a running total of past gradients, so directions that keep agreeing build up while directions that keep flipping sign cancel out.
- Why does computing the gradient cost about the same no matter how many parameters the network has?Because one backward sweep shares intermediate derivatives across all parameters, so the whole gradient costs a few forward passes in total rather than one per parameter.
- Why does Adam need bias correction at the start of training?Adam needs bias correction because its two running averages start at zero, and without correction the early steps are several times larger than the learning rate asks for.
- Why does gradient descent still work when each step uses only one minibatch's gradient?A minibatch gradient is wrong at every step but correct on average, so the errors cancel over many steps while the true downhill pull keeps adding up.
- What is the difference between variance and standard deviation?They measure the same spread: variance is the average squared distance from the mean, standard deviation is its square root, so you report the standard deviation and calculate with the variance.
- How do you make a vague claim precise enough to tell whether it's true?Fix what is being talked about, what is asserted, which cases are covered and the cut-off, then name an observation that would prove it false.