The learning rate is the one setting you will tune more than any other in machine learning. It is also the one most explanations rush past. Here is the whole idea with real numbers, in about four minutes.

The one-line version

Gradient descent updates a weight like this:

w = w - learning_rate * gradient 

The gradient says which way is downhill. The learning rate says how big a step to take. Picture walking down a valley in the dark: the learning rate is your stride length.

A tiny experiment you can run

Take the simplest possible loss, loss = (w - 3)^2. The best answer is w = 3. Start at w = 0 (loss 9) and take 12 steps:

def run(lr, steps=12, w=0.0): for _ in range(steps): w -= lr * 2 * (w - 3) # gradient of (w - 3)^2 is 2(w - 3) return (w - 3) ** 2 for lr in [0.01, 0.1, 0.9, 1.1]: print(lr, round(run(lr), 4)) 
0.01 5.542 # too small: barely moved 0.1 0.0425 # good: almost at the bottom 0.9 0.0425 # same loss, but it got there by bouncing side to side 1.1 715.4716 # too big: every step overshoots more, the run diverges 

Three lessons hide in those four lines:

  • Too small wastes time. The curve is still sloping down when you stop.
  • Too big overshoots the bottom, lands higher on the other side, and the loss explodes.
  • "Works" is not the same as "smooth". 0.9 reaches the same loss as 0.1, but it zig-zags across the valley on the way. On a real model with noisy gradients, that bouncing is what makes training unstable.

How people actually pick it

  1. Search in multiples of about 3, not small steps. Try 0.001, 0.003, 0.01, 0.03, 0.1. Learning rates matter on a log scale, so 0.01 vs 0.03 is a real difference, while 0.03 vs 0.031 is not.
  2. Pick the largest value whose loss still falls smoothly. Bigger trains faster, until it starts bouncing.
  3. Start big, then slow down. A learning-rate schedule shrinks the step as training goes on: big strides while you are far from the bottom, small careful ones near it. Large models usually add a short warm-up at the start too.

The rule of thumb

What the loss curve does What to change
Falls, then flattens Nothing, this is good
Falls very slowly Raise the learning rate
Bounces or goes up Lower the learning rate

See it move

I built a free interactive lesson where you can drag the learning rate and watch the ball roll (or fly out of) the valley, next to the live training curve: Learning rate on Stepwise ML. It is part of a free set of 126 short visual ML lessons, no sign-up needed.

What confused you most when you first met learning rates? I'm collecting the common sticking points to make the lessons better.