AdaBoost improves performance by focusing on its mistakes. It does this by increasing the weights of misclassified samples, forcing the next learner in the sequence to pay closer attention to them. This re-weighting mechanism is effective, but it represents a specific solution to the problem of error correction.
Gradient Boosting takes a step back and reframes the entire process. Instead of asking, "How can we adjust sample weights to fix errors?", it asks a more fundamental question: "How can we directly minimize a given loss function by sequentially adding new models to our ensemble?" This shifts our perspective from a specific algorithm to a general optimization framework, which is a major advancement.
At its core, training a machine learning model is an optimization problem. We want to find a model, let's call it , that minimizes a loss function, , which measures the difference between our predictions and the true target values .
Boosting algorithms build this final model in an additive, stage-wise fashion. We start with a simple initial model, , and iteratively add new weak learners, , to improve it:
The central question in any boosting algorithm is how to find the best new weak learner to add at each step. This is where Gradient Boosting introduces its main innovation. It treats this problem as a form of gradient descent, but not in the parameter space you might be used to. Instead, it performs gradient descent in function space.
Think about standard gradient descent. To minimize a loss function with respect to a set of parameters , we compute the gradient and take a small step in the opposite direction:
Gradient Boosting applies this same logic. At each stage , we have our current model . We want to find a new function, our weak learner , that when added to , pushes the total loss down as much as possible. The most direct way to reduce the loss is to point our new function in the direction of the negative gradient of the loss function.
For each data point , we compute the negative gradient of the loss function with respect to the prediction from the previous stage, . These are called the pseudo-residuals:
The new weak learner, , is then trained not on the original target values , but on these pseudo-residuals . In effect, the weak learner is trained to predict the direction of the error from the previous model.
This might seem abstract, so let's make it concrete with a standard regression problem. A common loss function for regression is the Mean Squared Error (MSE), or more precisely, half the squared error for mathematical convenience:
Now, let's compute the pseudo-residual by taking the partial derivative of this loss function with respect to the model's prediction, :
The negative gradient is therefore:
This is simply the residual error: the difference between the true value and the current prediction. For MSE loss, the abstract concept of fitting a new model to the "negative gradient" simplifies to the very intuitive idea of fitting a new model to the "remaining error".
This connection is what makes Gradient Boosting so powerful. It provides a unifying mathematical framework that generalizes the error-fitting idea. While AdaBoost uses a specific re-weighting scheme, Gradient Boosting's use of gradients allows us to plug in any differentiable loss function, tailoring the algorithm directly to the problem at hand, whether it's regression, classification, or ranking.
A comparison of the sequential learning process in AdaBoost and Gradient Boosting. AdaBoost adjusts sample weights to focus on errors, while Gradient Boosting trains new models to predict the gradient of the loss function, generalizing the concept of error correction.
Was this section helpful?
© 2026 ApX Machine LearningEngineered with