Online Robust Regression via SGD on the l1 loss

Scott Pesme, Nicolas Flammarion

Abstract

Robust linear regression is critical for handling data streams contaminated by adversarial outliers. While offline methods are well-studied, they are often computationally prohibitive for large-scale or streaming applications. This paper demonstrates that a simple, parameter-free approach—applying Stochastic Gradient Descent (SGD) with Polyak-Ruppert averaging to the $\ell_1$ loss—achieves an optimal $O(1/n)$ convergence rate in an online setting. We highlight how the Gaussian nature of the features "smooths" the non-differentiable $\ell_1$ loss, providing local strong convexity and resilience to both outlier magnitude and feature ill-conditioning.

Introduction

Linear regression is a foundational statistical tool, but standard least-squares regression is notoriously fragile; even a single massive outlier can completely derail the model. Robust regression aims to recover the true underlying signal even when a fraction of the data is arbitrarily corrupted by an adversary.

While many algorithms exist for robust regression, almost all of them operate in an offline setting, requiring the entire dataset to be loaded into memory to identify and filter corrupted points. This is computationally expensive and unrealistic for massive, modern datasets or streaming applications like real-time fraud detection or sensor monitoring. This paper addresses the challenge of designing an efficient, strictly online algorithm that processes one data point at a time while maintaining rigorous recovery guarantees.

Methodology

Instead of designing complex outlier-filtering subroutines, the authors revisit a classic approach: minimizing the $\ell_1$ loss (Least Absolute Deviations) using Stochastic Gradient Descent (SGD) with Polyak-Ruppert averaging.

In this online setup, the algorithm receives a stream of data points. For each point, it updates its parameter estimate by taking a step in the direction of the sign of the residual (the error). The final output is the average of all these step estimates. The novelty of this work lies in the theoretical analysis of this simple algorithm within an adversarial, online setting. The authors analyze a model where data has standard Gaussian noise plus sparse adversarial outliers injected by an oblivious adversary (one that does not know the specific feature values).

Theoretical Insights

The paper provides several key insights into why this simple approach is so effective:

  • Gaussian Smoothing: The $\ell_1$ loss is famously non-differentiable at zero, which usually restricts gradient methods to a slow $O(1/\sqrt{n})$ convergence rate. However, the authors show that taking the expectation over continuous Gaussian features and dense noise naturally smooths the expected loss function.
  • Local Strong Convexity: Due to this smoothing effect, the expected $\ell_1$ loss becomes locally strongly convex around the true parameter. This geometric property allows averaged SGD to achieve a fast $O(1/n)$ convergence rate.
  • Immunity to Outlier Magnitude: The convergence rate depends on the effective outlier proportion, not the raw magnitude of the outliers. Whether an adversary changes a label to 100 or 1,000,000, the algorithm's performance remains unchanged.
  • Insensitivity to Ill-Conditioning: Unlike many least-squares-based robust methods, the dominant convergence terms of this SGD approach are independent of the condition number of the feature covariance matrix, ensuring performance does not degrade with highly correlated features.
  • Parameter-Free Deployment: Unlike the Huber loss, which requires tuning a threshold parameter to define outliers, the $\ell_1$ loss requires zero hyperparameter tuning.

Empirical Results

The authors evaluated the method using synthetic datasets with Gaussian features and sparse adversarial outliers. The results confirmed the theoretical findings:

  1. Optimal Convergence: The algorithm matches the theoretical $O(1/n)$ rate and performs as well as "oracle" algorithms that have perfect knowledge of which points are outliers.
  2. Efficiency: The proposed online method matches the accuracy of state-of-the-art offline robust algorithms (such as AdaCRR) but is significantly faster and more resilient when the data's covariance matrix is ill-conditioned.

Limitations and Future Work

The current theoretical guarantees rely on the assumption that input features and dense background noise follow a Gaussian distribution. If the data is highly non-Gaussian, the smoothing effect may not hold. Additionally, the analysis assumes an "oblivious" adversary. Future research may explore adaptive adversaries—where the adversary can inspect features before corrupting labels—and the combination of this approach with sparse recovery techniques for high-dimensional problems.

Summary updated

Abstract

We consider the robust linear regression problem in the online setting where we have access to the data in a streaming manner, one data point after the other. More specifically, for a true parameter $\theta^*$, we consider the corrupted Gaussian linear model $y = \langle x , \ \theta^* \rangle + \varepsilon + b$ where the adversarial noise $b$ can take any value with probability $\eta$ and equals zero otherwise. We consider this adversary to be oblivious (i.e., $b$ independent of the data) since this is the only contamination model under which consistency is possible. Current algorithms rely on having the whole data at hand in order to identify and remove the outliers. In contrast, we show in this work that stochastic gradient descent on the $\ell_1$ loss converges to the true parameter vector at a $\tilde{O}( 1 / (1 - \eta)^2 n )$ rate which is independent of the values of the contaminated measurements. Our proof relies on the elegant smoothing of the non-smooth $\ell_1$ loss by the Gaussian data and a classical non-asymptotic analysis of Polyak-Ruppert averaged SGD. In addition, we provide experimental evidence of the efficiency of this simple and highly scalable algorithm.
BibTeX
@inproceedings{pesme2020online,
  author = {Scott Pesme and Nicolas Flammarion},
  title = {{Online Robust Regression via SGD on the l1 loss}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=vKP0WntY_MV},
}
Figure