TExcelTAD
Home › Optimization › Rates of Convergence

Rates of Convergence

"Converges" is not enough: a method that gains one digit per thousand iterations and one that doubles its digits every iteration both converge. The rate of convergence classifies how fast the error ek=∥xk−x∗∥e_k = \lVert \mathbf{x}_k - \mathbf{x}^* \rVert goes to zero, and it is the main way to compare the methods of this part.

The four classes

Rate Definition Digits gained per step Typical method
sublinear ek→0e_k \to 0 slower than any geometric sequence, e.g. ek∼1/ke_k \sim 1/k fewer and fewer gradient descent on non-strongly-convex ff, SGD
linear ek+1≤r eke_{k+1} \le r\,e_k with r<1r < 1 constant, −log⁡10r-\log_{10} r gradient descent on strongly convex ff
superlinear ek+1/ek→0e_{k+1}/e_k \to 0 growing BFGS, L-BFGS (often)
quadratic ek+1≤Mek2e_{k+1} \le M e_k^2 doubling Newton's method near the solution

Linear convergence with r=0.9r = 0.9 gains one digit every 22 steps; with r=0.5r = 0.5, one digit every 3.3 steps. Quadratic convergence goes from 10−210^{-2} to 10−410^{-4} to 10−810^{-8} to 10−1610^{-16}: four steps from two digits to full double precision.

Measuring the rate from a run

Given a sequence of errors, the ratios ek+1/eke_{k+1}/e_k reveal linear convergence and log⁡ek+1/log⁡ek\log e_{k+1}/\log e_k approaches the order qq (1 for linear, 2 for quadratic):

python · try it yourself
import numpy as np

# solve x^2 = 2 three ways and record errors
root = np.sqrt(2.0)
def errors(update, x0, n):
    x, out = x0, []
    for _ in range(n):
        x = update(x); out.append(abs(x - root))
    return out

newton = errors(lambda x: x - (x * x - 2) / (2 * x), 1.0, 5)
fixed = errors(lambda x: x - 0.2 * (x * x - 2), 1.0, 12)          # gradient-like fixed step
print("Newton errors:", [f"{e:.1e}" for e in newton])
print("fixed-step errors:", [f"{e:.1e}" for e in fixed[::2]])
ratios = [fixed[k + 1] / fixed[k] for k in range(6, 11)]
print("fixed-step ratios e(k+1)/e(k):", np.round(ratios, 4))
print("Newton orders log e(k+1)/log e(k):", np.round([np.log(newton[k + 1]) / np.log(newton[k]) for k in range(2)], 3))
Newton errors: ['8.6e-02', '2.5e-03', '2.1e-06', '1.6e-12', '0.0e+00']
fixed-step errors: ['2.1e-01', '4.6e-02', '9.0e-03', '1.7e-03', '3.2e-04', '6.1e-05']
fixed-step ratios e(k+1)/e(k): [0.4347 0.4345 0.4344 0.4343 0.4343]
Newton orders log e(k+1)/log e(k): [2.447 2.173]

The fixed-step ratios settle at ∣1−0.2⋅22∣≈0.434\lvert 1 - 0.2 \cdot 2\sqrt{2} \rvert \approx 0.434, the derivative of the update map at the root, so that iteration is linear. Newton's errors square at each step until they hit rounding level.

Sublinear rates

Without strong convexity, gradient descent on an LL-smooth convex function only guarantees f(xk)−f∗=O(1/k)f(\mathbf{x}_k) - f^* = O(1/k); accelerated methods get O(1/k2)O(1/k^2); SGD with decreasing steps gets O(1/k)O(1/\sqrt{k}). To gain one more digit, a 1/k1/k method needs 10 times as many iterations.

python · try it yourself
import numpy as np

# f(x) = x^4 is convex but not strongly convex at 0: gradient descent is sublinear
x, t = 1.0, 0.1
for k in range(1, 100001):
    x -= t * 4 * x**3
    if k in (10, 100, 1000, 10000, 100000):
        print(f"k = {k:6d}: f - f* = {x**4:.2e}")
k =     10: f - f* = 8.47e-03
k =    100: f - f* = 1.41e-04
k =   1000: f - f* = 1.54e-06
k =  10000: f - f* = 1.56e-08
k = 100000: f - f* = 1.56e-10

Each factor of 10 in iterations buys only a factor of about 100 in ff, a power law, not a geometric decay.

Rates versus cost per iteration

The rate is only half the story; total work is the number of iterations times the cost per iteration:

Method Cost per iteration (nn variables) Rate
gradient descent one gradient, O(n)O(n) extra linear
L-BFGS one gradient, O(mn)O(mn) extra superlinear-ish
BFGS one gradient, O(n2)O(n^2) extra superlinear
Newton gradient + Hessian, O(n3)O(n^3) to solve quadratic

For nn in the millions, Newton's O(n3)O(n^3) solve is impossible, which is why deep learning lives with first-order methods.

In software

  • Solver logs (scipy.optimize.minimize(..., options={"disp": True}), IPOPT, Gurobi) print the residual per iteration; reading the pattern of exponents tells you which rate you are getting and whether something is wrong.
  • A method that is supposed to be quadratic but looks linear usually has a wrong Hessian or gradient.

Exercises

Exercise 1: Classify

Classify the error sequences: (a) 10−1,10−2,10−3,…10^{-1}, 10^{-2}, 10^{-3}, \dots; (b) 10−1,10−2,10−4,10−810^{-1}, 10^{-2}, 10^{-4}, 10^{-8}; (c) 1,12,13,14,…1, \frac{1}{2}, \frac{1}{3}, \frac{1}{4}, \dots

Answer

(a) linear, r=0.1r = 0.1; (b) quadratic; (c) sublinear.

Solution

(a) has constant ratio 0.1. (b) squares the error each step. (c) has ratios k/(k+1)→1k/(k+1) \to 1.

Exercise 2: Iterations for linear convergence

With r=0.99r = 0.99, how many iterations reduce the error from 1 to 10−610^{-6}?

Answer

About 1375.

Solution

0.99k=10−60.99^k = 10^{-6} gives k=−6ln⁡10ln⁡0.99≈1374.6k = \frac{-6\ln 10}{\ln 0.99} \approx 1374.6.

Exercise 3: Measure an order (code)

The secant method for x2=2x^2 = 2 uses xk+1=xk−f(xk)xk−xk−1f(xk)−f(xk−1)x_{k+1} = x_k - f(x_k)\frac{x_k - x_{k-1}}{f(x_k) - f(x_{k-1})}. Estimate its order from the errors.

Answer

Between 1.6 and 1.8, heading for the golden ratio 1+52≈1.618\frac{1 + \sqrt{5}}{2} \approx 1.618: superlinear but not quadratic.

Solution
python · try it yourself
import numpy as np
f = lambda x: x * x - 2
a, b, errs = 1.0, 2.0, []
for _ in range(6):
    a, b = b, b - f(b) * (b - a) / (f(b) - f(a))
    errs.append(abs(b - np.sqrt(2)))
print([f"{e:.1e}" for e in errs])
print([round(float(np.log(errs[k + 1]) / np.log(errs[k])), 3) for k in range(1, 4)])
['8.1e-02', '1.4e-02', '4.2e-04', '2.1e-06', '3.2e-10', '2.2e-16']
[1.828, 1.68, 1.675]

The ratios of logarithms (1.83, 1.68, 1.68) drift down toward the theoretical order 1.618; after six steps the error is already at rounding level, so the estimate cannot be refined further.

Test yourself

Errors 10−2,10−4,10−8,10−1610^{-2}, 10^{-4}, 10^{-8}, 10^{-16} show…

  1. linear convergence
  2. quadratic convergence
  3. sublinear convergence
  4. divergence

A linearly convergent method with ratio r=0.5r = 0.5 gains about… decimal digits per iteration.

  1. 0.3
  2. 0.5
  3. 1
  4. 2

Why don't deep learning frameworks use Newton's method despite its quadratic rate?

  1. It diverges on all functions
  2. Forming and solving with the Hessian costs O(n2)O(n^2) memory and O(n3)O(n^3) time for millions of parameters
  3. It needs integer variables
  4. It only works in one dimension