We’ve argued that it’s important to consider algorithm-specific bounds:
sometimes is too big for uniform convergence,
but still learns well.
This is true both for deep learning and for, say, kernel ridge regression with a universal kernel,
This algorithm could feasibly return any ,111Consider a where ,
the distribution on is “sufficiently broad,”
and as .
If this kernel is also continuous,
is the unique minimizer of ,
and checking the details in some asymptotic analysis will give us that .
and so a typical uniform convergence analysis will have to use .
But we know that the VC dimension and Rademacher complexity of are both infinite for a universal kernel,
so a uniform convergence analysis won’t tell us anything useful.
We can generalize this setting a bit to regularized loss minimization (RLM):
(RLM)
(Kernel ridge regression uses square loss, with the RKHS , and . We’ll use the factor of 1/2 because it makes 1-strongly convex, as in propositionC.9.)
We’ve appealed before to a connection between RLM and constrained ERM:
The two problems are Lagrange dual to each other:
for any , there is some such that the solutions agree,
and vice versa.
But converting between and generally requires actually solving the problem,
(RLM) is typically easier computationally,
and it’s usually easier to choose a good than to choose a good .
So, we’d like to come up with a direct analysis of (RLM) for its own sake,
in addition to developing techniques that will help with other analyses.
Randomized algorithms
Our analyses of ERM applied to any empirical risk minimizer,
so exactly what the algorithm did didn’t really matter.
When we’re dealing with specific algorithms, though,
it’s important to note that these algorithms might be randomized:
for instance, stochastic gradient descent sees points in a random order,
and might start at a random location.
Notationally,
we’ll use to denote the potentially random result of the algorithm on a set :
even for a fixed , the result could be a random variable.
Something like will denote the mean of the loss on a fixed when training on a fixed .
We’ll always assume that this randomness is independent of (other than its size):
for instance, this will be the random seed that determines that pattern in which we access the .
If is deterministic, it’s just a point-mass distribution.
15.1 Definitions of Stability
The general intuition we’re going to use is algorithmic stability:
if two training sets and are “similar,”
then and will also be “similar.”
Then doesn’t “depend too much” on the particular sample set,
and so it’s likely to not really overfit too much.
(Defining “similar” in different ways will yield different notions of stability.)
In (RLM), the regularizer “stabilizes” the algorithm.
For instance,
if you run linear regression on “multicollinear” data
(where the data matrix isn’t full rank),
there are multiple possible solutions:
the algorithm isn’t stable.
But if you add the regularizer ,
then there’s always a unique solution that doesn’t depend too much on any one input point.
We’ll use the following notation for changing single sample points:
Now, notice the following basically-trivial result:
Proposition 15.1.
For any distribution and learning algorithm ,
On the right-hand side,
the first loss term is the generalization loss, since doesn’t train on .
The second one is the training error, since does train on .
Proof.
Splitting up the expectation,
the second term has
The first is
where we switched the names of the iid variables and in the first equality.
∎
This motivates what is basically the weakest useful notion of stability:
Definition 15.2.
is -on-average-replace-one stable
if for all ,
We say an algorithm is on-average-replace-one stable
if for all .
Thus, an -on-average-replace-one stable algorithm
will have small average-case generalization gap :
it won’t overfit much, on average.
Like for uniform convergence, there are bad stable algorithms:
consider that always returns regardless of .
But a stable algorithm that also usually fits its training data,
one with small ,
will have small .
This is the notion studied by Chapter 13 of [SB14];
also see [SSS+10].
Notice that since proposition15.1 is an equality,
any algorithm where is always close to
will necessarily be on-average replace-one stable;
this is what I meant by it being the weakest notion.
There’s also a more commonly considered but much stronger notion of stability:
Definition 15.3.
222[BE02] defined as the change from removing the th element, which implies this one with a factor of difference; [EEP05] extended to random algorithms. This version (without the 2) is called strongly-uniform-replace-one stable by [SSS+10].
A learning algorithm is
-uniformly stable if for all ,
We say an algorithm is uniformly stable if .
That is, changing one point in any training set
gives you a hypothesis that looks almost the same for any test point.
If you know differential privacy, this might seem familiar:
it turns out that an -differentially private algorithm with loss
is -uniformly stable
([WLF16], Lemma 23).
If is -uniformly stable,
it’s -on-average-replace-one stable,
just by plugging in the definitions.
But the converse is not true.
(There are also in-between notions; see [BE02, SSS+10].)
If we do have uniform stability, though, we can get stronger bounds:
Suppose that almost surely.
Let be -uniformly stable.
Then, with probability at least over the choice of training points ,
The best case for this bound is when ,
in which case you get a usual rate.
That turns out to be often the case.
Proof.
We’ll apply McDiarmid’s inequality (theorem5.6)
to the function .
Since -uniformly stable algorithms are
-on-average-replace-one stable,
proposition15.1
implies that .
For brevity, write for ,
and for .
Then we have directly that
is slightly more complicated, since one evaluation point changes too:
Thus satisfies the bounded differences condition of McDiarmid
with .
Combining with gives the desired result.
∎
In fact, even stronger rates have been shown recently,
with more complex techniques;
333I don’t know whether their results hold for random or not.
[BKZ20] showed for deterministic that,
with probability at least over the choice of ,
(15.1)
by simplifying and improving techniques of [FV18, FV19] inspired by techniques from differential privacy.
This shows a rate as long as ,
much weaker than the required by theorem15.4.
15.2 Convex RLM
Recall regularized loss minimization (RLM),
and suppose is convex for each ,
444If it’s strongly convex with some different , just scale it and inversely scale .
and is 1-strongly convex.
Then ,
the sum of a convex function and a -strongly convex function,
is -strongly convex.
Let denote ;
since is strongly convex, it has a unique minimizer.
Now, notice that for any ,
we have that
Thus for any ,
Plugging in and ,
since minimizes ,
we get that
Noting also that ,
propositionC.3 implies that
.
Thus we’ve shown that
(15.2)
15.2.1 Lipschitz loss
If we further assume that is -Lipschitz for each ,
i.e. for all ,
then (15.2) yields that
and hence
Using the Lipschitz property again,
for any , and so we’ve shown -uniform stability.
Plugging into theorem15.4, we’ve shown the following result.
Proposition 15.5.
Suppose that
is -Lipschitz and convex for each .
Let be -strongly convex.
Then the RLM algorithm of (RLM) is -uniformly stable, and hence
If we further have that for all and -almost all ,
(RLM) satisfies that,
with probability at least over the choice of ,
15.2.2 Smooth, nonnegative loss
It’s possible, though messier, to show a similar result for nonnegative -smooth functions
(those with -Lipschitz gradients, as in definition11.1):
in the end,
if you also assume that ,
you get (see [SB14, Section 13.3.2]) that
If is nonnegative and there is some with ,
e.g. the zero predictor when ,
and we also have that ,
say because the loss is always less than ,
then we know that
in which case we can upper-bound by .
15.3 Fitting-Stability Trade-Off
Proposition15.5 shows that is closer to as grows.
But will also get worse for bigger ,
since cares more and more about having “simpler” than minimizing .
How can we find the best to trade off between them?
For any fixed ,
if is nonnegative and -strongly convex,
we have that
if the loss is convex and -Lipschitz, and is nonnegative and -strongly convex.
We now have two routes we can take from this bound.
Choosing
Because our canonical regularizer is ,
let’s compare our result to any satisfying .
We then have
(15.5)
Using that is minimized at
with value ,
we can minimize this bound by picking
to get
Definition 15.6.
A learning problem is convex, -Lipschitz, -bounded555
The class of problems is also sometimes described in terms of Bregman divergences;
see e.g. Chapter 14 of [MRT18].
if the hypothesis set is convex,
bounded as for all for some strongly convex function ,
and the loss functions are convex and -Lipschitz for each .
Regularized loss minimization can therefore learn (in the sense of expected loss) any convex-Lipschitz-bounded learning problem.
(Section 12.2.1 of [SB14] gives examples of problems which are not learnable if they’re convex but not Lipschitz and/or not bounded.)
You can do a similar thing for the case where the loss is nonnegative and smooth instead of Lipschitz ([SB14], Corollaries 13.10 and 13.11).
Fixing
Instead of fixing some and picking accordingly,
we can instead ask: what happens if we run the algorithm with any particular choice of ?
We minimized (15.5) in terms of ,
but it’s equivalent to take as given and minimize the bound in terms of ,
in which case we find
and
This is exactly the same analysis, but tells us what happens with different choices of :
for instance, if we pick a constant as grows,
then we only compete with simpler and simpler hypotheses as we see more data (not ideal).
We need for the second term to go to zero,
i.e. we need .
If we also want to eventually compete with any possible predictor,
we need ,
i.e. .
Thus, consider picking for any :
the second term becomes .
Note that this means boundedness isn’t actually required for learnability:
convexity and Lipschitzness of the loss is enough.
With boundedness, however, we know that will become exactly for bigger than some threshold.
Without boundedness, it might be that is not actually achieved,
only approached as ;
this is actually the case for logistic regression of separable data.
To get a final bound, then,
we would need to know the rate at which approaches its asymptote as grows.
15.3.2 High-probability bound
To get high-probability bounds, also assume that .
We showed in the proof of theorem15.4
that satisfies bounded differences
with .
We then have that is close to , which we just upper-bounded;
we don’t actually need to apply theorem15.4 directly,
and doing so wouldn’t be any tighter.
This tells us that
and plugging in (15.5) gives for any fixed ,
it holds with probability at least that
(15.6)
We can see that the choice ,
which was optimal in the average-case analysis of section15.3.1,
will now give us a constant upper bound.
That’s no good.
The problematic term is ,
the same as in theorem15.4,
but using means that becomes .
We’ll thus need a larger .
Assuming ,
we can minimize (15.6) when
giving a bound of
Notice that this upper bound on the suboptimality is bigger than
;
that rate is much slower than the rate for the mean!
Using the sharper bound of (15.1) instead gives a much better result:
This upper bound is minimized by
,
giving
This is a far more satisfying final bound,
and notice that the choice of is similar (up to log factors)
to the case from section15.3.1 where we only analyzed the mean.
Either of these analyses shows that convex-Lipschitz-bounded learning problems
are also learnable by RLM with high probability.
A similar, but messier, analysis should also work for the case of a nonnegative -smooth loss.
15.4 More
Other algorithms than RLM are also stable.
The theory originated out of analyses of “local learning rules” like -nearest neighbour,
which are on-average-replace-one stable
(and “hypothesis stable”)
but not uniformly stable.
You can also show that (stochastic) gradient descent is uniformly stable for convex problems,
and even get some results in non-convex settings ([HRS15, FV19]).
And, as mentioned, any differentially private algorithm is automatically uniformly stable (with the randomized variant).
Stability is also very useful for analyzing cross-validation, especially leave-one-out cross-validation,
which is discussed by many of the papers here ([BE02, SSS+10]).
[SSS+10] also have thorough accounting of when stability is necessary, or not, to be able to learn different kinds of problems,
and [WLF16] a similar accounting of the relationship to privacy.