Machine Learning for Variance Reduction in Online Experiments

Yongyi Guo, Dominic Coey, Mikael Konutgan, Wenting Li, Chris Schoener, Matt Goldman

In the landscape of online platforms, A/B tests—or randomized controlled trials—are the gold standard for evaluating new features and algorithms. However, even with millions of active users, these experiments face a fundamental statistical hurdle: variance. When outcome metrics like "time spent" or "revenue" are naturally noisy or heavy-tailed, detecting small but meaningful improvements requires running experiments for extended periods or across massive user cohorts.

Presented at NeurIPS 2021 by researchers from Princeton and Facebook, a novel framework called MLRATE (Machine Learning Regression-Adjusted Treatment Effect) offers a robust solution. By leveraging machine learning to predict experiment outcomes from pre-existing user data, MLRATE effectively "denoises" results, providing massive variance reduction while mathematically guaranteeing it will perform no worse than standard statistical methods.

The Limitations of Traditional Adjustment

To compensate for high variance, practitioners often use variance reduction techniques like CUPED, which typically adjust for a single variable—most commonly, the user's pre-experiment behavior for the specific metric being tested. While effective, this univariate approach leaves significant efficiency on the table. The challenge lies in safely utilizing hundreds of different covariates and complex, non-linear machine learning models to reduce noise without introducing statistical bias or overfitting to the experimental data.

The MLRATE Methodology

To solve this, the authors introduce a two-stage estimator that isolates the machine learning prediction from the treatment effect calculation:

  1. The ML Prediction Stage (via Cross-Fitting): Instead of training a single model on the entire dataset, MLRATE employs cross-fitting. The data is split into $K$ folds. To generate a prediction for a user in Fold 1, the system uses a model trained exclusively on Folds 2 through $K$. This ensures that the prediction for any given user is strictly independent of their actual treatment assignment, a critical requirement for avoiding bias.
  2. The Linear Calibration Stage: Rather than simply subtracting the ML prediction from the observed outcome, MLRATE uses the prediction as a covariate in a final Ordinary Least Squares (OLS) regression.

This second step acts as a safety valve. By calibrating the ML prediction within a linear model, the estimator becomes "agnostic" to the model's quality. If the ML model is highly accurate, the variance of the treatment effect estimate drops significantly. If the model is completely inaccurate (uncorrelated with the outcome), the regression coefficient naturally approaches zero, and the estimator seamlessly reverts to a standard unadjusted A/B test comparison.

Empirical Validation and Key Results

The researchers validated MLRATE using both complex non-linear simulations and real-world data from Facebook. The Facebook dataset included 48 different outcome metrics from A/A tests (simulated experiments with no actual treatment applied) involving approximately 400,000 users.

Confidence Interval (CI) Coverage and Relative CI Width comparing MLRATE methods to unadjusted estimates.

The results demonstrated substantial efficiency gains without compromising statistical validity:

  • Massive Variance Reduction: On average, MLRATE reduced variance by over 70% compared to a simple difference-in-means estimator. As shown in the table above, MLRATE using Gradient Boosted Decision Trees (GBDT) achieved a relative confidence interval width of just 0.62 compared to the unadjusted baseline, while maintaining the target 95% coverage.
  • Outperforming Industry Standards: Compared to "LinInteract," a common univariate regression adjustment technique, MLRATE provided an additional 19% reduction in variance.
Performance comparison of MLRATE against LinInteract across various metrics.
  • Sample Size Efficiency: The practical implications for experiment velocity are profound. To achieve the same statistical power as MLRATE, a standard unadjusted experiment would need to be 5.44 times larger. Even an experiment using standard univariate adjustment would require 1.56 times more users.

Key Insights and Future Directions

A primary advantage of MLRATE is its "No Harm" Guarantee. The authors prove that the estimator is asymptotically normal and consistent, guaranteeing a variance no larger than standard methods. Furthermore, the framework exhibits Model Agnosticism; practitioners do not need perfectly tuned, state-of-the-art models to see benefits. Relatively simple algorithms like GBDT or Elastic Net provide massive gains out-of-the-box.

However, the method does come with trade-offs. The cross-fitting process requires training multiple models per experiment, increasing computational overhead. Additionally, because MLRATE relies heavily on pre-experiment covariates, it is less effective for brand-new users who lack historical data.

Future work may explore using more sophisticated architectures, such as deep recurrent neural networks or transfer learning across different metrics, to drive variance even lower. There is also potential in leveraging contemporaneous data from users outside the experiment to further refine predictions, pushing the boundaries of online experimentation efficiency.

Summary updated

BibTeX
@inproceedings{guo2021machine,
  author = {Yongyi Guo and Dominic Coey and Mikael Konutgan and Wenting Li and Chris Schoener and Matt Goldman},
  title = {{Machine Learning for Variance Reduction in Online Experiments}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=w5fW0TNWPyc},
}
Figure