Problem
X5's online A/B platform runs dozens of experiments at once, each with millions of users and several metrics recalculated daily. Per-user statistics are slow and expensive at this scale. Compressing users into buckets cuts the cost, but the effect must still be estimated per user and not per bucket. It must also work for ratio metrics, any split and CUPED.
Example from the article: average order value (revenue divided by orders) in a simulated experiment of about 1 million users with a 90/10 split. Control: 3000 ₽ revenue and 2 orders per user (1500 ₽ per order). Pilot revenue: 3200 ₽.
Solution in brief
Each experiment keeps 512 cells (256 buckets times two groups) with a numerator sum, a denominator sum and a user count. The delta method linearizes a ratio metric into an additive quantity that sums exactly over cells. A regression with weights on the linearized cell sums reproduces the per-user estimate exactly, and CUPED is one more regressor.
Questions this case answers
- How to compute an unbiased effect estimate and a valid standard error for a ratio metric from a fixed number of aggregated cells instead of per-unit data, under an unequal split
- How to apply pre-period variance reduction when only aggregated sums per cell are stored
- How to compute A/B test results for dozens of parallel experiments without storing and scanning millions of user rows?
- How to estimate the effect of a ratio metric such as average order value from per-bucket aggregates?
Tools and methods
- Hash-based bucketing — assigns each user a group and one of 256 buckets by independent hashes, so every bucket has the experiment's own group proportions
- Delta-method linearization — turns a ratio of sums into an additive per-user quantity
- Weighted least squares (WLS) — weights remove the heteroscedasticity created by summing users within cells
- CUPED — adds the linearized pre-period sum of the same metric as a covariate
Google or a one-time email code. No password.
