Benchmark Overfitting & Adaptive Data Analysis
When reusing a test set quietly invalidates it.
A test set gives an honest estimate exactly once. Every decision made after looking at it, every resubmission to a leaderboard, every paper that builds on last year's best number makes the next estimate a little less honest. This lesson shows how fast adaptivity can destroy a holdout's guarantees, how differential privacy and the Ladder restore them, and what large studies of Kaggle, ImageNet and CIFAR-10 found when they measured the damage.
What you’ll learn
- Explain Freedman's paradox and why selecting and testing on the same data invalidates the test.
- Contrast the non-adaptive holdout guarantee, logarithmic in the number of queries, with the boosting attack and the computational lower bound for adaptive queries.
- Describe the reusable holdout and the Ladder, and the guarantees that differential privacy and leaderboard thresholds provide.
- Summarize the empirical evidence (a meta-analysis of Kaggle competitions, new ImageNet and CIFAR-10 test sets, seed variance) and the practices that follow from it.
Freedman's paradox
Freedman (1983) described a two-pass analysis that every applied statistician has seen. Take 100 observations of 50 candidate predictors and a response, all independent noise, so that no predictor has any relation to the response. First pass: regress the response on all 50 and keep the predictors whose coefficients are significant at the 25% level. Second pass: refit using only those, and test.
| Quantity (mean over 4,000 simulated datasets) | Value |
|---|---|
| first pass: overall -test significant at 5% | 5% of runs, as it should be |
| predictors kept by the screen | 12.5 |
| second pass: overall -test significant at 5% | 94% of runs |
| second pass: | 0.31 |
| second pass: coefficients significant at 5% | 5.6 |
Nothing in the second pass is computed incorrectly. Its -values assume the predictors were chosen before seeing the data; they were chosen because of it, so the selected predictors are exactly those that happen to correlate with this noise. The general principle: data that suggested a hypothesis cannot also test it. Machine learning repeats the pattern whenever a test set guides the next model.
Think first How could the analyst have tested the screened model honestly?
Screen on one part of the data and test on another, untouched part (sample splitting), or collect new data. The test on the held-out part is then valid, because the selection never saw it. Methods for selective inference go further and correct the -values for the selection itself, but they need a precise description of how the selection was made, which a human analyst's choices rarely provide.
Why adaptivity breaks the holdout
A holdout of examples evaluates classifiers fixed in advance. For each one, Hoeffding's inequality bounds the deviation of the holdout error from the true error, and a union bound covers all of them at once:
The cost grows only with : a single holdout can vet millions of fixed classifiers.
How large must a holdout be for 1,000 classifiers, all fixed before the holdout is touched, to have every error estimate within 2 percentage points of the truth with probability at least 95%?
Show the answer
13200 examples
. For a million classifiers it would be about : logarithmic growth.
The union bound needs every to be independent of the holdout. In adaptive data analysis, is chosen after seeing the scores of , and the guarantee is gone. Blum & Hardt (2015) made this concrete with a boosting attack on a leaderboard that reports error on a hidden label vector :
- Submit uniformly random label vectors .
- Keep those whose reported error is at most .
- Submit the coordinatewise majority vote of the kept vectors.
Each kept vector is slightly correlated with by luck, and the majority vote adds up those correlations. They prove that the final submission's reported error is at most with probability , although its predictions are independent of the labels of any new data, on which it scores 50%.
| Random submissions | 10 | 100 | 1,000 | 4,000 |
|---|---|---|---|---|
| holdout accuracy of the majority vote () | 50.8% | 52.2% | 57.1% | 64.1% |
Accurate answers are limited for every efficient method, not just naive ones. Under a standard computational hardness assumption, Hardt & Ullman (2014) proved that no computationally efficient algorithm can accurately answer adaptively chosen statistical queries from samples, and Steinke & Ullman (2015) lowered the threshold to .
Differential privacy and the reusable holdout
The way around the attack is to make each answer depend only a little on any single holdout example. Dwork, Feldman, Hardt, Pitassi, Reingold & Roth (2015) proved a transfer theorem: if the queries are answered by a differentially private mechanism, then the answers stay close to the population values even when the queries are chosen adaptively. Privacy limits how much the analyst can learn about the particular holdout sample, and therefore how far the analyst can overfit it. Their computationally efficient mechanism has error of order , up to logarithmic factors, after adaptive queries, so about queries can be answered to constant accuracy, matching the hardness result up to the factor. Bassily et al. (2016) sharpened these bounds and extended them to more general queries.
The Ladder
Competitions need something simpler: a leaderboard that participants can query thousands of times. Blum & Hardt (2015) observed that a participant mostly needs to know whether a submission beats the best so far. Their Ladder mechanism keeps the best score; when a new submission arrives it releases a new score only if it improves on the best by more than a step , rounded to a multiple of , and otherwise reports the old best. Little information about the holdout leaks per submission.
Why does the Ladder resist the boosting attack?
- It adds large random noise to every score
- Random submissions almost never beat the best score by more than the step , so they receive no new information about the holdout
- It limits each participant to a small number of submissions
- It uses a larger holdout set
Show the answer
B. Random submissions almost never beat the best score by more than the step , so they receive no new information about the holdout
The attack needs a score for each random submission, to tell slightly-better-than-chance vectors from slightly-worse ones. The Ladder reports the same old best score for all of them, so the selection step has nothing to work with.
What actually happened to the benchmarks
Worst-case theory says a holdout can be exhausted after roughly adaptive queries. Practice has been kinder than that:
- Kaggle. Roelofs et al. (2019) compared public and private leaderboards in more than one hundred Kaggle competitions, where participants saw the public holdout throughout but the private test set was used once, and found "little evidence of substantial overfitting."
- ImageNet and CIFAR-10. Recht, Roelofs, Schmidt & Shankar (2019) built new test sets following the original collection procedures. Accuracy dropped by 3%–15% on CIFAR-10 and 11%–14% on ImageNet, yet "accuracy gains on the original test sets translate to larger gains on the new test sets." Their results suggest that the drops are not caused by adaptivity but by the models' "inability to generalize to slightly 'harder' images" than those in the original test sets: a subtle distribution shift between collections, not overfitting to the test set.
- Why so benign? Submitted models are highly similar to one another, which shrinks the effective number of queries (Mania, Miller, Schmidt, Hardt & Recht, 2019), and researchers mostly act on whether they beat the best result, the same principle the Ladder exploits (Hardt & Recht, 2022, chapter 8).
A second problem is mundane variance. Bouthillier et al. (2021) modeled the benchmarking process and found that variance due to data sampling, parameter initialization and hyperparameter choice "impact markedly the results," enough to flip conclusions about which method is better. A single run per method, on a single split, measures luck as well as quality.
| Practice | Protects against |
|---|---|
| report the spread over seeds, data splits and tuning runs, not one number | mistaking variance for progress |
| compare methods with equal tuning budgets and the same evaluation protocol | measuring effort instead of method |
| keep a final test set untouched, or periodically collect a fresh one | adaptive overfitting accumulated over many papers |
| on leaderboards, reveal coarse or thresholded scores | attacks that mine the holdout |
| check new test data for overlap with training data, including web-scale pretraining corpora | contamination, which no statistical guarantee covers |
Key takeaways
- Selecting and testing on the same data invalidates the test: in Freedman's setup, pure noise yields a "significant" regression in almost every run.
- For fixed classifiers a holdout needs only ; adaptively chosen ones break the union bound, and a boosting attack gains of fake accuracy. Efficient mechanisms cannot answer more than about adaptive queries.
- Differentially private answers transfer to the population even under adaptivity; Thresholdout consults the holdout only when overfitting shows, and the Ladder reveals only thresholded improvements, with error .
- In practice, Kaggle leaderboards showed little adaptive overfitting, and new ImageNet and CIFAR-10 test sets showed drops from distribution shift with rankings preserved; seed and split variance remain a major source of false progress.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
In Freedman's two-pass experiment, the second-pass regression on pure noise looks highly significant. What is the error?
- The -test is miscomputed in the second pass
- The predictors were selected using the same data on which they were then tested, so the test's null distribution no longer applies
- Fifty predictors are too many for 100 observations
- A 25% screening level is too strict
Show the answer
B. The predictors were selected using the same data on which they were then tested, so the test's null distribution no longer applies
The second pass is computed correctly, but its -values assume the predictors were fixed in advance. Screening picked exactly the predictors that correlate with this sample's noise, so they look significant on that same sample.
A holdout of size can certify fixed classifiers with growing like . Why does this guarantee fail when each new classifier is chosen after seeing the previous holdout scores?
- Because Hoeffding's inequality needs at least 30 examples
- Because the union bound needs more classifiers
- Because later classifiers depend on the holdout, so their holdout errors are no longer unbiased estimates of their true errors
- It does not fail: the union bound covers adaptive choices too
Show the answer
C. Because later classifiers depend on the holdout, so their holdout errors are no longer unbiased estimates of their true errors
Hoeffding's inequality applies to a classifier that is independent of the holdout. Once a classifier is built from holdout scores, as in the boosting attack, its holdout error is biased toward lower values, and union bounds over a fixed list no longer describe it.
On new ImageNet and CIFAR-10 test sets, accuracies dropped by several points, but gains on the original test sets translated into larger gains on the new ones. What does this pattern suggest?
- Years of adaptive reuse had overfit the original test sets, explaining the drop
- The new test sets were collected incorrectly and should be discarded
- The drop comes mainly from a shift between the old and new test distributions, not from adaptive overfitting, since progress on the old sets still transferred
- The models were overfitting their training sets
Show the answer
C. The drop comes mainly from a shift between the old and new test distributions, not from adaptive overfitting, since progress on the old sets still transferred
If adaptive overfitting caused the drop, the models that gained most on the old test set (the most tuned to it) would gain least on the new one. Instead the gains carried over and grew. Recht et al. attribute the drop to slightly "harder" images in the new collections.
Why does answering holdout queries through a differentially private mechanism preserve their validity under adaptivity?
- Because private answers are exactly equal to the population values
- Because privacy hides the identities of the people in the data
- Because it limits the analyst to non-adaptive queries
- Because each answer depends only slightly on any single holdout example, so the analyst cannot learn the sample's idiosyncrasies and fit them
Show the answer
D. Because each answer depends only slightly on any single holdout example, so the analyst cannot learn the sample's idiosyncrasies and fit them
Differential privacy bounds how much the output distribution can change when one example changes. That stability transfers to generalization: answers stay close to population values even for adaptively chosen queries (Dwork et al., 2015).
Further reading
- D. A. Freedman, "A note on screening regression equations," The American Statistician 37(2), 152–155 (1983).
- C. Dwork, V. Feldman, M. Hardt, T. Pitassi, O. Reingold & A. Roth, "The reusable holdout: preserving validity in adaptive data analysis," Science 349(6248), 636–638 (2015).
- A. Blum & M. Hardt, "The Ladder: a reliable leaderboard for machine learning competitions," Proceedings of the 32nd International Conference on Machine Learning, PMLR 37, 1006–1014 (2015).
- B. Recht, R. Roelofs, L. Schmidt & V. Shankar, "Do ImageNet classifiers generalize to ImageNet?" Proceedings of the 36th International Conference on Machine Learning, PMLR 97, 5389–5400 (2019).
- R. Roelofs, V. Shankar, B. Recht, S. Fridovich-Keil, M. Hardt, J. Miller & L. Schmidt, "A meta-analysis of overfitting in machine learning," Advances in Neural Information Processing Systems 32 (2019).