Learning Rates and Convergence
Imagine training a model where every step of gradient descent makes the loss worse, not better. The model diverges, and the loss explodes to infinity. A beginner concludes the algorithm itself is broken. In fact nothing is wrong with Gradient Descent. The step size, or learning rate, is simply too large. Choosing this single scalar (or schedule of scalars) is one of the most consequential decisions in all of machine learning. It separates a model that trains in minutes from one that never converges at all. The learning rate controls how far each parameter update travels along the negative gradient direction. Too small, and training crawls, wasting compute. It also risks convergence to a poor local region, because the process stops early. Too large, and updates overshoot the minimum. This causes oscillation or outright divergence. Real training pipelines — from logistic regression to billion-parameter transformers — spend enormous engineering effort on this one knob. Warmup schedules, decay schedules, adaptive per-parameter rates, and learning-rate finders are all attempts to tame this tradeoff automatically. The big picture is that convergence rate and stability follow precise mathematical relationships. These relationships link the learning rate, the curvature of the loss function, and the desired accuracy. For convex, smooth objectives, classical optimization theory gives exact bounds. A learning rate above a computable threshold guarantees divergence. A rate below it guarantees convergence at a known rate. This is not folklore. It is provable from the structure of gradient descent itself. This article develops the theory of step-size choice from first principles. It derives the convergence-rate bounds for convex and strongly convex objectives. It walks through concrete numerical traces showing divergence versus convergence. It also surveys the schedules (constant, decaying, adaptive) used in practice. It closes by connecting learning rates to the ideas of Stochastic Gradient Descent and Momentum Methods. These methods build directly on the step-size machinery introduced here.
- The learning rate η scales each gradient-descent step; it is the single most sensitive hyperparameter in optimization.
- For an L-smooth objective, any η < 2/L guarantees the loss does not increase; η > 2/L can cause divergence.
- Convex smooth objectives converge at rate O(1/k) in loss value with a well-chosen constant η.
- Strongly convex smooth objectives converge geometrically (linearly), with rate governed by the condition number L/μ.
- Practical schedules — step decay, exponential decay, cosine annealing, warmup — trade exploration early on for stability and precision later.
- Poor learning-rate choice is the most common cause of failed training runs, more so than model architecture.
The learning rate sets the tradeoff between convergence speed and stability, and this tradeoff is precisely quantified by the smoothness and curvature of the loss surface.
The idea
Gradient descent updates parameters by
where is the objective (loss) function and is the learning rate (also called the step size). At each iteration the algorithm moves opposite to the gradient — the direction of steepest local increase — scaled by . The gradient tells you which direction to move; the learning rate tells you how far. This decoupling is exactly why the learning rate is such a delicate quantity: the gradient direction is determined by the geometry of , but the step length is a free choice that must be matched to that geometry to behave well. Two properties of control what "matched" means. Smoothness: is -smooth if its gradient is -Lipschitz, , which bounds how fast the gradient can change and hence how curved can be. Strong convexity: is -strongly convex if is convex, which lower-bounds curvature and guarantees a unique minimizer. Together and define the condition number , the single number that most tightly controls how hard an objective is to optimize with a fixed-step method. A learning rate schedule is a rule that may change over iterations , rather than a single fixed constant. Schedules exist because the optimal constant rate for fast initial progress is often too aggressive for fine convergence near the minimum, and vice versa; varying lets an optimizer be aggressive early and cautious late, which is the guiding principle behind step decay, exponential decay, cosine annealing, and warmup schedules used throughout deep learning.
How it works
The mechanism has two layers: the descent step itself (unchanged from plain Gradient Descent), and the rule that produces at each iteration. The pseudocode below implements full-batch gradient descent with a general schedule, plus an optional backtracking line search that adaptively certifies a safe step size at every iteration — a concrete algorithm for turning the theory below into a robust implementation. ``` function GRADIENT_DESCENT(f, grad_f, theta_0, schedule, max_iters, tol): theta = theta_0 for k = 0, 1, 2, ..., max_iters - 1: g = grad_f(theta) if norm(g) < tol: return theta # converged: near-stationary point eta_k = schedule(k, theta, g, f) # constant / decaying / line-search theta = theta - eta_k g return theta function CONSTANT_SCHEDULE(eta): return function(k, theta, g, f): return eta function STEP_DECAY_SCHEDULE(eta0, drop, every): return function(k, theta, g, f): return eta0 drop^floor(k / every) function EXPONENTIAL_DECAY_SCHEDULE(eta0, rate): return function(k, theta, g, f): return eta0 exp(-rate k) function BACKTRACKING_LINE_SEARCH(eta_init, shrink, c): return function(k, theta, g, f): eta = eta_init while f(theta - eta g) > f(theta) - c eta dot(g, g): eta = eta shrink # Armijo sufficient-decrease condition return eta ```
Step-by-step reading of the algorithm: 1. Gradient evaluation. Compute ; this is the same cost as in plain gradient descent and does not depend on the schedule. 2. Stopping check. If is below tolerance, is (approximately) a stationary point and the loop terminates — this is the correctness base case. 3. Schedule evaluation. The schedule function decides . A constant schedule ignores ; decaying schedules shrink over time; the line-search schedule tests candidate step sizes against the Armijo condition
which certifies that the step produces at least a fraction of the decrease predicted by the local linear (first-order Taylor) approximation. 4. Update. Apply . 5. Repeat until convergence or the iteration budget is exhausted. Backtracking line search is the practical bridge between theory and practice: instead of hand-picking a single global , it re-derives a locally safe step size at every iteration by directly testing the sufficient-decrease condition, at the cost of extra function evaluations per step.
Complexity & correctness
Per-iteration cost. Each plain gradient-descent step costs arithmetic beyond the gradient computation itself, where is the parameter dimension (the update is a vector subtraction and scalar multiply). The dominant cost is computing , which for a dataset of points is typically for full-batch gradients — the schedule computation itself (constant, step decay, exponential decay) is per step. Backtracking line search adds per outer iteration, where is the number of shrink attempts, each costing one function evaluation.
Convergence rate — smooth convex case. Suppose is convex and -smooth. A standard descent lemma states that for any ,
Derivation sketch: -smoothness gives the quadratic upper bound . Substituting yields , and choosing makes the coefficient of at most , so the loss is monotonically non-increasing. This is exactly why is the divergence boundary: past the coefficient flips positive and the bound no longer guarantees decrease. Summing this inequality over steps and using convexity (which relates gradient norm to suboptimality) gives the classical rate
with the optimal constant choice . This is a sublinear rate: to halve the error you need roughly to double the iteration count.
Convergence rate — strongly convex case. If in addition is -strongly convex, choosing gives the sharper, linear (geometric) rate
where is the condition number. This means error shrinks by a constant multiplicative factor each iteration — exponentially fast in — but the factor approaches 1 as grows, so ill-conditioned problems (large ) converge arbitrarily slowly even though the rate is technically linear. This is the precise mathematical reason poorly scaled features or highly elongated loss bowls make training slow.
Divergence for . For the simplest case (a pure quadratic with curvature ), gradient descent gives , so . This converges to 0 iff , i.e. iff ; at the iterates oscillate with constant magnitude, and for , and geometrically. This single closed-form example is the rigorous backbone behind the informal claim "too large a learning rate causes divergence" — it is not a heuristic, it is provable exactly.
Tradeoffs. Constant guarantees stability but only sublinear convergence for merely convex objectives, and requires knowing (or estimating) , which is often unavailable in practice for nonconvex deep networks. Decaying schedules trade a slower theoretical worst-case rate for empirical robustness to a misestimated . Line search removes the need to know at all but pays extra function evaluations per step — a real cost when is expensive, as in large-batch training.
Worked example
Take the 1-D quadratic , so , minimum at , and (the Lipschitz constant of ). The threshold for guaranteed non-divergence is . Start at .
| (small) | (optimal) | (near boundary) | (over boundary) | |
|---|---|---|---|---|
| 0 | 5.000 | 5.000 | 5.000 | 5.000 |
| 1 | 4.000 | 0.000 | 0.500 | −0.500 |
| 2 | 3.200 | 0.000 | 0.050 | 0.050 |
| 3 | 2.560 | 0.000 | 0.005 | −0.005 |
| 4 | 2.048 | 0.000 | 0.0005 | 0.0005 |
| 10 | 0.537 | 0.000 | ≈0 | ≈0 |
| (formula) | for |
For : since , we get , whose magnitude grows without bound — this is provable divergence, not slow convergence, matching exactly the closed-form analysis above. For , , so the iterate reaches the exact minimum in a single step — the theoretically optimal rate for this perfectly conditioned quadratic. For , convergence is geometric but slow, shrinking by a factor of each step; it takes about steps to reach , versus one step at the optimal rate. For , the iterate oscillates in sign but still shrinks in magnitude by a factor of per step, since — oscillation alone does not imply divergence, only does. This table demonstrates all three qualitative regimes predicted by the theory: monotone slow convergence, one-shot optimal convergence, oscillatory-but-convergent behavior, and true divergence — from a single formula , exactly as derived in the Complexity & correctness section.
Common pitfalls & traps
| Pitfall | Why it happens | Fix |
|---|---|---|
| Picking by trial-and-error with no bound in mind | No estimate of or curvature is used | Use a line search, or estimate via the Hessian's largest eigenvalue / power iteration |
| Assuming oscillation always means divergence | Confusing (convergent oscillation) with (divergence) | Track the loss value across iterations, not just the sign of updates |
| Using one global for badly scaled features | Ill-conditioned makes a single rate near-optimal for one direction and unstable for another | Normalize/standardize features; consider per-parameter adaptive rates (foreshadowing adaptive optimizers) |
| Decaying too fast, too early | Schedule designed for a different problem scale or dataset size | Tune decay rate/step against a validation curve; use warmup before decay |
| Treating the constant-rate convex bound as applying to nonconvex deep nets | -smoothness and convexity rarely hold globally in deep networks | Use adaptive/backtracking rates and monitor loss directly; treat convex bounds as intuition, not guarantees |
| Off-by-one in schedule step counting (decaying at wrong iteration) | Confusing "epoch" index with "step" index in `floor(k/every)` | Log and plot the realized trajectory, don't just trust the formula |
Pioneers & history
Origins · 1 minAugustin-Louis Cauchy and how this was discovered
Cauchy's original steepest-descent method used a fixed, hand-chosen step and could diverge or crawl exactly as shown above; it took over a century of convex analysis — culminating in the smoothness- and strong-convexity-based bounds used today — to turn "try a step and see" into a provable theory of step-size selection. The condition-number-dependent linear rate derived in this article is the direct descendant of that analysis, and it directly motivates why later methods reweight or precondition gradients, foreshadowing both Stochastic Gradient Descent and Momentum Methods.
Where this matters
Learning-rate schedules are load-bearing infrastructure in essentially every production machine learning system. Deep learning frameworks such as PyTorch and TensorFlow ship dozens of built-in schedulers (step decay, cosine annealing, exponential decay, one-cycle) precisely because no single constant rate works across model scales. Large language model training runs use carefully tuned warmup-then-decay schedules — a short initial phase with small to avoid destabilizing randomly initialized weights, followed by cosine or linear decay to fine-tune late in training. Learning-rate finders (used in fastai and elsewhere) automate the search for a good constant rate by scanning over orders of magnitude and plotting the resulting loss curve. Recommendation systems, reinforcement learning agents, and classical convex solvers (logistic regression, SVMs, LASSO) all rely on the same smoothness/strong-convexity theory to choose safe step sizes or line-search parameters. The condition-number argument also explains why feature normalization and batch normalization are so effective in practice: they directly reduce , letting a single learning rate work well across all parameter directions.
Ask the tutor: How does mini-batch noise in stochastic gradient descent change the safe range for the learning rate compared to full-batch gradient descent?
Why is 2/L exactly the divergence threshold rather than some other value?
For the model quadratic , gradient descent gives , a linear recurrence with ratio . The iterates converge to zero exactly when , which expands to , i.e. . At , and iterates oscillate with constant magnitude forever; beyond that, and magnitude grows geometrically. Because -smoothness means the true objective is upper-bounded by such a quadratic everywhere, the same threshold provably applies to the general smooth case, not just this toy example.
If a smaller learning rate is always "safer," why not just always use a very small one?
A smaller shrinks the per-step decrease guaranteed by the descent lemma, since the bound is . Halving roughly doubles the number of iterations needed to reach the same accuracy, so extremely small rates waste enormous amounts of compute even though they never diverge. In practice you want the largest that still satisfies the stability threshold, which is why is the theoretically optimal constant choice for smooth convex problems.
Why do practitioners decay the learning rate over training instead of using a single constant value?
Early in training, gradients are large and a bigger step makes fast progress toward a good region of parameter space. Near convergence, large steps overshoot the minimum and cause the loss to oscillate around it rather than settle. Decaying schedules exploit this by being aggressive early (fast exploration) and cautious late (fine convergence), effectively approximating a time-varying local Lipschitz constant that shrinks as the loss surface flattens near a minimum. This mirrors the fixed-vs-adaptive tradeoff formalized later in adaptive methods.
How does the condition number κ connect to feature scaling and normalization?
The Hessian eigenvalues of a quadratic loss reflect the curvature along each parameter direction; if one feature has much larger scale than another, the loss surface becomes an elongated ellipse with a large ratio between its largest and smallest curvature, i.e. large . Since the strongly convex rate is , a large makes this factor close to 1 and convergence painfully slow with a single global learning rate. Standardizing features (zero mean, unit variance) roughly equalizes curvature across directions, shrinking and letting one learning rate work well everywhere — this is a major, non-cosmetic reason normalization speeds up training.
Does backtracking line search remove the need to know or estimate L?
Yes — that is its main practical advantage. Instead of computing or bounding analytically (often intractable for nonconvex deep networks), backtracking line search repeatedly shrinks a candidate step until the Armijo sufficient-decrease condition holds, effectively discovering a locally safe step size at every iteration. The cost is extra evaluations of per outer iteration, which can be expensive when requires a full forward pass over a large dataset or model. In deep learning, exact line search is rarely used for this cost reason; instead, adaptive methods approximate its benefits more cheaply.
Is a schedule that guarantees monotone decrease always better than one that allows temporary increases?
Not necessarily — the monotone-decrease guarantee (e.g., under smoothness) is a worst-case guarantee, and real nonconvex losses often benefit from occasional larger steps that temporarily increase loss but escape shallow local structure. Schedules like cyclical learning rates and one-cycle policies deliberately allow the loss to rise briefly to improve final generalization. The rigorous convergence bounds in this article are safety guarantees for convex problems, not claims that monotonicity is always optimal for nonconvex deep learning.
How does this theory foreshadow stochastic gradient descent and momentum?
Everything here assumes the full, exact gradient , so -smoothness fully determines the safe step size. In Stochastic Gradient Descent, gradients are noisy estimates from mini-batches, so a constant that would be safe for full-batch descent can cause persistent oscillation around the minimum rather than convergence, motivating decaying schedules with stricter conditions (e.g. , ). Momentum Methods instead modify the update direction itself, accumulating past gradients to dampen oscillation along high-curvature directions, effectively improving the effective condition number that governs the geometric rate derived here.