Out of the Ordinary: Spectrally Adapting Regression for Covariate Shift
Benjamin Eyre, Elliot Creager, David Madras, Vardan Papyan, Richard Zemel
TL;DR
This work analyzes why ordinary least squares regression fails under covariate shift by linking OOD risk to the interaction of source and target eigenspectra and identifying Spectral Inflation as the core culprit. It introduces Spectral Adapted Regressor (SpAR), a lightweight, post-hoc method that uses unlabeled target data to project out spectral directions prone to inflation, yielding a regressor that adapts the last layer of pre-trained neural regressors. The authors derive a bias-variance decomposition per eigenvector, provide an alpha-based rule for selecting which spectral components to remove, and prove that the optimal projection improves OOD performance under the stated assumptions. Empirically, SpAR improves out-of-distribution performance across synthetic, tabular, image, and PovertyMap-WILDS datasets, often outperforming stronger baselines while remaining computationally efficient.
Abstract
Designing deep neural network classifiers that perform robustly on distributions differing from the available training data is an active area of machine learning research. However, out-of-distribution generalization for regression-the analogous problem for modeling continuous targets-remains relatively unexplored. To tackle this problem, we return to first principles and analyze how the closed-form solution for Ordinary Least Squares (OLS) regression is sensitive to covariate shift. We characterize the out-of-distribution risk of the OLS model in terms of the eigenspectrum decomposition of the source and target data. We then use this insight to propose a method for adapting the weights of the last layer of a pre-trained neural regression model to perform better on input data originating from a different distribution. We demonstrate how this lightweight spectral adaptation procedure can improve out-of-distribution performance for synthetic and real-world datasets.
