AdaBoost reweights points — misclassified ones get louder. What if, instead of reweighting anything, each new model just predicted whatever the current model still gets wrong?
Five points, nowhere near a straight line. At 0 rounds the fit is just the flat average — bad everywhere. Each round after that fits a small step to whatever's still left over, and the curve bends closer to the data.
This is gradient boosting. Start from the simplest possible model — a constant — then repeatedly fit a new small model to whatever the current ensemble still gets wrong, and add it in:
- — the starting prediction: just the training mean , before any model has run.
- — the ensemble's prediction after rounds.
- — round 's new "weak learner", here a single-split regression stump.
is fit to each point's pseudo-residual — the negative gradient of the loss with respect to the current prediction. For squared-error loss , that gradient works out to something completely ordinary:
- — point 's pseudo-residual going into round .
- — point 's true target value.
- Squared-error loss makes it literal
For squared-error loss, "fit the negative gradient" and "fit the ordinary leftover residual" are the exact same instruction — that's why the very first boosting example anyone sees is usually just "fit the residuals," with the gradient framing hidden underneath.
- Any differentiable loss plugs into the same recipe
Swap in a different differentiable loss (say, one built for classification) and the pseudo-residual formula changes, but the outer loop — fit a small model to the current gradient, add it in, repeat — doesn't.
- Every round only ever sees what's still wrong
Round 's stump never sees directly — only , the part of that hasn't explained yet. Whatever the ensemble already gets right stays untouched.
Watch the residual list shrink as rounds are added — this is the "pseudo-residual" input each new stump is actually trained on, made visible.
Five points: .
- F0 is just the mean
. Each point's residual going into round 1 is :
- :
- :
- :
- :
- :
Squaring and summing: .
- Round 1's stump finds the split at x = 2.5
Splitting into and :
- Left group mean:
- Right group mean:
This beats every other candidate split by a wide margin. for , and for .
- New residuals, and a new SSE
at each point:
- :
- :
- :
- :
- :
Squaring and summing: — down from . Real progress, but are still off by as much as 3.
- Round 2 fits a fresh stump to those residuals
Splitting at (isolating the single worst point, ):
- Left group mean ():
- Right group mean ():
for , and for :
- :
- :
- :
New residuals are , giving a final SSE of just .
Chain enough rounds of stumps to push the total squared error below 5. One round alone isn’t enough — check the numbers.
AdaBoost reweights the data; gradient boosting reweights nothing — it just keeps handing each new weak learner a smaller and smaller piece of what's left unexplained. Two rounds here cut total error from to — over 30x — and the mechanism generalizes past regression: swap the loss, and the same "fit the gradient, add it in" loop produces a boosted classifier instead.