Fall 2026, Instructor: Haipeng Luo
This document presents the original English text of the Lecture 2 slides, restored against the source PDF. Mathematical notation, theorem/lemma/proposition/equation numbering, and proof structure are preserved as in the original.
1 Uniform Convergence and Rademacher Complexity
In this lecture, we focus on studying the value , which, as discussed last time, completely characterizes the learnability of a class in the batch/statistical learning setting. We will perform a sequence of upper-bounding steps on this value to reach a much more manageable form, and in the end argue that these upper bounds are very tight.
Recall that the value is defined as
where ranges over all (distributions of) mappings from training samples to a final predictor , and ranges over all data-generating distributions on .
As the first step of relaxing this value, we consider a very simple algorithm: output the Empirical Risk Minimizer (ERM):
Here, the empirical risk simply refers to the average loss over the training set. For simplicity, we assume that at least one such minimizer exists, which is basically without loss of generality. Clearly, we now have
Before further discussion, we make the following two remarks on ERM.
First, finding an ERM is a well-defined optimization problem, and there are many well-studied optimization algorithms for it. As discussed last time, this optimization aspect is out of the scope of this course. In general, finding an ERM could even be an NP-hard problem; here we only focus on whether the problem is statistically, as opposed to computationally, learnable.
Second, one might wonder why we should study this somewhat "naive" algorithm without "regularization", given that minimizing training loss alone might lead to overfitting in practice. The answer is that for many problems, a regularized ERM
is equivalent to the ERM over a smaller class:
where is some other constant. So regularization is really just a way to implicitly learn over a restricted class that hopefully is statistically easier to learn.
1.1 Empirical Process and Uniform Convergence
Next, we further simplify Equation (1). Let
We have[^1]
Here, the collection of random variables indexed by
is called an empirical process. Each of these random variables is nothing but the difference between the expected value of the function on a random input drawn from and its empirical average value on a set of i.i.d. inputs drawn from the same distribution.
Clearly, these random variables are all zero-mean, and by the law of large numbers, each of them should be small when is large. However, in order to claim that Equation (2) is small, we in some sense have to argue that these random variables are all small simultaneously, and whether this is true depends on the class .
If
we say that satisfies uniform convergence. That is, for any data-generating distribution, the expected supremum of the empirical process is arbitrarily small as long as is large enough. From Equation (2), it is clear that if satisfies uniform convergence, then is learnable.
1.2 Symmetrization and Rademacher Complexity
For a given class , how do we know whether the expected supremum of the empirical process is small or not? To answer this question, we will further relax this quantity via an important technique called symmetrization, and arrive at something called Rademacher complexity.
To this end, we first define a Rademacher random variable as a random variable that takes on values and with equal probability. For a class of functions and a sequence of arbitrary inputs , define the conditional Rademacher complexity of on these inputs as
where are i.i.d. Rademacher random variables.
The (unconditional) Rademacher complexity of with respect to a distribution supported on is defined as
where are i.i.d. samples from .
At a high level, the Rademacher complexity of a class measures how well it can fit random signs, because the correlation is large when is of the same sign as . Therefore, the larger the Rademacher complexity, the more expressive the class is.
The connection between the Rademacher complexity and the expected supremum of an empirical process is summarized in the following theorem.
Theorem 1. For any data-generating distribution and any class , we have
where
Proof. By definition, we write as
and arrive at
Pulling the expectation out of the supremum leads to the following upper bound, which is symmetric:
Next, we claim the following equality:
This is true because for each possible value of the sequence ,
and
differ only in that we switch the two examples and whenever . Since and follow the same distribution, this switch makes no difference in expectation.
Splitting the supremum into two parts then leads to the further upper bound
Finally, note that and have the same distribution, so the two terms above are both exactly
Dividing by then gives the conclusion.
1.3 Erasing the Loss for Supervised Learning
For many problems, especially supervised learning problems, when analyzing the Rademacher complexity of , the part involving the loss function is in fact not that important and can usually be removed.
Specifically, consider a supervised learning problem with and . In the following two cases, we can easily relate and .
Lemma 1. For a binary classification problem with and the 0-1 loss, one has, for any sequence ,
and thus
Proof. By definition,
The last step uses the fact that Rademacher variables are zero-mean, and the fact that for any labels , the random variables
are again i.i.d. Rademacher random variables.
Lemma 2 (Contraction Lemma). Consider a regression problem with , where the loss has the form
where is -Lipschitz in the first parameter, that is, for any ,
Then for any sequence , one has
and thus
Proof. By definition,
First averaging over the two possible values of the last Rademacher variable , we obtain
where the last step uses the -Lipschitzness of . By symmetry, removing the absolute value in the last expression makes no difference under the . Splitting this supremum once again, we obtain
Repeating this process for in turn gives the conclusion.
Note that Lipschitzness is usually satisfied for common problems. Take the squared loss
as an example. If , it is clear that this loss is -Lipschitz.
2 Finite Class
Let us make a quick summary at this point. Through a sequence of upper-bounding steps, we have relaxed the value of a statistical learning problem to the Rademacher complexity of the class:
where, for a binary classification problem, ; for a regression problem, is the Lipschitz constant of the loss.
It is now clear that understanding the Rademacher complexity of a class is critical to understanding the learnability of a problem. So how should we compute it?
We start with a simple yet fundamental case: is a finite class. All subsequent discussions on infinite classes will eventually make use of the results for finite classes. The key lemma we need is the maximal inequality for sub-Gaussian random variables.
Recall: if a zero-mean random variable satisfies, for all ,
that is, its moment generating function is bounded by that of a zero-mean Gaussian with variance , then is said to be -sub-Gaussian. For example, any zero-mean random variable with range is -sub-Gaussian. This is Hoeffding's lemma.
Lemma 3 (Maximal Inequality). Let be a finite collection of -sub-Gaussian random variables. Then
Proof. For any , we have
Rearranging gives
Setting
a choice that minimizes the upper bound, we obtain
This completes the proof.
Next, we apply this maximal inequality to bound the Rademacher complexity of a finite class.
Theorem 2 (Massart's Lemma). Let be a finite class and be an arbitrary set of inputs. Then
Consequently, if for some , then
Proof. Note that
where
The following calculation shows that is -sub-Gaussian with
Indeed, for any ,
The first step uses the fact that are independent; the second step uses the fact that is -sub-Gaussian. Applying Lemma 3 then gives the conclusion.
The theorem above implies that finite classes with function values bounded in are all learnable, since
as goes to infinity. In fact, it also gives the exact convergence rate when learning via an ERM.
The reader may notice that one can also apply the maximal inequality directly to the empirical process
to reach the same conclusion. However, we will soon see why it is important to do this on the Rademacher complexity instead.
3 Infinite Class: Classification
We next move on to study the Rademacher complexity of infinite classes. As the first step, we consider binary classification problems with . While Lemma 3 seems not applicable to infinite classes, it in fact still plays a key role.
The main observation is the following: the conditional Rademacher complexity can be equivalently written as
where
is the projection of onto the input set .
While is infinite, is always finite, and its size is at most . Based on this intuition, we define the growth function of on inputs as
It is the maximum number of distinct labelings one can possibly obtain on samples using functions from . From the previous observation and Lemma 3, we immediately have
A trivial upper bound on the growth function is . Plugging it into the bound above only gives a constant-order Rademacher complexity. Therefore, for the Rademacher complexity to vanish, the class needs a much milder growth function. Below we discuss two examples.
Proposition 1. Let and consider the class of threshold functions
Then
and thus
Proof. For any , labels all points to the left of as and all points to the right as . Clearly, for any distinct points on the real line, all the possible labelings, from left to right, are
This completes the proof.
Proposition 2. Let and consider the class of interval functions
Then
and thus
Proof. Any distinct points divide the real line into regions. Placing the interval endpoints and into any two distinct regions gives labelings. Placing the two endpoints into the same region, whichever one is chosen, produces exactly one extra labeling in which all labels are .
It is worth noting that while replacing with in the definition of Rademacher complexity is very intuitive and direct, one cannot do the same thing directly for or its upper bound
because the dependence of on is not only through the values .
This highlights the importance of relaxing these quantities to the Rademacher complexity via symmetrization, and also explains why, in the finite-class case, we did not apply the maximal inequality directly to the empirical process.
3.1 VC Dimension and Sauer's Lemma
While the growth function is a nice way to characterize the complexity of a class, it is not always easy to compute. To see this, consider and the class of linear classifiers
where when and otherwise. What is for this class?
For simplicity, let's start with . It is pretty clear that for any , one can find points such that realizes all labelings, and therefore
What about ? Well, first we know , because for any four points in a 2D plane, it is impossible for linear classifiers to realize all possible labelings (try to convince yourself of this).
But what exactly is the value of ? After spending some time you can probably figure this out as well. But what about , , and more generally for an arbitrary ? Do we need to figure out all these values one by one, a tedious process?
Somewhat surprisingly, it turns out that the two facts mentioned above,
are already enough to derive a pretty tight upper bound on for an arbitrary . To show this result, we first make a few definitions.
If
that is, realizes all possible labelings of this input set, we say that shatters the input set .
The Vapnik–Chervonenkis (VC) dimension of is defined as the size of the largest input set that can be shattered by , that is,
If this set is empty, we define ; if this set is not finite, that is, for all , we define .
As an example, the VC dimension of the 2D linear classifiers discussed above is . The following seminal result connects the growth function of a class with its VC dimension (the proof is deferred to the next subsection).
Lemma 4 (Sauer's Lemma). For a class with finite VC dimension , one has, for any ,
By the definition of VC dimension, we clearly have for any . What Sauer's lemma shows is that once becomes larger than , there is a phase transition: the exponential growth of the growth function suddenly becomes a polynomial growth, roughly .
Combining this with the previous discussion, we have
implying that a class with finite VC dimension is always learnable.
We emphasize that to prove , one needs to show exactly two things:
- , that is, provide a concrete set of inputs of size and prove that realizes all possible labelings on this set;
- , that is, prove that for any input set of size , there exists a labeling that is not achievable by .
This is often easier than finding the growth function for an arbitrary , as we already saw in the linear classifier example. Below are a few more examples.
Proposition 3. A class has VC dimension if and only if it contains only one function.
Proposition 4. The threshold function class defined in Proposition 1 has VC dimension .
Proposition 5. The interval function class defined in Proposition 2 has VC dimension .
You should be able to prove these statements without too much difficulty. For the threshold and interval function classes, we figured out the exact growth function earlier, and one can see that the upper bound given by Sauer's lemma is very tight.
Proposition 6. The linear classifier class defined in Equation (3) has VC dimension .
We have already proved this statement for in the earlier discussion. Proving the general case will be part of HW 1.
By now, you might have noticed that the VC dimension often matches the number of parameters of the class. Indeed, the number of parameters often serves as a quick (and most of the time accurate) guess for the VC dimension. This is, however, not always correct, as shown in the following example where a class with a single parameter has infinite VC dimension. The intuition is that by picking a large enough , the function can wiggle arbitrarily often within a small interval (see HW 1).
Proposition 7. Let and let
Then
3.2 Proof of Sauer's Lemma
Proof. Let
We prove by induction on the value of that, when ,
The base case is trivial: the only possible configuration is and , and in this case
Next, assume the statement holds for all with and , and we prove . The case is again trivial, so assume
For any set of distinct inputs , let
be the projection of onto the inputs ; and let be such that
That is, for any labeling of , labeling with either label leads to a labeling of that can be realized by . It is clear that
Now, view and as two function classes defined only on (so a function is just a vector in ). Clearly,
where the last step uses the inductive hypothesis and the fact that cannot have VC dimension larger than that of .
On the other hand,
where the last step uses the inductive hypothesis and the fact that has VC dimension at most .
Indeed, if the VC dimension of were larger than , there would exist a subset of of size that can be shattered by . By the construction of , adding to this subset leads to a set of size that can be shattered by , contradicting the condition .
Together, this implies
Since this holds for any , we have
finishing the inductive proof.
The second inequality of the lemma holds because
This completes the proof.
4 Summary and Closing the Loop
This lecture can be summarized by the following sequence of upper-bounding steps:
where, again, for a binary classification problem , and for a regression problem is the Lipschitz constant of the loss; is a bound on the magnitude of the function values; and .
In the end, we found that for binary classification, having a finite VC dimension is a sufficient condition for learnability. But is it also necessary? In other words, is this sequence of upper-bounding steps tight enough?
The answer is yes: a finite VC dimension is also necessary for learnability, so we basically have a closed loop.
Indeed, if a class has infinite VC dimension, then for any , we can find a subset with elements that is shattered by ; that is, behaves the same as on this set.
Therefore, by the exact same argument as the no free lunch theorem discussed in Lecture 1, for any algorithm one can find a distribution supported on such that it suffers excess risk at least , implying that is not learnable.
This also implies that if a class is learnable (for a binary classification problem), then it must be learnable via the simple ERM algorithm.
As a final remark, this conclusion is not always true for general statistical learning problems.
[^1]: For simplicity, we ignore the issue that might not exist; it can be handled easily.