Can we globally optimize cross-validation loss? Quasiconvexity in ridge regression

William T. Stephenson, Zachary Frangella, Madeleine Udell, Tamara Broderick

Introduction

Cross-validation (CV) is the gold standard for tuning hyperparameters in machine learning. In ridge regression, we rely on Leave-One-Out Cross-Validation (LOOCV) to select the optimal penalty parameter $\lambda$. Most practitioners and textbooks assume that the CV loss surface is "well-behaved"—a simple, U-shaped curve where any local search algorithm, such as gradient descent or a coarse grid search, will inevitably find the global minimum.

However, this paper challenges that fundamental assumption. The authors demonstrate that for ridge regression, the CV loss is almost never convex and frequently fails to be quasiconvex. This means the loss surface can harbor multiple local minima that trap standard optimization algorithms, leading to sub-optimal hyperparameter selection and poor generalization.

The Myth of the U-Shaped Curve

The common "cartoon" of a smooth, single-minimum CV curve is often a simplification. In practice, especially with smaller datasets or specific data structures, the curve can exhibit multiple "dips."

Comparison of idealized LOOCV loss vs. real-world datasets. The idealized curve shows a smooth U-shape, while the Life Expectancy and Wine datasets exhibit multiple local minima.

As shown in the figure above, while an idealized illustration suggests a clear global minimum, real-world data like the Wine Quality dataset ($N=50, D=11$) can produce a loss surface with two distinct local minima. A gradient-based optimizer starting at a high $\lambda$ might get stuck in a local minimum with significantly higher loss than the global optimum. Even in larger datasets like the WHO Life Expectancy data ($N=2,938$), subtle local minima can exist (see inset).

Theoretical Guarantees for Quasiconvexity

The researchers investigated the conditions under which the CV loss remains globally optimizable (quasiconvex). Quasiconvexity is a property where any local minimum is guaranteed to be a global minimum, ensuring that local search methods remain effective.

Through a decomposition of the LOOCV loss function, the authors identified key data components that affect its shape. Their core contribution, Theorem 1, proves that for a sufficiently large number of data points ($N$), the CV loss is guaranteed to be quasiconvex if three conditions are met:

  1. Flat Covariate Spectrum: The singular values of the covariate matrix are "nearly uniform."
  2. Moderate Signal-to-Noise Ratio: The least-squares fit is reasonably good (low noise).
  3. Regular Left Singular Vectors: The data is not dominated by a few outliers (high "coherence").

Empirical Findings and Stress-Testing

The paper uses real-world datasets to demonstrate that "bumpy" loss surfaces are not merely theoretical curiosities.

  • Wine Quality Dataset: By examining subsets of the red wine dataset, the authors found clear examples of non-quasiconvexity. In these cases, standard tuning tools could return a sub-optimal $\lambda$.
  • Life Expectancy (WHO): With $N=2,938$ observations, one might expect a well-behaved loss. However, the authors found that applying Principal Component Regression (PCR)—a common pre-processing step—can actually induce non-quasiconvexity by altering the covariate spectrum and destroying the "flatness" required for a well-behaved loss surface.

Key Insights

  • Convexity is Rare: The authors prove that in almost every practical scenario, the CV loss is not convex. Quasiconvexity is the best we can usually hope for.
  • The Spectrum is Critical: The "flatness" of the covariate matrix's singular values is the primary driver of a well-behaved loss surface. A "decaying" spectrum, where a few principal components dominate, significantly increases the likelihood of encountering local minima.
  • Safety in Numbers: As the number of data points $N$ increases, the probability of the loss being quasiconvex tends toward 1 under standard statistical assumptions (like i.i.d. sub-Gaussian covariates).

Conclusion and Future Work

This research highlights a potential pitfall in automated machine learning pipelines. If the CV loss surface is not quasiconvex, simple hyperparameter tuning methods may fail. While the authors provide asymptotic guarantees for quasiconvexity, several questions remain. Future work is needed to determine if these local minima are "close enough" to the global minimum to be ignored in practice, and to extend these findings to other regularized models like logistic regression.

Summary updated

BibTeX
@inproceedings{stephenson2021can,
  author = {William T. Stephenson and Zachary Frangella and Madeleine Udell and Tamara Broderick},
  title = {{Can we globally optimize cross-validation loss? Quasiconvexity in ridge regression}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=uOMID9ygB3b},
}
Figure