Introduction
In randomized controlled trials and A/B tests, ensuring "covariate balance"—where treatment and control groups share similar baseline characteristics (e.g., age, location, past behavior)—is crucial. Balancing covariates reduces the variance of estimated treatment effects, enabling researchers to detect smaller effects with the same sample size.
However, traditional balancing methods like blocking or the Gram-Schmidt Walk are typically offline. They require knowing all participants' characteristics before assigning anyone, or they demand polynomial compute time. This is a dealbreaker for online experiments, such as web A/B testing, where users arrive sequentially and must be assigned a treatment instantly. Slow assignment algorithms cause latency, leading to user drop-off and biased results.
To address this, the authors introduce the Balancing Walk Design (BWD), a linear-time algorithm for covariate-balanced experimental design in online settings. BWD significantly reduces the variance of causal estimates while maintaining robustness against adversarial arrivals, and it seamlessly supports multiple treatments and non-uniform assignment probabilities.
Methods: The Balancing Walk Design
BWD builds on recent advances in online discrepancy minimization. Instead of simple coin flips (Bernoulli randomization), BWD assigns treatments sequentially by evaluating the current state of imbalance. When a new user arrives, the algorithm calculates an assignment probability based on the inner product of the new user's covariates and a running sum of prior observations. If assigning a user to the treatment group would worsen overall imbalance, the algorithm skews the probability toward the control group, and vice versa.
The authors introduce several practical extensions to adapt this for real-world experiments:
- The $\phi$ Tuning Parameter: A parameter $\phi \in (0,1)$ explicitly controls the tradeoff between pure covariate balance and robustness (randomization).
- Arbitrary Marginal Probabilities: The underlying math is generalized to support non-uniform treatment splits (e.g., an 80/20 split instead of 50/50).
- Multiple Treatments: The binary treatment algorithm is extended to handle $k$ treatments by structuring independent two-treatment algorithms into a binary tree. Arriving users are routed down the tree to a specific leaf representing their treatment group.
Key Insights
- Near-Offline Performance in Online Time: BWD achieves covariate balance guarantees within a logarithmic factor of the best-known offline methods, but operates in $O(n)$ time and $O(1)$ space per arrival.
- The Balance vs. Robustness Tradeoff: Optimizing solely for balance creates a vulnerability to accidental bias (e.g., adversarial arrival orders or unobserved confounders). Injecting controlled randomness via the $\phi$ parameter ensures the algorithm's state cannot be perfectly predicted, securing the experiment's validity.
- Implicit Ridge Regression Connection: The worst-case mean squared error of this online design is mathematically upper-bounded by an implicit ridge regression estimator, providing strong theoretical guarantees for the reliability of causal estimates.
Key Results
The paper evaluates BWD using synthetic datasets simulating various Data Generating Processes (DGPs), including standard linear models, non-i.i.d. arrivals (drifting or seasonal covariates), and non-linear models.
Computational Speed
BWD scales linearly. In simulations, it processed assignments for massive sample sizes in fractions of a second. In contrast, offline methods like QuickBlock became computationally prohibitive past $10^4$ samples.
Variance Reduction and Robustness
On linear and near-linear DGPs, BWD drastically reduced the Mean Squared Error (MSE) of the Average Treatment Effect compared to simple randomization. It matched or outperformed offline methods in small sample sizes and maintained its performance even when users did not arrive randomly (e.g., drifting or seasonal covariates).
Flexibility
The algorithm successfully maintained target marginal probabilities (e.g., 10% vs 30% vs 60% splits) and scaled gracefully to dozens of treatment groups without losing its variance-reduction benefits.
Limitations and Future Work
BWD explicitly optimizes for linear covariate balance. If the true relationship between covariates and outcomes is highly non-linear, traditional offline blocking methods still outperform BWD. While non-linearities could theoretically be handled using kernel methods, doing so would sacrifice the strict linear-time computational efficiency that makes BWD ideal for high-throughput online settings.
Summary updated