For least-squares linear regression , how does the condition number of govern the convergence speed of gradient descent, and why does standardising features speed up gradient descent even though it leaves the closed-form predictions unchanged?
Linear algebra and optimisation, Gradient methods
Level L4 Advanced. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you can connect the linear-algebra condition number of the Hessian directly to feature scaling and GD convergence.
Key idea
The Hessian of the least-squares loss is , so gradient descent's convergence factor depends on the condition number . Unscaled features on different magnitudes (e.g. vs ) stretch the error contours into narrow ellipses and inflate by up to , forcing tiny step sizes.
Steps
- Compute the gradient and Hessian: and . For full-column-rank , the eigenvalues of are , where are the singular values of .
- Relate to GD speed: fixed-step gradient descent must keep for stability. With the optimal fixed step , the parameter error shrinks each step by , where . Thus steps needed scale linearly with .
- Show the effect of unscaled features: suppose feature 1 is in millimetres () and feature 2 is in metres (). Even if the features are orthogonal, scales as . A step size safe for feature 1 barely moves feature 2.
- Contrast with the closed-form solution: replacing by (rescaling columns by an invertible diagonal ) gives new optimal weights and identical predictions , and centring features by subtracting their means is likewise absorbed by an intercept column when present. Closed-form normal equations are invariant to invertible feature scaling, whereas Euclidean gradient descent is not.
Common mistakes
- Thinking feature scaling improves the expressiveness or optimal training loss of linear regression. With an intercept, standardising features leaves the optimal predictions unchanged; it changes only the geometry of the optimisation path.
- Forgetting that : a difference in feature scale produces a worse condition number in the Hessian.
How long your answer should be
Half a page; 4–5 minutes.
Last checked on 4 December 2026.
Read this
Previous in Linear algebra and optimisation: Why can deterministic gradient descent take arbitrarily long or get trapped near a strict saddle point, and how do stochastic gradient noise (SGD) or perturbed gradient descent escape strict saddles?
Next in Linear algebra and optimisation: Minimise with , and using the conjugate gradient method. How do you show that it reaches the exact minimiser in two steps, and why does this happen?