CUPED

Also known as: Controlled-experiment using pre-experiment data

On this page 7

CUPED, short for Controlled-experiment using pre-experiment data, is a variance reduction technique for randomized online experiments that adjusts each user’s outcome metric with a covariate measured before the experiment started. In experimentation, it lets a team reach the same statistical power with a smaller sample or a shorter test, without changing what the experiment estimates.

The method was introduced for large-scale web A/B testing in 2013 and has since become a standard feature of experimentation platforms. Its core insight is simple: much of the noise in a metric such as revenue per user is explained by how users behaved before the test, and that pre-period behavior cannot have been influenced by the treatment.

How CUPED adjusts the outcome metric

CUPED replaces the observed metric Y with an adjusted metric Y_cuped = Y - θ(X - mean(X)), where X is the pre-experiment covariate for the same user. The coefficient θ equals cov(X, Y) / var(X), the slope of an ordinary least squares regression of Y on X, estimated on pooled data from all experiment groups.

Because X is measured before randomization, its expected value is identical in the control group and the treatment group. Subtracting a centered X therefore leaves the treatment effect estimate unbiased while removing the portion of variance that X explains. The variance of the adjusted metric equals var(Y)(1 – ρ²), where ρ is the correlation between X and Y.

The following table shows how the correlation between covariate and metric translates into variance reduction and sample savings.

Correlation ρRemaining varianceSample needed for equal power
0.391 percentAbout 91 percent
0.575 percentAbout 75 percent
0.751 percentAbout half
0.919 percentAbout one fifth
Effect of covariate correlation on required sample size

Since required sample size is proportional to variance, a correlation of 0.7 roughly halves the users or days needed to detect the same minimum detectable effect.

Choosing a good pre-experiment covariate

The quality of CUPED depends almost entirely on the choice of covariate. The best covariate is usually the same metric measured over a pre-period, for example sessions per user in the two weeks before the test when the outcome is sessions per user during the test.

CovariateTypical correlationMain limitation
Same metric, pre-periodHigh for engaged usersMissing for new users
Related metric, pre-periodModerateWeaker reduction
User attributes such as tenureLow to moderateExplains little short-term variance
Model prediction of the outcomeOften highestMore complex to build and validate
Common covariate options and their behavior

The covariate must be unaffected by the treatment. Any variable collected after exposure, even a few minutes later, can absorb part of the true effect and bias the estimate. A pre-period of one to four weeks is typical; longer windows add stability but may describe user behavior that has since changed.

New users without history are a frequent complication. A common practice sets their covariate to a constant, often zero, and includes an indicator for missing history, which keeps them in the analysis while letting returning users contribute most of the reduction.

CUPED compared with other variance reduction methods

CUPED is one member of a broader family of regression adjustment methods. It is mathematically close to analysis of covariance, and with a single covariate the two give essentially the same estimate.

MethodCore ideaStrengthWeakness
CUPEDSubtract scaled pre-period covariateSimple and unbiasedNeeds user history
StratificationAnalyze within pre-defined segmentsIntuitiveCoarse use of information
ANCOVA regressionInclude covariates and treatment in a modelHandles several covariatesRequires model diagnostics
CUPACUse a machine learning prediction as covariateHigher correlationPipeline complexity
Difference-in-differencesCompare pre and post changesUseful without randomizationRelies on parallel trends
CUPED and related approaches

Unlike difference-in-differences, CUPED requires proper randomization and does not attempt to correct for confounding. It is a precision tool, not a substitute for a valid experimental design.

Applying CUPED in an experimentation workflow

In practice, CUPED is applied at analysis time, so it does not change randomization, assignment or traffic allocation. Teams should still plan sample size with the expected reduction in mind, because underestimating the correlation leads to tests that run longer than necessary.

  1. Define the outcome metric and the pre-period window before the experiment starts.
  2. Compute X for every assigned user, including a rule for users without history.
  3. Estimate θ on pooled data from all groups, not separately per group.
  4. Calculate adjusted metrics and run the usual t-test or confidence interval on them.
  5. Report both raw and adjusted estimates to confirm they point in the same direction.

For ratio metrics such as click-through rate, the adjustment is combined with the delta method so that the variance estimate stays correct when the analysis unit differs from the randomization unit.

Limitations and common mistakes

CUPED is robust when applied correctly, but several errors appear repeatedly in production experimentation platforms. The table below lists the most frequent ones with their causes and fixes.

SymptomLikely causeFix
Biased effect estimateCovariate measured after exposureUse only pre-assignment data
Little or no reductionWeak correlation or short historyUse the same metric over a longer window
Inflated false positivesθ estimated separately per groupEstimate θ on pooled data
Distorted ratio metricsNaive per-user adjustmentApply the delta method
Typical CUPED errors and remedies

CUPED also cannot fix sample ratio mismatch, novelty effects or peeking. It reduces random noise, but it does not repair a flawed design, and adjusted results should never be selected after comparing them with raw results to obtain significance.

A non-technical view

When a company tests a new website design, user behavior is naturally very uneven: some people buy often and some rarely. That unevenness hides small improvements. CUPED uses what each person did before the test to account for those natural differences.

Imagine comparing two fertilizers on plants that started at different heights. Measuring growth instead of final height makes the comparison much clearer. CUPED works the same way, so the company can reach a reliable answer faster and with fewer visitors.

A concrete example

An online grocery service wants to test a redesigned checkout page and measures orders per user over 14 days. Without adjustment, the power analysis says the test needs about 400,000 users to detect a 1 percent lift, which would take nearly four weeks of traffic.

The analysts use each user’s order count from the 28 days before assignment as the covariate. The correlation with the in-test metric is about 0.65, which removes roughly 42 percent of the variance. The same lift becomes detectable with around 230,000 users, so the test finishes in about two weeks and the team ships the winning checkout two weeks earlier.