When evaluating a machine learning model, $K$-fold cross-validation is the industry standard for estimating generalization error. We split our data into $K$ blocks, train on $K-1$ of them, and evaluate on the remaining one. This process yields $K$ distinct error measurements. To determine if Model A is significantly better than Model B, or simply to draw error bars around Model A's performance, standard practice dictates calculating the mean and variance of these $K$ measurements and applying a traditional statistical test like a paired $t$-test.
However, this standard approach contains a fatal flaw: traditional hypothesis tests assume that the $K$ observations are Independent and Identically Distributed (i.e., i.i.d.). In cross-validation, they are deeply, inherently correlated.
The Anatomy of Fold Dependency
To understand why cross-validation folds are not independent, consider the data used to train the models. In a standard 10-fold cross-validation setup, any two folds will have training sets that share exactly 80% of the total dataset.
Because the training sets overlap so heavily, the models trained on them are nearly identical. If two models are virtually identical, they will make the same types of errors on the evaluation sets. As noted by Ravi Kumar et al. in Near-Optimal Bounds for Cross-Validation via Loss Stability, this massive overlap introduces complex correlations between the models learned on each fold. When we treat the resulting error metrics as independent draws, we ignore this shared information, creating an illusion of having more unique data points than we actually do.
The Impossibility of Unbiased Variance Estimation
Why not simply calculate the exact correlation between the folds and subtract it out?
In their foundational paper, No Unbiased Estimator of the Variance of K-Fold Cross-Validation, Yoshua Bengio and Yves Grandvalet proved a fundamental "no-go" theorem showing that this is mathematically impossible from a single cross-validation run. They demonstrated that the true variance of a cross-validation estimate is composed of three distinct components:
- The variance of individual errors.
- The covariance between errors within the same fold.
- The covariance between errors across different folds.
Because we only observe a single dataset, the cross-fold covariance is structurally inseparable from the overall variance. The authors proved that no universal, unbiased estimator for this variance exists; any error bars derived purely from a single cross-validation run are fundamentally biased. This constraint means that any variance estimate must rely on structural heuristics or conservative approximations, a conclusion reinforced by further theoretical analysis from Claude Nadeau and Yoshua Bengio in Inference for the Generalization Error.
The Cost of Ignorance: False Discoveries
When practitioners ignore this dependency and use naive variance estimators, they treat correlated folds as independent experiments. This systematically underestimates the true variance, resulting in artificially narrow confidence intervals and a massive inflation of Type I errors (false positives). Researchers frequently conclude that a model is "significantly better" when the difference is actually just statistical noise.
This issue causes severe overconfidence across multiple domains:
- Neuroimaging: A study in NeuroImage demonstrated that for small sample sizes typical in brain imaging ($N < 100$), standard error calculations underestimate true uncertainty by a factor of two to four, rendering many published "biomarkers" unreliable.
- Natural Language Processing: Rotem Dror et al. in The Hitchhiker's Guide to Testing Statistical Significance in Natural Language Processing highlighted a systemic neglect of these dependencies in NLP literature, leading to widespread false claims of algorithmic superiority.
- Large Language Models: When evaluating model degradation, Jonas M. Kübler and Kailash Budhathoki showed in When LLMs get significantly worse: A statistical approach to detect model degradations that evaluating baseline and optimized models as independent variables ignores per-sample error correlations, wildly distorting uncertainty estimates.
- Data Leakage via Clustering: As explored by Matt Barnes et al. in On the Interaction Effects Between Prediction and Clustering, when data points themselves are inherently correlated (e.g., multiple samples from the same patient or cluster), standard random splits cause "dependency leakage," severely underestimating out-of-cluster error.
Building Honest Error Bars
Since an unbiased estimator is impossible, how do we perform valid statistical inference? Researchers have developed several workarounds to calibrate uncertainty by mathematically accounting for the cross-fold correlation.
Heuristic Variance Corrections
In early work, Claude Nadeau and Yoshua Bengio introduced the Corrected Resampled t-test in Inference for the Generalization Error. They applied a correction factor based on the ratio of the test set size to the training set size:
$$\text{Variance Correction} \propto \frac{N_{\text{test}}}{N_{\text{train}}}$$
This adjustment directly scales up the denominator of the $t$-statistic, preventing the underestimation of variance without requiring additional computational overhead.
Effective Sample Size and Confusion Matrices
To prevent overconfidence in Bayesian settings, Alexandre Lacoste et al. scaled the variance of risk estimates using an effective sample size ratio in Agnostic Bayesian Learning of Ensembles.
Similarly, Ruibo Wang and Jihong Li developed an effective confusion matrix framework in Bayes Test of Precision, Recall, and F1 Measure for Comparison of Two Natural Language Processing Models. This method estimates correlation coefficients between folds to calibrate the posterior distributions of performance metrics. This approach was later extended to fairness metrics by Ainhize Barrainkua et al. in Uncertainty Matters: Stable Conclusions under Unstable Assessment of Fairness Results, ensuring that dependencies do not lead to overconfident and non-reproducible fairness claims.
Structural Re-sampling and Exact Bounds
Instead of adjusting standard cross-validation, some approaches alter the evaluation structure itself. In Cross-Validation: What Does It Estimate and How Well Does It Do It?, Trevor Hastie details Nested Cross-Validation (NCV), which partitions data into distinct training and holdout loops to calculate an unbiased estimate of the standard CV point estimate's mean squared error.
For the extreme case of leave-one-out cross-validation, Alexandre Bayle et al. proposed an all-pairs variance estimation method in Cross-validation Confidence Intervals for Test Error. This technique maps out the exact dependencies between all overlapping pairs of folds, establishing new Central Limit Theorems that yield asymptotically exact confidence intervals.
Key Foundational Work
Inference for the Generalization Error (1999) — contributed 7 concept elements to this direction.
Inference for the Generalization Error (1999) — contributed 4 concept elements to this direction.