Majority-of-Three is Optimal
How simple can an optimal learner be? [arXiv]
(Part of a series of short writeups covering recent work.)
Generally in learning theory, we are concerned with a notion of statistical optimality: given samples, how little error can a learner incur on the true distribution? Generally, we know some lower bound, and the main challenge is designing an algorithm that matches that lower bound. In the theory of PAC (probably approximately correct) learning, the first algorithm to achieve the optimal statistical rate was given in 2016 [Han16]. However, the algorithm was based around a very sophisticated splitting of the dataset and carefully designed overlaps, and its analysis was similarly quite involved. Thus, a new line of work emerged with a different goal: find the simplest optimal PAC learner. In particular, one such proposed algorithm was majority-of-three, proposed by [AHL+24] and proven to be optimal in expectation (i.e. on average it achieves the optimal rate). It was not, however, proven optimal with high probability1 — an extra factor remained in their analysis, and it was conjectured that it could be removed to prove that majority-of-three is indeed optimal with high probability. In this short note, we give a better analysis and prove that the algorithm is an optimal PAC learner.
Setup#
Supervised Learning, Hypothesis Classes, and VC Dimension#
Generally, the supervised learning setup is as follows: some true function exists, we see it applied to some finite set of samples drawn i.i.d. from some unknown distribution , and we must then predict the rule. Let's introduce some notation: we see , where is our training set, and are the labels. Let's assume all the labels are binary, i.e. either or (one can also use and , or really anything, it doesn't matter). Further, let us assume that we know that the true function is a member of some class of functions . Immediately, this is helpful; our learner need not search over all functions, only over .
We call our hypothesis class. Knowing that we need only search over is helpful, but intuitively, if is a very complex function class, our learning problem is much harder. In order to quantify this, we use the VC dimension. The VC dimension is just the largest number of samples that can label in every possible way. It might help to think of this as a game: assume you're playing against some adversary who wants to make the learning problem as hard as possible for you. Since the adversary knows that you both know the search space is , the adversary can choose points on which every possible labeling is produced by some in , so no labeling can be ruled out in advance and you get no usable information. Knowing the VC dimension of is then just says that for any points, there is at least one labeling that no in can produce.
A good example here is the hypothesis class of thresholds: functions that predict if and if . It is clear that the VC dimension of this class is 1: every possible labeling of a single point is realizable by just choosing a threshold above or below , and we can construct a labeling of 2 points that is not realizable. Indeed, for such that , set the label of to and the label of to — no threshold function can realize this labeling (if you're not convinced, try drawing it out!).
PAC Learning#
Recall that we see samples drawn i.i.d. from some probability distribution , along with their labels. So, from that, we want to do well on the entire distribution . In PAC learning, we basically want that most of the time (the probably) we are pretty close to the right answer (the approximately correct). To make this more formal, we want that for some and , we are within error at least of the time. More formally, define . Then, PAC learning wants
We can attain this trivially by setting , so assume and are fixed. Now we ask how small can be. For realizable PAC learning (the setting we've been working in where we know the answer is in our family ),2 the answer is where the notation indicates scaling up to a constant (this is the matching upper and lower bounds thing we discussed earlier). Reading the above relation, we can think of the term as what we pay for the expressiveness of the class (a more complex class is harder to get right) and the term as the price of guaranteeing that it holds over unlucky samples. Our focus will be on the second term.
Finally, let us make a remark on in-expectation vs. high-probability bounds. Bounding error in expectation is a much simpler ask: we need only show that on average . On the other hand, showing a high-probability bound requires showing that the tails decay sufficiently fast; we might be optimal in expectation, but have fat tails.
Empirical Risk Minimization#
By this point, all this machinery probably feels overly complex; surely the right answer is simply to minimize the error on our training set. Since we're in the realizable regime, there is at least one rule that gets every training point right, so just output one of those rules! This is empirical risk minimization (ERM), simply understood as "output any rule consistent with the data."
Note the use of the word "any." ERM is a family of algorithms since when several rules are consistent, nothing tells us which to pick. Formally, we just fix some deterministic tie-breaking rule upfront and assume nothing else about it.3 Because of this, one can actually show that some consistent rules are suboptimal and miss the optimal rate, hence the interest (and difficulty) in developing optimal algorithms.
Let's also make one observation here, for use later. Every statement we've made here has been about symmetric differences with the target, so we can relabel so that the target is the empty set (this just means we can relabel so that is the function which assigns to every sample).4 Once we've done this, a consistent hypothesis (meaning a hypothesis that matches the training data we've seen) is just a set containing none of the training points, and its error is just the probability mass that the distribution assigns to it. So going forward, ERM gives us a set avoiding the sample, and we want to prove that that set is small.
The Majority-of-Three Rule#
The majority-of-three algorithm is about as simple as an algorithm could possibly be:
- Split the sample of size into three independent blocks of size .
- Run ERM on each block to get three hypotheses .
- The final prediction is the majority vote: .5
The open problem was whether this algorithm achieves the theoretically optimal rate of , or whether it incurs the extra left by previous analysis.
[NOTE] From here it gets a bit more technical — some background in probability will likely be useful.
Reducing to an Overlap Problem#
With the target relabeled to the empty set, each is an error region, so the majority vote is wrong at exactly when at least two of the three sets contain . Writing this in set notation: and by the union bound the error is at most . Since the blocks are independent, each of those three terms has the same law and we've reduced our problem into bounding the overlaps of two ERM outputs.
Remember, the whole point of this is to get high-probability bounds, and the standard way to get these is through the method of moments.6 Write for the overlap of the ERM outputs on two independent samples and study Raising the overlap to the -th power is the same as asking for independent test points to all land in the overlap, and a point lands in the overlap exactly when both ERMs contain it. So if we write for an ordered tuple of test points and for the probability that a single ERM output consumes the entire tuple, then independence of and factors the two ERMs apart and
So now, all that remains for us to answer is how likely a single ERM is to contain prescribed points at once.
Ideally, we want a bound of the form Given the above bound, the optimal rate follows immediately. Taking norms and applying Minkowski's inequality to the three-term union bound gives , and then Markov's inequality on the -th moment converts that into a tail bound decaying like . Choosing forces the tail down to , and since , we are done.
A Proof by Partitioning into Dyadic Scales#
We need to control ; the chance that one ERM contains a whole tuple. The issue is that ERM is a rather finicky process: conditioning on the event that it already contains reweights which samples we are looking at and the conditioned process can behave completely differently.
By the chain rule of conditional probability, where is the conditional probability that the ERM contains given that it already contains all the earlier points of the tuple.
Dyadic Profiles#
The main trick here is to not evaluate the conditional probabilities, but rather to track their scale. For each point , let be the integer with and call the vector the dyadic profile of the tuple. Every tuple has a dyadic profile, and the profile immediately gives . The profiles are countable, so we can bound each class of tuples separately and sum at the end.
Within a profile class, the -net theorem and Sauer's lemma apply to each level set, and give that the set of points whose conditional inclusion probability sits at level has mass at most about where is the probability of the conditioning event. There are two notable features of the above that drive the proof.
The first is that the level sets balance nicely. A point that is very likely to be included (small ) can only live in a very thin slice of the space; a point sitting in a fat slice has to be correspondingly unlikely to be included. Intuitively, the product of "how big is this level set" and "how likely is inclusion at this level" is bounded, so everything is nicely behaved.
The second is a bit more subtle. The VC contribution is : it depends on the level, but not on how many points we have already conditioned on. Conditioning on a long prefix does not inflate the effective VC dimension. The only cost we pay for conditioning is the rarity term and rarity is something that a profile already knows since a profile that has large 's at earlier levels has small prefix probability. So, we may rewrite the rarity term as a deterministic function of the profile, and the bound stops depending on the particular prefix entirely!
Closing It Out#
Once the one-step bound is independent of the prefix, every level has the same upper bound regardless of the points that came before it, and we can iterate Fubini's theorem up the chain, integrating out the last point, then the one before it, etc. all the way down to the empty prefix. That gives us a bound on the probability of each profile class, and summing the resulting series over all profiles (more or less just a counting exercise and an application of AM-GM) gives as desired. The optimal rate then follows.
A Recursive Proof#
The dyadic profiling argument is neat, but it required a lot of intermediate machinery. It turns out that the entire multiscale decomposition can be collapsed into a single recursion. In particular, if we track the "rarity the conditioning has accumulated so far," we never need the levels at all.
Concretely, instead of partitioning the space, define a weighted functional on prefixes of length , with the rarity penalty built into the weight: At first, this looks pretty magical (at least it did to me), but let's get some intuition for this by looking at the endpoints. At the exponent is zero, the penalty disappears, and is exactly our target overlap moment . At the prefix is empty, , and is a deterministic constant, roughly . So the functional interpolates between the thing we want to bound and something we already know.
The step from to integrates out the last point, via a uniform tail bound on the conditional inclusion probability . Fixing a prefix , classical VC theory gives which is the same -net estimate as before, just stated as a tail instead of being applied level by level. Rewriting the expectation over as an integral against this tail and doing a bit of calculus gives the contraction: Note that the generated by the tail bound during integration is exactly absorbed by the penalty already sitting in the functional, and the exponent increasing by one is what "pays" for it.
With the one-step contraction established, the rest more or less writes itself. Iterate times, from the full tuple down to the empty prefix:
An Experiment with LLMs#
The recursive argument above was found (in part) by an LLM. The original proof was worked out by hand, with an LLM used only to check intermediate calculations and look for local simplifications; on reviewing it we experimented further and found that, given a prompt of hints distilled from that proof, the models were able to streamline it considerably. Interestingly, they were not able to prove the conjecture from the problem statement alone.
This is discussed a bit more in Appendix A of the note. My original proof is outlined in Appendix B, and the full version is available here.
- This seems like a pretty trivial distinction, but these are actually very very different, and being optimal in expectation does not guarantee that an algorithm will be optimal in high probability; see [ACS+22] for example. ↩
- Realizable means that the hypothesis class of our learner actually contains the true function . Dealing with agnostic (non-realizable) PAC learning is a whole other deal; hopefully the subject of future work! ↩
- Formally, a deterministic measurable selector taking a sample to a hypothesis with . No other properties are assumed. ↩
- The reduction is that the class of symmetric differences has the same VC dimension as , contains the empty set, and turns consistent hypotheses into sample-avoiding sets. The majority vote commutes with taking symmetric differences, so the error region of the vote is unchanged. ↩
- This is reminiscent of bagging, though here the three learners are trained on disjoint sample splits rather than bootstrap resamples. ↩
- If a nonnegative random variable has then Markov's inequality gives , so controlling the -th moment for a single well-chosen gives a tail bound at that scale. Setting converts a moment bound into a -dependent bound; this is the same reason the in eventually gives the in the final rate.f ↩
References#
- [ACS+22]Ishaq Aden-Ali et al. "The One-Inclusion Graph Algorithm is not Always Optimal". 2022. [link] ↩
- [AHL+24]Ishaq Aden-Ali et al. "Majority-of-three: The simplest optimal learner?". 2024. [arXiv] ↩
- [Han16]Steve Hanneke. "The Optimal Sample Complexity of PAC Learning". 2016. [link] ↩
- [Wel12]Emo Welzl. Computational geometry: Chapter 15 — epsilon nets. 2012. ↩