Why must the loss function in standard gradient boosting be differentiable?

Quick Overview

Asks why standard gradient boosting needs a differentiable loss and how non-smooth losses and metrics are handled. Tests understanding of pseudo-residuals, second-order boosting libraries, kinked losses such as absolute error, and training on surrogate objectives.

Why must the loss function in standard gradient boosting be differentiable?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why must the loss function in standard gradient boosting be differentiable? ```hint What the next tree is fit to Write down the target each new tree is trained on, in terms of the loss and the model's current predictions. ``` ```hint Try a loss you cannot train on Plug 0-1 loss into that target and look at what the trees would receive. ``` ### What a Strong Answer Covers - What each boosting round fits and how the loss enters that target. - What second-order implementations need beyond the first derivative. - How losses with a kink, such as absolute or quantile error, are still handled. - Why metrics like accuracy, AUC and F1 cannot be optimized directly, and what is done instead. ### Follow-up Questions - How does XGBoost use gradients and hessians to score a candidate split? - How would you train a boosted model when the metric you care about is AUC or a ranking metric? - What goes wrong if you pass absolute error as a custom objective to a second-order boosting library? - How does Huber loss behave in boosting compared with squared and absolute loss?

Overview: Asks why standard gradient boosting needs a differentiable loss and how non-smooth losses and metrics are handled. Tests understanding of pseudo-residuals, second-order boosting libraries, kinked losses such as absolute error, and training on surrogate objectives.

General logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

Why must the loss function in standard gradient boosting be differentiable?

What a Strong Answer Covers Guidance

  • What each boosting round fits and how the loss enters that target.
  • What second-order implementations need beyond the first derivative.
  • How losses with a kink, such as absolute or quantile error, are still handled.
  • Why metrics like accuracy, AUC and F1 cannot be optimized directly, and what is done instead.

Follow-up Questions Guidance

  • How does XGBoost use gradients and hessians to score a candidate split?
  • How would you train a boosted model when the metric you care about is AUC or a ranking metric?
  • What goes wrong if you pass absolute error as a custom objective to a second-order boosting library?
  • How does Huber loss behave in boosting compared with squared and absolute loss?