Wild refitting for black box prediction

Martin J. WainwrightarXiv 2025 · DOI

Abstract

Accurately estimating instance-wise risk—the error a specific model produces on future samples—is a fundamental challenge in machine learning. Traditional methods like cross-validation and bootstrapping are often computationally prohibitive for large-scale models. This paper introduces Wild Refitting, a lean procedure that provides high-probability upper bounds on prediction error using only a single additional model fit. By perturbing residuals with random signs, the method adapts to heteroskedastic noise and requires only black-box access to the training algorithm.

Introduction

In modern predictive modeling, researchers often require a rigorous estimate of a model's "optimism"—the gap between its training error and its true population error. While classical tools like Stein’s Unbiased Risk Estimate (SURE) provide such estimates, they typically rely on Gaussian noise assumptions and internal knowledge of the model's structure. Conversely, computationally intensive methods like the bootstrap require hundreds of refits, making them impractical for deep neural networks or massive datasets.

Wild Refitting addresses these gaps by providing a fast, non-asymptotic guarantee that holds even when noise is non-Gaussian or varies across observations (heteroskedasticity).

The Wild Refitting Procedure

The core of the proposed method is a three-step process inspired by the wild bootstrap:

  1. Residual Computation: Calculate the initial residuals $\tilde{w}_i = y_i - \hat{f}(x_i)$ from the original model fit $\hat{f}$.
  2. Symmetrization: Generate "wild" responses $y^\diamond_i$ by adding perturbed residuals back to the predictions: $y^\diamond_i = \hat{f}(x_i) + \rho \epsilon_i \tilde{w}_i$, where $\epsilon_i$ are Rademacher variables ($\pm 1$) and $\rho$ is a scaling factor.
  3. The Single Refit: Perform exactly one additional training run using these wild responses to obtain a new estimate $f^\diamond_\rho$.

The difference between the wild responses and the new estimate provides a "Wild Optimism" value, which serves as a reliable upper bound for the true optimism of the original model.

Theoretical and Practical Insights

A key theoretical contribution is the proof that a single realization of the Rademacher variables is sufficient to provide a rigorous guarantee. This "single query" advantage makes the method viable for models where training is expensive. Furthermore, the method is "black-box friendly," requiring only that the estimator is firmly non-expansive—a property satisfied by many convex optimization and proximal algorithms.

To optimize the noise scale $\rho$, the paper introduces "Wild Complexity" $W_n(r)$, a theoretical construct that measures how much a model can overfit to random noise within a certain radius.

Experimental Validation

The paper evaluates Wild Refitting across synthetic and real-world datasets. In synthetic smoothing tasks, the method was tested on both Tikhonov (L2) and Total Variation (L1) regularized models to see how it handles different function geometries.

Tikhonov (L2) regularization estimate on a synthetic smoothing task.

Beyond synthetic data, the method was applied to:

  • Motion Capture (NRSFM): Successfully identifying optimal regularization parameters for 3D body position recovery, preventing both over-regularization (shrinking) and under-regularization (spinning).
  • Image Denoising: Using "Plug-and-Play" (PnP) frameworks with deep neural network priors. The method's parameter selection closely matched the "Oracle" choice, even under heavy-tailed Student-t noise where classical variance estimators often fail.

Conclusion

Wild Refitting offers a computationally efficient alternative to traditional risk estimation. While currently focused on fixed-design settings and quadratic loss, its ability to handle heteroskedastic noise and black-box models makes it a promising tool for modern machine learning pipelines. Future work may extend these principles to random designs and a broader class of M-estimators.

Summary updated

Abstract

We describe and analyze a computionally efficient refitting procedure for computing high-probability upper bounds on the instance-wise mean-squared prediction error of penalized nonparametric estimates based on least-squares minimization. Requiring only a single dataset and black box access to the prediction method, it consists of three steps: computing suitable residuals, symmetrizing and scaling them with a pre-factor $ρ$, and using them to define and solve a modified prediction problem recentered at the current estimate. We refer to it as wild refitting, since it uses Rademacher residual symmetrization as in a wild bootstrap variant. Under relatively mild conditions allowing for noise heterogeneity, we establish a high probability guarantee on its performance, showing that the wild refit with a suitably chosen wild noise scale $ρ$ gives an upper bound on prediction error. This theoretical analysis provides guidance into the design of such procedures, including how the residuals should be formed, the amount of noise rescaling in the wild sub-problem needed for upper bounds, and the local stability properties of the block-box procedure. We illustrate the applicability of this procedure to various problems, including non-rigid structure-from-motion recovery with structured matrix penalties; plug-and-play image restoration with deep neural network priors; and randomized sketching with kernel methods.
BibTeX
@misc{wainwright2025wild,
  author = {Martin J. Wainwright},
  title = {{Wild refitting for black box prediction}},
  year = {2025},
  eprint = {2506.21460},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.21460},
}
Figure