Skip to content
Numerical Method , home
Menu

Writing2026

Training Is Numerical Integration: What Numerical Analysis Says About Learning Rates

Here is the thesis. Gradient descent is a numerical method for an ordinary differential equation, and the most useful things we know about training follow from taking that literally. The learning rate is not a speed setting. It is a choice of model, because a gradient descent run with step hh follows, with error O(h2)O(h^2), the exact gradient flow of a different loss, L+h4∥∇L∥2L + \tfrac h4\lVert\nabla L\rVert^2. And the number of steps is not a budget. Together with the step size, it defines a training time t=kht = kh, and for least-squares problems that training time is, up to a constant factor in risk, the inverse of a ridge penalty.

None of the ingredients is new. Backward error analysis is half a century old, the modified loss was written down by Barrett and Dherin (2021), the link between early stopping and ridge regression is classical, and practitioners have long traded learning rate against epochs. What I want to show is what these facts say together, with explicit bounds, and where they stop being true. For plain gradient descent on least squares, the learning rate, the step count and the regularization strength reduce to one dial, with a provable error. That explains why early stopping in return prediction is shrinkage. It also explains why, at the signal-to-noise ratios of real returns, the step size stops being a detail. The practical rules at the end apply to plain gradient descent and, as heuristics, to stochastic gradient descent; they do not apply to Adam and other preconditioned methods.

The phenomenon everyone has seen

What does every practitioner who has trained a model know? Three things, usually learned the hard way.

First, there is a largest learning rate beyond which training diverges, and good runs often sit not far below it. Second, if you never stop, a flexible model will eventually fit the noise. Training error keeps falling while test error turns around and climbs. Third, the learning rate and the number of epochs interact: halve one and you often need to double the other to get the same result, but not always, and the cases where the rule fails are where the interesting behaviour lives.

Each of these facts is usually explained separately, with a different vocabulary: optimization for the first, statistics for the second, rules of thumb for the third. A numerical analyst sees one object behind all three: a one-step method for an ODE, with a stability limit, a modified equation and a time variable.

Gradient descent is the forward Euler method

Gradient descent with step hh,

θk+1=θk−h ∇L(θk),\theta_{k+1} = \theta_k - h\,\nabla L(\theta_k),

is precisely the forward Euler method applied to the gradient flow

θ˙(t)=−∇L(θ(t)).\dot\theta(t) = -\nabla L(\theta(t)).

Iterate kk approximates the flow at time t=kht = kh. The flow itself is the idealized learner. It has no step size, it decreases LL monotonically, and for convex problems it converges to a minimizer. Everything a real run does differently from the flow is a discretization effect, and numerical analysis has spent sixty years classifying discretization effects.

The first is stability. Near a minimum, LL is approximately quadratic with Hessian HH. In an eigendirection of HH with eigenvalue λ\lambda, one Euler step multiplies the deviation from the minimum by 1−hλ1 - h\lambda.

Proposition 1 (stability limit). For a quadratic loss with Hessian H⪰0H \succeq 0, gradient descent converges for every starting point if and only if 0<h<2/λmax⁡(H)0 < h < 2/\lambda_{\max}(H) (with λmax⁡>0\lambda_{\max} > 0). For 1/λmax⁡<h<2/λmax⁡1/\lambda_{\max} < h < 2/\lambda_{\max} the component along the top eigenvector converges with alternating sign.

Proof. The error ek=θk−θ⋆e_k = \theta_k - \theta^\star satisfies ek+1=(I−hH)eke_{k+1} = (I - hH)e_k, so each eigencomponent is multiplied by 1−hλi1 - h\lambda_i per step. All components converge if and only if ∣1−hλi∣<1\lvert 1 - h\lambda_i\rvert < 1 for every λi>0\lambda_i > 0, that is, h<2/λmax⁡h < 2/\lambda_{\max}. The sign of 1−hλmax⁡1 - h\lambda_{\max} is negative exactly when h>1/λmax⁡h > 1/\lambda_{\max}. □\square

This is the textbook stability region of the forward Euler method, restated in the vocabulary of machine learning. The “largest learning rate” is 2/λmax⁡2/\lambda_{\max}, and λmax⁡\lambda_{\max}, the sharpness of the loss, plays the role that the stiffest eigenvalue plays for a differential equation. For neural networks λmax⁡\lambda_{\max} is not a constant: training changes it. We will return to this.

The learning rate chooses the loss

The second effect is subtler and more important. A numerical method does not solve the equation you gave it. To higher order, it solves a nearby equation exactly. This is the idea behind backward error analysis for differential equations, developed at length by Hairer, Lubich and Wanner (2006). Find the modified vector field whose exact flow passes through the numerical iterates, and you know what the method is really doing.

For gradient descent the computation is short. We look for a vector field fh=−∇L+hf1f_h = -\nabla L + h f_1 whose exact flow over a time hh agrees with one Euler step up to O(h3)O(h^3).

Proposition 2 (modified loss; Barrett and Dherin 2021). Let LL be three times continuously differentiable. The flow of

θ˙=−∇L~h(θ),L~h=L+h4 ∥∇L∥2,\dot\theta = -\nabla \widetilde L_h(\theta), \qquad \widetilde L_h = L + \frac h4\,\lVert\nabla L\rVert^2,

agrees with one step of gradient descent with step hh up to O(h3)O(h^3). Consequently, over any fixed time interval [0,t][0, t] the gradient descent iterates stay within O(h2)O(h^2) of this flow, whereas they are only O(h)O(h) from the gradient flow of LL itself.

Derivation. Write g=∇Lg = \nabla L and H=∇2LH = \nabla^2 L, and expand the flow of θ˙=f(θ)\dot\theta = f(\theta) with f=−g+hf1f = -g + hf_1 in powers of the elapsed time hh:

θ(h)=θ+hf+h22 f′f+O(h3)=θ−hg+h2(f1+12Hg)+O(h3),\theta(h) = \theta + h f + \tfrac{h^2}{2}\,f'f + O(h^3) = \theta - hg + h^2\bigl(f_1 + \tfrac12 Hg\bigr) + O(h^3),

where we used f′f=(−H)(−g)+O(h)=Hg+O(h)f'f = (-H)(-g) + O(h) = Hg + O(h). Matching this with the Euler step θ−hg\theta - hg requires f1=−12Hgf_1 = -\tfrac12 Hg. Since ∇(12∥g∥2)=Hg\nabla\bigl(\tfrac12\lVert g\rVert^2\bigr) = Hg, we have f1=−∇(14∥g∥2)f_1 = -\nabla\bigl(\tfrac14\lVert g\rVert^2\bigr), and therefore f=−∇(L+h4∥∇L∥2)f = -\nabla\bigl(L + \tfrac h4\lVert\nabla L\rVert^2\bigr). The global statement follows from the local one by the standard argument: a local error of O(h3)O(h^3) accumulated over t/ht/h steps of a Lipschitz flow gives a global error of O(h2)O(h^2). □\square

Read the modified loss as a statement about learning. Gradient descent with step hh does not minimize LL. It minimizes LL plus a penalty on the squared gradient norm, with a weight proportional to the learning rate. Trajectories through regions where the loss is steep are penalized. A larger learning rate is therefore not “the same optimization, faster”. It is a different objective, with a stronger preference for flat regions. Barrett and Dherin call this implicit gradient regularization, and Smith, Dherin, Barrett and De (2021) extended the analysis to stochastic gradient descent, where minibatch noise contributes a further penalty.

The quadratic case shows that nothing has been lost in the expansion. For L(θ)=12θ⊤AθL(\theta) = \tfrac12\theta^{\top}A\theta the modified loss is L~h=12θ⊤(A+h2A2)θ\widetilde L_h = \tfrac12\theta^{\top}\bigl(A + \tfrac h2A^2\bigr)\theta, so the modified flow contracts an eigendirection with eigenvalue ss at the rate s(1+hs2)s(1 + \tfrac{hs}{2}). Over one step of length hh that is a factor exp⁡(−hs−h2s22)\exp\bigl(-hs - \tfrac{h^2s^2}{2}\bigr). Gradient descent multiplies by 1−hs=exp⁡(ln⁡(1−hs))=exp⁡(−hs−h2s22−h3s33−⋯ )1 - hs = \exp\bigl(\ln(1-hs)\bigr) = \exp\bigl(-hs - \tfrac{h^2s^2}{2} - \tfrac{h^3s^3}{3} - \cdots\bigr). The two agree through second order and differ at third order, exactly as Proposition 2 says. The same expansion shows where the description must fail: the series for ln⁡(1−hs)\ln(1-hs) diverges as hs→1hs \to 1, and for hs>1hs > 1 the factor 1−hs1 - hs is negative, which no exponential can reproduce. The modified equation lives inside the stability region, and loses its meaning at the halfway point to the edge.

Is the O(h2)O(h^2) claim true in practice, outside the asymptotic regime? We can check directly. Take a one-hidden-layer tanh network with 48 parameters, fitted to 64 points of a smooth function, and 50 random initializations. Run gradient descent to time t=2t = 2 with five learning rates, and integrate both the gradient flow and the modified flow to high accuracy with a fourth-order Runge–Kutta method. The code computes Hessian–gradient products by differencing the analytic gradient.

Log-log chart of distance at time t equal to 2 against learning rate, with interquartile bands over 50 initializations. The median distance between gradient descent and gradient flow falls with slope one, from about 9 times 10 to the minus 3 to 4.5 times 10 to the minus 4. The median distance between gradient descent and the modified flow falls with slope two, from about 4 times 10 to the minus 3 to 1.3 times 10 to the minus 5. Fig. 1 — Gradient descent is first-order close to the gradient flow of LL and second-order close to the flow of L+h4∥∇L∥2L + \tfrac h4\lVert\nabla L\rVert^2. Medians and interquartile ranges over 50 initializations.

Fitting a power law to the three smallest learning rates of each initialization gives a slope of 1.0201.020 for the distance to the gradient flow (interquartile range 1.0071.007–1.0551.055) and 2.0072.007 for the distance to the modified flow (1.9931.993–2.0162.016). At h=0.0125h = 0.0125 the modified flow is a median of 30 times closer to what gradient descent actually did (interquartile range 20–54). Even for a small non-convex network, the modified loss is not a metaphor. It is a quantitatively better description of the training run than the loss we wrote down.

Training time is a regularization parameter

The third effect concerns the time variable. In the flow picture, a training run is parameterized not by its number of steps kk but by the time t=kht = kh it has integrated. For least squares this can be made exact, and the result shows directly what training time does.

Let A=X⊤X/nA = X^{\top}X/n be the sample covariance of the features, with eigenpairs (si,vi)(s_i, v_i), and let b=X⊤y/nb = X^{\top}y/n. The least-squares loss is L(w)=12w⊤Aw−b⊤w+constL(w) = \tfrac12 w^{\top}Aw - b^{\top}w + \text{const}, and its minimizer, ordinary least squares, has component bi/sib_i/s_i along viv_i, writing bi=vi⊤bb_i = v_i^{\top}b.

Proposition 3 (training as a spectral filter). Started from w0=0w_0 = 0, each of the following estimators has component φ(si) bi/si\varphi(s_i)\,b_i/s_i along viv_i, with

gradient descent after k steps:φkGD(s)=1−(1−hs)k,gradient flow at time t:φtGF(s)=1−e−ts,ridge regression with penalty α:φαR(s)=ss+α.\begin{aligned} &\text{gradient descent after } k \text{ steps:} && \varphi^{\mathrm{GD}}_{k}(s) = 1 - (1-hs)^k,\\ &\text{gradient flow at time } t: && \varphi^{\mathrm{GF}}_{t}(s) = 1 - e^{-ts},\\ &\text{ridge regression with penalty } \alpha: && \varphi^{\mathrm{R}}_{\alpha}(s) = \frac{s}{s+\alpha}. \end{aligned}

Proof. Gradient descent gives wk+1=(I−hA)wk+hbw_{k+1} = (I - hA)w_k + hb. Along viv_i this is the scalar recursion ck+1=(1−hsi)ck+hbic_{k+1} = (1 - hs_i)c_k + hb_i with c0=0c_0 = 0, whose solution is ck=(1−(1−hsi)k)bi/sic_k = \bigl(1 - (1-hs_i)^k\bigr)b_i/s_i. The flow w˙=b−Aw\dot w = b - Aw gives c(t)=(1−e−tsi)bi/sic(t) = (1 - e^{-ts_i})b_i/s_i. Ridge regression solves (A+αI)w=b(A + \alpha I)w = b, so c=bi/(si+α)c = b_i/(s_i + \alpha). □\square

The filter φ\varphi is the fraction of each direction that the estimator has learned. Directions with large eigenvalues, the strong and stable patterns in the data, are learned early. Directions with small eigenvalues, where the sample covariance is mostly noise, are learned late, and their components bi/sib_i/s_i are exactly the ones that blow up in ordinary least squares. Stopping at time tt keeps the first and suppresses the second. That is what shrinkage is.

None of this was discovered by machine learning. In 1951 Landweber proposed solving integral equations of the first kind, the model of an ill-posed inverse problem, by exactly the iteration wk+1=wk+h X⊤(y−Xwk)w_{k+1} = w_k + h\,X^{\top}(y - Xw_k), which is gradient descent on least squares. The numerical analysts who studied it found the behaviour of Figure 3 below decades before anyone drew a validation curve. The iterates first approach a sensible regularized solution and then, as the iteration starts to resolve the noise-dominated small singular values, move away from it again. They called this semiconvergence, and they treated the iteration count as a regularization parameter, to be chosen by a stopping rule such as Morozov’s discrepancy principle. The theory of iterative regularization that grew from it is set out in the monograph of Engl, Hanke and Neubauer (1996). Early stopping in neural network training is the same phenomenon, met again by a different community with a different vocabulary.

The reason this history matters is not priority. The inverse-problems literature asks a question that machine learning has mostly not asked: how should the stopping index depend on the noise level? For Landweber iteration with an a-priori stopping rule, the answer under a Hölder-type source condition of order μ\mu on the truth is a stopping index proportional to δ−2/(2μ+1)\delta^{-2/(2\mu+1)}, where δ\delta is the noise level. We test that below.

How close are the three filters? Two inequalities answer that, and both are short to prove.

Proposition 4. (a) If hλmax⁡(A)≤12h\lambda_{\max}(A) \le \tfrac12 and t=kht = kh, then

sup⁡0≤s≤λmax⁡∣φkGD(s)−φtGF(s)∣  ≤  hλmax⁡e.\sup_{0 \le s \le \lambda_{\max}}\bigl\lvert\varphi^{\mathrm{GD}}_k(s) - \varphi^{\mathrm{GF}}_t(s)\bigr\rvert \;\le\; \frac{h\lambda_{\max}}{e}.

(b) With α=1/t\alpha = 1/t,

sup⁡s≥0∣φtGF(s)−φ1/tR(s)∣=max⁡z≥0(1−e−z−z1+z)≈0.2036,\sup_{s \ge 0}\bigl\lvert\varphi^{\mathrm{GF}}_t(s) - \varphi^{\mathrm{R}}_{1/t}(s)\bigr\rvert = \max_{z \ge 0}\Bigl(1 - e^{-z} - \frac{z}{1+z}\Bigr) \approx 0.2036,

attained at z=ts≈2.51z = ts \approx 2.51.

Proof. (a) Put x=hs∈[0,12]x = hs \in [0, \tfrac12]. Since ln⁡(1−x)=−x−x2(12+x3+x24+⋯ )≥−x−x2\ln(1-x) = -x - x^2\bigl(\tfrac12 + \tfrac x3 + \tfrac{x^2}4 + \cdots\bigr) \ge -x - x^2 for x≤12x \le \tfrac12, we have e−kx≥(1−x)k≥e−kxe−kx2e^{-kx} \ge (1-x)^k \ge e^{-kx}e^{-kx^2}. Hence

0≤φkGD−φtGF=e−kx−(1−x)k≤e−kx(1−e−kx2)≤(kx)e−kx⋅x≤xe,0 \le \varphi^{\mathrm{GD}}_k - \varphi^{\mathrm{GF}}_t = e^{-kx} - (1-x)^k \le e^{-kx}\bigl(1 - e^{-kx^2}\bigr) \le (kx)e^{-kx}\cdot x \le \frac{x}{e},

using 1−e−y≤y1 - e^{-y} \le y and ye−y≤1/eye^{-y} \le 1/e. (b) Both filters depend on ss only through z=tsz = ts, and the difference is a function of one variable, which is non-negative and vanishes at 00 and at infinity. Its maximum is found numerically. □\square

The filters, computed exactly, are shown in Figure 2. With hλmax⁡=0.2h\lambda_{\max} = 0.2 the largest gap between gradient descent and gradient flow is 0.00540.0054, well inside the bound 0.0740.074 of part (a). With hλmax⁡=1.0h\lambda_{\max} = 1.0 it is 0.0280.028. With hλmax⁡=1.9h\lambda_{\max} = 1.9, close to the stability limit, the gradient descent filter overshoots to 1.591.59 in the stiffest direction, which is the alternating-sign regime of Proposition 1. The gap between gradient flow and ridge is 0.20360.2036 in every case, as part (b) says.

Chart of the fraction of each direction learned against the eigenvalue, log scale. The gradient flow filter and the ridge filter are both S-shaped and differ by at most 0.2. The gradient descent filter with h times lambda max equal to 1.9 follows the flow filter but overshoots to 1.6 at the largest eigenvalue. Fig. 2 — The three spectral filters at t=10t = 10. Early stopping and ridge regression differ by at most 0.210.21 in any direction. Gradient descent tracks the flow until the step size approaches the stability limit.

A filter gap of 0.20.2 is a statement about each direction separately. For the statistical question, how good the estimator is, Ali, Kolter and Tibshirani (2019) proved the stronger and more useful result. Under weak assumptions, and with no assumptions on the feature matrix, the estimation risk of gradient flow at time tt is within a factor of 1.691.69 of the risk of ridge regression with α=1/t\alpha = 1/t, for every tt. Early stopping does not merely resemble ridge regression. It is ridge regression up to a constant factor in risk.

What this means for return prediction

Return prediction is close to the worst case for the methods above, and therefore the best case for the argument. The signals are many and individually weak, the samples are short, the features are correlated, and the noise is large. Ordinary least squares is hopeless in that setting, and everyone knows it. What is less often noticed is that “I trained a model with gradient descent and stopped when the validation error was lowest” and “I fitted a ridge regression and chose the penalty by validation” are, by Proposition 3, nearly the same procedure.

The first experiment is a deliberately easy one. We take 200 correlated synthetic signals with weak true coefficients, 300 training days, 250 validation days and 5,000 test days, and fit linear predictors by gradient descent from zero at three learning rates: hλmax⁡=0.2h\lambda_{\max} = 0.2, 1.01.0 and 1.91.9. Each configuration is repeated on 50 independently drawn data sets. In this setting the true coefficients explain a median 24% of the variance of the target, far more than any real return predictor; we return to realistic values below. Gradient-descent paths are computed with the closed form of Proposition 3, which reproduces explicit iteration to a relative difference of 2×10−142\times10^{-14}.

Chart of out-of-sample R squared against training time on a log scale, with interquartile bands over 50 data sets. The three gradient descent curves rise together and peak at about 0.14 near t equal to 33, then fall below minus 0.6. The ridge curve, plotted against one over alpha, follows them closely and peaks at about 0.14. A dashed line at 0.24 marks the median R squared of the true coefficients. Fig. 3 — Out-of-sample R2R^2 along the training path, for three learning rates, plotted against training time t=kht = kh; ridge regression is plotted against 1/α1/\alpha. Lines are medians and bands interquartile ranges over 50 data sets. Curves start at the shortest time each step size can reach, one step. The vertical axis is truncated at −0.6-0.6; ordinary least squares reaches a median of −1.18-1.18.

Plotted against the number of steps, the three gradient descent runs would look like three different experiments, since one takes almost ten times as many steps as another. Plotted against training time, they are one curve. The median best out-of-sample R2R^2 is 0.14170.1417 at t=32.6t = 32.6 for hλmax⁡=0.2h\lambda_{\max} = 0.2, 0.14170.1417 at t=33.2t = 33.2 for hλmax⁡=1.0h\lambda_{\max} = 1.0, and 0.14180.1418 at t=35.1t = 35.1 for hλmax⁡=1.9h\lambda_{\max} = 1.9 (interquartile range of the first: 0.1000.100–0.2090.209). Within a factor of ten of the optimum, the curves for hλmax⁡=0.2h\lambda_{\max} = 0.2 and 1.01.0 differ by at most 0.0060.006 (median over data sets). Ridge regression reaches a median best of 0.14300.1430, at 1/α1/\alpha about 1.2 times the optimal training time. Ordinary least squares, the end point of every path, gives a median of −1.18-1.18. The true coefficients give 0.2390.239.

Proposition 3 also lets us say how complex the stopped model is. Ridge regression has a standard measure of effective model size, its degrees of freedom df⁡(α)=∑isi/(si+α)\operatorname{df}(\alpha) = \sum_i s_i/(s_i + \alpha), the trace of the matrix that maps observations to fitted values. The same trace for gradient descent is the sum of its filter over all directions. At the best stopping time it is a median of 32.5 (interquartile range 25.7–36.1), and at the best ridge penalty 32.3. The model has 200 coefficients, but the predictor that works best uses about thirty effective parameters, and the remaining directions are mostly suppressed. Ordinary least squares uses all 200, and that is precisely why it fails.

At realistic signal-to-noise

Real return predictors explain a fraction of a percent to a few percent of the variance of returns. We therefore reran the experiment with the truth rescaled so that the population R2R^2 of the true coefficients is 0.0050.005, 0.010.01 or 0.020.02, with 300 and with 1,250 training days, again on 50 data sets each. The table reports medians.

training days population R2R^2 best test R2R^2, GD hλmax⁡=0.2h\lambda_{\max}=0.2 (IQR) best, ridge validated GD optimal tt effective df best, GD hλmax⁡=1.9h\lambda_{\max}=1.9
300 0.005 0.0004 (−0.0003–0.0012) 0.0004 0.0001 0.4 1.2 −0.0071
300 0.01 0.0015 (0.0007–0.0036) 0.0015 0.0010 0.9 2.3 −0.0047
300 0.02 0.0062 (0.0033–0.0099) 0.0059 0.0035 1.7 3.9 −0.0001
1,250 0.005 0.0013 (0.0004–0.0023) 0.0013 0.0004 1.7 4.1 0.0009
1,250 0.01 0.0041 (0.0025–0.0058) 0.0040 0.0023 2.9 6.2 0.0037
1,250 0.02 0.0105 (0.0071–0.0131) 0.0101 0.0064 4.8 8.8 0.0095

Chart of out-of-sample R squared against training time for population R squared 0.01 and 1,250 training days, with interquartile bands. All curves peak near 0.004 at t between 2 and 5. The gradient descent curve with the largest step starts only at t equal to about 4, after the peak, and is slightly lower. Fig. 4 — The same experiment at a population R2R^2 of 0.01 with 1,250 training days. Medians and interquartile ranges over 50 data sets. The optimal training time is a few units, and a large step cannot stop early enough.

Empirical observation (synthetic). Three things change, and one does not. What does not change is the equivalence of early stopping and ridge regression: their best achievable R2R^2 differ by at most 0.00040.0004 in every row. What changes is, first, the optimal training time: it falls from about 33 to between 0.4 and 4.8, and the best predictor uses between 1 and 9 effective parameters out of 200. Second, the step size stops being a detail. The shortest time a run can stop at is one step, t=ht = h, which is about 2 for hλmax⁡=1.0h\lambda_{\max} = 1.0 and about 4 for hλmax⁡=1.9h\lambda_{\max} = 1.9. When the optimal training time is shorter than that, the larger step overshoots on its first step: with 300 training days the run at hλmax⁡=1.9h\lambda_{\max} = 1.9 never achieves a positive median R2R^2. Third, choosing the stopping time on a validation set of 250 days recovers only between a quarter and two thirds of the best achievable R2R^2. At these signal levels the noise in the validation estimate is comparable to the signal.

Beyond plain gradient descent

The propositions above are about plain gradient descent with a constant step. Three extensions matter in practice; they differ in how much of the argument survives.

Learning-rate schedules. With step sizes h1,h2,…h_1, h_2, \dots that change from step to step, the natural training time is t=∑khkt = \sum_k h_k, and the least-squares filter becomes φ(s)=1−∏k(1−hks)\varphi(s) = 1 - \prod_k (1 - h_k s). The proof of Proposition 4(a) carries over unchanged.

Proposition 5 (schedules). If hmax⁡λmax⁡(A)≤12h_{\max}\lambda_{\max}(A) \le \tfrac12, where hmax⁡=max⁡khkh_{\max} = \max_k h_k, and t=∑khkt = \sum_k h_k, then

sup⁡0≤s≤λmax⁡∣(1−∏k(1−hks))−(1−e−ts)∣  ≤  hmax⁡λmax⁡e.\sup_{0 \le s \le \lambda_{\max}}\Bigl\lvert \Bigl(1 - \prod_k (1 - h_k s)\Bigr) - \bigl(1 - e^{-ts}\bigr)\Bigr\rvert \;\le\; \frac{h_{\max}\lambda_{\max}}{e}.

Proof. Put xk=hks≤12x_k = h_k s \le \tfrac12 and X=∑kxk=tsX = \sum_k x_k = ts. As in Proposition 4(a), e−X≥∏k(1−xk)≥e−X−∑kxk2e^{-X} \ge \prod_k(1-x_k) \ge e^{-X - \sum_k x_k^2}, so the difference lies between 00 and e−X(1−e−∑kxk2)≤e−X∑kxk2≤e−X xmax⁡X≤xmax⁡/ee^{-X}\bigl(1 - e^{-\sum_k x_k^2}\bigr) \le e^{-X}\sum_k x_k^2 \le e^{-X}\,x_{\max}X \le x_{\max}/e. □\square

For least squares, then, a warm-up, a decay or a cyclic schedule changes the result only through ∑khk\sum_k h_k, up to an error controlled by the largest step. The collapse prediction below extends to schedules under the same condition, hmax⁡λmax⁡h_{\max}\lambda_{\max} small.

Momentum. Polyak’s heavy-ball method (Polyak, 1964), θk+1=θk−h∇L(θk)+β(θk−θk−1)\theta_{k+1} = \theta_k - h\nabla L(\theta_k) + \beta(\theta_k - \theta_{k-1}), is a discretization of a second-order ODE with friction; Nesterov’s accelerated method has a different second-order limit, analysed by Su, Boyd and Candès (2016). Heuristically, with fixed β\beta and a slowly varying gradient, the velocity settles at θk+1−θk≈−h∇L/(1−β)\theta_{k+1} - \theta_k \approx -h\nabla L/(1-\beta), so to first order heavy ball follows the gradient flow with effective step h/(1−β)h/(1-\beta), and its training time is t≈kh/(1−β)t \approx kh/(1-\beta). The second-order term differs. Ghosh, Lyu, Zhang and Wang (2023) derive the implicit regularizer of heavy-ball gradient descent and find it stronger than that of plain gradient descent by a factor (1+β)/(1−β)(1+\beta)/(1-\beta). Momentum therefore preserves the time variable to first order, with a rescaling, but changes the implicit regularization. Collapse onto tt should not be expected across different values of β\beta.

Adam and other preconditioned methods. Adam (Kingma and Ba, 2015) scales each coordinate’s step by a running estimate of its gradient magnitude. It is a discretization of a preconditioned flow θ˙=−P(t)∇L\dot\theta = -P(t)\nabla L whose preconditioner PP depends on the history of the run. There is then no single training time: each coordinate integrates its own clock, and the clocks change during training. Proposition 3 has no counterpart, the filter is not a function of the eigenvalues of AA alone, and the equivalence with ridge regression does not hold. The practical rules in this article apply to plain gradient descent and, with the caveats below, to stochastic gradient descent. They do not apply to Adam.

Minibatch stochastic gradient descent. Each step uses the gradient of a random batch of BB observations instead of all nn. The noise this adds has a scale proportional to h/Bh/B (Smith and Le, 2018), so at a fixed batch size, halving the step halves the noise and changes the run in a way that a change of time alone cannot undo. We tested this on the original problem: batches of 10, 30 and the full 300 observations, hλmax⁡∈{0.25,0.125}h\lambda_{\max} \in \{0.25, 0.125\}, 50 seeds. Medians, with interquartile ranges in brackets.

batch best test R2R^2, hλmax⁡=0.25h\lambda_{\max}=0.25 best, hλmax⁡=0.125h\lambda_{\max}=0.125 gap between the two step sizes near the optimum optimal tt relative to full batch
10 0.139 (0.097–0.201) 0.145 (0.104–0.208) 0.102 (0.080–0.126) 0.80 (0.46–1.36)
30 0.146 (0.103–0.210) 0.144 (0.107–0.212) 0.039 (0.031–0.055) 0.86 (0.48–1.31)
300 (full) 0.142 (0.100–0.209) 0.142 (0.100–0.209) 0.002 (0.001–0.004) 1

Empirical observation (synthetic). With the full batch the two step sizes give the same curve to within 0.0020.002. With batches of 10 the curves at the same training time differ by up to about 0.100.10 near the optimum, because each run’s path is noisy, although the best values reached differ by less than 0.010.01. The optimal training time is a median 14% to 20% earlier with small batches, consistent with the additional implicit regularization that noise provides, but the interquartile ranges include no shift, so this experiment does not establish it. All statements about stochastic gradient descent in this article are therefore heuristics: collapse onto tt holds for large batches and fails pointwise for small ones.

Prior art, and what is new here

The rule of thumb that learning rate and number of epochs trade off against each other is common practice. Its stochastic versions are established. The linear scaling rule of Goyal et al. (2017) multiplies the learning rate by kk when the batch size is multiplied by kk. Smith and Le (2018) identify the noise scale of SGD as roughly ϵN/B\epsilon N/B, with ϵ\epsilon the learning rate, NN the training set size and BB the batch size. Smith, Kindermans, Ying and Le (2018) show that increasing the batch size can replace learning-rate decay. The link between early stopping and ridge regression goes back to the inverse-problems literature and has a sharp modern form in Ali, Kolter and Tibshirani (2019). The modified loss is Barrett and Dherin’s (2021).

The contribution of this article is a synthesis. What is new is narrower: an explicit error bound for the collapse of (h,k)(h, k), or of a whole schedule, onto training time for least squares (Propositions 4 and 5); a measured limit on where the collapse holds (steps short compared with the optimal training time, full or large batches); and a translation into quantities that a finance practitioner already uses, namely shrinkage intensity and effective degrees of freedom, together with the observation that at realistic signal-to-noise ratios the optimal training time is only a few steps.

Practical rules

Three practical rules follow, for plain gradient descent and, as heuristics, for large-batch SGD.

The first is to report training time, not steps or learning rate, and to keep the step small compared with the optimal training time. The pair (h,k)(h, k) is a redundant parameterization of t=kht = kh when hλmax⁡h\lambda_{\max} is comfortably below one and the optimum lies many steps from the start. A grid search over learning rates and epochs then mostly searches the same one-dimensional family twice. At realistic signal-to-noise the optimum can be only a few steps away, and then the step size must be reduced until it is.

The second is to treat the stopping time with the same suspicion as a shrinkage intensity. It is a regularization parameter fitted to data, and choosing it on the same sample that measures performance is exactly as optimistic as choosing a ridge penalty that way. At realistic signal levels, validation noise alone cost between a third and three quarters of the achievable R2R^2 in our synthetic experiment.

The third is to state model complexity as effective degrees of freedom. “We trained for 40 units of time” means little to a risk committee. “The model has about five effective parameters, estimated from 1,250 observations” is a sentence everyone in the room can evaluate, and it comes free with the spectral decomposition of the feature covariance.

What the numerical analyst predicts

A framework is worth something only if it predicts. Here are four predictions, stated so that they can fail, and what has been tested.

Collapse. For problems that are approximately quadratic near their minimizers, test performance along a training path should depend on (h,k)(h, k), or on a schedule, only through t=∑khkt = \sum_k h_k, up to corrections of order hmax⁡λmax⁡h_{\max}\lambda_{\max}, provided the step is small compared with the optimal training time. Figures 3 and 4 confirm this for linear models trained with plain gradient descent, and they also show the failure when the proviso is violated. Minibatch SGD with small batches does not collapse pointwise. For deep networks the prediction is untested here; the obvious test is to replot published learning-rate sweeps against tt.

Order. Any modification of gradient descent that raises its order as an integrator, such as extrapolation or Runge–Kutta-type updates, also removes the h4∥∇L∥2\tfrac h4\lVert\nabla L\rVert^2 term from the modified loss. Such methods should therefore lose some of the implicit regularization of plain gradient descent, and a careful comparison should find them slightly worse in out-of-sample performance at equal training loss, unless the lost regularization is added back explicitly. This is a heuristic consequence of Proposition 2, not a theorem about generalization, and it has not been tested here.

Noise. Iterative-regularization theory predicts a stopping time proportional to δ−2/(2μ+1)\delta^{-2/(2\mu+1)}, a power law with exponent between −2-2 and 00 that is steeper the less smooth the truth. We tested this on the original problem by varying the noise standard deviation σ\sigma over six values from 0.250.25 to 88, holding the true coefficients fixed, and recording both the stopping time chosen on the validation set and the oracle stopping time that minimizes the population risk (50 data sets per value, step hλmax⁡=0.2h\lambda_{\max} = 0.2).

noise σ\sigma 0.25 0.5 1 2 4 8
validated tt, median 332 102 21 4.1 1.6 0.8
(IQR) (277–437) (85–122) (6.5–45) (2.2–7.3) (0.4–2.6) (0.4–1.4)
oracle tt, median 364 111 34 3.5 1.6 0.5
best test R2R^2 0.71 0.40 0.14 0.035 0.006 0.000

Empirical observation (synthetic). The stopping time falls steeply with noise, as predicted. A power law fitted to the medians over the whole range has exponent −1.82-1.82 for the validated and −1.99-1.99 for the oracle stopping time. That is the value the theory gives for a truth with no smoothness, μ≈0\mu \approx 0, which is what independently drawn coefficients amount to. The agreement is mixed in detail: the local slopes between neighbouring noise levels range from −1.0-1.0 to −3.3-3.3. Translated to finance, the same model should be stopped earlier in volatile regimes than in calm ones. Testing that on real data, by recording the validated stopping time together with the realized volatility of each training window, remains to be done.

Stiffness. Because the learning rate fixes the stability limit 2/h2/h, any training dynamics that increase the sharpness λmax⁡\lambda_{\max} must eventually collide with that limit. Cohen, Kaur, Li, Kolter and Talwalkar (2021) observed exactly such a collision empirically: in full-batch training of neural networks, the sharpness rises until it hovers just above 2/h2/h, while the loss keeps decreasing non-monotonically. In the language of this article, the network trains at the edge of the stability region of the forward Euler method. Why it can keep doing so without diverging is not explained by the arguments above, and the prediction was not tested here.

What this does not show

The modified-equation argument is asymptotic in the step size. It is accurate when hλmax⁡h\lambda_{\max} is small, it is informative when hλmax⁡h\lambda_{\max} is of order one, and it says nothing reliable at the edge of stability, which is where Cohen et al. find practical training. The most interesting regime of modern training is precisely the one in which the clean picture of this article breaks down, and a theory of it is, as far as I know, still incomplete.

The equivalence between early stopping and ridge regression is exact only for least squares. For neural networks it holds locally, around a point where the loss is approximately quadratic, and the relevant matrix is then a changing Hessian, not a fixed covariance. Nothing here applies to Adam or other adaptive methods.

The minibatch experiment is one small problem. It shows that collapse onto training time fails pointwise for small batches. It does not determine how the optimal training time depends on the batch size, and the SDE view (Li, Tai and E, 2017; Smith and Le, 2018) is the right starting point for that question.

The experiments are small by design: a 48-parameter network and a 200-feature linear model, so that every number can be reproduced on a laptop in seconds. They test the mathematics. They do not establish how large the effects are in large models, and nothing here should be read as a claim about any particular system.

Finally, every finance number above comes from synthetic data with stationary Gaussian noise, a known linear truth and independently drawn coefficients. Real return prediction adds non-stationarity, which makes any fixed stopping time stale, and heavy tails, which make validation even noisier than it is here.

References

  • Ali, A., Kolter, J. Z. and Tibshirani, R. J. (2019). A continuous-time view of early stopping for least squares regression. Proceedings of AISTATS, PMLR 89, 1370–1378.
  • Barrett, D. G. T. and Dherin, B. (2021). Implicit gradient regularization. International Conference on Learning Representations (ICLR).
  • Cohen, J. M., Kaur, S., Li, Y., Kolter, J. Z. and Talwalkar, A. (2021). Gradient descent on neural networks typically occurs at the edge of stability. International Conference on Learning Representations (ICLR).
  • Engl, H. W., Hanke, M. and Neubauer, A. (1996). Regularization of Inverse Problems. Kluwer Academic Publishers.
  • Ghosh, A., Lyu, H., Zhang, X. and Wang, R. (2023). Implicit regularization in heavy-ball momentum accelerated stochastic gradient descent. International Conference on Learning Representations (ICLR).
  • Goyal, P., Dollár, P., Girshick, R., Noordhuis, P., Wesolowski, L., Kyrola, A., Tulloch, A., Jia, Y. and He, K. (2017). Accurate, large minibatch SGD: training ImageNet in 1 hour. arXiv:1706.02677.
  • Hairer, E., Lubich, C. and Wanner, G. (2006). Geometric Numerical Integration: Structure-Preserving Algorithms for Ordinary Differential Equations, 2nd ed. Springer.
  • Kingma, D. P. and Ba, J. (2015). Adam: a method for stochastic optimization. International Conference on Learning Representations (ICLR).
  • Landweber, L. (1951). An iteration formula for Fredholm integral equations of the first kind. American Journal of Mathematics, 73, 615–624.
  • Li, Q., Tai, C. and E, W. (2017). Stochastic modified equations and adaptive stochastic gradient algorithms. Proceedings of the International Conference on Machine Learning (ICML).
  • Polyak, B. T. (1964). Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5), 1–17.
  • Smith, S. L. and Le, Q. V. (2018). A Bayesian perspective on generalization and stochastic gradient descent. International Conference on Learning Representations (ICLR).
  • Smith, S. L., Kindermans, P.-J., Ying, C. and Le, Q. V. (2018). Don’t decay the learning rate, increase the batch size. International Conference on Learning Representations (ICLR).
  • Smith, S. L., Dherin, B., Barrett, D. G. T. and De, S. (2021). On the origin of implicit regularization in stochastic gradient descent. International Conference on Learning Representations (ICLR).
  • Su, W., Boyd, S. and Candès, E. J. (2016). A differential equation for modeling Nesterov’s accelerated gradient method: theory and insights. Journal of Machine Learning Research, 17(153), 1–43.

Code and data. All numbers and figures come from experiments.py (Python 3.9, numpy 2.0), which runs in about four minutes on a laptop and writes results.json. Seeds are fixed, and every stochastic experiment uses 50 seeds.

Revised 11 November 2026. This version replaces single-seed results with medians and interquartile ranges over 50 seeds, adds the experiments at realistic signal-to-noise ratios, the test of the noise prediction and the minibatch experiment, adds the sections on schedules, momentum and adaptive methods and on prior art, and corrects the number of predictions from three to four.

Tags — gradient descent, backward error analysis, implicit regularization, early stopping, ridge regression, return prediction