Why is the pseudo-residual identical to the ordinary residual only for squared error loss?

Quick Overview

Asks why a gradient boosting pseudo-residual matches the ordinary residual only under squared error loss. Tests the negative-gradient definition, an argument that no other loss gives the same signal, and what pseudo-residuals look like for absolute, Huber and log loss.

Why is the pseudo-residual identical to the ordinary residual only for squared error loss?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

In gradient boosting, each new tree is fit to pseudo-residuals. Why is the pseudo-residual identical to the ordinary residual only for squared error loss? ```hint Work backward from the derivative Suppose some loss had negative derivative $y - F$ with respect to $F$ for every $y$ and $F$. Integrate and see what that loss has to be. ``` ```hint Check a classifier Under log loss the model outputs log-odds. Take a positive example whose log-odds are already above 1 and compare the sign of $y - F$ with the sign of the negative gradient. ``` ### What a Strong Answer Covers - The definition of the pseudo-residual as the negative derivative of the loss with respect to the prediction - The squared-error computation, including what the constant factor does - An argument that no other loss gives exactly $y - F$ - The pseudo-residuals of other common losses, including the log-loss case where the target and the model output are on different scales - Why the general rule is to fit the negative gradient ### Follow-up Questions - For which losses is the pseudo-residual "target minus predicted mean", even though it is not $y - F$? - What would go wrong if you fit trees to $y - F$ while training a binary classifier on log loss? - Huber's pseudo-residual equals $y - F$ for small errors. When does Huber boosting behave like squared-error boosting, and when does it differ?

Overview: Asks why a gradient boosting pseudo-residual matches the ordinary residual only under squared error loss. Tests the negative-gradient definition, an argument that no other loss gives the same signal, and what pseudo-residuals look like for absolute, Huber and log loss.

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

In gradient boosting, each new tree is fit to pseudo-residuals. Why is the pseudo-residual identical to the ordinary residual only for squared error loss?

What a Strong Answer Covers Guidance

  • The definition of the pseudo-residual as the negative derivative of the loss with respect to the prediction
  • The squared-error computation, including what the constant factor does
  • An argument that no other loss gives exactly y−Fy - F
  • The pseudo-residuals of other common losses, including the log-loss case where the target and the model output are on different scales
  • Why the general rule is to fit the negative gradient

Follow-up Questions Guidance

  • For which losses is the pseudo-residual "target minus predicted mean", even though it is not y−Fy - F ?
  • What would go wrong if you fit trees to y−Fy - F while training a binary classifier on log loss?
  • Huber's pseudo-residual equals y−Fy - F for small errors. When does Huber boosting behave like squared-error boosting, and when does it differ?