Optimization1964foundational9 min read

Some Methods of Speeding Up the Convergence of Iteration Methods

بعض طرق تسريع تقارب الأساليب التكرارية

Polyak, B. T. — USSR Computational Mathematics and Mathematical Physics

The problem

takes small, cautious steps proportional to the local slope. On elongated, narrow valleys — where the curvature is high in one direction and low in another — it zig-zags back and forth across the valley floor instead of racing along it. The worse the (ratio of largest to smallest curvature), the worse the zig-zagging, and slows to a crawl.

The contribution

Polyak added a single term to the descent update: a fraction of the previous step. This "" term acts like physical inertia — it accumulates velocity along consistent gradient directions and dampens oscillations across them. For strongly convex quadratics, the optimal momentum reduces the from (κ−1)/(κ+1) to (√κ−1)/(√κ+1), where κ is the condition number. This is a dramatic speedup: a problem with κ=100 goes from needing ~200 steps per halving of error to ~18.

The impact

Momentum became the first "acceleration" technique in optimization and remains a default in virtually every today. with momentum is the workhorse of neural network training. The idea directly inspired Nesterov's accelerated gradient (1983) and is a core component of (2014), the most popular optimizer in modern AI. Polyak's physical analogy — treating optimization as a ball rolling down a surface — shaped how generations of researchers think about optimization dynamics.

Imagine navigating a foggy mountain valley where you can only feel the slope directly under your feet. Gradient descent is like taking one careful step downhill, stopping, feeling the slope again, stepping again. On a long, narrow valley it zig-zags endlessly between the walls instead of walking along the floor.

Now imagine you're a heavy ball instead. When you roll downhill and the slope keeps pointing the same way, you pick up speed. When the slope suddenly reverses (a valley wall), your mass resists the reversal — you slow down instead of bouncing all the way back. You still feel the same slope, but your momentum carries you along the valley floor far faster than the cautious step-by-step approach.

The problem: gradient descent zig-zags on ill-conditioned landscapes

Consider minimizing a smooth function f(x)f(\mathbf{x}). Standard gradient descent updates the parameters by stepping opposite to the gradient:

xk+1=xk−α∇f(xk)\mathbf{x}_{k+1} = \mathbf{x}_k - \alpha \nabla f(\mathbf{x}_k)

where α\alpha is the . On a perfectly round bowl (equal curvature in every direction), this works beautifully — each step heads straight for the bottom.

But most real problems are not round bowls. surfaces in are typically elongated valleys: steep in some directions (high curvature) and gentle in others (low curvature). The ratio of the largest to smallest curvature is the condition number κ=L/μ\kappa = L / \mu.

On such landscapes, gradient descent faces a dilemma: a learning rate large enough to make progress along the gentle direction overshoots across the steep direction, causing . A learning rate small enough to avoid oscillation makes progress painfully slow along the gentle direction.

The convergence rate of gradient descent on a strongly convex quadratic is ρGD=κ−1κ+1\rho_{\text{GD}} = \frac{\kappa - 1}{\kappa + 1}. When κ=100\kappa = 100, this is 0.980.98 — meaning each step reduces the error by only 2%. You need roughly κ\kappa steps to halve the error.

Open in Lab
Watch gradient descent zig-zag across a narrow valley while momentum glides along the floor. Drag the condition number slider to make the valley narrower.
The demo wakes as you arrive…

The idea: remember yesterday's step

Polyak's insight was beautifully simple: add a fraction of the previous update to the current one. Instead of deciding where to go based only on the slope right here, you also look at where you were already heading.

Think of it as giving the optimizer memory. Gradient descent is memoryless — it forgets its entire history at every step. Momentum gives it a one-step memory: "I was heading this way, so unless the gradient strongly disagrees, keep going."

When gradients consistently point in the same direction (along the valley floor), the momentum term accumulates and the effective step size grows — the optimizer accelerates. When gradients keep reversing sign (the zig-zag walls), the momentum term and the gradient partially cancel each other, dampening the oscillation automatically.

xk+1=xk−α∇f(xk)+β(xk−xk−1)\mathbf{x}_{k+1} = \mathbf{x}_k - \alpha \nabla f(\mathbf{x}_k) + \beta (\mathbf{x}_k - \mathbf{x}_{k-1})
The Heavy Ball update — gradient descent plus momentum — α = learning rate · ∇f(x_k) = gradient at current position · β = momentum coefficient (typically 0.9) · (x_k − x_{k-1}) = previous step direction. The β term is the entire contribution of this paper: it adds inertia to the optimizer.

An equivalent and more common formulation uses a velocity variable v\mathbf{v}:

vk+1=βvk−α∇f(xk)\mathbf{v}_{k+1} = \beta \mathbf{v}_k - \alpha \nabla f(\mathbf{x}_k) xk+1=xk+vk+1\mathbf{x}_{k+1} = \mathbf{x}_k + \mathbf{v}_{k+1}

Here v\mathbf{v} is the velocity of the "heavy ball". At each step, the velocity decays by β\beta (friction) and gains a push from the negative gradient (gravity). The parameter update then simply follows the velocity.

This form makes the physics clearer: β\beta close to 1 means low friction (the ball keeps rolling a long time); β=0\beta = 0 recovers vanilla gradient descent (no inertia at all).

Open in Lab
Drag β to see how velocity accumulates over consistent gradients and dampens on reversals.
The demo wakes as you arrive…

Why it works: the physics of optimization

Polyak's method is modeled on Newton's second law. A ball on a surface experiences gravity (the gradient) and friction (the decay β\beta). The continuous-time equation is:

x′′(t)+γx′(t)+∇f(x(t))=0\mathbf{x}''(t) + \gamma \mathbf{x}'(t) + \nabla f(\mathbf{x}(t)) = 0

This is the equation of a damped harmonic oscillator. The γ\gamma friction term prevents the ball from overshooting the minimum and oscillating forever. The key insight is that the second-order dynamics (acceleration, not just velocity) allow the system to use curvature information implicitly, even though we never compute the .

On a quadratic f(x)=12xTAxf(\mathbf{x}) = \frac{1}{2}\mathbf{x}^T A \mathbf{x}, the eigenvalues of AA are the curvatures in each direction. Without momentum, convergence along each eigendirection proceeds independently at rate ∣1−αλi∣|1 - \alpha \lambda_i|. The optimal step size must compromise between the fastest (λmax⁡=L\lambda_{\max} = L) and slowest (λmin⁡=μ\lambda_{\min} = \mu) directions.

With momentum, the convergence factor becomes κ−1κ+1\frac{\sqrt{\kappa} - 1}{\sqrt{\kappa} + 1} — the square root transforms the condition number. This is the difference between O(κ)O(\kappa) and O(κ)O(\sqrt{\kappa}) iterations: a quadratic-to-linear improvement in the dependence on problem difficulty.

Open in Lab
Drag the condition number κ and compare iterations to convergence.
The demo wakes as you arrive…

Choosing the right momentum

Polyak derived the optimal hyperparameters for strongly convex quadratics. Given the smallest μ\mu and largest eigenvalue LL of the Hessian:

α∗=4(L+μ)2β∗=(L−μL+μ)2\alpha^* = \frac{4}{(\sqrt{L} + \sqrt{\mu})^2} \qquad \beta^* = \left(\frac{\sqrt{L} - \sqrt{\mu}}{\sqrt{L} + \sqrt{\mu}}\right)^2

In practice, μ\mu and LL are unknown, so practitioners use the common heuristic β=0.9\beta = 0.9 (sometimes 0.99). This works because most landscapes in deep learning are highly ill-conditioned (κ≫1\kappa \gg 1), where β∗\beta^* approaches 1 anyway.

The learning rate α\alpha interacts with β\beta: higher momentum allows a larger effective step size. A useful mental model is that momentum amplifies the learning rate by a factor of roughly 11−β\frac{1}{1 - \beta}: with β=0.9\beta = 0.9, the effective learning rate is 10× the nominal rate.

Open in Lab
Adjust L and μ to see how the optimal β* and α* change. Notice how β* → 1 as the condition number grows.
The demo wakes as you arrive…

Momentum as exponential moving average

There is another way to see the velocity form. Unrolling the recurrence vk+1=βvk−α∇f(xk)\mathbf{v}_{k+1} = \beta \mathbf{v}_k - \alpha \nabla f(\mathbf{x}_k) gives:

vk+1=−α∑i=0kβk−i∇f(xi)\mathbf{v}_{k+1} = -\alpha \sum_{i=0}^{k} \beta^{k-i} \nabla f(\mathbf{x}_i)

The velocity is an exponentially weighted sum of all past gradients, with recent gradients weighted most. This is an — the same tool used in signal processing to smooth noisy data.

This view explains why momentum helps with noisy (stochastic) gradients: the averaging smooths out the while preserving the consistent signal. In stochastic gradient descent, each gradient is a noisy estimate; momentum effectively averages over multiple mini-batches.

Open in Lab
See how momentum smooths noisy stochastic gradients. Toggle noise on/off to compare.
The demo wakes as you arrive…

The same idea in code

SGD with momentum, completepython

Simplified to show the idea — not the real implementation.

import numpy as np

def sgd_momentum(gradient_fn, x0, lr=0.01, beta=0.9, steps=100):
    """Minimize f(x) using SGD with Polyak momentum.

    gradient_fn: returns ∇f(x) — possibly stochastic
    x0:          initial parameters
    lr:          learning rate  α
    beta:        momentum coefficient  β  (0 = vanilla SGD)
    """
    x = x0.copy()
    v = np.zeros_like(x)         # velocity starts at zero

    for k in range(steps):
        g = gradient_fn(x)       # compute (stochastic) gradient
        v = beta * v - lr * g    # update velocity: decay + push
        x = x + v               # follow the velocity

    return x

# Example: minimize  f(x,y) = 50x² + y²  (condition number κ = 100)
def grad(x):
    return np.array([100 * x[0], 2 * x[1]])

x_star = sgd_momentum(grad, np.array([1.0, 1.0]), lr=0.002, beta=0.9)
# x_star ≈ [0, 0]  —  reached much faster than without momentum

Why it mattered: from 1964 to every optimizer today

  1. 1964

    Polyak's Heavy Ball

    First momentum method. Adds β(x_k − x_{k-1}) to gradient descent. Proved optimal local convergence on strongly convex quadratics.

  2. 1983

    Nesterov's Accelerated Gradient

    Computes gradient at the lookahead position. Achieves provably optimal O(1/k²) rate for general convex functions — the first "globally accelerated" method.

  3. 2012

    SGD + Momentum trains AlexNet

    Krizhevsky's ImageNet breakthrough used SGD with momentum β=0.9. This combination became the standard recipe for training deep convolutional networks.

  4. 2014

    Adam optimizer

    Kingma and Ba combined Polyak momentum (β₁) with per-parameter adaptive rates (β₂) into the most popular optimizer in deep learning.

  5. 2017

    SGD+M trains Transformers

    "Attention Is All You Need" used Adam (whose first moment is Polyak momentum) to train the Transformer. Every large language model since inherits this choice.

Momentum in the optimizer family tree

Polyak's momentum is the seed from which the modern optimizer tree grew. The relationship is direct and traceable:

  • Vanilla SGD: xk+1=xk−α∇f(xk)\mathbf{x}_{k+1} = \mathbf{x}_k - \alpha \nabla f(\mathbf{x}_k) — no memory.
  • SGD + Momentum (Polyak, 1964): adds β(xk−xk−1)\beta(\mathbf{x}_k - \mathbf{x}_{k-1}) — one-step memory.
  • Nesterov Momentum (1983): evaluates gradient at xk+βvk\mathbf{x}_k + \beta \mathbf{v}_k — "look before you leap."
  • Adam (2014): momentum on both first moment (β1\beta_1) and second moment (β2\beta_2) of the gradient.

The entire trajectory from SGD to Adam is a sequence of increasingly sophisticated ways to use gradient history — and it all started with one extra term in Polyak's update rule.

Open in Lab
Click any optimizer to see how its update rule relates to Polyak's original momentum.
The demo wakes as you arrive…

CitationPolyak, B. T.. Some Methods of Speeding Up the Convergence of Iteration Methods. USSR Computational Mathematics and Mathematical Physics, 1964.

Terms in this paper