Skip to content
IT glossary
Data and MLUpdated December 3, 2026

Gradient boosting

Градиентный бустинг

This machine learning method builds a predictor in stages. Each new model, usually a decision tree, adds a correction to what the models built so far predict.

Also known as: CatBoost, XGBoost, LightGBM

The idea

Imagine predicting how long a delivery will take. Start with the same estimate for every order, such as the average delivery time in the training data. A small tree might add time for long trips and subtract time for short ones. After that adjustment, the model may still underestimate deliveries during rush hour. Another tree can learn a correction for that pattern. At prediction time, you add the trees’ contributions to the starting estimate rather than asking the trees to vote.

What the gradient does

A loss function measures how far the model’s predictions are from what you want it to predict. Gradient boosting starts with a simple prediction, typically a constant chosen to minimize that loss on the training set. It then repeats three steps:

  1. For each training example, differentiate the loss with respect to the model’s current prediction and flip the sign. The result is a target called a pseudo-residual: it points in the direction that would reduce the loss for that example.
  2. Fit a base learner, usually a small decision tree, to approximate those targets. Some implementations also refine the values assigned to the leaves.
  3. Add the new tree’s output to the current model, scaled by the learning rate. Recompute the gradients before fitting the next tree.

The distinction from ordinary parameter updates in gradient descent is that boosting adds a new prediction function at each step. The gradient tells the new tree what to approximate; it is not a derivative with respect to the tree’s split thresholds.

One update by hand

With half squared error, L = ½(y − F)², the negative gradient is exactly y − F, the ordinary residual. If a delivery took 40 minutes and the model predicted 30, the residual is +10 minutes. The new tree might assign a correction of +8 to that delivery because it shares a leaf with other orders. With a learning rate of 0.1, the new prediction is 30 + 0.1 × 8 = 30.8 minutes. For other losses, the targets need not be ordinary residuals. In binary classification with logistic loss, for example, trees update a log-odds score, not a probability directly.

Where it fits

Boosted trees are common on tabular problems such as demand forecasting, churn prediction, and search ranking. XGBoost, LightGBM, and CatBoost are libraries that implement gradient boosting, not interchangeable names for the method. They differ in how they grow trees and handle features; CatBoost, for instance, has built-in handling for categorical features.

What comes up in interviews

A common comparison is with random forests: the trees in a forest don’t learn from one another’s predictions, while each boosting round depends on the rounds before it. Another common question is how to tune the ensemble. A smaller learning rate usually needs more rounds, and overly deep trees can fit noise. With early stopping, you track a validation metric during training and keep the model from the best round rather than using the test set to choose when to stop.