Boosting as Gradient Descent in Function Space
1. Which weak learner $h \in \mathcal{H}$ should we add next?
Given the current ensemble $H(x) = \sum_{t=1}^{T} \alpha_t h_t(x)$ and any differentiable, convex loss $\mathcal{L}$, we want to choose the next weak learner $h \in \mathcal{H}$ (with small step size $\alpha > 0$) that minimizes the updated loss:
2. First-order Taylor expansion $\implies$ inner product $\bigl\langle \frac{\partial \mathcal{L}}{\partial H},\, \alpha h \bigr\rangle$
Expand $\mathcal{L}(H + \alpha h)$ around $H$ using a first-order Taylor expansion:
Because $\mathcal{L}(H)$ is constant with respect to the candidate function $h$, dropping it turns the optimization into minimizing the inner product between the gradient $\frac{\partial \mathcal{L}}{\partial H}$ and $h$ across all $n$ training points:
3. Why the negative gradient (residual) minimizes the inner product
For a fixed vector $a$, the dot product $a \cdot b$ (with fixed length $\|b\|$) is minimized when $b$ points in the exact opposite direction, $b = -a$. Therefore, the unconstrained function value $h(x_i)$ that minimizes $\left\langle \frac{\partial \mathcal{L}}{\partial H(x_i)},\, \alpha h(x_i) \right\rangle$ is the negative gradient:
For squared loss $\mathcal{L} = \frac{1}{2}\sum_{i=1}^{n} \bigl(H(x_i) - y_i\bigr)^2$, the gradient with respect to $H(x_i)$ is $\frac{\partial \mathcal{L}}{\partial H(x_i)} = H(x_i) - y_i$, giving the ordinary residual:
4. Completing the square: from inner product to least-squares CART fit
When $h \in \mathcal{H}$ is restricted to a family of shallow regression trees (CART of limited depth), it cannot match $-\frac{\partial \mathcal{L}}{\partial H(x_i)}$ at every point independently. Write the gradient as $r_i = \frac{\partial \mathcal{L}}{\partial H(x_i)}$ and the negative gradient (pseudo-residual) as $t_i = -r_i = -\frac{\partial \mathcal{L}}{\partial H(x_i)}$:
Now normalize (bound) $h$ on the training set so $\sum_{i=1}^{n} h(x_i)^2 = c$ is constant, and note that $t_i = -\frac{\partial \mathcal{L}}{\partial H(x_i)}$ is independent of $h$ so $\sum_{i=1}^{n} t_i^2$ is also constant with respect to $h$. Adding both constants inside the $\arg\min$ completes the square:
This gives the general boosting algorithm for any differentiable loss $\mathcal{L}$: