Fast and Accurate Least-Mean-Squares Solvers

Alaa Maalouf, Ibrahim Jubran, Dan Feldman

Least-Mean-Squares (LMS) solvers are the workhorses of modern data science. Whether you are running a simple linear regression, performing Principal Component Analysis (PCA), or regularizing a model with Lasso or Ridge regression, you are likely using an LMS solver under the hood. However, as datasets grow to millions of rows, practitioners face a frustrating trade-off: use fast methods that accumulate numerical errors, or use stable methods that are too slow for "big data" applications.

In a recent NeurIPS paper, researchers from the University of Haifa present a "best of both worlds" solution. They introduce a meta-algorithm that boosts the speed of existing solvers by up to 100x while maintaining—and often improving—numerical accuracy.

TL;DR

The authors developed a linear-time algorithm to compute a "Caratheodory set"—a tiny, weighted subset of data that perfectly preserves the statistical properties (like mean and covariance) of the original massive dataset. By running standard solvers on this "coreset" instead of the full data, they achieve massive speedups and better numerical stability for common tasks like Lasso and Ridge regression.

What Problem Does This Paper Address?

The core challenge lies in how we compute the covariance matrix ($A^T A$), which is the heart of most LMS problems.

There are generally two ways to do this:

  1. The "Summing" Method: You add up the outer products of every row. This is fast and works for streaming data, but it is numerically "brittle." On modern hardware (especially GPUs using 32-bit floats), tiny rounding errors accumulate over millions of additions, eventually leading to significant inaccuracies.
  2. The "Factorization" Method: You use techniques like Singular Value Decomposition (SVD) or QR decomposition. These are much more stable but significantly slower ($O(nd^2)$ with large constants) and are difficult to implement for streaming or distributed data.

The authors sought a way to summarize the data into a tiny subset that is small enough for stable solvers to handle instantly, but accurate enough that no information is lost.

Methods: The "Coresets meet Sketches" Approach

The researchers turned to a classic result in geometry: Caratheodory’s Theorem (1907). The theorem states that any point in the convex hull of $n$ points in $d$ dimensions can be represented as a convex combination of just $d+1$ points.

While mathematically elegant, the traditional algorithm to find this subset takes $O(n^2d^2)$ time—far too slow for practical use. The paper’s breakthrough is FAST-CARATHEODORY-SET, which computes this subset in linear time ($O(nd)$).

Geometric illustration of the merge-and-reduce strategy for coresets.

The algorithm uses a recursive "merge-and-reduce" strategy:

  1. Partition: Divide the $n$ points into small clusters.
  2. Sketch: Compute the mean (a "sketch") of each cluster.
  3. Reduce: Use the (slow) traditional Caratheodory construction on these few cluster means to find a subset of "important" clusters.
  4. Recover: Keep the original data from the selected clusters and discard the rest.
  5. Repeat: Recursively apply this until you are left with only $d+1$ points (or $d^2+1$ points for covariance matrices).

This fusion allows the algorithm to maintain the "subset" property of coresets (preserving the original data's structure and sparsity) while gaining the speed of sketching techniques.

The "Booster" Philosophy

Linear Time is the game changer here. By reducing the complexity of finding a Caratheodory set from quadratic to linear, the authors turned a theoretical curiosity into a practical pre-processing tool.

Crucially, the authors don't try to replace scikit-learn or Intel’s optimized libraries. Instead, they provide a "booster" that shrinks the input data so that these existing libraries can run on a tiny fraction of the original size.

Standard LMS solvers and their objective functions targeted by the booster.

This is especially powerful for Cross-Validation Efficiency. In machine learning, we often run the same solver dozens of times to find the best regularization parameter ($\alpha$). With this method, you compute the coreset once, and then run the parameter search on the tiny subset, leading to the reported 100x speedups.

Key Results and Datasets

The authors evaluated their "booster" using both synthetic data and three diverse real-world datasets (3D Road Network, Household Electric Power Consumption, and House Sales in King County).

  • Speed: For solvers using cross-validation (like LassoCV), the booster improved running times by 10-100x.
  • Accuracy: Theoretically, the error is zero ($\epsilon = 0$). In practice, the numerical error was often orders of magnitude lower than standard streaming methods because the coreset is so small, avoiding the "death by a thousand cuts" of floating-point errors that occur when summing millions of rows.
  • Implementation: The authors provided open-source code and demonstrated that their method works seamlessly with both standard CPython and Intel’s optimized Python distributions.

Limitations and Future Work

The primary limitation lies in dimensionality ($d$). The size of the coreset for covariance matrices grows with $d^2$. While this is a massive reduction for $n=1,000,000$ and $d=10$, the benefit diminishes if the number of features ($d$) is very high (e.g., thousands of features), as the "small" subset might start approaching the size of the original data.

Future directions suggested by the authors include extending this framework to other "sketch-coreset" pairs and optimizing the algorithm specifically for GPU architectures and even higher-dimensional data by processing columns in pairs.

Summary updated

BibTeX
@inproceedings{maalouf2019fast,
  author = {Alaa Maalouf and Ibrahim Jubran and Dan Feldman},
  title = {{Fast and Accurate Least-Mean-Squares Solvers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
}
Figure