Dehghani 2021 - Stateful Benchmarks and Adaptive Overfitting

Summary

Benchmarks are stateful: each new method is designed knowing the test results and published tricks of its predecessors. In adaptive data analysis the guarantee on test error fails once the number of adaptive queries is of the order of the test-set size, and a boosting attack can achieve accuracy of order above chance. Empirical studies on ImageNet and Kaggle find little actual overfitting, but the paper argues the risk and the tricks-accumulation effect should still be managed.

Overview

“At any point in time, the attempt of a new idea for beating a particular benchmark depends on the information gathered from previous submissions and publications.” Researchers usually have full access to the holdout set; copy-pasting hyperparameters, code and even pretrained checkpoints means new models are built on “thousands of queries, direct or indirect, to the test set.”

Main Content

Adaptive data analysis bound (paper’s statement)

Adaptivity and test-set reuse (as stated in the paper)

Let the test set have size . If the designer of the -th model can see the errors of the first models on the test set, then, by the boosting attack (Blum and Hardt, 2015), one can ensure the -th model’s test accuracy is as high as

above its true accuracy. Hence (Dwork et al., 2015) once the test-set results “are no longer an indication of model quality.” The adaptive data analysis framework instead provides evaluation mechanisms with guaranteed upper bounds on the difference between the average error on test examples and the population error.

Caveat on the statement. The paper writes the bound as and the condition as in prose; the formulation here follows the paper’s wording and does not restate the precise conditions of Blum and Hardt, which are in that reference.

Empirical counter-evidence and refinements

FindingSourceImplication
Little overfitting to holdouts on ImageNet-like datasets; rankings stable on re-collected test setsRecht et al. 2018, 2019; Yadav and Bottou 2019Adaptivity risk may be smaller than worst-case reasoning suggests
No significant adaptive overfitting in Kaggle classification competitionsRoelofs et al. 2019Same
Large number of classes makes overfitting substantially harderFeldman et al. 2019a,bMulti-class tasks are more robust
New test sets are not always possible (rare or one-time phenomena); need an effective upper bound on test-population gap based on description length of models given knowledge before and after test-set creationArora and Zhang 2021Bound-based assurance where re-collection is impossible
How the test set is accessed matters, not only how many timesPaper’s discussionCount queries and study access pattern

Conclusion of the paper: prior information about test performance may influence later modelling choices and hyperparameters, and this adaptive behaviour “in principle, may have an effect on generalization and can, to different extents, create a gap between test error and full distribution error.”

Questions to ask when using a benchmark

  1. Do improvements on the benchmark correspond to progress on the original problem?
  2. How does the number of times, and the way, the test set has been accessed relate to the statistical validity of results?
  3. How far can one get by gaming the benchmark rather than progressing on the original problem?

Lottery tickets and tricks

  • Accessing the test set more than others “can be interpreted as … buying more lottery tickets”; the paper cites an ImageNet challenge episode (2015 announcement) where extra test-set access secured a margin.
  • Echo-chamber effect: leading models are adapted by re-using code, pretrained weights and hyperparameters.
  • Accumulated tricks. Late participants face dataset-specific recipes; e.g., pretraining on MNLI is needed for strong results on RTE and STS; “standard GLUE tricks” in pretraining and fine-tuning. Whether a novel algorithm can use these tricks “is again a form of lottery.”

Examples

Boosting attack on a coin-flip test set (simulation, not from the paper)

Setup. Test labels are fair coin flips, so every classifier has true accuracy 0.5. We query random classifiers on test points, keep those that beat chance on the test set, and take their majority vote.

import numpy as np
rng = np.random.default_rng(0)
N, k = 2000, 400
y = rng.choice([-1, 1], size=N)
guesses = rng.choice([-1, 1], size=(k, N))
acc = (guesses == y).mean(1)
vote = np.sign(guesses[acc > 0.5].sum(0))
print("best single model:", acc.max())
print("ensemble on test :", (vote == y).mean())
fresh = rng.choice([-1, 1], size=N)
print("ensemble on fresh:", (vote == fresh).mean())

Output observed. best single model 0.525; ensemble on the reused test set 0.574; on fresh labels 0.476. Interpretation. Selecting on the test set inflates measured accuracy by about 7 points over truth with no real skill; a fresh sample exposes it. This is adaptive overfitting in miniature and is the mechanism behind “buying lottery tickets.”

Connections

See Also