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

Algorithmic Stability and Online Learning

shipped3 tiersLean: none

Anchor (Master): Bousquet & Elisseeff 2002 J. Mach. Learn. Res. 2 (stability and generalization — uniform/hypothesis stability, the variance and exponential bounds via the bounded-differences inequality, the σ-admissible-loss stability of Tikhonov regularization with rate κ²/(2λn)); Littlestone 1988 Mach. Learn. 2 (learning quickly when irrelevant attributes abound — the Littlestone dimension, the Standard Optimal Algorithm, and the mistake-bound characterization of online learnability); Cesa-Bianchi & Lugosi 2006 Prediction, Learning, and Games (Cambridge) ch. 2-4 (the weighted-majority / Hedge regret bound, the exponentially-weighted forecaster, and online-to-batch conversion); Shalev-Shwartz 2012 Online Learning and Online Convex Optimization (Foundations and Trends in Machine Learning 4:2)

Intuition Beginner

The earlier units measured a family of rules by how rich it is, then argued that a rich family can fool you by fitting noise. This unit offers two different lenses on the same worry, neither of which counts the family at all. The first asks a question about the learning procedure itself: if you remove one training example, does the rule it produces change much? A procedure that barely flinches when you drop one example cannot have leaned hard on any single point, so it cannot have memorised the noise in your sample. That insensitivity is called stability, and it turns out that a stable procedure automatically generalises.

Why is stability the right thing to ask about? Because overfitting is, at heart, sensitivity to individual examples. A rule that fits the noise must change a lot when the noisy point is removed. So a procedure built to resist such change — for instance by adding a penalty that discourages extreme rules — is a procedure that cannot overfit. This explains why penalised methods like ridge regression and support vector machines work well even when the family of candidate rules is enormous.

The second lens drops the assumption that data come from a fixed distribution at all. Picture a game played day by day. Each day you predict tomorrow's weather, then nature reveals the truth, possibly chosen by an adversary to trip you up. You cannot hope to be right every time. Instead you measure regret: how much worse you did than the single best fixed forecaster, looking back. A good online method keeps its average regret shrinking to zero, so over time it does almost as well as the best fixed rule, even against an adversary. Remarkably, a method that wins this adversarial game can be turned into one that generalises in the ordinary fixed-distribution setting.

Visual Beginner

Two pictures. On the left, stability: a learning recipe takes in a class roster and outputs a rule; remove one student and rerun, and a stable recipe gives almost the same rule, while an unstable one lurches. On the right, the online game: each round you guess, then the answer arrives, and you tally how far behind the best fixed expert you have fallen.

   STABILITY                              ONLINE / REGRET
   full sample S  --> recipe --> rule h   round 1: guess, see answer, tally
   drop one point --> recipe --> rule h'  round 2: guess, see answer, tally
                                          ...
   stable:   h and h' nearly identical    regret = your total loss
   unstable: h and h' very different              minus best fixed expert's
   "barely notices a missing point"       "how much you regret not copying
   = cannot have memorised it             the best single expert all along"
Lens What it measures Good behaviour means
stability change in output when one example is dropped small change, so no overfitting
regret (online) gap to the best fixed rule in hindsight average gap shrinks to zero
capacity (earlier units) richness of the family small relative to sample size

These two pictures, plus the capacity lens of the earlier units, are three independent ways to certify that a learner will do well on data it has not seen.

Worked example Beginner

We watch a tiny online game with three weather experts and a learner that follows the weighted-majority rule. Each day an expert says rain or shine; the learner blends their votes by weight and predicts the heavier side. After the truth is revealed, every expert who was wrong has its weight halved.

Step 1. Start all weights equal: , total weight .

Step 2. Day one. Experts say (rain, rain, shine). Weighted vote for rain is , for shine is . The learner predicts rain. Truth is shine, so experts one and two were wrong. Halve their weights: .

Step 3. Day two. Experts say (shine, rain, shine). Weighted vote for shine is , for rain is . The learner predicts shine. Truth is shine, everyone correct who said shine; experts one and three keep their weight, expert two is wrong and is halved: .

Step 4. Count. The learner made one mistake in two days. Expert three, the best fixed expert so far, made zero. The running gap is one mistake, but notice expert three's weight has grown relative to the others, so the learner is steadily concentrating on the best expert.

What this tells us: by demoting wrong experts, the learner's weight piles onto whoever is doing best, so its long-run mistake count stays close to that of the best single expert. The gap, divided by the number of days, shrinks toward zero — that is the no-regret promise.

Check your understanding Beginner

Formal definition Intermediate+

The setting is the learning framework of 45.07.05: a domain (typically ), an unknown distribution , a sample , a loss with values in , and the risk with empirical counterpart . A learning algorithm is a map sending a sample to a hypothesis . Write for with the -th example deleted and for with the -th example replaced by an independent .

Definition (uniform stability). The algorithm is -uniformly stable if for every sample of size , every index , and every ,

The replacement variant bounds and is equivalent up to a factor of . Uniform stability is a property of the algorithm and loss, not of any hypothesis class; it makes no reference to capacity [Bousquet Elisseeff 2002].

Definition (regularized loss minimization / Tikhonov regularization). For a convex loss and a reproducing-kernel Hilbert space (the RKHS of 45.07.05), the RLM algorithm returns

The penalty makes the objective -strongly convex, which is the source of stability. A loss is -admissible if it is convex and -Lipschitz in its prediction argument.

Definition (online learning, mistakes, regret). In the online model the interaction proceeds in rounds : the learner receives , outputs a prediction , then observes the true and suffers loss . In the realizable classification case some target satisfies for all , and the relevant quantity is the total number of mistakes ; an algorithm has mistake bound if it makes at most mistakes on any realizable stream. In the general (agnostic) case the quantity is the regret against a comparator class ,

and the algorithm is no-regret if for every (possibly adversarial) stream.

Definition (Littlestone dimension). A mistake tree (shattered tree) for on is a complete binary tree of depth whose internal nodes are labelled by instances , such that for every root-to-leaf path — reading the left/right branch taken at each node as the bit — there is an consistent with the instance/bit pairs along that path. The Littlestone dimension is the depth of the deepest such tree (possibly ). It is the online/sequential analogue of the VC dimension: VC shatters an unordered set, while shatters an adaptively chosen tree, so always [Littlestone 1988].

Counterexamples to common slips Intermediate+

  • "Stability is just a restatement of low capacity." It is logically independent: the -nearest-neighbour rule has unbounded capacity (it interpolates any sample) and is not uniformly stable, while regularized convex ERM is stable with regardless of how large the RKHS is. Stability bounds generalization through the algorithm; capacity bounds it through the class.
  • "Finite VC dimension implies online learnability." False for the realizable online model. The class of thresholds on has VC dimension but infinite Littlestone dimension — an adversary can binary-search the threshold forever, forcing a mistake every round. Online learnability needs finite , a strictly stronger condition than finite VC.
  • "Regret measures distance to the optimal predictor." It measures distance to the best fixed member of the comparator class in hindsight. Against an adversary the best fixed expert may itself incur large loss; no-regret only promises you match that comparator, not that the loss is small in absolute terms.

Key theorem with proof Intermediate+

The signature result is that uniform stability implies generalization: a stable algorithm's empirical risk is, in expectation and with high probability, close to its true risk, with the high-probability statement coming from the bounded-differences inequality of 45.07.05's concentration prerequisite. The companion fact is that strongly-convex regularized ERM is uniformly stable, so the two together explain the generalization of ridge and SVM directly from the algorithm.

Theorem (stability implies generalization). Let be -uniformly stable with loss bounded by . Then

and for every , with probability at least over ,

Moreover, RLM over an RKHS with a -admissible loss and is -uniformly stable with , so its generalization gap is . [Bousquet Elisseeff 2002]

Proof. For the expectation bound, introduce a ghost sample independent of , and let be with replaced by . Since is a fresh draw, and . Because and have the same joint law under the swap , renaming gives . Therefore

and each summand is at most in absolute value by uniform stability (the replacement form, with the factor folded into ). The mean is thus bounded by .

For the high-probability bound, view as a function of the independent coordinates and verify the bounded-differences property. Replacing by changes to ; uniform stability bounds the change in by and in each term of by , while the directly altered empirical term changes by at most . Collecting, . McDiarmid's inequality (the bounded-differences inequality assumed by 45.07.05) gives, with probability ,

using . Bounding by the first part yields the displayed bound.

For RLM stability, let , which is -strongly convex in over . Let and be the two minimizers. Strong convexity gives the quadratic lower bound (the gradient at the minimizer vanishes), and symmetrically for . Adding the two inequalities, the regularization terms cancel and only the single differing loss term survives:

the last step by -admissibility (the loss is -Lipschitz in the prediction). The reproducing property and Cauchy-Schwarz give . Substituting and cancelling one factor of yields . Finally, for any the loss change is .

Bridge. This theorem is the foundational reason regularized convex learners generalize even where the uniform-convergence bound of 45.07.05 is loose: it shows the generalization gap is controlled by an algorithmic quantity, , with no reference to the capacity of the RKHS, and the bridge is the same bounded-differences inequality that upgraded the in-expectation Rademacher bound to a high-probability one, here applied to instead of to a supremum over the class. This is exactly the substitution that makes the lens shift visible: where Rademacher complexity measured the class, stability measures the map, and putting these together the strong convexity injected by the penalty is what converts a Lipschitz loss into a stability, so the regularization that 45.07.05 read as shrinking the effective complexity is here read as buying stability. The result builds toward the online theory of the same chapter, where the analogous regret bound appears again as a sequential, distribution-free certificate, and the central insight — that learnability has several independent certificates — is what online-to-batch conversion makes precise. The bridge is that stability and regret are the two algorithm-side lenses complementing the class-side capacity lens, all three bounding the same generalization gap.

Exercises Intermediate+

Advanced results Master

The two lenses divide into four developments: stability as a generalization certificate, the strong-convexity mechanism that produces it, the Littlestone characterization of online learnability, and the regret machinery that unifies the online setting with the batch one through conversion.

Theorem 1 (stability implies generalization; sharp constants). For a -uniformly stable algorithm with loss in , , and with probability , [Bousquet Elisseeff 2002]. The high-probability statement is the bounded-differences inequality applied to the gap functional, with bounded-difference constant ; for the bound to be non-vacuous one needs , which the stability of regularization comfortably supplies. Hypothesis stability — a weaker form — gives only a variance/Chebyshev bound, so the uniform notion is what buys the exponential concentration.

Theorem 2 (RLM / Tikhonov is uniformly stable). Regularized loss minimization over an RKHS with -admissible loss and is -uniformly stable with [Bousquet Elisseeff 2002]. The mechanism is the -strong convexity of the penalised objective: two minimizers on samples differing in one point cannot be far apart, because the strongly-convex objective grows quadratically away from its minimizer while the two objectives differ by only one -weighted loss term. Soft-margin SVM (-admissible hinge loss) and kernel ridge regression are the canonical instances, so stability explains their generalization where a uniform-convergence argument over the unbounded RKHS would be loose — the complement to the norm-based Rademacher bound of 45.07.05, which controls the same learners through the class rather than the algorithm.

Theorem 3 (Littlestone dimension characterizes online learnability). In the realizable online model, the optimal mistake bound for equals , attained by the Standard Optimal Algorithm, and no algorithm achieves fewer mistakes against a worst-case stream [Littlestone 1988]. Thus is online learnable in the mistake-bound sense iff , the sequential analogue of the VC characterization of 45.07.04; since shattering a tree is at least as demanding as shattering a set, , with thresholds on (VC dimension , Littlestone dimension ) the canonical gap. In the agnostic online setting the minimax regret is governed by the sequential Rademacher complexity, the tree-indexed analogue of the empirical Rademacher complexity of 45.07.05.

Theorem 4 (Weighted Majority, Hedge, and online-to-batch). Against experts with losses in , the exponentially-weighted Hedge forecaster with has regret , and deterministic Weighted Majority makes at most mistakes (with multiplicative factor ) [Cesa-Bianchi Lugosi 2006]. These are the prediction-with-expert-advice instances of the mirror-descent / exponentiated-gradient regret bound of 44.06.05, the entropic mirror map on the simplex of experts. Online-to-batch conversion (Exercise 8) turns any regret into an batch excess-risk bound on the averaged hypothesis, so the no-regret guarantee and the stochastic-optimization guarantee are one statement read in two directions, exactly as in 44.06.05.

Synthesis. The foundational reason this chapter has three lenses on generalization is that the same gap admits a class-side certificate (capacity, the Rademacher complexity of 45.07.05), an algorithm-side certificate in the batch setting (uniform stability), and an algorithm-side certificate in the sequential setting (low regret), and each is the natural object for a different question. This is exactly why regularization appears twice: in 45.07.05 the penalty shrinks the effective norm-ball complexity, while here the same penalty makes the objective -strongly convex and so buys stability — one design choice, two readings, and the central insight is that strong convexity is the common cause of both the complexity control and the stability. The online theory is dual to the batch theory through online-to-batch conversion, which generalises the offline-to-online correspondence of 44.06.05: a no-regret online method, run on i.i.d. data, yields a batch learner, so the Littlestone dimension is to the online setting what the VC dimension of 45.07.04 is to the batch setting, and the Hedge regret bound is the simplex mirror-descent bound of 44.06.05. Putting these together, the bridge across the whole chapter is concentration: the bounded-differences inequality upgrades the in-expectation stability and Rademacher bounds alike to high-probability statements, so capacity, stability, and regret are not competing theories but three faces of the single fact that a learner which cannot be shaken — by a rich-but-controlled class, by deleting one point, or by an adversarial stream — is a learner that generalizes.

Full proof set Master

Proposition 1 (stability implies generalization in expectation). If is -uniformly stable then .

Proof. With a ghost sample and the replacement of by , since each is an independent test point. Relabelling , which preserves the i.i.d. joint law, gives . Hence , and each term has absolute value by uniform stability (replacement form). The average is bounded by .

Proposition 2 (high-probability stability bound). Under the hypotheses of Proposition 1 with loss in , with probability , .

Proof. Let . Replacing by changes by (stability) and changes by : each of the loss terms moves by through the change of hypothesis, but the directly replaced term also moves by from the data change, and a careful accounting collapses this to a single bounded difference for . McDiarmid's inequality with gives with . Setting the right side to and using from Proposition 1 yields the bound.

Proposition 3 (RLM uniform stability). RLM over an RKHS with -admissible loss and is -uniformly stable with .

Proof. Let , minimise the -strongly-convex objectives and . Strong convexity at a minimizer gives and . Adding, the penalties and all shared loss terms cancel, leaving by -admissibility. The reproducing property and Cauchy-Schwarz give . Substituting and cancelling one factor of gives ; then for every .

Proposition 4 (Perceptron mistake bound). For data with separable with margin by a unit , the Perceptron makes at most mistakes.

Proof. Indexing by mistakes, and . The projection grows: , so . The norm grows slowly: because the mistake condition kills the cross term, so . Cauchy-Schwarz gives , hence .

Proposition 5 (Standard Optimal Algorithm achieves ). In the realizable online model the SOA makes at most mistakes, and this is optimal.

Proof. The SOA maintains the version space and predicts the label with larger, where . If it errs, the true label is the smaller-dimension one. Both children cannot have : joining two shattered trees of depth under the node would exhibit a shattered tree of depth inside , contradicting the definition. So on every mistake; starting from and staying nonnegative bounds the mistakes by . Optimality is the adversary of Exercise 7, which walks a depth- shattered tree and answers against the learner, forcing mistakes.

Proposition 6 (Hedge regret bound). Hedge with losses in and has .

Proof. With , the per-round increment is by Hoeffding's lemma for -bounded variables. Telescoping, , while . Rearranging, ; the optimal gives .

Proposition 7 (online-to-batch conversion). An online algorithm with regret on i.i.d. data with convex bounded loss yields for the averaged hypothesis .

Proof. Since depends only on and , , and for fixed . Taking expectations of the regret inequality gives . Convexity of in the prediction and Jensen give , so .

Connections Master

This unit is the algorithm-side complement of the class-side theory of 45.07.05. Rademacher complexity bounds the generalization gap uniformly over the hypothesis class through the data-dependent complexity of that class; uniform stability bounds the same gap through the sensitivity of the algorithm to a single example, with no capacity term. For regularized convex learners the two meet: the penalty shrinks the norm-ball complexity in the Rademacher bound and simultaneously makes the objective strongly convex, the source of the stability, so the same regularization is read by both lenses.

This unit extends the characterization theme of 45.07.04. There the fundamental theorem identified finite VC dimension as the combinatorial characterization of batch (PAC) learnability via uniform convergence; here the Littlestone dimension plays the exactly parallel role for the online realizable model, characterizing sequential learnability through shattered trees rather than shattered sets. Since , online learnability is strictly stronger, and the threshold class is the canonical witness; the agnostic online minimax regret is governed by the tree-indexed sequential Rademacher complexity, the sequential analogue of the empirical Rademacher complexity.

This unit consumes the online convex optimization theory of 44.06.05. The Hedge / multiplicative-weights forecaster is precisely mirror descent with the entropic map on the simplex of experts, so its regret is the simplex instance of the OCO regret bound proved there; online-to-batch conversion, also developed there, is what turns the no-regret online guarantee into a batch excess-risk bound, making the stochastic-optimization rate and the regret bound a single statement read in two directions.

The high-probability upgrade throughout relies on the bounded-differences (McDiarmid) inequality, the same concentration tool 45.07.05 used to upgrade its in-expectation Rademacher bound; here it is applied to the gap functional , whose bounded-difference constant is . The stability route and the Rademacher route to a high-probability generalization bound thus share their concentration engine.

The RKHS regularization that makes RLM stable is the kernel-machine framework whose representer theorem and norm geometry 45.07.05 uses for its dimension-free Rademacher bounds; soft-margin SVM and kernel ridge regression are the shared canonical instances, certified by stability here and by norm-based complexity there.

Historical & philosophical context Master

The idea that an algorithm insensitive to individual training points must generalize traces to the leave-one-out and cross-validation heuristics of the 1970s and to the hypothesis stability notion of Devroye and Wagner (1979) for nearest-neighbour and local rules. The modern uniform stability definition, together with the exponential generalization bound obtained by applying the bounded-differences inequality to the leave-one-out gap and the proof that Tikhonov / RKHS regularization with a -admissible loss is -stable, is due to Olivier Bousquet and André Elisseeff in their 2002 Journal of Machine Learning Research paper [Bousquet Elisseeff 2002].

The online mistake-bound model and the combinatorial characterization of online learnability were introduced by Nick Littlestone in 1988, who defined the dimension that bears his name as the depth of the deepest realized shattered binary tree, proved that the optimal realizable mistake bound equals it, and gave the Standard Optimal Algorithm and the WINNOW multiplicative-update rule [Littlestone 1988]. The Perceptron mistake bound for margin-separable data is older, from the convergence analysis of Block (1962) and Novikoff (1962). The prediction-with-expert-advice framework, the Weighted Majority algorithm of Littlestone and Warmuth (1994), and the Hedge / exponentially-weighted-average forecaster with its regret were synthesized by Nicolò Cesa-Bianchi and Gábor Lugosi in their 2006 monograph, which also developed online-to-batch conversion [Cesa-Bianchi Lugosi 2006]. The textbook account assembling uniform stability, the Littlestone dimension, and the weighted-majority regret bound into the form used here is due to Shalev-Shwartz and Ben-David, whose chapters 13 and 21 are the intermediate anchors for this unit.

Bibliography Master

@article{bousquetelisseeff2002,
  author  = {Bousquet, Olivier and Elisseeff, Andr\'e},
  title   = {Stability and generalization},
  journal = {Journal of Machine Learning Research},
  volume  = {2},
  pages   = {499--526},
  year    = {2002}
}

@article{littlestone1988,
  author  = {Littlestone, Nick},
  title   = {Learning quickly when irrelevant attributes abound: a new linear-threshold algorithm},
  journal = {Machine Learning},
  volume  = {2},
  number  = {4},
  pages   = {285--318},
  year    = {1988}
}

@article{littlestonewarmuth1994,
  author  = {Littlestone, Nick and Warmuth, Manfred K.},
  title   = {The weighted majority algorithm},
  journal = {Information and Computation},
  volume  = {108},
  number  = {2},
  pages   = {212--261},
  year    = {1994}
}

@article{freundschapire1997,
  author  = {Freund, Yoav and Schapire, Robert E.},
  title   = {A decision-theoretic generalization of on-line learning and an application to boosting},
  journal = {Journal of Computer and System Sciences},
  volume  = {55},
  number  = {1},
  pages   = {119--139},
  year    = {1997}
}

@book{cesabianchilugosi2006,
  author    = {Cesa-Bianchi, Nicol\`o and Lugosi, G\'abor},
  title     = {Prediction, Learning, and Games},
  publisher = {Cambridge University Press},
  year      = {2006}
}

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

@article{shalevshwartz2012,
  author  = {Shalev-Shwartz, Shai},
  title   = {Online learning and online convex optimization},
  journal = {Foundations and Trends in Machine Learning},
  volume  = {4},
  number  = {2},
  pages   = {107--194},
  year    = {2012}
}

@article{devroyewagner1979,
  author  = {Devroye, Luc and Wagner, Terry},
  title   = {Distribution-free performance bounds for potential function rules},
  journal = {IEEE Transactions on Information Theory},
  volume  = {25},
  number  = {5},
  pages   = {601--604},
  year    = {1979}
}