Improving Implicit Regularization of SGD with Preconditioning for Least Square Problems

Junwei Su, Difan Zou, Chuan WuarXiv 2024

Abstract

Stochastic gradient descent (SGD) exhibits strong algorithmic regularization effects in practice and plays an important role in the generalization of modern machine learning. However, prior research has revealed instances where the generalization performance of SGD is worse than ridge regression due to uneven optimization along different dimensions. Preconditioning offers a natural solution to this issue by rebalancing optimization across different directions. Yet, the extent to which preconditioning can enhance the generalization performance of SGD and whether it can bridge the existing gap with ridge regression remains uncertain. In this paper, we study the generalization performance of SGD with preconditioning for the least squared problem. We make a comprehensive comparison between preconditioned SGD and (standard & preconditioned) ridge regression. Our study makes several key contributions toward understanding and improving SGD with preconditioning. First, we establish excess risk bounds (generalization performance) for preconditioned SGD and ridge regression under an arbitrary preconditions matrix. Second, leveraging the excessive risk characterization of preconditioned SGD and ridge regression, we show that (through construction) there exists a simple preconditioned matrix that can make SGD comparable to (standard & preconditioned) ridge regression. Finally, we show that our proposed preconditioning matrix is straightforward enough to allow robust estimation from finite samples while maintaining a theoretical improvement. Our empirical results align with our theoretical findings, collectively showcasing the enhanced regularization effect of preconditioned SGD.

Introduction

In the era of overparameterized machine learning, models often possess more parameters than available data points. Despite this, Stochastic Gradient Descent (SGD) frequently yields models that generalize well to unseen data. This phenomenon is attributed to "implicit regularization," where the optimization algorithm itself biases the solution toward simpler configurations. However, a known performance gap exists: in "ill-conditioned" scenarios—where data variance is highly non-uniform across different dimensions—SGD's implicit regularization can be significantly weaker than the explicit $L_2$ regularization of Ridge Regression. This paper investigates whether preconditioning can bridge this gap by rebalancing optimization across the data's eigenspectrum.

Methodology

Preconditioned SGD (PreSGD)

The authors analyze Preconditioned SGD for least-squares problems, deriving new excess risk bounds that characterize generalization error under arbitrary preconditioning matrices. They propose a specific, "damped" preconditioning matrix designed not just for speed, but for regularization:

$$G = (\beta \mathbf{H} + \mathbf{I})^{-1}$$

where $\mathbf{H}$ represents the data covariance matrix and $\beta$ is a tunable constant. Unlike traditional preconditioning that seeks to approximate $\mathbf{H}^{-1}$ to accelerate convergence, this form flattens the eigenspectrum of the data. This ensures that SGD's bias error, which typically decays slowly in directions with small eigenvalues, is addressed more uniformly.

Practical Estimation: PreSGD-Est

Since the true population covariance $\mathbf{H}$ is typically unknown, the researchers introduced PreSGD-Est. This variant estimates the preconditioning matrix using a finite set of unlabeled data. This approach leverages the distribution of features to enhance regularization without requiring additional labeled samples.

Experimental Setup

The theoretical findings were validated through controlled simulations of synthetic Gaussian Least Square problems. Six distinct instances were created by varying:

  1. The Eigenspectrum: Eigenvalues of the covariance matrix decaying as $i^{-1}$ or $i^{-2}$.
  2. Model Structure: The ground-truth model vector $w^*$ was varied (e.g., $w^*[i] = 1, i^{-1}, \text{ or } i^{-10}$).

Performance was evaluated using Mean Squared Error (MSE) on an independent test set of 1,000 samples, comparing standard SGD, PreSGD (with known covariance), Ridge Regression, and PreSGD-Est (with estimated covariance).

Key Results

The empirical results strongly support the theoretical claim that preconditioning can match or exceed the regularization benefits of Ridge Regression.

Comparison of MSE for SGD, PreSGD, Ridge, and PreSGD_Est across six synthetic problem instances with varying eigenspectra and model structures.

As shown in the figures above, PreSGD (red) consistently matches or outperforms standard SGD (blue) and Ridge Regression (green). Notably, PreSGD-Est (purple), which relies on estimated covariance from finite unlabeled data, tracks the performance of the ideal PreSGD closely. This demonstrates that the proposed regularization boost is robust to estimation noise. The core insight is that by "flattening" the spectrum, PreSGD ensures that the model learns important features in leading directions more effectively, closing the previously observed gap between implicit and explicit regularization.

Conclusion and Future Work

This work provides a rigorous foundation for using preconditioning as a regularization tool. The authors prove that for any generalizable Ridge Regression solution, a corresponding PreSGD configuration exists that is at least as effective. Furthermore, they demonstrate that unlabeled data can be a powerful resource for improving SGD's generalization via covariance estimation.

While this study focuses on linear least-squares problems, preliminary discussions on ReLU Regression suggest these principles may extend to non-linear models. Future research will explore decaying step sizes and the application of these preconditioning strategies to deep neural networks.

Summary updated

BibTeX
@misc{su2024improving,
  author = {Junwei Su and Difan Zou and Chuan Wu},
  title = {{Improving Implicit Regularization of SGD with Preconditioning for Least Square Problems}},
  year = {2024},
  eprint = {2403.08585},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.08585},
}
Figure