Shrinkage and the Learning-Rate vs Tree-Count Tradeoff
In gradient boosting, a small learning rate combined with many trees generalizes better than a large learning rate with few trees — but the two knobs must be tuned together, and each extra tree costs training time.
Prerequisites: Gradient Boosting as Functional Gradient Descent, Forward Stagewise Additive Modelling
Gradient boosting builds a model one small tree at a time, each new tree correcting the errors left by the ones before it. Two knobs control how that process unfolds: the learning rate (how much of each new tree's prediction you actually add to the model) and the number of trees (how many correction rounds you run). Turn the learning rate up and you can get a strong model in just a few dozen trees; turn it down and you need hundreds or thousands of trees to reach the same fit. The surprising part is that the slow, many-trees route usually generalizes better — but it isn't free.
Shrinkage, in words
Instead of letting each new tree add its full predicted correction, boosting multiplies every tree's contribution by a small factor (the learning rate, typically between 0.01 and 0.3) before adding it to the running total:
In plain English: the model's prediction after rounds equals its prediction after rounds, plus a shrunk version of the newest tree's correction. This is called shrinkage. A smaller means each tree is only allowed to nudge the model a little, so no single tree — including one that overfits its particular training batch — can dominate the final prediction. The cost is that you need proportionally more trees to reach the same total amount of correction, roughly like taking smaller steps to cover the same distance.
Why small steps generalize better
Each boosting round fits a tree to the current residual errors, and any individual tree's fit reflects some genuine signal plus some noise specific to that round's data. A large learning rate bakes a big fraction of that noise permanently into the model on round one. A small learning rate means noise from any single round only ever contributes a sliver to the final answer, and errors from different rounds partially average out over the many trees needed to reach the same fit. In practice, this is one of the most reliable regularization levers in gradient boosting: shrink the rate, add more trees, and validation error typically keeps improving well past the point where a high learning rate would have started overfitting.
Worked example: three learning-rate settings
Suppose fitting a boosted model on a signal-prediction task and tracking validation log-loss:
| Learning rate | Trees to converge | Best validation log-loss |
|---|---|---|
| 0.3 | ~50 | 0.612 |
| 0.1 | ~180 | 0.588 |
| 0.02 | ~900 | 0.581 |
The 0.3 setting converges fastest but plateaus at the worst validation score — it locked in noisy early corrections before they could be refined. The 0.02 setting needs 18× more trees but reaches the best score, because each tree can only make a small, cautious adjustment, letting later trees fine-tune what earlier ones got approximately right. If training time is a hard constraint, 0.1 is a reasonable middle ground: most of the accuracy gain of the slow schedule, at a fraction of the tree count.
Try shrinking the step size in the explorer above: small steps take longer to reach the bottom of the loss curve but are less likely to overshoot and bounce around it — the same tension that shrinkage manages in boosting.
What this means in practice
The two knobs are coupled, not independent: halving the learning rate roughly doubles the trees needed for the same fit, so tune them together, and always pair a small learning rate with early stopping on a validation set so training halts once additional trees stop helping. A moderate learning rate (0.05–0.1) with early stopping is usually the practical sweet spot for production retraining budgets.
Shrinkage multiplies each new tree's contribution by a small learning rate before adding it to the model, so no single round of boosting can dominate the fit. Lower learning rates paired with more trees typically generalize better than a high learning rate with few trees, because errors from individual rounds are diluted and partially average out — but the two settings must be tuned together, and more trees means more training time.
Don't tune the learning rate and the number of trees independently on separate validation runs — they trade off against each other, so a "best" number of trees found at one learning rate is close to meaningless at another. Always search them together, or fix a small learning rate and use early stopping to pick the tree count automatically.
Related concepts
Practice in interviews
Further reading
- Friedman, 'Greedy Function Approximation: A Gradient Boosting Machine' (2001)