Quant Memo
Core

Forward Stagewise Additive Modelling

Build a strong model one small, greedy piece at a time — fit a weak model, see what it still gets wrong, fit another weak model to just that leftover error, and repeat — which is the shared skeleton underneath both boosting and simple additive forecasting.

Prerequisites: Decision Trees and CART

Fitting one flexible, powerful model to a hard prediction problem often means fighting overfitting the entire way — the more the model can bend to fit the training data, the more it risks bending around noise. Forward stagewise additive modelling takes a different route: instead of one powerful model, build a sum of many deliberately weak, simple models, adding them one at a time, where each new piece is fit specifically to whatever the sum-so-far still gets wrong.

The analogy: sculpting with small corrections

A sculptor working from a rough block doesn't carve the final form in one confident pass. She makes a first rough cut, steps back, looks at where the shape is still off, and makes a small correction targeted exactly at that remaining error. Then she steps back again and corrects what's still off after that correction. Each individual cut is simple and could never produce the final sculpture alone, but the accumulated sequence of small, targeted corrections converges on something far more refined than any single bold cut could achieve — and crucially, each cut only has to fix what's still wrong, not solve the whole problem at once.

The procedure

Start with an initial simple model, often just the target's average, F0(x)=yˉF_0(x) = \bar{y}. At each stage mm, fit a new weak learner hm(x)h_m(x) (commonly a shallow decision tree) to whatever the current model still gets wrong, then add it in, usually scaled down by a small learning rate ν\nu:

Fm(x)=Fm1(x)+νhm(x)F_m(x) = F_{m-1}(x) + \nu \cdot h_m(x)

In words: the model after stage mm is just the model after stage m1m-1 plus a small, freshly fit correction. What "still gets wrong" means depends on the loss function — for squared-error regression it's literally the residual yiFm1(xi)y_i - F_{m-1}(x_i), so each new weak learner is fit directly to predict the leftover error of everything fit before it. The learning rate ν\nu (typically small, like 0.05 to 0.1) deliberately slows the process down: each individual correction is kept modest so the model doesn't overreact to any one stage's fit, which is itself a form of regularization — many small, cautious steps generalise better than a few large, confident ones.

Worked example: three stages of boosting a tiny dataset by hand

Four training points with target values y=10,14,9,17y = 10, 14, 9, 17. Start with F0(x)=yˉ=(10+14+9+17)/4=12.5F_0(x) = \bar{y} = (10+14+9+17)/4 = 12.5 for every point.

Stage 1 residuals: 1012.5=2.510-12.5=-2.5, 1412.5=1.514-12.5=1.5, 912.5=3.59-12.5=-3.5, 1712.5=4.517-12.5=4.5. Fit a simple weak learner h1h_1 to these residuals — suppose it captures a rough pattern and predicts {2,1,3,4}\{-2, 1, -3, 4\} for the four points (not exact, since it's deliberately weak). With learning rate ν=0.5\nu = 0.5: F1=F0+0.5h1={12.51.0, 12.5+0.5, 12.51.5, 12.5+2.0}={11.5,13.0,11.0,14.5}F_1 = F_0 + 0.5 h_1 = \{12.5{-}1.0,\ 12.5{+}0.5,\ 12.5{-}1.5,\ 12.5{+}2.0\} = \{11.5, 13.0, 11.0, 14.5\}.

Stage 2 residuals: 1011.5=1.510{-}11.5={-}1.5, 1413.0=1.014{-}13.0=1.0, 911.0=2.09{-}11.0={-}2.0, 1714.5=2.517{-}14.5=2.5 — smaller in magnitude than stage 1's residuals across the board, confirming the model is converging. Suppose h2h_2 predicts {1,1,2,2}\{-1, 1, -2, 2\}. Then F2=F1+0.5h2={11.0,13.5,10.0,15.5}F_2 = F_1 + 0.5h_2 = \{11.0, 13.5, 10.0, 15.5\}.

Stage 3 residuals: 1011.0=1.010{-}11.0={-}1.0, 1413.5=0.514{-}13.5=0.5, 910.0=1.09{-}10.0={-}1.0, 1715.5=1.517{-}15.5=1.5 — smaller again. After just three small, individually crude stages, the model has moved from a flat 12.512.5 for every point to {11.0,13.5,10.0,15.5}\{11.0, 13.5, 10.0, 15.5\}, tracking the true targets {10,14,9,17}\{10, 14, 9, 17\} noticeably more closely, purely by repeatedly correcting leftover error.

target: 17 F0=12.5 F1=14.5 F2=15.5
One point's prediction climbing toward its true target of 17 over successive stages, each stage correcting only what's still left over from the last.

What this means in practice

This exact scheme, with squared-error loss and shallow trees as the weak learner, is the skeleton underneath modern gradient boosting machines like XGBoost and LightGBM — the "gradient" in gradient boosting comes from generalising "fit the residual" to "fit the negative gradient of an arbitrary loss function," which extends the same additive-correction idea to classification, ranking, and quantile losses (see Gradient Boosting as Functional Gradient Descent for that generalisation). Two practical knobs fall directly out of the mechanism: the learning rate trades convergence speed for robustness (smaller ν\nu needs more stages but generalises better), and the number of stages is a direct overfitting control — too few and the model underfits, too many and, since each weak learner is fit to whatever residual is left including noise, the model eventually starts correcting toward noise rather than signal, which is exactly why boosted models are almost always trained with early stopping on a validation set rather than a fixed stage count.

Forward stagewise fitting builds a strong model by chaining many weak, targeted corrections rather than fitting one flexible model all at once — and because each stage is small, deliberately imperfect, and can be stopped early, the process gives you a natural, built-in dial for controlling overfitting.

The word "forward" matters as much as "stagewise": once a stage is fit and added, earlier stages are never revisited or adjusted, unlike some other additive schemes that re-optimise every term jointly after each addition. That greediness is a deliberate simplification — it makes each stage cheap to fit and keeps the overall procedure tractable even with thousands of stages — but it also means an early stage's mistake is never directly corrected, only compensated for by later stages fitting around it. In practice this rarely matters much, because each individual stage is weak enough that no single one commits the model to a bad path it can't be nudged out of later.

Related concepts

Practice in interviews

Further reading

  • Hastie, Tibshirani & Friedman, The Elements of Statistical Learning, ch. 10
  • Friedman, Greedy Function Approximation: A Gradient Boosting Machine
ShareTwitterLinkedIn