What effect does the L1 alpha penalty on leaf weights have in XGBoost?

Quick Overview

Asks how the L1 alpha penalty in XGBoost changes leaf weights and split gain, and how it differs from the L2 lambda penalty. Tests whether you can derive the regularized leaf weight and reason about sparsity, feature selection and tuning against the gradient scale.

What effect does the L1 alpha penalty on leaf weights have in XGBoost?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

XGBoost can penalize leaf weights with an L1 term (`alpha`, also exposed as `reg_alpha`) in addition to the L2 term (`lambda`). What effect does the L1 `alpha` penalty on leaf weights have in XGBoost? ```hint Start from the leaf objective Write the second-order objective for a single leaf weight $w$ using the leaf's gradient sum $G$ and Hessian sum $H$, add $\alpha |w|$, and find the minimizer. ``` ```hint Look near zero Compare how $|w|$ and $w^2$ behave close to $w = 0$, and ask what that means for a leaf whose gradient sum is small. ``` ### What a Strong Answer Covers - The regularized leaf weight with the L1 term, and the condition under which a leaf outputs exactly zero. - How `alpha` changes the split gain and therefore which splits survive. - How `alpha` differs from the L2 `lambda` penalty. - Whether `alpha` performs feature selection with tree boosters, and how that differs under `gblinear`. - When it is worth tuning and which settings and data properties it interacts with. ### Follow-up Questions - `alpha` and `gamma` can both stop a split from being made. How do they differ in what they penalize? - Why does the same `alpha` value matter less for leaves that contain many rows, and what does that imply when the training set grows? - With `booster='gblinear'`, what does `alpha` do to the model, and why does it produce sparsity there? - If you switch the loss from squared error to logistic loss, why might a previously tuned `alpha` stop working well?

Overview: Asks how the L1 alpha penalty in XGBoost changes leaf weights and split gain, and how it differs from the L2 lambda penalty. Tests whether you can derive the regularized leaf weight and reason about sparsity, feature selection and tuning against the gradient scale.

PracHub logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

XGBoost can penalize leaf weights with an L1 term (alpha, also exposed as reg_alpha) in addition to the L2 term (lambda). What effect does the L1 alpha penalty on leaf weights have in XGBoost?

What a Strong Answer Covers Guidance

  • The regularized leaf weight with the L1 term, and the condition under which a leaf outputs exactly zero.
  • How alpha changes the split gain and therefore which splits survive.
  • How alpha differs from the L2 lambda penalty.
  • Whether alpha performs feature selection with tree boosters, and how that differs under gblinear .
  • When it is worth tuning and which settings and data properties it interacts with.

Follow-up Questions Guidance

  • alpha and gamma can both stop a split from being made. How do they differ in what they penalize?
  • Why does the same alpha value matter less for leaves that contain many rows, and what does that imply when the training set grows?
  • With booster='gblinear' , what does alpha do to the model, and why does it produce sparsity there?
  • If you switch the loss from squared error to logistic loss, why might a previously tuned alpha stop working well?