Robustness and Generalization II: A Learning Method Generalizes w.r.t. a Training Sequence If and Only If It Is Weakly Robust w.r.t. ItResearch Paper
Motivation
Most generalization guarantees in statistical learning theory bound the gap between training error and expected error through a complexity measure of the hypothesis class: VC dimension, Rademacher complexity, covering numbers. Such bounds are sufficient conditions, and they say little about why a particular algorithm, run on a particular data stream, does or does not generalize. Xu and Mannor (Mach Learn 86 (2012) 391–423) proposed algorithmic robustness as an alternative: an algorithm is robust if a test sample "close to" a training sample incurs a loss close to that training sample's loss. Their first results show that robustness implies generalization (Theorem 1 of the paper, the subject of the first mission in this series).
Section 8 of the paper asks the converse question: is some form of robustness also necessary? The answer is Theorem 8. For a learning method trained on a fixed, growing sequence of samples, generalization is equivalent to a weaker property, weak robustness. The authors present this as evidence that robustness is "an essential property of successful learning", and contrast it with the characterization of learnability by stability (Remark 5 of the paper, citing Shalev-Shwartz et al. 2009; journal version JMLR 11 (2010)): learnability is uniform over all distributions, whereas the generalization studied here is for one distribution and one training sequence.
Setting
Let be a measurable space of samples, drawn from an unknown probability measure . Let be a set of hypotheses and a loss with for all (the paper's standing assumption, Sect. 1.1).
- The expected loss of is (
expectedLoss). - The average loss of on an -sample set is (
avgLoss). - A learning method is a sequence of maps ; is the hypothesis learned from .
- A training sequence is fixed and deterministic, and denotes its first elements (
firstN). - A test sample consists of i.i.d. draws from ; always refers to .
The method generalizes w.r.t. (Definition 8) if
It is weakly robust w.r.t. (Definition 9) if there are sets with and
A set can be read as a family of perturbed copies of the training set that carries almost all of the probability of the test sample.
Formalization targets
Goal: Theorem 8 (p. 409)
for every probability measure , every loss measurable in with values in , every learning method and every training sequence .
Milestones
- First equality of the proof (p. 410). For and every , .
- Sufficiency display (p. 410). If and on , then
- Lemma 2 (p. 410). If is not weakly robust w.r.t. , there are with
- Eq. (9) (p. 411). in probability.
Milestones 1–2 give the sufficiency direction; milestones 3–4 give necessity.
Significance
Theorem 8 is a characterization, not a bound. The sufficiency half says a quantitative robustness property yields generalization. The necessity half says every method that generalizes along a sequence is weakly robust along it, so no generalization argument can avoid something of this shape. The paper remarks that -robustness for every implies weak robustness, which places Theorem 1's condition inside this characterization. Corollary 6, the almost-sure version (generalization with probability 1 iff almost-sure weak robustness), follows from Theorem 8 applied sequence by sequence.
The result is proved in the paper; no machine-checked proof of it is known. This mission contributes a formal statement of Definitions 8 and 9 in Lean, the two directions of the proof as reusable finite- and asymptotic lemmas, and a place to formalize the bounded-loss law of large numbers for a hypothesis that changes with (Eq. (9)), which Mathlib states for a fixed random variable.
Difficulty
The sufficiency direction is a direct estimate once the expectation of the average test loss is identified with the expected loss; the formal work is in handling the product measure and a set that need not be measurable.
The necessity direction is where care is needed. Eq. (9) is not the weak law of large numbers for a fixed function: the hypothesis changes with , so the concentration must be uniform in the hypothesis, which holds only because the loss is uniformly bounded. Lemma 2 negates a statement with an existential over sequences of sets and a limit; the naive reading "for each some works eventually" does not by itself produce a single sequence satisfying (6) with one limit.
Formalization scope
- is a type with a
MeasurableSpace, aMeasurewithIsProbabilityMeasure, an arbitrary type. The learning method isA : (n : ℕ) → (Fin n → Z) → H, the training sequencesStar : ℕ → Z, andMeasure.pi (fun _ : Fin n => μ). Indices start at . - The loss bound is a hypothesis of every theorem. Measurability of is added; the paper explicitly ignores measurability. Expectations are Bochner integrals, well defined here because the loss is bounded and measurable.
- Probabilities and their limits live in (
ℝ≥0∞). The sets need not be measurable; their probability is the outer measure. "For infinitely many " is∃ᶠ n in atTop. - Eq. (6) is encoded without a supremum: weak robustness asks for sets and reals with for all and all . This avoids Lean's junk value ; since forces to be nonempty for all large , the bound form is equivalent to the paper's reading.
- Only part 1 of Definitions 8 and 9 is formalized. Corollary 6 is out of scope.
- The goal is not trivial in either direction: a constant method on a one-point space satisfies both sides, and a constant method whose hypothesis has training average and expected loss along a fixed sequence fails both, so neither side is vacuous or always true.
- Needed infrastructure: integrals over
Measure.piof coordinate functions, a Chebyshev or Hoeffding bound for averages of bounded i.i.d. variables uniform over a family of functions, and a diagonal-sequence construction. The uniform concentration lemma is reusable beyond this mission. Proofs of the milestones, and alternative routes to Eq. (9), are welcome.
Selected references
- Huan Xu, Shie Mannor, Robustness and Generalization, Machine Learning 86 (2012) 391–423. https://doi.org/10.1007/s10994-011-5268-1
- Shai Shalev-Shwartz, Ohad Shamir, Nathan Srebro, Karthik Sridharan, Learnability, Stability and Uniform Convergence, Journal of Machine Learning Research 11 (2010) 2635–2670. https://www.jmlr.org/papers/v11/shalev-shwartz10a.html
- Wassily Hoeffding, Probability Inequalities for Sums of Bounded Random Variables, Journal of the American Statistical Association 58 (1963) 13–30. https://doi.org/10.1080/01621459.1963.10500830