Enhancing External Validity of Experiments with Ongoing Sampling

Chen Wang, Shichao Han, Shan HuangarXiv 2025 · DOI

Abstract

Participants in online experiments often enroll over time, which can compromise sample representativeness due to temporal shifts in covariates. This issue is particularly critical in A/B tests, online controlled experiments extensively used to evaluate product updates, since these tests are cost-sensitive and typically short in duration. We propose a novel framework that dynamically assesses sample representativeness by dividing the ongoing sampling process into three stages. We then develop stage-specific estimators for Population Average Treatment Effects (PATE), ensuring that experimental results remain generalizable across varying experiment durations. Leveraging survival analysis, we develop a heuristic function that identifies these stages without requiring prior knowledge of population or sample characteristics, thereby keeping implementation costs low. Our approach bridges the gap between experimental findings and real-world applicability, enabling product decisions to be based on evidence that accurately represents the broader target population.

Introduction

In traditional scientific research, participants are typically recruited as a fixed sample upfront. However, modern online A/B testing operates under "ongoing sampling," where users enter the experiment at different times as they interact with a platform. This temporal aspect introduces a significant challenge: early participants (often "heavy users") are rarely representative of the broader population.

If a product manager concludes an experiment prematurely based on these early arrivals, the results may suffer from poor external validity. A feature that appears successful among highly active users might fail when rolled out to the general user base. This paper introduces a framework to dynamically assess and correct for these biases, allowing for faster, more reliable decision-making.

Methodology: The Three-Stage Framework

The proposed framework divides the ongoing sampling process into three distinct stages based on sample representativeness. To identify these stages efficiently, the authors utilize Survival Analysis, repurposing models like Kaplan-Meier and Cox Proportional Hazards to estimate the "time until participation" for various user segments.

  1. Unstable Stage: In the earliest days, the sample is too small and skewed. The framework advises against making any inferences here.
  2. Overlapping Stage: Once the sample covers a sufficient range of the population's covariate space, the authors apply an Inverse Probability Weighting (IPW) estimator. This uses the survival model to re-weight data, correcting for the underrepresentation of certain user types.
  3. Representative Stage: As the sample naturally converges to mirror the population, the bias becomes mathematically negligible. At this point, practitioners can revert to the standard Difference-in-Means (DIM) estimator.

Experimental Evaluation

The framework was validated using synthetic data, a large-scale platform-wide analysis of 600 WeChat experiments, and a specific real-world case study.

In the synthetic trials, the IPW estimator achieved a Mean Squared Error (MSE) of $2.637 \times 10^{-4}$, significantly outperforming the standard DIM estimator ($1.312 \times 10^{-3}$) during the overlapping stage. In the platform-wide test, the framework increased the True Positive Rate (TPR) by up to 56% and reduced the False Positive Rate (FPR) by up to 29% compared to traditional power-analysis methods.

Average Treatment Effect over time in a WeChat experiment, showing initial bias and eventual stabilization.

The case study of a WeChat recommendation algorithm (illustrated in the figure above) highlights the practical impact. The unadjusted data showed a massive "false positive" effect on day 2 due to heavy-user bias. By applying the proposed framework, the team could identify the true, non-significant outcome much earlier than waiting for the sample to stabilize naturally.

Discussion and Future Directions

The core insight is that time is a hidden confounder in online experiments. Experimenters are not just accumulating more data over time; they are accumulating different data. Survival analysis provides a computationally efficient "white-box" approach to monitoring this shift.

While powerful, the framework currently relies on observable covariates. Future work could integrate deep learning-based survival analysis to handle high-dimensional, sparse data and further refine the heuristic thresholds used to transition between stages. This approach bridges the gap between rapid product iteration and the statistical rigor required for global rollouts.

Summary updated

BibTeX
@misc{wang2025enhancing,
  author = {Chen Wang and Shichao Han and Shan Huang},
  title = {{Enhancing External Validity of Experiments with Ongoing Sampling}},
  year = {2025},
  eprint = {2502.18253},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.18253},
  howpublished = {arXiv},
}
Figure