Boosting Algorithms: AdaBoost, Gradient Boosting & XGBoost
The core idea: learn from your mistakes, sequentially
Most ensemble methods you encounter early on — like averaging several independent models — treat each model as a separate vote. Boosting does something fundamentally different: it builds models sequentially, where each new model is trained specifically to fix the mistakes of the ensemble built so far.
The individual models in a boosting ensemble are deliberately simple — usually shallow decision trees with just a handful of splits, sometimes called 'stumps' when limited to a single split. These are called weak learners: each one alone performs only slightly better than random guessing. Boosting's trick is combining many weak learners in a way that the combination becomes a strong, accurate model.
AdaBoost: reweighting the hard examples
AdaBoost (Adaptive Boosting), one of the earliest and most influential boosting algorithms, works by adjusting the weight of each training example after every round:
1. Train a weak learner on the (initially equally weighted) training data.
2. Find which examples it got wrong.
3. Increase the weight of misclassified examples, decrease the weight of correctly classified ones.
4. Train the next weak learner on this reweighted data — it is now forced to focus on the examples the previous learner struggled with.
5. Repeat for a fixed number of rounds, then combine all the weak learners into a final prediction via a weighted vote, where more accurate learners get more say.
The effect is that each successive model specializes in the hard cases the ensemble is currently getting wrong, while the ensemble as a whole steadily improves.
Gradient Boosting: fitting residuals directly
Gradient Boosting generalizes the same sequential idea but frames it as explicit optimization. Instead of reweighting examples, each new tree is trained to predict the residual error (the gap between the current ensemble's predictions and the true values) of the ensemble so far.
The process: start with a simple initial prediction (often just the mean of y). Compute the residuals. Fit a new tree to predict those residuals. Add a scaled-down version of that tree's predictions to the running total (scaled by a learning rate, typically small, like 0.01-0.3). Recompute residuals against the updated total. Repeat.
This is literally gradient descent, but taking steps in 'function space' rather than parameter space — each new tree is the direction that most reduces the loss, and the learning rate is the step size. This framing is why the same algorithm generalizes cleanly beyond squared-error regression to log-loss for classification, and to any differentiable loss function at all.
Note
XGBoost and friends: engineering gradient boosting for scale
XGBoost, LightGBM, and CatBoost are production-grade implementations of gradient boosting that add major engineering and algorithmic improvements over the basic idea: regularization terms built directly into the loss function to control tree complexity, second-order (Newton's method style) gradient information for more accurate tree splits, efficient handling of missing values, histogram-based split finding for speed, and native support for categorical features (CatBoost especially).
These implementations are why gradient boosted trees dominate tabular-data machine learning competitions and production systems — they combine the statistical power of gradient boosting with optimizations that make training on millions of rows practical.
AdaBoost vs. Gradient Boosting vs. XGBoost
| Algorithm | How it corrects errors | Loss function flexibility | Typical use today |
|---|---|---|---|
| AdaBoost | Reweights misclassified examples | Limited (exponential loss) | Simple baselines, teaching boosting |
| Gradient Boosting | Fits new trees to residual gradients | Any differentiable loss | General-purpose boosting |
| XGBoost / LightGBM / CatBoost | Gradient boosting + engineering optimizations | Any differentiable loss, highly tunable | Production tabular ML, competitions |
Note
What's next
Boosting is one of three major ensemble strategies. The next lesson, Ensemble Modeling: Bagging, Boosting & Stacking Compared, puts boosting side by side with bagging and stacking to make clear when each one is the right tool.
I build these systems professionally.
Whether it's a RAG pipeline, analytics migration, or AI workflow — let's talk.