We’d like to bound these two terms,
which would then give us a bound on how much worse is than the comparator .
Since is arbitrary, choosing the best lets us compare to the best thing ERM could have possibly done.
The first thing to note, though, is that anything with a in it
– so everything above except for –
depends on the draw of the random training set .
It’s possible that we could get some ridiculously unlikely training set where everything behaves nonsensically.
So we’ll need to do some kind of probabilistic bound.
Remember that the only thing that’s random here is ,
since is just some fixed hypothesis.
So, we can frame this as ,
where the are iid random variables
with mean .
The law of large numbers therefore guarantees that as ,
converges (almost surely) to ,
and so this term in the bound converges to zero.
In fact, for many and , the other term will also have the same property,
that .
Therefore, by (1.6),
we have (if is a minimizer of )
that .
Various formalizations of this last property are called consistency,
and it’s a nice property to have:
eventually, your learning algorithm works as well as it could have.
One problem with this notion, though, is that this is all it tells you.
There’s no guarantee about what happens with ,
or when going from to ,
or anything at all other than “eventually it works.”
A more precise analysis might use the central limit theorem.
Let and assume this is finite;
111Formally, we’d write ; the is convergence in distribution.
informally, the CLT then says that
behaves like .
In fact, it’s often true that the first term is also asymptotically normal ([VAN98], Section 5.3).
This is a nicer result than before:
it still doesn’t say anything particular for a finite (maybe the CLT takes a long time to kick in),
but it tells us a lot about the asymptotic behaviour,
including both its limiting value and also roughly how much variation we can expect around that value.
It can be tough to find these exact limiting distributions in general, though,
and they’re not always true
(e.g. the one I didn’t state for the first term above has some strict requirements on the way that is parameterized,
which are often not true for real models ([WMG+23])).
A similar but somewhat looser style of bound is to say that
222You can check the wiki page for a formal definition of , but it roughly means “with any constant probability, a sequence of sampled random variables is .”
the estimation error is ,
which is implied by the CLT result above, but can also be much easier to show.
Again, this doesn’t imply anything for a finite
(just like how analyses don’t say anything for any specific input size on your algorithms),
but it does say things like “for reasonably large ,
observing four times as much data should roughly halve your estimation error.”
The most preferred kind of result, though,
is usually one with explicit constants:
something like (if is finite – see section2.3)
or, where is a problem parameter,
These results give you a rate, but also apply to any, not just eventually.
(They might not be meaningful for small , though;
if you’re using 0-1 loss, it’s not very helpful to say the estimation error is less than four!)
2.2 Uniform convergence, bounded loss
We’re first going to assume that for all ;
often ,
and e.g. for the 0-1 loss we have .
For something like the square loss,
it isn’t “automatically” bounded,
but it still might be bounded by the choice of and ;
we’ll discuss this later.
As we discussed, (B) is an average of iid random variables.
We can bound this with the following form of Hoeffding’s inequality,
which we’ll prove in chapter3:
Proposition 2.1(Hoeffding, simple form).
Let be independent,
each with mean
and bounded in almost surely ().
Then
Applying this to the random variables
handles the bound for (B).
It’s tempting to also try to apply this result directly to (A),
which would then complete our bound and everything would be really simple.
The problem is that the aren’t independent!
The choice of depends on all of , i.e. on all of the other ,
so and are not independent.
So, how can we bound this?
The most common way is called uniform convergence.
The idea is that
if we know that is small for all,
then it’ll be small for , no matter how we pick it – since it’s something in .
That is,
444 is the version of for potentially infinitely many things, like how is the version of .
if we know that
then we also have that .
Or, stating it another way,
(2.1)
and so upper-bounding the right-hand side bounds the left-hand side.
How can we bound that?
2.3 Finite
To start, we’ll make a kind of drastic assumption:
that is finite,
e.g. we’re only considering possible hypotheses.
Proposition 2.2.
Suppose is almost surely bounded in ,
is finite,
and is any ERM in .
Then for any , with probability at least over the choice of , it holds that
Proof.
For any hypothesis , we can allow it a “failure probability” of
in Hoeffding’s inequality:
If we do this for each hypothesis ,
we know that the probability of each particular being bad is low.
We then want to combine them into the probability that anything is bad;
we can do this with a union bound.
Combining all of them together, the probability that any happens to look way better than it is can be bounded as
But we’ll also need the other direction for (B):
in particular doesn’t look way worse than it actually is.
Giving it the same failure probability to make things nice,
Now, if and ,
then (1.6) tells us that
.
Using another union bound,
∎
Another way to state proposition2.2 is that with samples,
we can achieve estimation error at most
with probability at least .
Or, alternatively, we can say that we can achieve estimation error at most with probability at least
if we have at least samples.
2.3.1 Is this finiteness assumption reasonable?
Every we use in practice is finite.
Our models are represented on a computer with bounded memory,
so we consider no more than hypotheses.
On the other hand, might be really large.
Typical vision CNNs are around a few hundred megabytes:
100 megabytes is 800,000,000 bits,
and is quite big.
For 0-1 loss,
this would mean that for our bound to show that
ERM learns a 100-MB network even to within an extremely loose additive error
with probability at least ,
we’d need
100 MB is a relatively small model these days (ViTs are usually a few gigabytes),
and 28 billion is a lot of samples.
But the union bound we did over ignores all structure in .
If we change just one parameter by ,
then we’re treating the error of that new hypothesis totally separately,
when in reality those two errors are tightly correlated.
We’ll approach that soon,
with various techniques that will also allow us to handle infinitely large ;
but first, we’ll go back and prove Hoeffding’s inequality.