Fitting the next model to what is left over
Boosting builds an additive model: the prediction is a running sum, and each new tree is trained on the error the sum has so far.
- : the ensemble after rounds.
- : the tree added in round .
- : the learning rate, which shrinks every tree's contribution.
The first model is usually just a constant, the mean of the target, and every tree after it is a correction.
The residual is a gradient
Each tree is fitted to the negative gradient of the loss with respect to the current prediction, evaluated at every training point.
For squared error that gradient is exactly the residual, which is where the plain-English description comes from.
For any other loss it is not a residual at all, and that generality is the whole point of the word gradient in the name.
Boosting is gradient descent, with each step taken in the space of functions rather than the space of parameters.
One round, in order
- Compute the negative gradient of the loss at every training point.
- Fit a shallow regression tree to those values.
- Choose the value each leaf should output, by line search on the loss.
- Add that tree to the ensemble, scaled by the learning rate.
- Repeat until the validation score stops improving.
Why the trees are kept small
Each tree only has to capture one correction, so a stump or a small tree is enough and a deep one fits noise that the next round then has to undo.
A small learning rate makes each correction timid, which needs more rounds and reliably generalises better.
Learning rate and number of trees trade directly against each other. Halve and you need roughly twice as many rounds to reach the same fit.
Why it overfits where a forest does not
A forest averages independent trees, so adding trees can only help and is not a tuning parameter.
Boosting is sequential, so adding rounds keeps reducing training loss past the point where validation loss turns.
The number of rounds is therefore the main regularisation dial, and it is set by early stopping on a validation fold rather than chosen in advance.