Gradient descent is an iterative method for minimizing a differentiable function : choose an initial vector and repeatedly move opposite its gradient.[ref]
With a fixed positive step size , the update is
The direction and the step size play different roles: the gradient supplies local information about increase, while determines how far that information is trusted. A varying step size gives instead; exact line search for a positive-definite quadratic chooses it by minimizing along the current direction.
Why is this the steepest direction? For a unit vector in the Euclidean norm, the directional derivative is . The Cauchy-Schwarz inequality bounds it below by , attained by when the gradient is nonzero. This is steepest descent relative to the Euclidean norm; changing the norm can change the steepest direction. A finite step need not decrease , because a directional derivative describes infinitesimal motion.
For the quadratic form with linear term , assuming is a symmetric matrix, the negative gradient is the linear-system residual . Thus gradient descent turns the linear system into repeated residual corrections; a positive-definite matrix makes its solution the unique global minimum. This is useful when applying the linear map is affordable but directly solving the linear system is costly.
The attraction is that a gradient evaluation gives an entire update without solving a new linear system. The difficulty is choosing a step size that progresses along gently curved directions without overshooting steep ones. Fixed-step gradient descent on a positive-definite quadratic makes this tension exact: every eigenvector direction has its own multiplier, determined by its eigenvalue. The resulting condition number dependence explains why a narrow valley can slow even an inexpensive iterative method.
The simplicity of the gradient update and its sensitivity to the condition number of the Hessian matrix are central practical features.[ref]
For this nonsymmetric matrix, consider the formal residual update , with nonzero . Put and . Algebra gives when . But and . Hence and for every defined nonzero step. At , the quotient is undefined. Thus the iteration cannot converge to zero linear-system residual from any nonzero initial residual. This concrete divergence proof distinguishes failure of an algorithm from mere failure to meet a sufficient theorem's hypotheses.
Let be real symmetric, let be a unit eigenvector satisfying , and use scalar step sizes . The gradient of the displayed cubic polynomial function is
On the eigenline, , so a gradient descent update remains on that same line and obeys the scalar recurrence in the title. Induction proves invariance for every iterate starting on the line, including an iterate that reaches zero. This is a statement about the geometry of the updates, not a convergence theorem: when , the restriction is unbounded below in one direction.
The number of optimization epochs needed to meet a stated accuracy criterion. Comparisons must specify the work counted by an optimization epoch, the accuracy measure, and whether a random method is controlled in expectation or with a stated probability. Counting coordinate partial derivatives is useful for comparing randomized block coordinate descent with gradient descent, but need not match elapsed computation time.
Target: gradient-descent.bigb, under Stochastic gradient descent.
A unit of work corresponding to one full pass through the components used to measure an iterative method. For coordinate descent in coordinates, count coordinate partial derivative evaluations as an optimization epoch: updates on blocks of size require updates per optimization epoch. For stochastic gradient descent on a finite sum of losses, a common different convention counts one evaluation of every loss component. The convention must be specified. Random sampling with replacement need not visit every component during one such unit of work.
Target: gradient-descent.bigb, under Gradient descent.
Consider the original two-dimensional example
The Hessian matrix is , a symmetric matrix and positive-definite matrix. Its eigenvectors are the coordinate directions, its eigenvalues are and , and its Euclidean norm condition number is . The unique global minimum is , so the error equals . The linear map , with the identity matrix, gives
For , the two coordinate error multipliers are and . Consequently , , and the second coordinate changes sign at every step while both shrink. The Euclidean norm of the error contracts by each step. The objective gap, which we call the quadratic energy, contracts by its square:
The level sets of are ellipses. Oscillation across their narrow direction is compatible with strictly decreasing energy.
Figure 1.
Original gradient descent iterates on : step size contracts both directions, whereas expands the second
. Details.
For , the coordinate error multipliers become and , giving . The first coordinate still tends to zero, but the second alternates and grows. Direct substitution gives
Thus a larger positive step size can turn a strictly convex function into a divergent iteration. Energy and error are different quantities: coordinate errors carry signed multipliers, while each coordinate's contribution to energy carries the squared multiplier.
Figure 2.
Exact constructed quadratic-energy histories from : step sizes and converge, while diverges
. Details.
For the general quadratic form with linear term
the error obeys the same linear map . The spectral theorem for real symmetric matrices supplies an orthonormal basis of eigenvectors with positive eigenvalues . Writing gives the exact solution and energy identity
Therefore convergence from every initial vector is equivalent to
At , a nonzero error component along a largest-eigenvalue eigenvector flips sign without shrinking. Above that threshold it grows. A particular start can still converge if it has zero components in every unstable direction; the interval is the condition for all starts. If , then and . These bounds follow by summing the squared components in the orthonormal basis.
For a fixed symmetric matrix and positive-definite matrix , what positive step size minimizes the largest coordinate error multiplier over all eigenvector directions? Let and . Since is a convex function of , its maximum over the eigenvalues occurs at an endpoint:
Balance the two extremes by solving :
Here is the Euclidean norm condition number of . This balance is optimal: for the endpoint exceeds , and for the endpoint exceeds . The optimal worst-case energy factor is , rather than . This optimizes a uniform one-step bound; a particular initial error supported on fewer eigenvectors can have a different best step size.
In the example , , so and . Both eigenvalue directions attain that energy factor, making the displayed history exact. The smaller step size instead gives
Its first step reaches , below for , but subsequent progress is limited by the first direction's energy factor . By , the energies are approximately and , respectively; by , the iteration is ahead. A better first step need not yield a faster long-run history.
As the condition number grows, approaches one: stability in the direction of the largest eigenvalue forces small movement along the smallest-eigenvalue direction. This is a precise reason to improve scaling or use a method such as the conjugate gradient method, rather than merely increasing the step size. When , choosing eliminates every error component in one step.
Gradient ascent seeks a maximum by stepping along the gradient of a differentiable objective. It is gradient descent applied to . Taylor expansion gives , so sufficiently small positive steps improve the objective when the gradient is nonzero. Line search, projection onto admissible controls, and noise-aware gradient estimates are common practical modifications; a local stationary result need not be globally optimal.
Stochastic gradient descent updates parameters using an unbiased or approximate gradient computed from one observation or a mini-batch rather than the complete data set.
Suppose a fixed-step size stochastic gradient descent iteration satisfies
and has a global minimizer . Taking expectations and forming a telescoping sum proves the displayed bound with and deterministic . The Cauchy-Schwarz inequality then bounds the averaged, or the best, expected gradient Euclidean norm by . This is a guarantee of stationarity in the indicated senses, rather than a last-iterate convergence assertion. The additive is a stochastic gradient noise floor.
Target: real-analysis.bigb, under Strongly convex function.
A residual accuracy level in a bound for stochastic gradient descent with a fixed step size and nonvanishing gradient noise. For a convex function with an -Lipschitz gradient, step size and conditional total variance at most , typical bounds have floors for averaged squared gradient norms, for averaged gradient norms, and for the best expected objective function gap. Such floors are upper bounds depending on the analysis and assumptions, rather than claims that these exact values are attained or that every last iterate converges.
Target: gradient-descent.bigb, under Stochastic gradient descent.
Projected stochastic gradient descent takes a stochastic-gradient step and then projects the result onto a closed feasible set. For a convex set it has the form .
A random vector is an unbiased stochastic gradient at when .
For an unbiased stochastic gradient at with finite conditional second moment, expand in the squared Euclidean norm. The cross term has zero conditional expectation, which proves the displayed identity. It separates the squared true gradient from the total conditional variance of its random estimate.
Target: gradient-descent.bigb, under Stochastic gradient descent.
A differentiable function has a -Lipschitz gradient on a set if its gradient satisfies Lipschitz continuity there:
All norms here are the Euclidean norm. The constant limits how fast the gradient changes; it is not a bound on the magnitude of the gradient. For , the gradient is the linear map . Its operator norm is , so works globally and is sharp by taking . The gradient itself is unbounded on the whole Euclidean space.
If has a continuous Hessian matrix on an open convex set and throughout , integrate that linear map along the line segment from to :
The operator norm bound proves the displayed Lipschitz continuity. Convexity of the domain keeps the entire line segment inside it. Bounding the Hessian matrix only at the endpoints is insufficient.
For a continuously differentiable convex function on with coordinate Lipschitz continuity constants , its block coordinate gradient is Lipschitz continuous along each corresponding coordinate subspace, with constant at most .
To prove this without assuming a Hessian matrix, put . Sum the coordinate derivative bound by Bregman divergence over the block, then repeat with interchanged and average:
If is supported in the block, the dot product uses only . The Cauchy-Schwarz inequality and cancellation of its Euclidean norm give the result, including the zero case separately. Taking the full block supplies a global Lipschitz gradient constant .
Target: convex-optimization.bigb, under Coordinate descent.
Suppose is a differentiable convex function with coordinate Lipschitz continuity constant . Put , the Bregman divergence from the supporting affine function at . The subgradient inequality gives , and its coordinate Lipschitz constant is still . The coordinate descent lemma with step size yields
Since , rearrangement proves the bound. Continuous differentiability suffices; a Hessian matrix is unnecessary.
Target: gradient-descent.bigb, under Lipschitz gradient.
The displayed estimate, for all and real , defines a coordinate Lipschitz constant for the partial derivative in coordinate . It implies the coordinate descent lemma
by the fundamental theorem of calculus and integration of the Lipschitz continuity estimate. Subtracting an affine function leaves these constants unchanged.
The apparently weaker estimate along the singleton negative gradient direction is equivalent when every real step size is allowed: if the initial partial derivative is nonzero, any displacement can be written ; if it is zero but the final partial derivative is nonzero, reverse the endpoints; if both vanish the estimate is trivial.
Target: gradient-descent.bigb, under Lipschitz gradient.
Suppose is a differentiable function on an open convex set and has an -Lipschitz gradient there, in the Euclidean norm. For , the descent lemma states
A bounded continuous Hessian matrix gives one sufficient route to this estimate.[ref]
For a short proof, put . The fundamental theorem of calculus along the line segment gives
The Cauchy-Schwarz inequality and the Lipschitz gradient bound make the integrand at most ; its integral is . This proof needs no assumption that is a convex function.
For the gradient descent update , provided , substitution yields
For and , this ensures strict decrease whenever the gradient is nonzero. At it guarantees only nonincrease; the quadratic example has a nonshrinking alternating component at this endpoint. At the guaranteed decrease is . A bound valid only on cannot justify a step leaving .
If a fixed admissible step size is used forever, every iterate stays in , and has a finite lower bound, summing this inequality shows , hence . That conclusion alone gives neither convergence of the iterates nor a global minimum. For example, the smooth polynomial has and : gradient descent started at zero never moves, although . On , , so the Lipschitz gradient hypothesis holds on this domain. Convex functions and strongly convex functions provide additional structure; the exact quadratic convergence result above uses a positive-definite matrix.
For with positive definite and residual , exact line search along uses
The objective error contracts by
For a real symmetric positive-definite matrix and nonzero linear-system residual , minimize for . Differentiating with respect to gives , yielding the displayed positive step. Positive definiteness makes it the unique minimum along the line. Applying the same quotient to a nonsymmetric or indefinite matrix is a formal iteration, but this minimization proof and its convergence consequences no longer apply.
For a positive-definite matrix , the conjugate gradient method chooses mutually -conjugate search directions. Starting with and , it uses
and with
.
For a symmetric positive-definite matrix, choose an orthonormal eigenbasis and write the exact solution as . Starting at zero, the conjugate gradient method chooses an admissible polynomial of degree at most the iteration count that minimizes the displayed error. The weights depend on both the eigenvalues and the solution coefficients. For two eigenvalues , the first polynomial is , with . Comparable nonzero coefficients and large give , so the high-eigenvalue error is removed first. A sufficiently tiny high-mode coefficient changes this behavior; the spectrum alone does not determine the first step.
Nonzero vectors are conjugate directions with respect to a symmetric positive-definite matrix when they are pairwise orthogonal in the inner product . They need not be orthogonal in the ordinary Euclidean inner product. They are linearly independent: multiplying a vanishing linear combination by isolates its th coefficient times .
Let be conjugate directions for a symmetric positive-definite matrix . Starting from any , minimize successively along those full lines, stopping early if the linear-system residual vanishes. The quadratic minimization along a line uses and gives .
This makes . For , conjugacy preserves . By mathematical induction, is orthogonal to all preceding search vectors. The conjugate directions are linearly independent and hence form a basis, so . Thus the method reaches the unique solution of the linear system in at most steps in exact arithmetic. The conjugate gradient method generates such directions without storing a complete prescribed basis in advance.
For a symmetric positive-definite matrix , the Conjugate gradient method minimizes the error in the induced weighted norm over its affine Krylov subspace. Writing the error as gives
For , choose the scaled Chebyshev polynomial . On the spectral interval its numerator has absolute value at most one. With , the denominator equals . This proves the displayed bound. If the two endpoints coincide, is a positive scalar multiple of the identity and one iteration solves the system exactly.
The residual of an approximate solution of is . It is the unbalanced right-hand side, while the solution error is . The conjugate gradient method makes residuals orthogonal to successive Krylov subspaces.
The norm of a linear-system residual, used to measure how closely an approximate solution satisfies its linear system. It differs from the solution-error norm . Their relationship depends on the matrix inverse and the condition number, so a small residual alone is not a scale-free relative-error guarantee.
At iteration of the conjugate gradient method,
and itself lies in . These Galerkin conditions imply finite termination once the Krylov subspace becomes invariant under .
A symmetric preconditioner transforms into
The aim is to make the transformed positive-definite matrix have clustered eigenvalues while keeping application of inexpensive.
For a positive-definite matrix , choosing gives , so conjugate gradients terminates in one step. Constructing or applying the exact inverse square root is generally as expensive as solving the original system.
The order- Krylov subspace generated by and is
With zero initial guess, the generalized minimal residual method minimizes the Euclidean norm of the linear-system residual over each Krylov subspace. The Arnoldi decomposition reduces this to , followed by . Givens rotations solve the small problem in operations once the decomposition is available. For an invertible matrix , the same iterate minimizes the error in the weighted norm induced by , because .
One step of restarted GMRES searches along the current residual. In the displayed nonsingular system, the first residual minimization is , whose minimizer is zero. Restarting then repeats the same problem forever and never moves. Unrestarted GMRES instead solves exactly at step two, since span the entire space. Thus a smaller search-space cost can come at the price of stagnation; nonsingularity alone does not guarantee progress for one-step restarting.
Starting with , the Arnoldi iteration constructs an orthonormal basis of successive Krylov subspaces. At step , orthogonalize against , and normalize the remainder as if it is nonzero. The coefficients form an upper Hessenberg matrix and satisfy . A zero remainder means the current Krylov subspace is invariant under .
For a real symmetric matrix , the leading block of the Arnoldi decomposition is both symmetric and an upper Hessenberg matrix, hence a tridiagonal matrix. The resulting three-term recurrence is the Lanczos algorithm. If is a symmetric positive-definite matrix, its compression is too, since for nonzero .
The factorization produced by the Arnoldi iteration, with orthonormal and an upper Hessenberg matrix . Multiplying by identifies its leading square block as .
For a diagonalizable finite-dimensional operator, write with nonzero in distinct eigenspaces of eigenvalues . Then . The Vandermonde matrix of the first powers is invertible for distinct eigenvalues, so these powers span exactly the independent components . Thus the stabilized Krylov subspace dimension is . It counts distinct spectral components, not the number of nonzero coefficients in an arbitrary eigenbasis: , has Krylov dimension one. Equivalently it is the minimum number of eigenvectors needed when those vectors may be chosen freely.
In exact arithmetic, conjugate gradients reaches the exact solution in at most the number of distinct eigenvalues of , and therefore in at most steps for an -dimensional system.
The heavy-ball iteration adds momentum to gradient descent:
For and ,
Thus is a polynomial in applied to the initial residual and lies in the corresponding Krylov subspace.
For ,
If is diagonal with entries , a coordinate permutation turns this matrix into blocks
For , , and , every error-propagation block has spectral radius at most , and equality occurs.

Ancestors (5)

  1. Numerical analysis
  2. Analysis
  3. Area of mathematics
  4. Mathematics
  5. Home

Synonyms (1)

Discussion (0) New discussion

There are no discussions about this article yet.

Articles by others on the same topic (1)

Gradient descent is an optimization algorithm used to minimize a function by iteratively moving towards the steepest descent direction, which is indicated by the negative gradient of the function. It is widely used in machine learning and deep learning to minimize loss functions during the training of models.