Introduction
Standard A/B testing frameworks heavily rely on the $t$-test, which assumes that the underlying data follows a normal distribution. While the Central Limit Theorem (CLT) suggests that test statistics eventually converge to a bell curve, this "eventual" convergence often requires sample sizes far exceeding what is practical or even possible in many experimental settings. In the technology sector, metrics such as video uploads, session durations, or user spend are notoriously skewed and "long-tailed." This paper introduces a theoretical framework to determine the precise sample sizes required for $t$-test reliability and proposes an Edgeworth-based correction for smaller datasets.
The Problem: Skewness and Directional Bias
In real-world online platforms, a small fraction of "power users" often dominates key metrics. When combined with unequal traffic allocation (e.g., a 5/95 split for low-risk rollouts), this high skewness distorts the $p$-values generated by standard $t$-tests.
As shown in Figure 1, the distribution of the test statistic $T$ can become highly asymmetric. This leads to "directional bias," where the test might report a false positive in one direction (e.g., the right tail) much more frequently than the other. For a practitioner, this means a feature might be launched based on a "statistically significant" win that is actually a fluke caused by data distribution rather than a true treatment effect.
Methodology: Edgeworth Expansions
To address these distortions, the authors utilize Edgeworth expansions, a mathematical technique that approximates the distribution of a test statistic using higher-order moments like skewness and kurtosis. This approach provides a more granular view than the standard mean-and-variance focus of the CLT.
The research contributes two primary tools:
- Minimum Sample Size Formulas ($N_{min}^{(1)}, N_{min}^{(2)}$): These formulas calculate the threshold of users needed to keep the Type I error rate within a specified tolerance ($\epsilon$).
- Edgeworth-based Correction: A "plug-in" adjustment for $p$-values when sample sizes fall below the calculated thresholds, ensuring test trustworthiness even with smaller, non-normal datasets.
Empirical Validation on Real-World Data
The framework was validated using massive datasets from ByteDance, specifically focusing on "Publish Count" (highly skewed video uploads) and "Live Duration" (zero-inflated streaming data).
As illustrated in Figure 4, the proposed formulas closely track the empirical requirements across different error tolerances. For highly skewed metrics, the "minimum sample size" for a standard $t$-test to remain valid can reach into the hundreds of millions. The $N_{min}^{(2)}$ formula, which incorporates kurtosis, provides a tighter and more practical threshold than traditional conservative rules.
Key Results and Impact
The Edgeworth-corrected test demonstrated significant improvements in reliability and efficiency:
- Stability: In "publish count" experiments, the standard $t$-test required over 50,000 samples to stabilize at a 5% error rate, while the corrected test achieved stability much earlier.
- Economic Value: By preventing incorrect feature launches and optimizing traffic allocation, the authors estimate that large-scale platforms could save hundreds of millions of dollars.
Conclusion
While this framework provides a robust solution for two-sample A/B tests, future work remains in extending these corrections to multi-arm testing and sequential testing environments where "peeking" is common. Nevertheless, moving beyond the assumption of normality is a critical step toward reliable experimentation in the age of big, skewed data.
Summary updated