ML0082 XGBoost Improves Gradient Boosting

How does XGBoost improve upon the classical gradient-boosted decision tree algorithm?

Answer

XGBoost keeps the sequential additive recipe of classical gradient boosting but upgrades it on three axes. First, optimization: it fits each tree with a second-order Taylor approximation of the loss, using both gradients and Hessians, so leaf weights and split gains are Newton-style steps instead of plain gradient steps. Second, regularization: the objective explicitly penalizes the number of leaves and the squared leaf weights, which prunes weak splits analytically. Third, systems: sparsity-aware split finding, a weighted quantile sketch for approximate splits, and cache-aware block layouts let it scale to billions of examples. The result dominated competitions: 17 of the 29 winning solutions published on Kaggle’s blog in 2015 used XGBoost.

(1) Second-Order Optimization: gradients alone say which way is downhill; Hessians say how curved the surface is, so XGBoost computes closed-form optimal leaf weights and exact split gains per candidate split.
(2) Regularized Objective: the penalty on leaf count and weight magnitude means a split must beat an explicit complexity cost to survive, a built-in analogue of pruning that classical GBDT lacks.
(3) Systems Engineering: default directions for missing values, approximate split proposals from weighted quantiles, and out-of-core cache-aware blocks deliver the reported 10x-plus speedups that made it the industry default.

One-dimensional loss curve with a gradient-only step undershooting the minimum while a second-order Newton step, using curvature, lands near it

Figure 1: Why the Hessian helps: a first-order step moves along the tangent and misses the valley; a second-order step accounts for curvature (dashed parabola) and lands near the minimizer, which is what closed-form leaf weights do for every leaf.

The second-order view also explains where the regularization bites. Once you collect all examples routed to a leaf, the objective contribution of that leaf is a one-dimensional quadratic in its weight, whose closed-form minimizer shrinks toward zero as the penalty grows. Splits are scored by how much they reduce the total objective including the per-leaf cost, so a split that adds two leaves must overcome an explicit gamma toll twice. Classical GBDT instead fits trees to raw gradients and controls complexity only indirectly through depth caps and shrinkage.

Mathematical Formulation:
\mathcal{L}^{(t)} \simeq \sum_{i=1}^{N} \left[ g_i f_t(x_i) + \frac{1}{2} h_i f_t^2(x_i) \right] + \Omega(f_t)
\Omega(f) = \gamma T + \frac{1}{2}\lambda \sum_{j=1}^{T} w_j^2
w_j^* = -\frac{G_j}{H_j + \lambda}

Where:

  • g_i and h_i are the first and second derivatives of the per-example loss at the current prediction; f_t is the new tree.
  • \Omega(f) is the regularizer: \gamma charges per leaf (T leaves) and \lambda penalizes squared leaf weights w_j.
  • G_j, H_j are the sums of g_i, h_i over the examples routed to leaf j, and w_j^* is the closed-form optimal leaf weight; larger \lambda shrinks every leaf toward zero.
AspectClassical GBDTXGBoost
Loss InformationFirst-order gradients (residuals)Gradients + Hessians (second-order Taylor)
RegularizationIndirect: depth caps, shrinkage, subsamplingExplicit: gamma on leaf count, lambda on leaf weights
Split FindingExact scan or basic histogramsWeighted quantile sketch + sparsity-aware defaults
ScaleIn-memory, single machineCache-aware blocks, out-of-core, distributed
Track RecordStrong but slow at scale17 of 29 Kaggle 2015 winning solutions; every KDDCup 2015 top-10 team

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *