RandALO: Out-of-sample risk estimation in no time flat

Parth Nobel, Daniel LeJeune, Emmanuel J. CandèsarXiv 2024 · DOI

Abstract: RandALO is a novel randomized algorithm designed to estimate out-of-sample risk with high precision at a fraction of the computational cost of traditional cross-validation. By integrating Approximate Leave-One-Out (ALO) theory with randomized linear algebra, RandALO achieves the accuracy of leave-one-out methods while remaining faster than standard 5-fold cross-validation. This paper details the three core innovations of RandALO—randomized diagonal estimation, MMSE denoising, and risk inflation debiasing—and demonstrates its performance across synthetic and large-scale real-world datasets like the UK Biobank.

1. Introduction

In machine learning, selecting optimal hyperparameters requires reliable estimates of out-of-sample performance (risk). The "gold standard" for this is Leave-One-Out Cross-Validation (LOO-CV), which involves training a model $n$ times, each time omitting a single data point. While accurate, LOO-CV is computationally prohibitive for large datasets. Practitioners typically rely on $K$-fold Cross-Validation (CV), which reduces training to $K$ iterations. However, $K$-fold CV remains computationally expensive and introduces significant bias, particularly in high-dimensional settings where the model trained on a subset of data differs substantially from the model trained on the full dataset.

2. The RandALO Method

RandALO builds upon Approximate Leave-One-Out (ALO), which uses a single Newton step from the full-model solution to approximate the effect of removing individual data points. The primary bottleneck in ALO is computing the diagonal of a massive Jacobian matrix. RandALO introduces three innovations to overcome this:

  1. Randomized Diagonal Estimation: Instead of full computation, it employs a randomized trace estimator (BKS method) requiring only a few Jacobian-vector products.
  2. MMSE Denoising: To manage the noise inherent in randomized estimates, a Minimum Mean Squared Error (MMSE) estimator with a truncated normal prior is used, ensuring diagonal estimates remain within the valid $[0, 1]$ range.
  3. Risk Inflation Debiasing: The authors identified that estimation noise systematically inflates risk. They mitigate this by calculating risk at varying noise levels and using linear regression to extrapolate to a zero-noise state ($m \to \infty$).
Validation of theoretical foundations: empirical distribution of $\mu_i$, Gaussianity of z-scores, and low pairwise correlation.

For non-smooth models like the Lasso, the Jacobian-vector products are computed efficiently by solving a quadratic program. Theoretical validation (as seen in the figure above) confirms that the underlying z-scores follow a Gaussian distribution and the empirical distribution of $\mu_i$ aligns with theoretical predictions, justifying the randomized approach.

3. Key Results and Efficiency

RandALO was validated across synthetic high-dimensional Lasso problems, non-linear kernel logistic regression on Fashion-MNIST, and large-scale genetic data from the UK Biobank (over 75,000 samples and nearly 600,000 features).

A primary advantage is the "no time flat" efficiency. RandALO can provide a risk estimate with only 0.1% bias in approximately $2\times$ the time of a single model fit. In contrast, achieving even 1% bias with $K$-fold CV might require $K=20$, taking $20\times$ the training time.

Efficiency of RandALO compared to K-fold CV and exact ALO, showing lower bias in significantly less time.

Furthermore, RandALO remains a consistent estimator in high dimensions ($p \approx n$), where $K$-fold CV is notoriously biased. In hyperparameter tuning sweeps, $K$-fold CV often identifies incorrect optima due to this bias, while RandALO consistently finds the true minimum. On the massive UK Biobank dataset, RandALO accurately tracked the out-of-sample error curve, matching the performance of a dedicated holdout set without sacrificing data for training.

4. Conclusion and Future Work

RandALO offers a scalable, accurate alternative to traditional cross-validation. While currently optimized for twice-differentiable loss functions and convex problems, future work aims to extend the framework to non-smooth losses (e.g., Hinge loss), multi-class classification, and deep learning architectures. The authors have released the user-friendly Python package, randalo, to facilitate adoption by practitioners.

Summary updated

BibTeX
@misc{nobel2024randalo,
  author = {Parth Nobel and Daniel LeJeune and Emmanuel J. Candès},
  title = {{RandALO: Out-of-sample risk estimation in no time flat}},
  year = {2024},
  eprint = {2409.09781},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.09781},
}
Figure