Quant Memo
Core

The S-Learner and T-Learner

The two simplest ways to estimate how an individual's outcome would change under a treatment using off-the-shelf machine learning models — one model shared across both treatment groups (S-learner) versus one model trained separately for each (T-learner).

Prerequisites: ATE, ATT and Other Treatment Effect Estimands

Suppose you want to know how much a trading desk's move to a new execution algorithm improved fill quality for each individual order, not just on average — because some order types might benefit a lot and others not at all, and you'd like to route accordingly. You have historical data on orders that did and didn't use the new algorithm, plus features describing each order (size, venue, time of day). The meta-learner framework turns this into an off-the-shelf supervised learning problem, and the S-learner and T-learner are the two simplest ways to set it up.

The idea: predict outcomes under each treatment, then difference them

Both approaches want the same quantity, the individual-level treatment effect given features xx:

τ(x)=E[YX=x,T=1]E[YX=x,T=0]\tau(x) = \mathbb{E}[Y \mid X = x, T = 1] - \mathbb{E}[Y \mid X = x, T = 0]

In plain English: τ(x)\tau(x) is the expected outcome difference between being treated (T=1T=1) and not (T=0T=0) for a unit with features xx — the effect of the new execution algorithm, say, on an order with exactly this size and venue. The two learners differ only in how they estimate the two conditional expectations on the right-hand side.

The S-learner (single model) trains one model μ^(x,t)\hat{\mu}(x, t) on all the data, with the treatment indicator tt folded in as just another input feature alongside xx. To estimate the effect for a given xx, it predicts once with t=1t=1 and once with t=0t=0 and takes the difference: τ^(x)=μ^(x,1)μ^(x,0)\hat{\tau}(x) = \hat{\mu}(x, 1) - \hat{\mu}(x, 0).

The T-learner (two models) instead splits the data by treatment group and trains two entirely separate models — μ^1(x)\hat{\mu}_1(x) on treated units only, μ^0(x)\hat{\mu}_0(x) on untreated units only — then differences their predictions: τ^(x)=μ^1(x)μ^0(x)\hat{\tau}(x) = \hat{\mu}_1(x) - \hat{\mu}_0(x).

Worked example: a small execution-quality dataset

Ten large orders used the new algorithm (treated), ten used the old one (control), each with a "size" feature. Fitting a T-learner means training a model on the ten treated orders alone to predict fill quality from size, and a completely separate model on the ten control orders alone. If the treated-only model predicts a fill quality of 92 for a size-500 order and the control-only model predicts 85 for the same size, the T-learner's estimated effect is τ^(500)=9285=7\hat{\tau}(500) = 92 - 85 = 7. An S-learner instead fits one model on all twenty orders with size and a treatment flag as joint inputs; if that shared model is a tree-based method with modest depth, and treatment barely improves its splits relative to size, it may end up effectively ignoring the treatment flag and predicting almost the same fill quality regardless of tt — understating the effect because the single model, sharing structure across both groups, can end up "regularizing away" a genuine treatment effect it never gets to model with enough dedicated flexibility.

T-learner: two models treated control S-learner: one shared model effect compressed
The T-learner's two independently-fit curves can separate freely; the S-learner's single shared model can end up smoothing the treatment effect toward zero, especially when the treatment signal is weak relative to other features.

What this means in practice

The T-learner is preferred when treatment and control groups plausibly have quite different response surfaces and there's enough data in each group to fit separately; it can suffer, though, when one group is much smaller than the other, since the smaller group's model is trained on less data and becomes noisier. The S-learner is preferred when data is scarce and a shared model can borrow strength across both groups, but it risks the opposite failure — a regularized or low-flexibility model can implicitly treat the treatment indicator as unimportant relative to other features, shrinking real effects toward zero. Neither correctly accounts for confounding on its own; both assume treatment assignment is as good as random once conditioning on the observed features, which is a strong assumption in most financial and trading settings and should be checked before trusting the estimated effects.

The T-learner fits a separate outcome model per treatment group and differences their predictions; the S-learner fits one shared model with treatment as an input feature. T-learners can be noisy with imbalanced groups; S-learners can suppress a real effect when the model under-weights the treatment indicator.

An S-learner built on a regularized or low-flexibility model can silently shrink a genuine treatment effect toward zero if the model finds other features more useful for prediction than the treatment flag — always sanity-check S-learner estimates against a T-learner fit on the same data.

Related concepts

Practice in interviews

Further reading

  • Künzel et al., Metalearners for Estimating Heterogeneous Treatment Effects Using Machine Learning
ShareTwitterLinkedIn