MIT 6.790 — Lecture 9
Gradient Descent
§ Gradient Descent
Recall from Lecture 8 that logistic regression requires minimizing the following (logistic) loss:
Unfortunately, unlike with linear regression, there is no closed-form expression for the minimizing parameter of logistic loss. But because logistic loss is convex, we can apply gradient descent to find the global minimum. (Recall from Lecture 8 that we can say “global minimum” rather than “local minimum” because of convexity.)
Definition. Let be a differentiable function. In gradient descent (GD), we start with some and proceed via:
Note the hyperparameter , which we call the step size. The hope is that converges to a local minimizer of .
§ Stationary Points
Gradient descent stops at a value where ; we call such a point a stationary point. We can think of stationary points as being classifiable into two categories:
Category I: Global maximizers, global minimizers, local maximizers, or local minimizers.
Category II: Saddle points (as in, stationary points that are not Category I).
This is kind of irrelevant, though; gradient descent only converges to saddle points for a measure-zero set of initial points .
For a further discussion of how the Hessian relates to saddle points and whatnot, see Lecture 16 and Lecture 19 of 18.701 (specifically the subsections linked above).
§ Lower-Bounding GD Efficiency
For one-dimensional functions , we can upper-bound the number of steps required to get close to a stationary point.
Theorem. (One-Dimensional Descent Lemma) Suppose is twice differentiable, and for all . Then if we set , the iterates of gradient descent satisfy:
In particular, each step of gradient descent produces an improvement of at least .
Proof: We won't provide a rigorous proof. The rough idea is to use the quadratic Taylor approximation.
Plugging in and rearranging yields:
That's the promised bound, with many computations omitted. This proof, of course, lacks rigor in that everything carries an symbol due to the Taylor approximation.
An immediate corollary of the Descent Lemma is the following.
Theorem. (One-Dimensional GD Efficiency) Suppose, in the setting of the Descent Lemma, that . If gradient descent yields , then for any , there is some for which .
Remark. Note that none of the reasoning here carries an assumption that is convex.
For some reason, 6.790 does not state the multivariate versions of these theorems, even though their statements and proofs are nearly identical to the one-dimensional case. We state them here for completeness.
Theorem. (Multivariate Descent Lemma) Suppose is twice differentiable, and for all . Then if we set , the iterates of gradient descent satisfy:
In particular, each step of gradient descent produces an improvement of at least .
Remark. The ordering is the Loewner order on symmetric matrices: if and only if is positive semidefinite.
Theorem. (Multivariate GD Efficiency) Suppose, in the setting of the Descent Lemma, that . If gradient descent yields , then for any , there is some for which .
§ Linear Regression Convergence Rate
Suppose we use gradient descent to find the minimum in simple least-squares linear regression. Then an overly large step size can cause gradient descent to fail to converge!

This often happens when the level sets of are elliptically-shaped, rather than spherically-shaped.

Let's investigate how this behavior appears specifically in the case of least-squares linear regression.
Theorem. (Least-Squares Gradient Descent) Suppose we use gradient descent to find a such that, given training data and , the loss is minimized. Then the sequence satisfies:
where is the Hessian matrix (notably, independent of ).
Proof: It's just plain computation. First, compute the relevant derivatives.
Then note the minimizer is known to satisfy (see Lecture 23 of 18.650) the equation , so:
Recalling and applying induction finishes the job.
For very large , the effect of can be summarized by its eigenvalues. Say are the eigenvalues of . Then we can make the following observations.
The eigenvalues of are precisely .
To ensure convergence, we require all eigenvalues to be in .
The largest eigenvalue gives the tightest bound here; the constraint implies , roughly.
However, smaller values of lead to slower convergence, as is further from when is smaller.
The smallest eigenvalue gives the slowest convergence here. For , the decay is:
We can summarize this whole story like so.
Definition. Let the condition number of a matrix be (the ratio of its largest eigenvalue to its smallest).
Theorem. (Least-Squares Convergence Rate) Gradient descent for least-squares linear regression, with step size , converges to the global minimum at an exponential rate, described below.
This also explains why elliptically-shaped level sets yield slower convergence: they have a larger condition number.