Stability and Generalization 2: Exponential Generalization Bounds for Uniformly Stable AlgorithmsResearch Paper
Motivation
A learning algorithm is judged by its generalization error: the expected loss of the hypothesis it outputs on a fresh example. That quantity depends on an unknown distribution, so it is estimated from the training data, by the empirical error (the average loss on the training set) or the leave-one-out error (the average loss on each training point of the hypothesis trained without it). Classical learning theory controls the gap between these estimates and the true error uniformly over a hypothesis class, through its VC dimension or covering numbers. Such bounds say nothing useful about algorithms that search very large or infinite-dimensional spaces, such as support vector machines and regularization networks in a reproducing kernel Hilbert space.
Bousquet and Elisseeff (JMLR 2 (2002) 499–526) replaced the capacity of the class by a property of the algorithm, its stability: how much its output changes when one training example is removed. Their exponential bound for uniformly stable algorithms is the starting point of the stability approach to generalization, which was later used for stochastic gradient descent (Hardt, Recht and Singer, 2016) and differential privacy, and sharpened by Feldman and Vondrák (2019) and Bousquet, Klochkov and Zhivotovskiy (2020).
Timeline. Rogers and Wagner (1978) and Devroye and Wagner (1979) bounded the leave-one-out error of local rules such as k-nearest neighbours through their stability. McDiarmid (1989) proved the bounded-differences inequality. Lugosi and Pawlak (1994) combined it with smoothed error estimates. Kearns and Ron (1999) named hypothesis and error stability and related them to the VC dimension. Bousquet and Elisseeff (2002) introduced uniform stability and proved the exponential bounds this mission formalizes.
Setting
Let be a measurable space of labelled examples with an unknown probability distribution . A training set is drawn from . A learning algorithm maps a training set to a hypothesis . It is deterministic and symmetric: it depends on the training set only as a multiset, so it is a function Multiset (X × Y) → (X → Y'), defined for training sets of every size. For a cost , the loss of a hypothesis at is .
Given , write for with its -th example removed, and for with replaced by an independent draw . The three errors are
An algorithm has uniform stability at sample size (Definition 6) if for every , every and every ,
As a function of the sample size this constant is written .
Formalization targets
Goal: Theorem 12
If has uniform stability and for all and all training sets , then for every and , each of the following holds, separately, with probability at least over :
Milestones
- McDiarmid's inequality (Theorem 2): for measurable with , .
- Uniform stability implies (p. 504).
- Lemma 7: the bias identities for , and .
- and have bounded differences .
- and .
- The tail bounds and the leave-one-out analogue.
Significance
When both bounds are , with constants that do not depend on any capacity of the hypothesis space. Later sections of the paper show that Tikhonov regularization in a reproducing kernel Hilbert space has , so the theorem gives generalization bounds for support vector regression, kernel ridge regression and, through a smoothed loss, soft-margin classification. The theorem is also the template for later stability bounds: the decomposition into a bias term controlled by stability and a deviation term controlled by a concentration inequality recurs throughout the literature.
The result has been proved since 2002, and replace-one variants appear in textbooks (Mohri, Rostamizadeh and Talwalkar, Foundations of Machine Learning, Theorem 14.2; Shalev-Shwartz and Ben-David, Chapter 13). On Prove2Me the replace-one textbook version is not formalized, and Mathlib at the platform's environment has no McDiarmid inequality. This mission asks for a machine-checked proof of the paper's remove-one version with its exact constants, and a reusable McDiarmid inequality with per-coordinate constants.
Difficulty
The deterministic steps (the bias identity and the bounded-differences estimates) are short on paper. The central difficulty is McDiarmid's inequality itself: it needs a martingale argument along the coordinates of a product measure, or an equivalent tensorization of conditional sub-Gaussian bounds, with the Doob martingale expressed through partial integration over Measure.pi. Hoeffding's inequality for sums, which Mathlib has, does not apply directly: is not a sum of independent terms. A second, bookkeeping difficulty is Lemma 7: the identities rest on exchanging with and on the symmetry of , which in Lean means measure-preserving coordinate permutations of and multiset equalities such as .
Formalization scope
Conventions committed to by the Lean statements:
- An algorithm is a function of a multiset; this is how symmetry is encoded. Samples are
Fin m → X × Y, and isFunction.update. - The law of is
Measure.pi (fun _ => D)withDa probability measure; and are independent draws, integrated against the product(Measure.pi fun _ => D).prod D. - The paper's standing assumption that all functions are measurable is one hypothesis: is measurable for every sample size. With the bound for training sets of every size, every expectation is a genuine integral, so no bound can hold because a non-integrable expectation defaults to .
- Uniform stability quantifies over every sample, every index and every point, not almost every one.
- "With probability at least " means the -measure of the failure set is at most . The two bounds (11) and (12) are separate statements, joined by a conjunction; they are not claimed for one joint event.
- The paper assumes is non-increasing in and bounds by (p. 504). The leave-one-out bound (12) and its milestones carry the explicit hypothesis of uniform stability at size ; the empirical bound (11) does not.
- McDiarmid's inequality sums over ; the paper's printed upper index is a slip.
- When a displayed tail bound has a zero denominator, its formal statement uses the limiting bound . In McDiarmid's inequality this is the constant-function case; in the stability tails the loss is identically zero.
The stability notion is the paper's remove-one notion. A formalization with replace-one stability would prove a different theorem with different constants, and the published FoundationsML_Stability_UniformlyStable (replace-one) is therefore not used.
The development needs the published loss, empirical-error and generalization-error definitions from Foundations of Machine Learning, a McDiarmid inequality on product measures (reusable for any bounded-differences argument), and the coordinate-exchange lemmas for Measure.pi behind Lemma 7. Contributions of a general McDiarmid inequality, of exchangeability lemmas for product measures, and of proofs of any milestone are welcome.
Selected references
- O. Bousquet and A. Elisseeff, Stability and Generalization, Journal of Machine Learning Research 2 (2002) 499–526. https://www.jmlr.org/papers/v2/bousquet02a.html
- C. McDiarmid, On the method of bounded differences, Surveys in Combinatorics, LMS Lecture Note Series 141 (1989) 148–188. https://doi.org/10.1017/CBO9781107359949.008
- L. Devroye and T. Wagner, Distribution-free performance bounds for potential function rules, IEEE Trans. Inform. Theory 25 (1979) 601–604. https://doi.org/10.1109/TIT.1979.1056087
- M. Kearns and D. Ron, Algorithmic stability and sanity-check bounds for leave-one-out cross-validation, Neural Computation 11 (1999) 1427–1453. https://doi.org/10.1162/089976699300016304
- M. Hardt, B. Recht and Y. Singer, Train faster, generalize better: stability of stochastic gradient descent, ICML 2016. https://arxiv.org/abs/1509.01240
- V. Feldman and J. Vondrák, High probability generalization bounds for uniformly stable algorithms with nearly optimal rate, COLT 2019. https://arxiv.org/abs/1902.10710
- O. Bousquet, Y. Klochkov and N. Zhivotovskiy, Sharper bounds for uniformly stable algorithms, COLT 2020. https://arxiv.org/abs/1910.07833
- M. Mohri, A. Rostamizadeh and A. Talwalkar, Foundations of Machine Learning, 2nd ed., MIT Press, 2018, Chapter 14.