Simple Algorithm
Machine Learning · Convergence · 28 min

Why Boosting Resists Overfitting

Margins, and the long debate over boosting’s generalization.

Boosting decision trees on a letter-recognition task, Schapire and colleagues saw the training error hit zero after five rounds, yet the test error kept falling for the next thousand, from 8.4% to 3.1%. A thousand trees should overfit more than five. The margin theory explained the paradox, Breiman's arc-gv seemed to refute it, and the debate that followed shaped how we think about generalization.

What you’ll learn

  • Describe the empirical puzzle, and explain why bounds that grow with the number of rounds cannot account for it.
  • State the margin bound for votes, and prove it through the Rademacher complexity of the convex hull.
  • Prove that AdaBoost drives training margins up, with the bound ∏t2εt1−θ(1−εt)1+θ\prod_t2\sqrt{\varepsilon_t^{1-\theta}(1-\varepsilon_t)^{1+\theta}}, and explain why it still does not maximize the minimum margin.
  • Weigh Breiman's arc-gv challenge and the responses to it, and explain the roles of noise, early stopping and consistency.

A paradox in the error curves

Schapire, Freund, Bartlett & Lee (1998) ran AdaBoost on top of the C4.5 decision-tree learner on a letter-recognition dataset. C4.5 alone had a test error of 13.8%, and bagging 1,000 of its trees reached 6.6%. AdaBoost did better still. After just five trees its training error was already zero, yet its test error kept falling, from 8.4% at round 5 to 3.1% at round 1,000, when the vote involved more than two million tree nodes. Drucker and Cortes had first observed the effect, and Quinlan and Breiman confirmed it: boosting often does not overfit, even when run for thousands of rounds.

Why is that a paradox? A vote of TT trees is a far more complex function than a vote of five. Freund & Schapire (1997) had bounded the test error of AdaBoost by its training error plus a term of order Td/m\sqrt{Td/m}, up to logarithms, where dd is the VC dimension of the base class and mm the sample size. That bound grows with every round. The letter curves say the opposite: once the training error is zero, more rounds keep helping.

Think first From round 5 on, the letter experiment's training error was exactly zero. So what was AdaBoost still doing during the next 995 rounds, and why might it matter?

Increasing confidence. Every training example was already on the right side, but many had small margins, so the vote on them was nearly split. AdaBoost kept concentrating weight on the smallest-margin examples and adding trees that pushed those margins up. Schapire et al.'s plots showed the margin distribution moving right between rounds 5, 100 and 1,000. If a vote that wins decisively on the training set is more likely to win on new data, the falling test error is no longer mysterious.

A bound that does not grow with T

Schapire et al. proved a bound of this shape, with complexity term O~(d/m/θ)\tilde O\big(\sqrt{d/m}/\theta\big), by sampling from the vote. The cleaner proof below uses Rademacher complexity, following Koltchinskii & Panchenko (2002) and the textbook of Mohri, Rostamizadeh & Talwalkar (2018).

DerivationProof
  1. 1[u≤0] ≤ ϕθ(u)=min⁡(1,max⁡(0,1−uθ)) ≤ 1[u≤θ]\mathbf 1[u\le0]\ \le\ \phi_\theta(u)=\min\Big(1,\max\Big(0,1-\frac u\theta\Big)\Big)\ \le\ \mathbf 1[u\le\theta]

    Sandwich the 0–1 loss between two margin indicators with the ramp function ϕθ\phi_\theta, which is (1/θ)(1/\theta)-Lipschitz:

  2. E ϕθ(yf(x))≤E^S ϕθ(yf(x))+2 Rm(G)+ln⁡(1/δ)2m\E\,\phi_\theta\big(yf(\mathbf x)\big)\le\hat\E_S\,\phi_\theta\big(yf(\mathbf x)\big)+2\,\mathfrak R_m(\mathcal G)+\sqrt{\frac{\ln(1/\delta)}{2m}}

    Apply the uniform bound of Rademacher Complexity to the [0,1][0,1]-valued class G={(x,y)↦ϕθ(yf(x)):f∈conv⁡H}\mathcal G=\{(\mathbf x,y)\mapsto\phi_\theta(yf(\mathbf x)):f\in\operatorname{conv}\mathcal H\}: with probability at least 1−δ1-\delta, for every ff,

  3. Rm(G)≤1θ Rm({(x,y)↦yf(x)})=1θ Rm(conv⁡H)\mathfrak R_m(\mathcal G)\le\frac1\theta\,\mathfrak R_m\big(\{(\mathbf x,y)\mapsto yf(\mathbf x)\}\big)=\frac1\theta\,\mathfrak R_m\big(\operatorname{conv}\mathcal H\big)

    Talagrand's contraction lemma removes the Lipschitz ramp at the cost of 1/θ1/\theta, and the labels drop out because yiσiy_i\sigma_i has the same distribution as the random sign σi\sigma_i:

  4. sup⁡f∈conv⁡H∑i=1mσif(xi)=sup⁡h∈H∑i=1mσih(xi)⟹Rm(conv⁡H)=Rm(H)\sup_{f\in\operatorname{conv}\mathcal H}\sum_{i=1}^m\sigma_if(\mathbf x_i)=\sup_{h\in\mathcal H}\sum_{i=1}^m\sigma_ih(\mathbf x_i)\quad\Longrightarrow\quad\mathfrak R_m(\operatorname{conv}\mathcal H)=\mathfrak R_m(\mathcal H)

    The convex hull is free. For fixed signs, ∑iσif(xi)\sum_i\sigma_if(\mathbf x_i) is linear in the weights of ff, so its supremum over the hull is attained at a single base hypothesis:

  5. Rm(H)≤2ln⁡ΠH(m)m≤2dln⁡(em/d)m\mathfrak R_m(\mathcal H)\le\sqrt{\frac{2\ln\Pi_{\mathcal H}(m)}m}\le\sqrt{\frac{2d\ln(em/d)}m}

    Massart's lemma and the Sauer–Shelah lemma bound the base class. Insert this, then use the sandwich: the left side of the second display is at least P[yf≤0]P[yf\le0], and its empirical term is at most P^S[yf≤θ]\hat P_S[yf\le\theta].

Predict before you look

Take a base class of VC dimension d=10d=10, m=106m=10^6 training examples and θ=0.25\theta=0.25. How large is the complexity term 2θ2dln⁡(em/d)/m\frac2\theta\sqrt{2d\ln(em/d)/m}?

Show the answer

0.13

ln⁡(em/d)=ln⁡(e⋅105)≈12.51\ln(em/d)=\ln(e\cdot10^5)\approx12.51, so 20⋅12.51/106≈0.0158\sqrt{20\cdot12.51/10^6}\approx0.0158, and 2/θ=82/\theta=8 gives about 0.1270.127. Even with a million examples, the bound only promises that the test error is within about 13 points of the fraction of training margins below 0.250.25.

The bound is loose; Schapire later wrote that the theory gives a qualitative explanation while the bounds are quantitatively rather weak. Its value is structural. The complexity term depends on the base class, the sample size and θ\theta, never on TT. It rewards votes that put most training examples at a large margin. And it charges for the complexity of the base class, the term on which Breiman's challenge would turn.

AdaBoost pushes the margins up

DerivationProof
  1. 1[yif(xi)≤θ]≤exp⁡(θ∑t=1Tαt−yiF(xi))\mathbf 1\big[y_if(\mathbf x_i)\le\theta\big]\le\exp\Big(\theta\sum_{t=1}^T\alpha_t-y_iF(\mathbf x_i)\Big)

    A margin of at most θ\theta means θ∑tαt−yiF(xi)≥0\theta\sum_t\alpha_t-y_iF(\mathbf x_i)\ge0, so the exponential of that quantity is at least 1:

  2. P^S[yf(x)≤θ]≤eθ∑tαt∏t=1TZt=∏t=1TeθαtZt\hat P_S\big[yf(\mathbf x)\le\theta\big]\le e^{\theta\sum_t\alpha_t}\prod_{t=1}^TZ_t=\prod_{t=1}^Te^{\theta\alpha_t}Z_t

    Average over the sample, and reuse the identity 1n∑ie−yiF(xi)=∏tZt\frac1n\sum_ie^{-y_iF(\mathbf x_i)}=\prod_tZ_t from the training-error proof:

  3. eθαtZt=(1−εtεt)θ/22εt(1−εt)=2εt1−θ(1−εt)1+θe^{\theta\alpha_t}Z_t=\Big(\frac{1-\varepsilon_t}{\varepsilon_t}\Big)^{\theta/2}2\sqrt{\varepsilon_t(1-\varepsilon_t)}=2\sqrt{\varepsilon_t^{1-\theta}(1-\varepsilon_t)^{1+\theta}}

    Substitute AdaBoost's αt=12ln⁡1−εtεt\alpha_t=\tfrac12\ln\frac{1-\varepsilon_t}{\varepsilon_t} and Zt=2εt(1−εt)Z_t=2\sqrt{\varepsilon_t(1-\varepsilon_t)}:

  4. (1−2γ)1−θ(1+2γ)1+θ<1  ⟺  θ<ln⁡11−4γ2ln⁡1+2γ1−2γ=Υ(γ)(1-2\gamma)^{1-\theta}(1+2\gamma)^{1+\theta}<1\iff\theta<\frac{\ln\frac1{1-4\gamma^2}}{\ln\frac{1+2\gamma}{1-2\gamma}}=\Upsilon(\gamma)

    The logarithm of the factor has derivative 12(1−θε−1+θ1−ε)\tfrac12\big(\frac{1-\theta}{\varepsilon}-\frac{1+\theta}{1-\varepsilon}\big) in ε\varepsilon, positive for ε<1−θ2\varepsilon<\frac{1-\theta}2. So for θ<2γ\theta<2\gamma the factor is largest at εt=12−γ\varepsilon_t=\tfrac12-\gamma, where its square is below 1 exactly when:

With a constant edge, then, the fraction of training examples with margin below any θ<Υ(γ)\theta<\Upsilon(\gamma) shrinks exponentially in TT: AdaBoost keeps pushing margins up long after the training error, the case θ=0\theta=0, has reached zero. That is what the letter experiment's margin plots showed. But it is not margin maximization. By the minimax theorem of AdaBoost & the Exponential Loss, the best possible minimum margin is ρ∗=2γ∗\rho^*=2\gamma^*, where γ∗\gamma^* is the edge guaranteed on every distribution, and AdaBoost is guaranteed only about Υ(γ∗)\Upsilon(\gamma^*), roughly half of ρ∗\rho^* when γ∗\gamma^* is small. Rudin, Daubechies & Schapire (2004) proved that AdaBoost need not converge to a maximum-margin vote, and that its weights can settle into cycles.

Predict before you look

Every stump has weighted error εt=0.3\varepsilon_t=0.3, an edge of γ=0.2\gamma=0.2. Below what margin θ\theta does the theorem guarantee that, eventually, no training example has margin ≤θ\le\theta? (Find where the factor 2ε1−θ(1−ε)1+θ2\sqrt{\varepsilon^{1-\theta}(1-\varepsilon)^{1+\theta}} crosses 1.)

Show the answer

0.21

Υ(0.2)=ln⁡10.84/ln⁡1.40.6=0.1744/0.8473≈0.206\Upsilon(0.2)=\ln\frac1{0.84}\big/\ln\frac{1.4}{0.6}=0.1744/0.8473\approx0.206. At θ=0.1\theta=0.1 the factor is about 0.9560.956 and at θ=0.2\theta=0.2 about 0.9980.998, so margins up to about 0.20.2 are eventually exceeded by every example, while 0.30.3 gives a factor above 1 and no guarantee.

Breiman’s challenge and the long debate

If margins explain generalization, an algorithm that maximizes them should do even better. Breiman (1999) built one. His arc-gv provably converges to the vote with the largest minimum margin, and he proved a generalization bound in terms of the minimum margin alone, sharper than the bound of Schapire et al. He then boosted CART trees pruned to a fixed number of nodes on standard datasets. Arc-gv produced uniformly higher margins than AdaBoost, and it was worse on test data in almost every case. Breiman concluded that the margin explanation was in serious doubt.

Reyzin & Schapire (2006) reproduced the finding and found a confound. Although arc-gv's trees had the same number of leaves, they were much deeper, and more complex base classifiers inflate exactly the complexity term of the margin bound. With decision stumps, whose complexity is fixed, AdaBoost still did better on average, and arc-gv usually still had the larger minimum margin. But AdaBoost's margins were higher over most of the distribution, and its average margin was higher on every dataset they tried, for instance 0.27 against arc-gv's 0.07 on the breast-cancer data after 100 rounds. Their conclusion: maximizing the margins is desirable, but not necessarily at the expense of other factors, especially base-classifier complexity.

Gao & Zhou (2013) sharpened the theory. Their bound in terms of the kk-th smallest training margin gives a result like Breiman's minimum-margin bound at k=1k=1. They also proved a bound that depends on the same quantities as the bound of Schapire et al. yet is sharper than both it and Breiman's, and a bound that improves as the average margin grows and the margin variance shrinks. The target is a good margin distribution, with a large mean and a small variance, rather than the minimum margin alone.

AccountClaimWhere it stands
Occam / VC (Freund & Schapire 1997)test error ≤\le training error +O~(Td/m)+\tilde O(\sqrt{Td/m})grows with TT; contradicted by the error curves
Bias–variance (Breiman)voting works mainly by reducing varianceboosting stumps cuts error while variance does not fall (Schapire et al. 1998)
Margins (Schapire et al. 1998)a bound free of TT; AdaBoost raises marginsqualitatively right, quantitatively loose
Minimum margin (Breiman 1999)arc-gv: larger minimum margin, worse test errorcomplexity confound and the margin distribution (Reyzin & Schapire 2006; Gao & Zhou 2013)
Statistical (Friedman, Hastie & Tibshirani 2000)boosting is stagewise minimization of a convex losspredicts overfitting with noise; consistency needs early stopping (Zhang & Yu 2005; Bartlett & Traskin 2007)
Five accounts of boosting's generalization. They are complementary more than contradictory, and none of them alone predicts test error accurately.
Check your understanding

Two votes have the same base class and the same training error of zero. Vote A has minimum margin 0.10, and 95% of its training margins exceed 0.5. Vote B has minimum margin 0.15, and only 40% of its training margins exceed 0.5. Which comparison does the margin bound support?

  1. B, because the bound depends only on the minimum margin
  2. At θ=0.5\theta=0.5 the empirical term is 0.05 for A and 0.60 for B, so there the bound is far better for A; B can look better only at small θ\theta, where the complexity term ∝1/θ\propto1/\theta is large
  3. Neither: the bound cannot compare votes with zero training error
  4. A, because it has more members
Show the answer

B. At θ=0.5\theta=0.5 the empirical term is 0.05 for A and 0.60 for B, so there the bound is far better for A; B can look better only at small θ\theta, where the complexity term ∝1/θ\propto1/\theta is large

The bound trades the empirical term P^S[yf≤θ]\hat P_S[yf\le\theta] against the complexity term ∝1/θ\propto1/\theta, and holds for every θ\theta at once (up to a small union-bound cost). At larger θ\theta, A's empirical term is far smaller. This is the margin-distribution point that Reyzin & Schapire and Gao & Zhou made against judging by the minimum margin alone.

Noise, stopping and the modern view

Boosting is not immune to overfitting. The margin bound itself warns that complex base classifiers and small samples hurt. Grove & Schuurmans (1998) saw test error creep up slightly after extremely many rounds, and with label noise the effect is strong, because large margins can then be bought only by fitting mislabeled points (Boosting). The statistical view gives the complementary account: AdaBoost minimizes the exponential loss, whose infimum on separable data is approached only as the vote's weights diverge, and statistical consistency requires controlling the number of rounds. Zhang & Yu (2005) proved consistency of boosting with early stopping, and Bartlett & Traskin (2007) for AdaBoost stopped after n1−ϵn^{1-\epsilon} rounds.

Rosset, Zhu & Hastie (2004) connected the margin and loss views. With infinitesimally small steps, boosting approximately follows the path of ℓ1\ell_1-constrained loss minimization, and on separable data the normalized solutions along that path converge to an ℓ1\ell_1 maximum-margin separator. This is the boosting counterpart of gradient descent's drift toward the ℓ2\ell_2 maximum-margin direction in logistic regression (The Implicit Bias of Gradient Descent): the optimizer, not an explicit penalty, decides which of many zero-training-error solutions you get. Boosting was among the first widely used methods to fit its training data exactly and still generalize, a puzzle that returned with deep networks (Double Descent, Benign Overfitting).

Key takeaways

  • Boosting's test error can keep falling after its training error reaches zero (letter dataset: 8.4% at round 5, 3.1% at round 1,000), which contradicts bounds that grow with the number of rounds.
  • Margin bound: for every vote f∈conv⁡(H)f\in\operatorname{conv}(\mathcal H), P[yf≤0]≤P^S[yf≤θ]+2θ2dln⁡(em/d)/m+ln⁡(1/δ)/(2m)P[yf\le0]\le\hat P_S[yf\le\theta]+\frac2\theta\sqrt{2d\ln(em/d)/m}+\sqrt{\ln(1/\delta)/(2m)}; the convex hull has the Rademacher complexity of H\mathcal H, so TT never appears.
  • AdaBoost makes the fraction of training margins below θ\theta vanish exponentially for θ<Υ(γ)≈γ\theta<\Upsilon(\gamma)\approx\gamma, but it does not maximize the minimum margin and can cycle.
  • Breiman's arc-gv achieved larger minimum margins and worse test error; the resolution involves base-classifier complexity and the whole margin distribution (Reyzin & Schapire 2006; Gao & Zhou 2013).
  • Boosting does overfit with label noise; consistency requires early stopping, and small-step boosting drifts toward the ℓ1\ell_1 maximum-margin vote (Rosset, Zhu & Hastie 2004).

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

In the letter experiment, the training error was zero from round 5 on, yet the test error fell from 8.4% to 3.1% by round 1,000. What kept changing on the training set?

  1. The number of misclassified training examples
  2. The VC dimension of C4.5's trees
  3. The training margins yif(xi)y_if(\mathbf x_i), which kept growing
  4. Nothing: the improvement is a statistical fluctuation
Show the answer

C. The training margins yif(xi)y_if(\mathbf x_i), which kept growing

With every example already correct, AdaBoost kept moving weight onto the smallest-margin examples and adding trees that made the vote on them more decisive. The margin bound turns larger training margins into a better guarantee on test error.

Question 2

Which feature of the margin bound lets it explain why boosting can keep improving as rounds are added?

  1. Its complexity term decreases as TT grows
  2. Its complexity term does not depend on TT at all, only on the base class, θ\theta and mm
  3. It depends only on the minimum training margin
  4. It is tight enough to predict the test error to within a point
Show the answer

B. Its complexity term does not depend on TT at all, only on the base class, θ\theta and mm

The vote lives in conv⁡(H)\operatorname{conv}(\mathcal H) whatever TT is, and the convex hull has the same Rademacher complexity as H\mathcal H. Adding rounds can only change the empirical term P^S[yf≤θ]\hat P_S[yf\le\theta], and AdaBoost drives that down.

Question 3

A colleague argues: "arc-gv attains larger minimum margins than AdaBoost but generalizes worse, so margins are irrelevant." Which response does the evidence best support?

  1. The colleague is right, and the margin bound has been disproved
  2. Arc-gv was run for too few rounds
  3. The minimum margin is all that matters, so the experiments must contain an error
  4. The bound depends on base-classifier complexity and on the whole margin distribution: arc-gv's trees were more complex, and with stumps AdaBoost's margins were higher over most of the distribution despite a usually lower minimum
Show the answer

D. The bound depends on base-classifier complexity and on the whole margin distribution: arc-gv's trees were more complex, and with stumps AdaBoost's margins were higher over most of the distribution despite a usually lower minimum

Reyzin & Schapire (2006) reproduced Breiman's finding and showed both effects. Their conclusion: maximizing the margins is desirable, but not necessarily at the expense of other factors, especially base-classifier complexity.

Question 4

AdaBoost with stumps is run for 10,000 rounds on data with 20% random label noise. What is most likely, and what should you do?

  1. The test error eventually rises as the vote fits the flipped labels; choose the number of rounds by validation
  2. The margin bound guarantees the test error keeps falling, so run longer
  3. Nothing changes, because noise affects only the training error
  4. Switch to arc-gv, which is immune to noise
Show the answer

A. The test error eventually rises as the vote fits the flipped labels; choose the number of rounds by validation

With noise, large margins on the training set are bought by fitting mislabeled points, and the theory's guarantees weaken: the empirical margin term stays large unless the vote fits the noise. Consistency results for boosting require stopping (Bartlett & Traskin 2007).

Further reading

  • R. E. Schapire, Y. Freund, P. Bartlett & W. S. Lee, "Boosting the margin: a new explanation for the effectiveness of voting methods," Annals of Statistics 26(5), 1651–1686 (1998).
  • L. Breiman, "Prediction games and arcing algorithms," Neural Computation 11(7), 1493–1517 (1999).
  • L. Reyzin & R. E. Schapire, "How boosting the margin can also boost classifier complexity," Proceedings of ICML, 753–760 (2006).
  • W. Gao & Z.-H. Zhou, "On the doubt about margin explanation of boosting," Artificial Intelligence 203, 1–18 (2013).
  • M. Mohri, A. Rostamizadeh & A. Talwalkar, Foundations of Machine Learning, 2nd ed. (MIT Press, 2018).