Accounting for Variance in Machine Learning Benchmarks

Xavier Bouthillier, Pierre Delaunay, Mirko Bronzi, Assya Trofimov, Brennan Nichyporuk, Justin Szeto, Nazanin Mohammadi Sepahvand, Edward Raff, Kanika Madan, Vikram Voleti, Samira Ebrahimi Kahou, Vincent Michalski, Dmitriy Serdyuk, Tal Arbel, Christopher Pal, Gael Varoquaux, Pascal Vincent

Abstract: Strong empirical evidence that one machine-learning algorithm A outperforms another one B, ideally calls for multiple trials optimizing the learning pipeline over sources of variation such as data sampling, augmentation, parameter initialization, and hyperparameters choices. This is prohibitively expensive, and corners are cut to reach conclusions. We model the whole benchmarking process and all sources of variation, revealing that variance due to data sampling, parameter initialization and hyperparameter choice impact markedly machine learning benchmark. We analyze the predominant comparison methods used today in the light of this variance. We show a counter-intuitive result that a biased estimator with more source of variation will give better results, closer to the ideal estimator at a 51× reduction in compute cost. Using this we perform a detailed study on the error rate of detecting improvements, on five different deep-learning tasks/architectures. This study leads us to propose recommendations for future performance comparisons.

The Reproducibility Crisis in SOTA Comparisons

In the competitive landscape of machine learning, researchers frequently claim "State-of-the-Art" (SOTA) status based on marginal performance gains. However, these comparisons often rely on a single training run or a small average of runs with different seeds. This practice ignores the significant noise inherent in the benchmarking process. Uncontrolled factors—such as the specific data subset used for training, random weight initialization, and hyperparameter optimization (HPO) settings—can influence results more than the algorithmic changes themselves. This leads to a reproducibility crisis where a method may appear superior simply because it benefited from a "lucky" random seed or data split.

Identifying Sources of Variation

To address this, we formally model the benchmarking process by categorizing variance into two primary groups:

  1. Learning Procedure ($\xi_O$): This includes variance from data sampling (bootstrapping), weight initialization, dropout, and the order of data presentation during training.
  2. Hyperparameter Optimization ($\xi_H$): This encompasses variance introduced by the choice of HPO algorithm (e.g., Bayesian Optimization vs. Random Search) and its specific configuration.

Our analysis across five diverse tasks—ranging from image classification (CIFAR10) to natural language processing (GLUE)—reveals a critical insight: Data sampling is the dominant source of variance. Contrary to common belief, random weight initialization is a relatively minor factor compared to the impact of the specific data split used.

Standard deviation (STD) of performance across different sources of variation for five tasks, highlighting that data bootstrapping is often the largest noise factor.

The "More is Better" Paradox in Estimation

Properly accounting for all sources of variance is traditionally seen as prohibitively expensive. We compare two types of estimators:

  • The Ideal Estimator: Unbiased but computationally exhaustive, requiring a full HPO cycle for every data split.
  • The Biased Estimator: A more efficient version where HPO is performed once, and the resulting hyperparameters are reused across multiple runs with different seeds and data splits.

We discovered a counter-intuitive "More is Better" paradox: randomizing more sources of variation (e.g., changing both the data split and the seed in every run) actually makes the cheap biased estimator significantly more accurate. By increasing the diversity of the samples, we reduce the correlation between runs, allowing the estimator to converge to the "ideal" value much faster.

Convergence of different estimators as the number of samples (k) increases. The biased estimator (FixHOptEst) approaches the ideal estimator's performance with significantly less computation.

Key Results and Recommendations

Our findings suggest that the machine learning community needs more robust statistical standards to move beyond noisy benchmarks:

  • Efficiency Gains: By randomizing all available sources of variation, our recommended biased estimator achieves the quality of the ideal estimator while being 51 times cheaper to compute.
  • The 29-Run Rule: Our statistical tests indicate that 29 runs (varying both data splits and seeds) are typically sufficient to detect a meaningful improvement with a 5% false-positive rate.
  • Probability of Outperforming: We propose a new decision criterion, $P(A > B)$, which asks: "What is the probability that a single run of Algorithm A will beat a single run of Algorithm B?" We suggest a threshold of $\gamma = 0.75$ for a result to be considered meaningful.

By adopting these practices, researchers can ensure that reported improvements are driven by algorithmic innovation rather than random noise, leading to more reliable and reproducible progress in the field.

Summary updated

BibTeX
@misc{bouthillier2021accounting,
  author = {Xavier Bouthillier and Pierre Delaunay and Mirko Bronzi and Assya Trofimov and Brennan Nichyporuk and Justin Szeto and Nazanin Mohammadi Sepahvand and Edward Raff and Kanika Madan and Vikram Voleti and Samira Ebrahimi Kahou and Vincent Michalski and Dmitriy Serdyuk and Tal Arbel and Christopher Pal and Gael Varoquaux and Pascal Vincent},
  title = {{Accounting for Variance in Machine Learning Benchmarks}},
  year = {2021},
  eprint = {2103.03098},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.03098},
}
Figure