Failures and Successes of Cross-Validation for Early-Stopped Gradient Descent

Pratik Patil, Yuchen Wu, Ryan J. Tibshirani · DOI

Introduction

In modern machine learning, Gradient Descent (GD) is more than just an optimization algorithm; it is a source of "implicit regularization." By halting training before the empirical error reaches zero—a technique known as early stopping—practitioners can prevent models from overfitting to noise, particularly in high-dimensional settings. However, determining the optimal stopping time remains a significant challenge. While Generalized Cross-Validation (GCV) is a standard computational shortcut for estimating out-of-sample risk in linear models, this paper reveals a surprising gap: GCV fails fundamentally when applied to the iterative path of Gradient Descent in high dimensions.

The Problem: Tuning the Stopping Time

For many classical methods like Ridge Regression, GCV provides a computationally efficient way to estimate prediction risk without the need for repeated training. Given the mathematical similarities between the iterates of Gradient Descent on least-squares problems and Ridge Regression, it has been widely assumed that GCV would serve as a reliable proxy for tuning the stopping time $k$.

This research investigates whether this assumption holds in the "modern" regime where the number of features $p$ and observations $n$ are both large and comparable. Using high-dimensional asymptotic analysis, the authors evaluate the consistency of two primary estimators: the popular GCV shortcut and the more rigorous Leave-One-Out Cross-Validation (LOOCV).

Why GCV Fails

The core theoretical contribution of this work is the proof that GCV is "generically inconsistent" for Gradient Descent. Even in ideal scenarios with linear models and Gaussian noise, the GCV estimate tends to drift away from the true risk as training progresses.

The failure stems from the "effective degrees of freedom" in GD. Unlike Ridge Regression, where the smoothing matrix is static for a given penalty parameter, the effective degrees of freedom in GD evolve in a data-dependent manner that the standard GCV formula fails to capture. In overparameterized settings ($p > n$), this discrepancy leads to a catastrophic "blow-up" of the GCV estimate, rendering it useless for selecting an optimal stopping point.

LOOCV: The Reliable Alternative

In contrast to the failure of GCV, the authors prove that LOOCV is uniformly consistent. It accurately tracks the true prediction risk across the entire training trajectory. This reliability holds regardless of whether the model is underparameterized or overparameterized, and even when the model is misspecified (e.g., non-linear data or heavy-tailed noise).

To make LOOCV practical for iterative algorithms, the authors developed a novel recursive shortcut formula. Traditionally, LOOCV requires re-training the model $n$ times, which is computationally prohibitive for GD. By viewing GD iterates as a specific type of linear smoother, the proposed method reduces the computational cost from $O(n^3k)$ to $O(n^3 + n^2k)$, making it feasible to monitor risk in real-time during training.

Key Results

Comparison of true Risk, GCV, and LOOCV across iterations. In the overparameterized regime (right), GCV diverges significantly from the true risk, while LOOCV remains consistent.

The empirical validation of these theorems reveals stark differences in estimator behavior:

  • GCV Divergence: As shown in the figures, while GCV may track risk initially, it diverges sharply in the overparameterized regime as the number of iterations increases.
  • LOOCV Consistency: LOOCV remains tightly coupled with the true risk throughout the training process, successfully identifying the "oracle" optimal stopping time.
  • Pathwise Prediction Intervals: Leveraging the consistency of LOOCV, the authors successfully constructed valid prediction intervals that maintain correct coverage throughout the training path.

Conclusion and Future Directions

This work highlights a critical pitfall in using standard cross-validation shortcuts for iterative optimization. While GCV's failure in high dimensions is a cautionary tale, the success and efficient implementation of LOOCV provide a robust path forward for tuning early-stopped models.

Future research will look to extend these findings beyond batch Gradient Descent to Stochastic Gradient Descent (SGD) and explore applications in non-squared loss functions, such as cross-entropy for classification, which are prevalent in deep learning architectures.

Summary updated

BibTeX
@inproceedings{patil2024failures,
  author = {Pratik Patil and Yuchen Wu and Ryan J. Tibshirani},
  title = {{Failures and Successes of Cross-Validation for Early-Stopped Gradient Descent}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2024},
}
Figure