ML Systems Lab Open interactive version →
Advanced 35 min read upliftCATEcausal MLtreatment effectmeta-learner

Uplift Modeling

S-learner, T-learner, X-learner, R-learner — heterogeneous treatment effects and targeting

A marketing team has a $1M budget for promotional emails. They can send to 1M users, but only 200K will benefit from the discount — people who would not have purchased without it. Sending to users who would purchase anyway wastes the discount cost. Sending to users who actively dislike being contacted is counterproductive. A simple propensity-to-purchase model predicts who will buy — but that is not uplift. Uplift is: who changes their behavior because of the treatment?

Four user types define the targeting problem. Persuadables will buy with treatment and not without — your target. Sure Things will buy regardless — wasting budget on them yields zero incremental revenue. Lost Causes will not buy regardless. Sleeping Dogs will buy without treatment but not with it — negative uplift, worse than doing nothing. A model maximizing purchase propensity concentrates budget on Sure Things. An uplift model maximizes incremental effect.

Uplift estimation targets τ(x) = E[Y(1) − Y(0) | X = x] — the Conditional Average Treatment Effect (CATE). You cannot observe τ(x) directly because you never observe both Y(1) and Y(0) for the same person. Meta-learners estimate it from RCT data. Two-model (T-learner): fit Y ~ X separately for treated and control, subtract predictions. S-learner: include T as a feature, fit one model. X-learner: imputes individual treatment effects and then builds a CATE model by borrowing strength across groups — better for imbalanced treatment/control splits. R-learner: fit nuisance models m(x) = E[Y|X] and e(x) = P(T=1|X) on one data fold, then solve Y − m(X) = τ(X)(T − e(X)) + ε by regressing the outcome residual on the treatment residual on a held-out fold (cross-fitting). This residual-on-residual step is what makes it orthogonalized: Neyman orthogonality means the loss's gradient with respect to τ vanishes at the true m and e, so small errors in the nuisance models don't bias τ̂ to first order — R-learner is often preferred when nuisance estimation is noisy or hard, such as with imbalanced treatment/control splits. Causal forests: non-parametric CATE estimator with valid confidence intervals.

Worked T-learner example: suppose the RCT gives a high-spend segment a treated purchase rate μ̂₁ = 0.52 and control rate μ̂₀ = 0.48, so τ̂(high-spend) = 0.52 − 0.48 = 0.04. A low-spend segment gives μ̂₁ = 0.31 and μ̂₀ = 0.09, so τ̂(low-spend) = 0.31 − 0.09 = 0.22 — 5.5× the incremental lift of the high-spend segment, even though its raw purchase rate (0.31) is lower than high-spend's (0.52). A response model, which ranks purely on μ̂₁, would rank high-spend above low-spend and get the targeting backwards; the T-learner's subtraction recovers the correct ranking.

Evaluation: Qini curves rank users by predicted uplift descending. At each percentile of targeted users, compute cumulative incremental outcome in the treatment arm versus the control arm of a held-out RCT split — because both arms are real, this is a direct measurement of incremental effect, not merely a ranking-quality proxy. Summing that gap across percentile bins gives the AUUC; when treatment and control groups are equal-sized this equals the plain unnormalized uplift-curve area, but a genuine Qini curve additionally rescales the control arm's cumulative outcome by the treatment/control size ratio, so the two areas diverge once the groups are imbalanced. What one offline Qini curve does NOT catch: tuning a model repeatedly against the same historical RCT split can overfit to that split's noise, and a historical split can miss distribution shift after deployment (new users, new season, a competitor's promo). A fresh, post-deployment no-contact holdout — held out from all tuning — is what catches those two failure modes; it is not required because offline Qini fails to measure real treatment effect, which it does measure when built from a genuine RCT split.

What a response model is not: an uplift model. A response model predicts P(purchase) — dominated by Sure Things. An uplift model predicts P(purchase | treatment) − P(purchase | no treatment) — targets Persuadables. These are orthogonal quantities. Deploying a response model as an uplift model wastes marketing budget and misses the actual causal effect of the treatment.

Key points

Takeaway

A response model finds likely converters; an uplift model finds people who convert because of the treatment — these are orthogonal, and targeting the first group wastes budget on Sure Things and backfires on Sleeping Dogs.

Recap

Check your understanding

Q1. Your response model targets customers with highest predicted purchase probability. Select the two true statements about why this can be suboptimal.

Q2. You have RCT dataset with 100,000 control users and 10,000 treated users. You want to estimate CATE. Which meta-learner and why?

Q3. After training X-learner for marketing targeting, how would you evaluate whether CATE estimates are actually measuring causal heterogeneity vs spurious correlation?

Q4. What is the R-learner and why does 'orthogonalisation' matter for CATE estimation?

Q5. You estimate CATE using X-learner on observational data (no RCT). A colleague argues the estimates cannot be trusted. Who is right?

Try it interactively

ML Systems Lab is a free interview-prep platform for ML engineers — work through the full interactive module, quizzes, and drills.

Open ML Systems Lab →