The Hill-Climbing Metaphor
Imagine the loss as a landscape — a hilly terrain where altitude = error. You want the lowest valley (minimum loss). You can't see the whole landscape, but you can feel the slope at your feet. Gradient descent says: take a step in the direction of steepest descent. Repeat until flat.
Mathematically: . The gradient is the steepest ascent direction; we negate it to descend. (the learning rate) is your step size.
The Three Failure Modes
- Learning rate too small → you crawl, take forever, possibly never converge.
- Learning rate too large → you overshoot the valley, oscillate, possibly diverge to infinity.
- Bad initialization → you start in a flat region (gradient ≈ 0) or a saddle point and don't move.
This is why "tuning the learning rate" is most of practical deep learning. The answer matters enormously and is rarely the default.
Variants You'll Meet
- SGD — vanilla gradient descent on mini-batches. Simple, often surprisingly competitive.
- Momentum — accumulate past gradients to push through small bumps.
- Adam — momentum + per-parameter learning rate. Default in most modern training.
- Schedules — start fast, slow down as you approach the valley. Cosine and warmup are common.
Gradient descent is the engine. The loss is the terrain. The learning rate is your step size. Most ML engineering is teaching this engine to navigate a particular terrain.