Spectral Algorithms under Covariate Shift

Jun Fan, Zheng-Chu Guo, Lei ShiarXiv 2025 · DOI

Abstract

In nonparametric regression, covariate shift presents a significant challenge where the training and test input distributions differ. While importance weighting is a standard correction technique, existing spectral algorithms often suffer from the "saturation phenomenon," where learning rates fail to improve beyond a certain smoothness level of the target function. This paper analyzes spectral algorithms under covariate shift, demonstrating that while unweighted methods are optimal for bounded density ratios, they falter when ratios are unbounded. We highlight a novel weighted spectral algorithm employing weight clipping that achieves minimax optimal convergence rates, effectively bypassing the saturation barrier without requiring restrictive eigenfunction assumptions.

1. Introduction

The fundamental assumption of many machine learning models is that training and testing data are independent and identically distributed (i.i.d.). However, in practical applications—ranging from medical diagnostics across different hospitals to autonomous driving in varying weather conditions—this assumption is frequently violated by covariate shift. Covariate shift occurs when the marginal distribution of inputs $P(x)$ changes between training and testing phases, while the conditional distribution $P(y|x)$ remains invariant.

Spectral algorithms, a versatile class of learning methods including Kernel Ridge Regression (KRR), Gradient Descent (Landweber iteration), and Spectral Cutoff, are widely used for nonparametric regression. This article explores the theoretical performance of these algorithms under covariate shift, focusing on the work of Fan, Guo, and Shi, who provide a rigorous framework for achieving optimal convergence rates in Reproducing Kernel Hilbert Spaces (RKHS).

2. The Problem: Saturation and Restrictive Assumptions

To mitigate the effects of covariate shift, researchers typically employ importance weighting. This involves weighting training samples by the density ratio $w(x) = dP_{test}(x) / dP_{train}(x)$. Despite its prevalence, two primary theoretical obstacles have persisted:

  1. The Saturation Phenomenon: Many weighted kernel methods encounter a performance "ceiling." Even if the underlying regression function is highly smooth (possessing high regularity), the convergence rate of the algorithm often stops improving after a specific threshold.
  2. Technical Constraints: Previous analyses often relied on the assumption of "bounded eigenfunctions" for the integral operators associated with the kernel. This condition is notoriously difficult to verify for common kernels, such as the Gaussian (RBF) kernel, limiting the generalizability of the theory.

3. Methodology: Spectral Filters and Weighting

The authors analyze spectral algorithms defined by a filter function $g_\lambda$. In the RKHS framework, the estimator is constructed using the empirical version of an integral operator. The paper evaluates three distinct approaches to weighting:

3.1 Unweighted Algorithms

Surprisingly, the authors prove that if the density ratio $w(x)$ is uniformly bounded, unweighted spectral algorithms can still achieve minimax optimal rates. In these cases, the shift is "mild" enough that the standard empirical risk minimizer remains robust.

3.2 Normalized Weights

To handle more significant shifts, the authors first examine a normalized weighting scheme where weights are scaled such that their mean is 1. While this provides better empirical stability, the authors demonstrate mathematically that this approach still falls victim to the saturation phenomenon.

3.3 Weight Clipping (Truncation)

The core innovation of the paper is the clipped weight spectral algorithm. When the density ratio $w(x)$ is unbounded, a few training points with very high ratios can dominate the estimator, leading to high variance. By clipping the weights at a threshold $D_n$ (where $D_n$ is a function of the sample size $n$), the algorithm prevents these outliers from destabilizing the learning process. This clipping acts as a secondary regularization mechanism.

4. Key Theoretical Results

The paper’s contributions are centered on the convergence rates of the generalization error. Let $r$ denote the smoothness of the target function and $\beta$ represent the capacity (effective dimension) of the RKHS.

  • Bounded Ratios: For bounded density ratios, the optimal rate is shown to be $O(n^{-\frac{r}{2r+\beta}})$.
  • The Saturation Barrier: For standard normalized weighted algorithms, the authors prove a saturation point at $r = 3/2$. Beyond this level of smoothness, the error rate stagnates at $O(n^{-3/(3+\beta)})$, failing to exploit the additional regularity of the function.
  • Breaking the Barrier: The proposed clipped weight algorithm achieves a rate of $O(n^{-\frac{r}{2r+\beta} + \epsilon})$ for any $\epsilon > 0$. This result is significant because it holds even when the density ratio is unbounded and does not require the bounded eigenfunction assumption, making it applicable to a much wider range of kernels.

5. Discussion and Limitations

While the paper provides a breakthrough in the theoretical understanding of covariate shift, several practical challenges remain:

  • Hyperparameter Tuning: The optimal clipping threshold $D_n$ and the regularization parameter $\lambda$ depend on the smoothness $r$, which is typically unknown in practice. Future work is needed to develop adaptive, data-driven methods for parameter selection.
  • Density Estimation: The theory assumes the density ratio $w(x)$ is known. In practice, this ratio must be estimated from unlabeled data, and the error from this estimation phase must be integrated into the total error bounds.
  • Computational Complexity: Implementing weighted spectral filters on large-scale datasets requires efficient numerical methods, particularly when dealing with the matrix inversions or iterations inherent in spectral algorithms.

In conclusion, by introducing weight clipping and utilizing integral operator theory, this work provides a robust path forward for applying spectral algorithms to real-world problems where the i.i.d. assumption no longer holds.

Summary updated

BibTeX
@misc{fan2025spectral,
  author = {Jun Fan and Zheng-Chu Guo and Lei Shi},
  title = {{Spectral Algorithms under Covariate Shift}},
  year = {2025},
  eprint = {2504.12625},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.12625},
}
Figure