Plain gradient boosting sets each leaf to the mean of its residuals — free, unregularized, first-order. What changes if the leaf value comes from an actual optimization instead of a shortcut?
The faint curve is last chapter's plain GBM fit. Drag up and watch the bold curve pull back toward round 1's fit — regularization is literally the ensemble refusing to fully trust round 2's correction.
XGBoost and LightGBM both replace "leaf value = mean of residuals" with a second-order (Newton) step on the loss, using each point's gradient and its curvature (Hessian):
- — the leaf's optimal prediction, replacing "mean of residuals."
- — point 's gradient of the loss with respect to the current prediction; for squared error, .
- — point 's Hessian (second derivative) of the loss — how sharply the loss curves at the current prediction.
- — an L2 regularization strength penalizing large leaf values directly.
- Squared error's Hessian is a constant, which is why GBM could skip it
For squared-error loss, for every point, always. At that makes mean of residuals — exactly plain gradient boosting's leaf value. Newton boosting doesn't replace GBM here; it generalizes it.
- Regularization shrinks every leaf toward zero, not just the extreme ones
Increasing grows the denominator for every leaf, pulling toward 0 regardless of how large is — a direct brake on how far any single leaf is allowed to move the prediction.
- Histogram binning speeds up finding the split, without changing what's optimized
LightGBM (and XGBoost's histogram mode) bucket each feature into a fixed number of bins before searching for the best split, trading a small amount of split precision for a search that's proportional to the number of bins instead of the number of distinct values — the leaf-value formula above is unaffected.
Both and a toy per-point Hessian are live. Raising either one shrinks the leaf values — a real curvature signal and an artificial regularization penalty end up looking identical in the formula, which is exactly the point: and enter the denominator the same way.
Reusing last chapter's round 2 exactly: splitting at gives a left leaf of 4 points with gradients and a right leaf of 1 point with .
- Left leaf: G = 3, H = 4 (at hessian=1)
. With : — identical to plain GBM's leaf value.
- Add regularization: lambda = 1
— a smaller step than before, exactly as is supposed to do.
- Add curvature: toy Hessian = 2 per point
Now .
- At : .
- At : .
- The right leaf shrinks the same way
, and for whatever the per-point Hessian is:
- : (matches GBM)
- :
- : , so
Round 2’s left leaf has G = 3 over 4 points. With λ = 1 and a toy Hessian of 2 per point, compute w* = −G / (H + λ).
Plain gradient boosting's "fit the mean of the residuals" was never a separate idea from this — it's the special case where is always 1 and is 0. Making the Hessian and the regularizer explicit is what lets a modern booster take a smaller, more careful step exactly where the loss is curving sharply or a leaf is trying to move too far, instead of taking the same size step everywhere.