Ill-Conditioning and the Hessian Spectrum
When a loss surface curves far more steeply in some directions than others, gradient descent is forced into a slow, zig-zagging path — the ratio between the steepest and gentlest curvature, the condition number, sets how bad that zig-zag gets.
Prerequisites: The Hessian and Second-Order Behavior, Saddle Points and Plateaus
Gradient descent takes one step size and applies it in every direction at once, which works fine if the loss surface curves about the same amount in every direction — like the bottom of a round bowl. It works badly if the surface is shaped like a narrow ravine, curving steeply on the sides and gently along the floor, because the single step size that is safe for the steep direction is far too small to make real progress along the gentle one. That mismatch — ill-conditioning — is measured directly by the Hessian's eigenvalues.
The analogy: a round bowl versus a narrow ravine
Rolling a ball down a round, symmetric bowl, it heads straight for the bottom no matter which side it starts on. Rolling the same ball down a long, narrow ravine — steep walls, a nearly flat floor — it instead bounces back and forth between the walls, only slowly drifting along the floor toward the actual low point, because most of its motion gets absorbed zig-zagging across the narrow direction rather than progressing along the long one. Gradient descent on an ill-conditioned loss surface behaves exactly like that ball in the ravine: it oscillates across the steep-curvature directions while crawling along the gentle ones.
The condition number
The Hessian's eigenvalues describe curvature along each principal direction of the loss surface. The condition number is their ratio:
where and are the largest and smallest eigenvalues. In words: measures how lopsided the bowl is — means perfectly round (equally steep in every direction), while means one direction is far steeper than another. Plain gradient descent's usable step size is capped by the steepest direction (a step too large there causes overshoot and divergence), roughly , even though that same step size is needlessly tiny for making progress along the gentlest direction — the larger is, the worse this mismatch, and the more iterations are needed to converge.
Worked example 1: the safe step size and its cost
Suppose a quadratic loss has Hessian eigenvalues , , giving . The safe learning rate bound is . Using (bigger than the bound) along the steep direction causes the iterate to overshoot and oscillate with growing amplitude — diverging rather than converging. Using the safe instead, progress along the gentle direction (with curvature ) advances by roughly of the remaining distance per step — needing on the order of 100 steps just to meaningfully close that gap, purely because the step size had to be set small enough for the other direction.
Worked example 2: convergence speed scales with
For gradient descent on a quadratic, the number of iterations needed to shrink the error by a fixed factor scales roughly with . At (perfectly conditioned), convergence takes on the order of a handful of iterations. At , it takes on the order of 100 times as many. At — not unusual for a poorly-scaled neural network loss — it takes on the order of 10,000 times as many iterations to reach the same accuracy, all else equal. This single ratio, more than the raw size of the gradient, is what actually predicts how painfully slow plain gradient descent will be on a given loss surface.
Drag the matrix parameters here until the unit circle becomes a long, thin ellipse — that is exactly what a high condition number looks like geometrically: the eigenvector along the ellipse's long axis is the gentle direction, the short axis is the steep one.
The Hessian's condition number, the ratio of its largest to smallest eigenvalue, measures how lopsided a loss surface is. Plain gradient descent's step size is bounded by the steepest direction, so a large condition number forces small steps everywhere, producing slow, zig-zagging convergence even when the gradient's magnitude looks reasonable.
What this means in practice
Ill-conditioning is a major reason adaptive optimizers (RMSProp, Adam, AdamW) and second-order methods exist — they effectively rescale each direction by its own local curvature, rather than using one global step size, directly attacking the mismatch a large condition number creates. Feature scaling and normalization layers also help indirectly, by keeping different parts of the network's loss surface from ending up with wildly different local curvatures in the first place.
The common mistake is diagnosing slow or oscillating training purely from the size of the loss or the gradient norm, and concluding the learning rate is simply "too big" or "too small" in some absolute sense. The right learning rate is relative to the steepest curvature direction, which a small gradient norm can hide entirely — a loss surface can have a small gradient right now and still be badly ill-conditioned, oscillating wildly the moment training approaches a steep direction the current point happens to be far from.
Related concepts
Practice in interviews
Further reading
- Goodfellow, Bengio & Courville, Deep Learning (2016), ch. 8
- Nocedal & Wright, Numerical Optimization (2006)