Imagine standing on a hillside in thick fog, trying to reach the lowest point in the valley without being able to see more than a few feet ahead. A reasonable strategy: feel which direction the ground slopes downward under your feet, take a step that way, and repeat — checking the slope again after every step rather than trying to plan the whole route in advance. That's gradient descent, and "which way is downhill" is exactly what a derivative measures.

A derivative, at a given point on a curve, is the slope of that curve at that exact spot — how steeply, and in which direction, the curve is rising or falling right there. A positive slope means the curve is heading up as you move right; a negative slope means it's heading down. Knowing the slope at your current position tells you which direction to move to go downhill, even without seeing the whole shape of the curve.

Gradient descent is the algorithm that repeats this feeling-around process automatically: start at some point, compute the slope (the "gradient," the multi-dimensional generalization of a derivative when there's more than one variable to adjust), take a small step in the downhill direction, and repeat until the slope flattens out to roughly zero — meaning a low point has been reached where a step in any direction stops helping.

This is exactly what "training" a machine learning model means under the hood: the model has a large number of adjustable numbers (its weights), and a "loss function" that measures how wrong its current predictions are, treated as the hillside's height. Training repeatedly nudges every weight a small amount in whatever direction reduces that loss fastest — descending the loss function's slope, the same way the hiker descends the hillside, just across millions of dimensions instead of two.

The step size in gradient descent — how big a stride to take before checking the slope again — is a genuinely important practical detail: too large a step and you can overshoot the low point and bounce around it forever; too small a step and reaching the bottom takes an impractically long time. That single tuning knob, called the learning rate, is one of the first things anyone training a model has to get right, and it's a direct consequence of the same fog-and-hillside picture the whole idea starts from.