Learning Rate and Convergence
What is it?
The learning rate (written ) is a small positive number that controls how big each step is during gradient descent. It is one of the most important settings in machine learning.
Why we need it
Gradient descent knows which direction to move (downhill), but not how far to step.
If you take tiny steps, you will eventually reach the minimum β but it will take a very long time.
If you take huge steps, you might jump over the minimum and end up somewhere worse. Take even bigger steps and the loss can grow instead of shrink β the model diverges.
The learning rate is the dial that controls step size. Finding a good value is one of the first things you tune in any ML project.
Explained in detail
Recall the gradient descent update rule:
The gradient tells us the direction and steepness of the slope. The learning rate scales that by telling us: of that full slope, what fraction of a step do we take?
Too small (): Each step barely moves. The ball creeps toward the minimum. Training takes thousands of steps. It may never get there in a reasonable time.
Just right (): Steps are large enough to converge in tens to hundreds of steps, but small enough not to overshoot. The loss decreases smoothly.
Too large (): Each step overshoots the minimum. The ball lands on the other side of the valley, then jumps back over again β going further each time. The loss oscillates or grows. The model diverges.
Imagine adjusting the temperature on a shower. Tiny turns and you wait forever for it to warm up. Huge turns and you slam between freezing and scalding. A moderate turn gets you to the right temperature quickly and smoothly.
How do you pick a learning rate in practice?
- Start around or and watch the loss curve.
- If the loss decreases smoothly β good.
- If the loss barely moves β try 10Γ larger.
- If the loss oscillates or increases β try 10Γ smaller.
- Use a learning rate schedule to start larger and decrease over time.
Learning Rate Comparison β Loss vs Steps
Three gradient descent runs with different learning rates. Gray = too slow, green = just right, red = too fast (may diverge).
What to try
- The figure shows three runs side by side: slow (small Ξ±), good (medium Ξ±), and fast/diverging (large Ξ±).
- Drag the Ξ± slider and press Run all to see how all three paths change.
- Watch the Loss vs Steps chart on the right: a good Ξ± produces a smooth, steeply falling curve. Too-small Ξ± falls slowly. Too-large Ξ± bounces or climbs.
- Try the "Goldilocks" preset to see the ideal convergence, then "Diverge" to see the loss explode.
Notes & Formula
A good rule of thumb: plot the loss vs. steps for a few values of Ξ± (e.g. 0.001, 0.01, 0.1). The best Ξ± is the one where the loss falls steeply and smoothly. This plot is called the loss curve.
Learning rate schedules start with a larger Ξ± early in training (when the model is far from the minimum and big steps are fine) and reduce it later (when you need fine adjustments near the minimum). Common schedules: step decay, cosine annealing, warmup.
Common mistake: choosing a learning rate once and never changing it. In practice, the best Ξ± for a large model at step 1 is not the same as at step 10 000.
Quiz
π§©
Ready to test yourself?
10 questions Β· explanations shown after
Mastered this concept?
Tick this box when you feel confident explaining it.
Topic Resources
ποΈ
No notes uploaded for this topic yet
Lecture notes, summaries, and notebook exercises will be added here. You can also view or contribute notes on GitHub.
Was this clear?