What role does the L2 parameter lambda play in the denominator of XGBoost's optimal leaf weight formula?

Quick Overview

Asks what the L2 term lambda does in the denominator of XGBoost's optimal leaf weight formula. Tests the second-order objective behind the formula, how leaf shrinkage depends on hessian mass, numerical stability, and the effect on split gain compared with eta and alpha.

What role does the L2 parameter lambda play in the denominator of XGBoost's optimal leaf weight formula?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

XGBoost sets the optimal weight of a leaf to $w^* = -\frac{G}{H+\lambda}$, where $G$ and $H$ are the sums of the first and second derivatives of the loss over the samples in that leaf. What role does the L2 parameter `lambda` play in the denominator of this formula? ```hint Work a number Keep $G$ fixed and plug in a small and a large $H$, with and without $\lambda$. Compare how much the weight moves in each case. ``` ```hint Follow the term back Ask where the denominator comes from when you minimize the second-order objective for a single leaf, and where else that same quantity shows up in tree building. ``` ### What a Strong Answer Covers - Where the $\lambda$ term in the denominator comes from - How $\lambda$ changes leaf weights and how that depends on the leaf's hessian sum, with a numeric example - What happens to the leaf weight as $H$ approaches zero, with and without $\lambda$ - The effect of $\lambda$ on split gain and how it works alongside `gamma` and `min_child_weight` - How $\lambda$ differs from `eta` and from the L1 term `alpha` ### Follow-up Questions - Derive the split gain formula from the optimal leaf weight and show where $\lambda$ and $\gamma$ enter. - `min_child_weight` and $\lambda$ both protect against tiny leaves. How do they differ in behavior? - Why can a larger $\lambda$ make the model need more boosting rounds, and how is that different from lowering `eta`?

Overview: Asks what the L2 term lambda does in the denominator of XGBoost's optimal leaf weight formula. Tests the second-order objective behind the formula, how leaf shrinkage depends on hessian mass, numerical stability, and the effect on split gain compared with eta and alpha.

Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

XGBoost sets the optimal weight of a leaf to w∗=−GH+λw^* = -\frac{G}{H+\lambda}, where GG and HH are the sums of the first and second derivatives of the loss over the samples in that leaf. What role does the L2 parameter lambda play in the denominator of this formula?

What a Strong Answer Covers Guidance

  • Where the λ\lambda term in the denominator comes from
  • How λ\lambda changes leaf weights and how that depends on the leaf's hessian sum, with a numeric example
  • What happens to the leaf weight as HH approaches zero, with and without λ\lambda
  • The effect of λ\lambda on split gain and how it works alongside gamma and min_child_weight
  • How λ\lambda differs from eta and from the L1 term alpha

Follow-up Questions Guidance

  • Derive the split gain formula from the optimal leaf weight and show where λ\lambda and γ\gamma enter.
  • min_child_weight and λ\lambda both protect against tiny leaves. How do they differ in behavior?
  • Why can a larger λ\lambda make the model need more boosting rounds, and how is that different from lowering eta ?