Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Convergence Rate of Gradient Descent for Smooth and Strongly Convex Functions

Hello! In our previous lesson, we established a solid theoretical footing by defining L-smoothness and m-strong convexity. We saw how these two properties "sandwich" a function between a quadratic upper bound and a quadratic lower bound. Today, we will put this powerful result to work.

Introduction

Our goal for this lesson is to fulfill the learning outcome: Derive the convergence rate of gradient descent for smooth and strongly convex functions. We will move beyond the empirical observation that gradient descent works and formally prove how quickly it converges to the optimal solution.

You've already seen that for a function to be well-behaved for gradient descent, its curvature shouldn't be too sharp (L-smoothness) or too flat (m-strong convexity). We will now quantify this relationship precisely. We will derive an expression showing that the error, or "suboptimality gap," decreases by a constant multiplicative factor at each iteration. This is known as linear convergence (or geometric convergence), and it is a hallmark of efficient optimization.

This lesson will connect the abstract condition number directly to the speed of your algorithm, providing a rigorous explanation for the behaviors you've observed in practice.


Part 1: Progress in a Single Step of Gradient Descent

Let's start by analyzing what happens in a single iteration of gradient descent. The update rule is:

where is the step size (or learning rate).

Our primary tool here is the quadratic upper bound for L-smooth functions, which we derived in the last lesson:

Let's apply this to a single step of gradient descent by setting and .
Substituting , we get:

This inequality is crucial. It shows that as long as the term is positive, the function value is guaranteed to decrease at every step (unless we are already at a point where the gradient is zero).

To maximize the progress in one step, we can choose to maximize this term. This is a simple quadratic in , and its maximum occurs at . Plugging this optimal step size back in, we get:

This result, derived using only the smoothness assumption, is already significant. It guarantees that with a step size of , gradient descent will always converge to a point with a zero gradient. However, it doesn't tell us how fast this convergence is in terms of reaching the global minimum . To do that, we need to bring in our second assumption: strong convexity.


Part 2: Deriving Linear Convergence

Now we will combine the result above with the properties of m-strong convexity to derive the final convergence rate.

Recall that a key consequence of m-strong convexity is a lower bound on the squared norm of the gradient in terms of the suboptimality gap, . Specifically, for an m-strongly convex function:

This inequality formalizes the idea that if we are far from the minimum (i.e., is large), the gradient must also be large, ensuring we take substantial steps.

We have everything we need. Let's combine our two main inequalities.

  1. From L-smoothness (with ):
  2. From m-strong convexity:

Let's subtract the optimal value from both sides of the smoothness inequality:

Now, substitute the strong convexity inequality into the expression above:

This is our main result. Let be the suboptimality gap at iteration . We have shown that:

By unrolling this recursion, we get the explicit convergence rate:

To solidify your understanding of this derivation, please study the following resource, which presents this proof formally.

8 Introduction to Optimization for Machine Learning

These lecture notes from Stanford's CME 323 course provide a concise and rigorous proof of the linear convergence rate we just derived.

Please read Section 8.2, focusing on Theorem 8.7 and its proof. This section cleanly combines the results from L-smoothness (which they proved earlier in the document) and m-strong convexity (from their Lemma 8.6) to arrive at the final convergence rate.


Part 3: Interpreting the Result

The formula we derived is rich with meaning. Let's break it down.

Linear Convergence

The term "linear convergence" can be slightly confusing. It means that the logarithm of the error decreases linearly with the number of iterations. The error itself shrinks by a constant factor at each step, which is a form of exponential decay. This is a very fast and desirable mode of convergence. This contrasts with sublinear convergence (e.g., ), which we would get with smoothness alone, where the steps become progressively smaller and convergence slows down dramatically.

The Condition Number

The rate of convergence is governed by the factor , where is the condition number.

  • Well-conditioned function (): Here, . The convergence factor is close to 0. This means the error is reduced dramatically at each step, leading to very fast convergence. A function with has spherical level sets, and gradient descent (with ) finds the minimum in a single step.
  • Ill-conditioned function (): Here, . The convergence factor is close to 1. The error decreases very slowly, and the algorithm requires many iterations to converge. This corresponds to the elongated, valley-like functions where gradient descent struggles.

The following video provides an excellent concrete example using a 2D quadratic function, perfectly illustrating the effect of the condition number on the path taken by gradient descent.

22. Gradient Descent: Downhill to a Minimum

In this classic lecture, Prof. Gilbert Strang analyzes gradient descent on a 2D quadratic function. This provides a perfect, concrete illustration of our general theoretical result.

Watch the segment from 43:17 to 52:42. First, he presents the exact iterative solution and identifies the crucial ratio (1-B)/(1+B) that governs the convergence speed. This ratio is a direct analogue to our general (1-1/κ). Then, he visualizes why ill-conditioned problems (small B, or high κ) lead to the slow, zigzagging behavior of gradient descent.

Test your understanding!

Let's revisit the function from our last lesson. We calculated its smoothness constant and strong convexity constant .

  1. What is the condition number ?
  2. According to our derived formula, what is the convergence factor ?
  3. Suppose the initial error is . After 10 iterations, what is the theoretical upper bound on the error, ?
Show answer
  1. The condition number is .
  2. The convergence factor is . This means the error is guaranteed to decrease by at least 20% at each iteration.
  3. The upper bound on the error after 10 iterations is . The error has been reduced by nearly a factor of 10.

Conclusion

In this lesson, we have moved from intuition to a rigorous mathematical proof, achieving a deep understanding of gradient descent's performance.

Key Takeaways:

  • For a function that is both L-smooth and m-strongly convex, gradient descent with a step size of converges at a linear rate.
  • The suboptimality gap decreases at each step according to the inequality: .
  • The convergence speed is entirely determined by the condition number . A high condition number signifies an ill-conditioned problem and leads to slow convergence.
  • This theoretical result precisely explains the practical behavior of gradient descent, where performance is excellent on "spherical" functions () and poor on "elongated valley" functions ().

Preview of the Next Lesson:
We have now concluded our deep dive into the theory of unconstrained optimization using gradient descent. Our next module, "Constrained Optimization and Duality," will introduce a new class of problems where the variables must satisfy certain constraints. We will begin by formulating optimization problems with equality constraints and derive the powerful method of Lagrange multipliers to solve them.

Can't find a good explanation? Sign up and we'll make it for you

Sign up