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

Smoothness and Strong Convexity

Hello! Let's build on our practical work with gradient descent by exploring the theoretical properties that govern its performance.

Introduction

In our last lesson, you successfully implemented the gradient descent algorithm and experimented with the learning rate, . You observed firsthand that the algorithm's convergence—or divergence—is highly sensitive to both and the shape of the function being minimized. This empirical understanding is crucial, but as you requested, our goal is to build a rigorous theoretical foundation.

Today's lesson addresses the learning outcome: Define smoothness (Lipschitz continuity) and strong convexity of a function. These two properties provide a formal, mathematical language to describe the "shape" or "curvature" of a function. Understanding them is the critical prerequisite for analyzing why gradient descent converges and how quickly it does so. We will move from trial-and-error to formal analysis, setting the stage to derive concrete convergence rates.


Why These Properties Matter

Before diving into formal definitions, it's helpful to build intuition. When we run gradient descent, we face two potential problems related to curvature:

  1. The gradient changes too quickly: If the function's curvature is very sharp and changes erratically, a step we take based on the gradient at one point might land us in a region with a completely different gradient, causing us to "overshoot" the minimum wildly. We need a way to control how fast the gradient can change. This leads to the concept of smoothness.
  2. The function is too flat: If the function is very flat around the minimum (like a wide, shallow bowl), the gradient will be very close to zero even when we are still far from the true minimum. This causes the algorithm to take tiny, inefficient steps, slowing convergence to a crawl. We need the function to be "curved enough" to guarantee progress. This leads to the concept of strong convexity.

The following video provides an excellent introduction to this motivation by comparing a quadratic function (which behaves well) to the absolute value function (which presents challenges for gradient descent).

3.2 Smooth and Strongly Convex Functions

Watch the introductory part of this video from Constantine Caramanis to get a feel for the practical implications of these properties.

Watch the segment from 00:08 to 05:22. The speaker discusses the different behaviors of gradient descent on a quadratic function versus an absolute value function. Pay attention to his description of the 'self-tuning' property and how the gradient's magnitude behaves far from the solution. These are the intuitions we are about to formalize.


Part 1: Smoothness (Lipschitz Continuity of the Gradient)

Smoothness formalizes the idea that the gradient does not change too rapidly. A function is considered smooth if its gradient is Lipschitz continuous.

Formal Definition

A differentiable function is called -smooth if its gradient is Lipschitz continuous with constant . This means that for any two points in its domain:

Here, is the standard Euclidean norm. This inequality states that the distance between the gradient vectors at two points is bounded by times the distance between the points themselves. The constant limits how much the gradient can change.

The Consequence: A Quadratic Upper Bound

The most important consequence of -smoothness for optimization is that it implies the function is globally upper-bounded by a quadratic. For any :

Notice the first two terms on the right, , form the first-order Taylor approximation (the tangent plane) of at . Smoothness guarantees that the function cannot grow faster than this tangent plane plus a simple quadratic term. This prevents the function from curving upwards too sharply.

To understand how this crucial inequality is derived from the definition of smoothness, please study the following resources. The video provides a detailed walkthrough, while the PDF offers a concise, formal proof.

3.2 Smooth and Strongly Convex Functions

This segment of the video provides a rigorous derivation of the quadratic upper bound from the definition of smoothness.

Watch from 08:02 to 19:53. The presenter defines a helper function g(x) and proves it is convex. He then uses the first-order condition for convexity of g(x) to derive the final inequality. Follow each step of the algebraic manipulation carefully.

1. Gradient method

For a more compact reference, review the following lecture notes from a UCLA optimization course by Vandenberghe et al. They demonstrate the equivalence between the Lipschitz condition and the quadratic upper bound.

Read pages 1-10 to 1-12. Page 1-10 gives the formal definition of a Lipschitz continuous gradient. Page 1-11 states the quadratic upper bound, and page 1-12 provides the proof of equivalence. This proof uses a slightly different but equally valid method involving integration along the line segment between x and y.

Connection to the Hessian

For a twice-differentiable function, there is a very direct way to determine if it is -smooth. The condition is equivalent to the eigenvalues of its Hessian matrix being bounded above by for all . Using matrix notation, this is written as:

where is the identity matrix and the symbol means that the matrix is positive semidefinite. This gives us a practical tool to find the smoothness constant for many functions. For example, for a quadratic function , the Hessian is the constant matrix , so its smoothness constant is simply the largest eigenvalue of .

Test your understanding!

Consider the one-dimensional function .

  1. Is this function smooth?
  2. If so, can we find a single, global smoothness constant that holds for all ? Why or why not?
Show answer
  1. Yes, the function is smooth. Its gradient is , and its second derivative is . Both are continuous functions.

  2. No, we cannot find a single, global smoothness constant . The condition for smoothness in 1D for a twice-differentiable function is . For our function, this means . This inequality cannot hold for all with a finite constant , because grows without bound as . The function is therefore called locally smooth (it has a valid in any bounded region) but not globally smooth. This is an important distinction in optimization theory.


Part 2: Strong Convexity

Strong convexity is, as the name suggests, a stronger condition than the standard convexity we have already discussed. It formalizes the notion that a function must be "sufficiently curved" and cannot have flat regions.

Formal Definition

A differentiable function is -strongly convex with parameter if for any two points in its domain, the following inequality holds:

Compare this to the standard first-order condition for convexity: . Strong convexity adds the extra quadratic term , which forces the function to lie strictly above its tangent plane. This provides the desired quadratic lower bound.

The following resources provide the formal definition and derivation.

3.2 Smooth and Strongly Convex Functions

The same video now introduces strong convexity, defining it in a way that directly parallels the discussion on smoothness.

Watch the segment from 23:00 to 27:18. The presenter defines strong convexity by stating that f(x) - (m/2)||x||^2 is a convex function. He then uses this definition to derive the quadratic lower bound inequality shown above. Observe the symmetry in the argument compared to the smoothness section.

3 Smoothness and strong convexity

These lecture notes provide a clear, formal definition of strong convexity and its consequences.

Read section 3.3, "Strong convexity" (page 2). Note the definition using Jensen's inequality (4), and the equivalent condition for differentiable functions (5), which is the quadratic lower bound we are focusing on.

Connection to the Hessian

Similar to smoothness, strong convexity has a direct link to the Hessian for twice-differentiable functions. A function is -strongly convex if and only if the eigenvalues of its Hessian matrix are all bounded below by for all . In matrix notation:

This means that the matrix must be positive semidefinite. For our quadratic example (with being symmetric positive definite), the strong convexity constant is the smallest eigenvalue of .


The "Sandwich" Property and Its Importance

Now, let's put everything together. If a function is both -smooth and -strongly convex, it is confined between a quadratic lower bound and a quadratic upper bound:

This "sandwiching" of the function between two quadratics is the single most important result of this lesson.

Visualizing Smoothness and Strong Convexity
This image provides a powerful visualization of what we've derived. The function f(x) is constrained to lie within the region between the parabolic lower bound from strong convexity (str-cvx-bound) and the parabolic upper bound from smoothness (smooth-bound).

The ratio is called the condition number of the function. It measures how "well-behaved" the function is for optimization.

  • If is close to 1, then , meaning the function's curvature is very uniform. It behaves almost like a perfect sphere, which is ideal for gradient descent.
  • If is very large, the function is ill-conditioned. This means it's very steep in some directions and very flat in others (like the elongated bowl from our previous lesson's implementation, ). This is where gradient descent can struggle.

This condition number will be the central quantity when we analyze the convergence rate in our next lesson.

Test your understanding!

Let's return to the function from the previous lesson: .

  1. Calculate the Hessian matrix .
  2. What are its eigenvalues?
  3. Based on the eigenvalues, what are the smoothness constant and the strong convexity constant for this function?
  4. What is the condition number ?
Show answer
  1. First, we find the gradient: . The Hessian is the matrix of second partial derivatives:
  2. Since the Hessian is a diagonal matrix, its eigenvalues are the diagonal entries: and .
  3. The smoothness constant is the largest eigenvalue: . The strong convexity constant is the smallest eigenvalue: .
  4. The condition number is .

Conclusion

In this lesson, we have established the formal definitions and implications of two fundamental properties in optimization theory.

Key Takeaways:

  • L-smoothness (Lipschitz Gradient): Limits how fast the gradient can change. It provides a quadratic upper bound on the function, ensuring it doesn't curve "too sharply." For twice-differentiable functions, it's equivalent to .
  • m-strong convexity: Requires the function to be sufficiently curved everywhere. It provides a quadratic lower bound, ensuring the function isn't "too flat." For twice-differentiable functions, it's equivalent to .
  • The Sandwich: A function that is both L-smooth and m-strongly convex is bounded between two quadratics. This property is the key to proving convergence guarantees for gradient descent.
  • Condition Number: The ratio quantifies how "well-behaved" the function is. A large indicates an ill-conditioned problem.

Preview of the Next Lesson:
We are now fully equipped to analyze the convergence of gradient descent with mathematical rigor. In the next lesson, we will use the quadratic upper and lower bounds derived today to prove that for an -smooth and -strongly convex function, gradient descent converges at a linear rate. We will derive an explicit formula that shows exactly how the error decreases at each iteration as a function of and .

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

Sign up