Lesson
The theory — Gradient Descent and the Learning Rate
Gradient descent is one line repeated: stand somewhere, measure the slope, and step downhill in proportion to it. x ← x − η f′(x). The step size η is not part of the problem — the loss curve is given, the gradient is computed, and η is the one number a person chooses. On a quadratic of curvature a the arithmetic is exactly solvable, which is why this page uses one: every later claim about learning rates is a claim about 1 − ηa.
What each symbol means
η- the learning rate, the only thing you choose
a- the curvature of the loss, which the problem chooses for you
- Assumes
- One variable, a fixed step size and an exactly known gradient. Real training breaks all three at once — millions of parameters, a step size on a schedule, and a gradient estimated from a small batch — and the one thing that survives intact is the boundary at 2/a, because it comes from the curvature in a single direction and a real loss surface has one of those per eigenvector.
Problem solved in full
-
Your learning rate of 0.4 is working. Find the exact curvature at which it stops working, and say what the failure looks like on either side of that point. Start from the tool at η = 0.4, a = 1, x₀ = 8, where the Step multiplier row reads 0.6000 and the path walks quietly down one wall.
-
Every question on this page is a question about |r| < 1, where r = 1 − aη. The rate is fixed at 0.4 and the curvature is what you are allowed to move, so write the condition in terms of a rather than η.
-
|1 − 0.4a| < 1 unfolds to −1 < 1 − 0.4a < 1, then to 0 < 0.4a < 2, so a < 5. The rate survives every curvature below 5 and none above it. This is the familiar η < 2/a read the other way round, as a < 2/η. Same inequality, and the second arrangement is the one that answers what was asked.
-
Set a = 5 exactly and read the table. r = −1.0000, and Position after 20 steps prints 8.000, the number it started at. The fraction of the starting loss is 1.000. This is the boundary itself: each step lands as far from the minimum as the last one did, on the opposite side, so the path bounces between 8 and −8 for as long as you leave it running.
-
Now nudge to a = 5.1. r = −1.0400, and after twenty steps x is 17.529 instead of 8. That is real divergence, and it is worth seeing how mild it looks: twenty steps roughly doubled the distance. A run just this side of the boundary can pass for merely noisy for a long time before the numbers turn obviously absurd.
-
Back the other way, a = 4.9 does still converge. r = −0.9600, |r| is under 1, and the table says Overshoots, converges. But Steps to bring |x| under 10⁻⁶ now reads 390, against 32 at a = 4. Almost-stable is close to useless.
Answer
a = 5, which is 2/η. Below it the rate converges, at it the loss never changes, above it the loss grows without limit. The expensive part is the approach. Near the boundary |r| is 1 − a·g, writing g for the gap 2/a − η, so log|r| ≈ −a·g and the step count is roughly log(|x₀|/tolerance) divided by a·g. It goes as one over the distance to the edge: halve the gap and you double the work. At a = 5 from x₀ = 8, gaps of 0.05, 0.025 and 0.0125 need 56, 120 and 247 steps, and multiplying each count by its own gap gives 2.8, 3.0 and 3.1, closing on log(8 × 10⁶)/5 = 3.18. That is why a tuned learning rate never sits at the edge of stability. The last safe sliver before the boundary is also among the slowest ground on the whole axis, and the fastest rate of all is the one in the middle at 1/a.
-
Learning path
Fitting a line to data
References (3)
- Where the method comes from. Two pages, and the idea is already complete: follow the gradient downhill in steps. A.-L. Cauchy, “Méthode générale pour la résolution des systèmes d’équations simultanées.” Comptes Rendus de l’Académie des Sciences 25, 536–538, 1847.
- The tool's central claim, in the form it takes for a real network: with a as the largest eigenvalue of the Hessian, the fastest single learning rate is 1/a and anything past 2/a diverges. This is the source for insight block 3. Y. LeCun, L. Bottou, G. B. Orr and K.-R. Müller, “Efficient BackProp.” In Neural Networks: Tricks of the Trade, Lecture Notes in Computer Science, 9–50. Springer, 1998.
- The convergence analysis behind the step count: why the work needed grows with the ratio of the largest curvature to the smallest, which is the condition number named in insight block 3. S. Boyd and L. Vandenberghe, Convex Optimization. Cambridge University Press, 2004.