45.07.09 · mathematical-statistics / 07-statistical-learning-theory

Sample Compression Schemes and Compression-Based Generalization

shipped3 tiersLean: none

Anchor (Master): Littlestone & Warmuth 1986 (unpublished manuscript, UC Santa Cruz) 'Relating data compression and learnability' (the original definition of a sample compression scheme and the proof that a compression scheme of size yields a PAC learner); Floyd & Warmuth 1995 Machine Learning 21 (sample compression, learnability, and the Vapnik-Chervonenkis dimension — labelled compression schemes, the maximum-class construction of size exactly , and the compression-bound machinery); Moran & Yehudayoff 2016 J. ACM 63 (every class of VC dimension admits a sample compression scheme of size — the resolution of the compression-vs-VC question up to the constant, via a boosting/minimax argument)

Intuition Beginner

Suppose a friend trains a rule on a thousand examples and then claims it works. You are skeptical. So you ask for receipts: point to the handful of examples that actually pinned the rule down. If your friend can hand you just five of the thousand and say "rebuild my exact rule from these five alone", that is a strong sign the rule is real and not an accident of memorising the other 995. A rule you can justify with a short list of examples is a rule that did not need to overfit the rest.

This is the whole idea of compression. A learner compresses if its final rule depends only on a small chosen subset of the training data, and the rest of the data could be deleted without changing the answer. The size of that subset is the compression size. A small compression size is a certificate of honesty: the rule commits to so little of the data that it cannot be hiding much.

Why does this control error on new data? Because the leftover examples — the 995 you did not keep — act as a fresh test. The rule was built without looking at them, so how it does on them is an honest preview of how it does on the world. If a short certificate makes few mistakes on a large pile of held-out examples, it will make few mistakes on new examples too. The shorter the certificate and the bigger the leftover pile, the tighter the guarantee.

Visual Beginner

Picture a thousand training points in a tray. The learner reaches in and pulls out a small handful — say the five points that touch its decision boundary — and tosses the rest back. From those five alone it rebuilds the exact same rule. The 995 it threw back were never consulted in the rebuild, so they form an honest test set the rule never saw.

   1000 training points (the tray)
   o o o o o o o o o o o o o o o o o o o o ...

   learner keeps a few:        [* * * * *]   <- compression set, size k = 5
   learner discards the rest:   o o o o ... o  <- 995 held-out, never used in rebuild

   rebuild rule from the 5  --->  same rule as trained on all 1000
   check rule on the 995    --->  honest preview of true error

   short certificate (small k) + big leftover pile (large m - k)
        =>  small gap between training error and true error
Compression size Held-out pile Trust in the rule
small (few receipts) large high — short certificate, big honest test
large (kept almost all) small low — kept too much, little left to check
equal to (kept everything) none no guarantee — nothing held out

The lesson the picture teaches: count how many examples the learner truly needs to reconstruct its rule. The fewer it needs, and the more it can throw away, the smaller the gap between what you measured and the truth.

Worked example Beginner

We turn the receipts idea into a number. Suppose you train on examples and your learner outputs a rule that depends on only of them — it can rebuild the exact rule from those four, and it gets all 100 training examples correct (zero training mistakes).

Step 1. Identify the held-out pile. The rule was reconstructed from examples, so examples were not used in the rebuild. These act as a fresh test the rule never consulted.

Step 2. Read the compression bound for the clean case. A rule of compression size that is correct on the training data has true error at most about divided by the held-out count . Using and a confidence amount of : the numerator is .

Step 3. Divide by the held-out pile. The bound is . So with high confidence the rule's true error is below about , purely from the fact that it compressed to four points and made no training mistakes.

Step 4. See the effect of compressing harder. If instead the learner had needed only example, the numerator would be and the bound — under . Fewer receipts, a stronger guarantee.

What this tells us: you can certify a learned rule from two numbers, the compression size and the sample size, with no reference to how many possible rules the learner could have produced. A small compression size does the work that counting all possible rules would otherwise demand.

Check your understanding Beginner

Formal definition Intermediate+

The setting is the binary-classification framework of 45.07.04: a domain , labels , a distribution on , true risk , and empirical risk on a sample . A compression scheme is a way of factoring a learning rule through a small subsample.

Definition (sample compression scheme). Fix a hypothesis space of functions (not necessarily the class being learned). A sample compression scheme of size for a learning rule consists of a pair of maps: a compression map that sends a sample of any length to a subsequence of with , given by an index set of size ; and a reconstruction map that sends any sequence of at most labelled examples to a hypothesis , subject to the fidelity requirement

The integer is the size of the scheme. The scheme is labelled if uses the labels of the compressed examples and unlabelled if it uses only their instances. The scheme may also carry side information: a string chosen by and read by , in which case the size is the pair [Littlestone Warmuth 1986].

Definition (compression-based learner). A learning rule is compressible to size if it admits a compression scheme of size . Equivalently, the output hypothesis is a function of an index set of at most of the training points (and at most bits of side information), and is independent of the remaining points once is fixed.

Sample-complexity reading. A scheme of size replaces the role played by (finite class) or (the fundamental theorem of 45.07.04) by the count of possible compressed subsamples. The bound below shows this count is the effective complexity, so a learner with a small compression size generalizes even if the hypothesis space it draws from is enormous.

Counterexamples to common slips Intermediate+

  • "Compression size is the number of hypotheses." It is the number of examples the output depends on. The reconstruction range can be infinite (all halfspaces, all decision lists); only the subsample is bounded by .
  • "Any subset of size works." The compression map must be a fixed, sample-independent rule that produces a specific index set, and reconstruction must reproduce exactly. Choosing a fortuitous subset after seeing the held-out labels is not a compression scheme and gives no bound.
  • "Compression requires zero training error." The realizable bound assumes consistency, but the agnostic compression bound applies to any compressible and charges its empirical error plus a deviation. Consistency only buys the faster rate.
  • "The held-out points must be a fixed test set." They are whatever is left after chooses ; the union bound over the possible is what licenses using a data-dependent held-out set.

Key theorem with proof Intermediate+

The signature result bounds the true risk of a compression-based learner by its empirical risk plus a term governed by the compression size , not by any property of the (possibly infinite) reconstruction space. The mechanism is a union bound over the choices of which indices are compressed, using that the reconstructed hypothesis, for a fixed index set, is independent of the held-out examples and so concentrates on them.

Theorem (compression generalization bound). Let admit a sample compression scheme of size . Fix and . With probability at least over :

(agnostic case)

(realizable case, when is consistent, i.e. )

[Shalev-Shwartz Ben-David 2014] [Littlestone Warmuth 1986]

Proof. Write . The plan is to control, for each possible index set, the error of the hypothesis it reconstructs on the points it did not select, then union over index sets and finally over the actual compressed size.

Fix an index set with . Let be the subsequence of at the indices in , and let be the remaining examples. Set , the hypothesis reconstructed from alone. The decisive point is that is a deterministic function of , so conditioned on the held-out examples are still i.i.d. draws from that are independent of . Therefore the empirical error of on , namely , is an average of independent indicator variables each with mean . Hoeffding's inequality (the concentration spine of 40.07.05) gives, for every ,

and the same bound holds unconditionally by averaging over .

Now union over index sets. The number of index sets of size at most is for (using and absorbing the factor). Hence

Setting the right side to gives . On the complementary event of probability , the inequality holds simultaneously for every , and in particular for the realised index set , for which by fidelity. Finally , and absorbing the slack into constants (or noting ) yields the agnostic bound after a standard rescaling; we keep the clean form since when errs only on held-out points is not assumed — using and for keeps the stated constant.

For the realizable case, consistent means , so for the realised . The relevant tail is then one-sided consistency: for a fixed with , the chance has true error yet errs on none of the held-out points is . Union over the index sets gives at , which is the realizable bound.

Bridge. This theorem is the foundational reason a learner that names a short list of decisive examples is trustworthy: it shows the effective complexity is the count of possible compressed subsamples, a quantity that replaces and the VC dimension of 45.07.04 without ever inspecting the reconstruction space. The bridge is the independence step — conditioned on a fixed index set the reconstructed hypothesis is independent of the held-out examples — which is exactly the device that turns a data-dependent held-out set into a legitimate test, and it is dual to the ghost-sample symmetrisation of 45.07.04: there the unknown true risk was replaced by a second sample so that the growth function could act; here it is replaced by the held-out portion of the same sample so that a union over index sets can act. This is exactly the substitution that lets a possibly infinite class be controlled by a finite combinatorial count, and it generalises the finite-class union bound from "number of hypotheses" to "number of compressed subsamples".

It builds toward the structural equivalence VC compression, where the same count is shown to be within a constant of the VC dimension, and the central insight reappears: learnability is the concentration of an error estimate over an effective count, whether that count is the growth function, the Rademacher complexity of 45.07.06, or the number of compression sets. Putting these together, compression is a third face — algorithmic and certificate-based — of the single learnability property the chapter circles.

Exercises Intermediate+

Advanced results Master

The compression bound is the hinge between four developments: the quantitative generalization theorem and its agnostic/realizable rates, the structural direction that compression forces finite VC dimension, the converse direction that finite VC dimension forces bounded compression (the Moran-Yehudayoff theorem), and the constructive schemes for special classes that motivated the conjecture.

Theorem 1 (compression generalization bound; agnostic and realizable rates). For a learner with a sample compression scheme of size and , with probability the agnostic bound and, when is consistent, the realizable bound hold [Shalev-Shwartz Ben-David 2014]. The agnostic and realizable rates mirror the VC rates of 45.07.04 with in place of and an extra from the union over index sets; the is the price of the data-dependent held-out set and is removable for some structured schemes but not in general. With side information of size the count becomes , adding to the numerator.

Theorem 2 (compression implies finite VC dimension). If a class is learned by a scheme of size then , and for labelled schemes up to constants [Littlestone Warmuth 1986] [Floyd Warmuth 1995]. The argument is a counting one: on a shattered set of size all labelings are realised, yet each must be reconstructed from one of at most compressed subsamples, forcing , hence and so . Thus bounded compression size is sufficient for learnability, recovering one direction of the fundamental theorem of 45.07.04 without symmetrisation — a self-contained route from a combinatorial certificate to a generalization guarantee.

Theorem 3 (Floyd-Warmuth: maximum classes compress to size ). A class is maximum of VC dimension if for every finite (the Sauer-Shelah bound met with equality). Every maximum class of VC dimension admits an unlabelled compression scheme of size exactly , constructed from the one-inclusion graph by corner peeling: the one-inclusion graph of a maximum class is a cubical complex in which a vertex of degree can be removed (peeled) so that the remainder is again the graph of a maximum class of dimension , and the peeling order encodes the reconstruction [Floyd Warmuth 1995]. This is the exact-size compression result and the source of the conjecture that every class of VC dimension — not only maximum ones — compresses to size or even .

Theorem 4 (Moran-Yehudayoff: VC dimension implies compression of size ). Every concept class of VC dimension admits a sample compression scheme of size , with side information of size [Moran Yehudayoff 2016]. The proof is a boosting / minimax argument over the dual class. By the von Neumann minimax theorem applied to the dual shattering game, for any distribution on the sample there is a small collection of hypotheses, each consistent on an -size subsample, whose majority vote is correct on a constant fraction; multiplicative-weights boosting over these weak learners yields a majority vote of hypotheses correct on the whole sample, and the union of the defining subsamples — each of size — is the compressed set, of total size examples, sharpened to by a more careful agnostic-boosting analysis. This resolves the qualitative Littlestone-Warmuth question affirmatively: finite VC dimension and bounded compression size are equivalent up to a constant factor, completing the circle VC learnable compressible.

Theorem 5 (the residual open problems). Whether every class of VC dimension compresses to size exactly , or even without exponential side information, remains open [Moran Yehudayoff 2016] [Floyd Warmuth 1995]. The maximum-class construction of Theorem 3 achieves size but only for maximum classes; the general construction of Theorem 4 achieves but pays bits of side information. The gap between these — a uniform -size scheme with side information for arbitrary VC classes — is the present frontier, linked to the sample-compression conjecture and to the structure of the one-inclusion graph for non-maximum classes.

Synthesis. The foundational reason compression sits inside the fundamental theorem rather than beside it is that the count of compressed subsamples is a third measure of effective capacity, and finite VC dimension, bounded compression size, and learnability are one property read through three lenses. This is exactly the meeting of the counting half — compression of size forces on a shattered set, so — and the constructive half — VC dimension yields a scheme of size by minimax boosting over the dual class — and putting these together the chain VC learnable compressible closes up to constants, with the residual question only the exact constant and the side-information budget. The compression bound is dual to the symmetrisation bound of 45.07.04: there the unknown true risk is replaced by a ghost sample so that the growth function acts; here it is replaced by the held-out portion of the same sample so that the union over index sets acts, and the central insight common to both is that learnability is the concentration of an error estimate over an effective count.

The data-dependence is what lets compression beat the worst-case VC/Rademacher bounds of 45.07.06 on benign instances: the realised compression size — few support vectors, few mistakes — can collapse far below the worst-case dimension, so a margin classifier with a wide margin and a compression certificate with few support vectors are two readings of the same benign-instance phenomenon. The bridge upward at every level is the same substitution of a finite combinatorial count for the cardinality of a possibly infinite class, and the Moran-Yehudayoff construction is the statement that this substitution is always available with a count of order .

Full proof set Master

Proposition 1 (independence of the reconstructed hypothesis from the held-out sample). Let be a compression scheme and fix an index set with . Write . Conditioned on , the held-out examples are i.i.d. and independent of , so is an average of independent variables with mean .

Proof. The examples are i.i.d. , hence exchangeable, and and are functions of disjoint coordinate blocks; by independence of the coordinates, is independent of and each , , is distributed . Since is a deterministic function of , conditioning on fixes while leaving i.i.d. . Therefore , , are independent Bernoulli with mean , and is their average.

Proposition 2 (single-index-set deviation). With as above and , for every , , and in the consistent case .

Proof. By Proposition 1, conditioned on the quantity is an average of independent variables in with mean . Hoeffding's inequality 40.07.05 gives ; averaging over preserves the bound. For the consistent case, if then each held-out example is correctly classified with probability , so all being correct has probability ; averaging over keeps it.

Proposition 3 (index-set count). The number of index sets of size at most in is for .

Proof. for , and . Hence since for (equality at ). For the claim holds because for ; small cases are checked directly.

Proposition 4 (compression generalization bound). Under a size- scheme with , with probability : agnostic, ; realizable (consistent), , .

Proof. Apply Proposition 2 to each of the index sets (Proposition 3) and union. Agnostic: at ; on the complement, taking with by fidelity gives , and for absorbs into the empirical term to the stated form (or, keeping when errors fall on held-out points, the clean form). Realizable: union the consistency tail, at ; since is consistent on it is consistent on , so .

Proposition 5 (compression size forces ). If is reconstructable by a labelled scheme of size , then for an absolute constant .

Proof. Let be shattered by , so all labelings of are realised by hypotheses in . For each labeling of , the learner on the sample outputs a hypothesis consistent with , reconstructed from a compressed subsample: an index set of size together with the labels of those points, i.e. one of at most choices (Proposition 3 with the extra for labels). Distinct labelings of require distinct hypotheses on , hence distinct compressed subsamples, so . Taking logarithms, , which forces : if then for large, a contradiction; small are checked directly.

Proposition 6 (maximum classes: existence of a size- scheme — statement and reduction). Every maximum class of VC dimension admits an unlabelled compression scheme of size .

Proof. The full construction is the corner-peeling argument on the one-inclusion graph; the structure reduces as follows. For a maximum class of VC dimension on a finite domain, the one-inclusion graph has vertex set and edges between hypotheses differing on a single coordinate; maximality gives that is a connected cubical complex whose number of -dimensional cubes equals -type counts saturating Sauer-Shelah. A corner is a vertex incident to a -cube in all directions; Floyd-Warmuth show a maximum class always has a corner, that deleting it leaves a maximum class of dimension on the same domain, and that recording the coordinate directions of the peeled corner specifies an unlabelled subsample of size from which the deleted hypothesis is reconstructed. Iterating peels the whole class, and the peeling assignment is the compression map; reconstruction inverts the peeling. Hence the scheme has size . The detailed cubical-complex combinatorics is the content of [Floyd Warmuth 1995] §4.

Proposition 7 (Moran-Yehudayoff: size from VC dimension — statement and proof sketch). Every class of VC dimension admits a compression scheme of size with side information.

Proof. Sketch following [Moran Yehudayoff 2016]. Consider the dual game: a learner picks a distribution over hypotheses, an adversary picks a point; the dual VC dimension is at most , so the dual class has bounded capacity. By the agnostic boosting / minimax theorem, for the empirical distribution on there exist hypotheses , each an ERM on a subsample of size , whose weighted majority vote is correct on all of (each round of multiplicative weights focuses on currently misclassified points; finite VC dimension guarantees a weak learner with edge a constant). A sharper analysis replaces rounds with effective hypotheses via the sample-compression-friendly boosting of the dual, giving hypotheses total, each defined by an -size subsample. The compressed set is the union of the defining subsamples, of size after deduplication, and the side information names which subsample defines which voter and the voting weights — a string of possibilities. Reconstruction reruns the ERMs and forms the majority vote. The generalization bound of Proposition 4 with and then matches the VC rate up to constants.

Connections Master

This unit is the compression-theoretic face of the fundamental theorem of 45.07.04. There learnability is tied to finite VC dimension through symmetrisation and the growth function; here it is tied to bounded compression size through a union over compressed subsamples, and the two are shown equivalent up to a constant by Theorems 2 and 4. The ghost-sample device that replaces the unknown true risk in 45.07.04 is the exact analogue of the held-out-sample device here: both manufacture an honest test out of the data so that a finite combinatorial count — the growth function there, the index-set count here — can carry a union bound.

The margin theory and SVM analysis of 45.07.06 supply the running example and the benign-instance regime where compression is sharpest. The SVM's separator depends only on its support vectors, so the number of support vectors is a compression size, and the realizable compression bound is a guarantee complementary to the margin bound of 45.07.06: a wide margin tends to produce few support vectors, so the two bounds tighten together on the same well-separated data. The fat-shattering / scale-sensitive capacity of 45.07.06 is the worst-case quantity that the realised compression size undercuts on benign instances.

The support vector machine itself, treated as an algorithm in 45.08.02, is the canonical compression scheme: its dual solution is supported on the active constraints, and re-solving on the support vectors reproduces the separator, giving the fidelity that makes it a compression scheme of size equal to the support-vector count. The compression bound is thus one of the two textbook generalization guarantees for the SVM, alongside the margin bound, and explains why a sparse support-vector solution generalizes.

The concentration spine of 40.07.05 is the analytic engine: Hoeffding's inequality applied to the held-out examples for each fixed index set is what makes the per-index-set deviation exponentially small, and the bounded-differences viewpoint there is what licenses the consistency tail in the realizable case. Every quantitative statement in this unit is that exponential tail unioned over the index sets, exactly as the VC bound of 45.07.04 is the Hoeffding tail unioned over the labelings of a doubled sample.

Historical & philosophical context Master

The idea that a learner whose output depends on few examples should generalize was made precise by Nick Littlestone and Manfred Warmuth in a 1986 manuscript at UC Santa Cruz, "Relating data compression and learnability", which defined the sample compression scheme and proved that a scheme of size yields a PAC learner with sample complexity governed by rather than by the size of the hypothesis space [Littlestone Warmuth 1986]. The manuscript circulated widely but was not formally published; its definitions and the basic generalization bound are the foundation of the area.

The theory was developed and published by Sally Floyd and Manfred Warmuth in their 1995 Machine Learning paper, which introduced labelled and unlabelled schemes, proved that every maximum class of VC dimension compresses to size exactly via the one-inclusion graph and corner peeling, showed that a scheme of size forces VC dimension , and posed the central conjecture: does every class of VC dimension admit a scheme of size [Floyd Warmuth 1995]. The conjecture stood for two decades and drove much of the structural theory of VC classes, the one-inclusion graph, and teaching dimension.

The qualitative form of the conjecture was settled affirmatively by Shay Moran and Amir Yehudayoff in 2016 (Journal of the ACM; STOC 2015), who proved that every class of VC dimension admits a compression scheme of size — with side information of size exponential in — via a minimax/boosting argument over the dual class [Moran Yehudayoff 2016]. Whether the size can be made exactly , or without exponential side information, is open. The textbook treatment assembling the compression bound, its SVM instance, and the equivalence with VC dimension is that of Shalev-Shwartz and Ben-David (2014) [Shalev-Shwartz Ben-David 2014].

Bibliography Master

@unpublished{littlestonewarmuth1986,
  author = {Littlestone, Nick and Warmuth, Manfred K.},
  title  = {Relating data compression and learnability},
  note   = {Unpublished manuscript, University of California, Santa Cruz},
  year   = {1986}
}

@article{floydwarmuth1995,
  author  = {Floyd, Sally and Warmuth, Manfred K.},
  title   = {Sample compression, learnability, and the {Vapnik}-{Chervonenkis} dimension},
  journal = {Machine Learning},
  volume  = {21},
  number  = {3},
  pages   = {269--304},
  year    = {1995}
}

@article{moranyehudayoff2016,
  author  = {Moran, Shay and Yehudayoff, Amir},
  title   = {Sample compression schemes for {VC} classes},
  journal = {Journal of the ACM},
  volume  = {63},
  number  = {3},
  pages   = {21:1--21:10},
  year    = {2016}
}

@book{shalevshwartzbendavid2014c,
  author    = {Shalev-Shwartz, Shai and Ben-David, Shai},
  title     = {Understanding Machine Learning: From Theory to Algorithms},
  publisher = {Cambridge University Press},
  year      = {2014}
}

@book{mohri2018c,
  author    = {Mohri, Mehryar and Rostamizadeh, Afshin and Talwalkar, Ameet},
  title     = {Foundations of Machine Learning},
  edition   = {2},
  publisher = {MIT Press},
  year      = {2018}
}

@article{graepelherbrichshawe-taylor2005,
  author  = {Graepel, Thore and Herbrich, Ralf and Shawe-Taylor, John},
  title   = {{PAC}-{Bayesian} compression bounds on the prediction error of learning algorithms for classification},
  journal = {Machine Learning},
  volume  = {59},
  number  = {1-2},
  pages   = {55--76},
  year    = {2005}
}

@article{warmuth2003compression,
  author  = {Warmuth, Manfred K.},
  title   = {Compressing to {VC} dimension many points},
  journal = {Lecture Notes in Computer Science (COLT/Kernel)},
  volume  = {2777},
  pages   = {743--744},
  year    = {2003}
}

@inproceedings{rubinsteinrubinstein2012,
  author    = {Rubinstein, Benjamin I. P. and Rubinstein, J. Hyam},
  title     = {A geometric approach to sample compression},
  booktitle = {Journal of Machine Learning Research},
  volume    = {13},
  pages     = {1221--1261},
  year      = {2012}
}