Faster Least Squares Optimization

Jonathan Lacotte, Mert PilanciarXiv 2019

Abstract

We investigate iterative methods with randomized preconditioners for solving overdetermined least-squares problems, where the preconditioners are based on a random embedding of the data matrix. We consider two distinct approaches: the sketch is either computed once (fixed preconditioner), or, the random projection is refreshed at each iteration, i.e., sampled independently of previous ones (varying preconditioners). Although fixed sketching-based preconditioners have received considerable attention in the recent literature, little is known about the performance of refreshed sketches. For a fixed sketch, we characterize the optimal iterative method, that is, the preconditioned conjugate gradient as well as its rate of convergence in terms of the subspace embedding properties of the random embedding. For refreshed sketches, we provide a closed-form formula for the expected error of the iterative Hessian sketch (IHS), a.k.a. preconditioned steepest descent. In contrast to the guarantees and analysis for fixed preconditioners based on subspace embedding properties, our formula is exact and it involves the expected inverse moments of the random projection. Our main technical contribution is to show that this convergence rate is, surprisingly, unimprovable with heavy-ball momentum. Additionally, we construct the locally optimal first-order method whose convergence rate is bounded by that of the IHS. Based on these theoretical and numerical investigations, we do not observe that the additional randomness of refreshed sketches provides a clear advantage over a fixed preconditioner. Therefore, we prescribe PCG as the method of choice along with an optimized sketch size according to our analysis. Our prescribed sketch size yields state-of-the-art computational complexity for solving highly overdetermined linear systems. Lastly, we illustrate the numerical benefits of our algorithms.

Introduction

In the era of "big data," overdetermined least-squares problems—where the number of observations $n$ significantly exceeds the number of features $d$—are ubiquitous. Standard direct solvers, such as QR decomposition, scale at $\mathcal{O}(nd^2)$, which becomes prohibitively expensive as $n$ grows. While iterative methods like Gradient Descent offer an alternative, their convergence speed is tied to the condition number of the data matrix; poorly scaled data can lead to agonizingly slow performance.

Randomized preconditioning, or "sketching," has emerged as a powerful remedy. By multiplying the data matrix $A$ by a smaller random matrix $S$, researchers can create a "sketch" that preserves the essential geometry of the data. This sketch then serves as a preconditioner. However, a fundamental question remained: is it better to compute one sketch and use it throughout (fixed preconditioning), or to refresh the random sketch at every iteration (refreshed preconditioning)? This paper provides a unified analysis to identify the mathematically optimal approach for solving these systems.

Methodology and Theoretical Framework

The study evaluates several first-order iterative methods under randomized preconditioning, including the Iterative Hessian Sketch (IHS), Polyak-IHS (adding heavy-ball momentum), Preconditioned Conjugate Gradient (PCG), and Generalized/Flexible CG (GCC/FCG) for varying preconditioners. The analysis covers a range of sketching distributions, such as Gaussian embeddings, Haar matrices, and the Subsampled Randomized Hadamard Transform (SRHT).

Critical sketch sizes $m_\delta$ for various embedding techniques required to achieve subspace embedding properties.

To compare these methods, the researchers utilized two analytical lenses:

  1. Extreme Eigenvalue Analysis: Used to bound the worst-case performance of fixed sketches based on their subspace embedding properties.
  2. Moment-Based Analysis: A novel approach for refreshed sketches that utilizes the "inverse moments" of random matrices to derive exact expected error formulas, moving beyond traditional upper bounds.

Theoretical proofs were validated using synthetic matrices with $n$ up to $10^7$ and $d$ up to $100$, testing the algorithms' sensitivity across different types of random embeddings.

Key Insights: The Momentum Paradox and PCG Optimality

The Optimality of Fixed PCG

The analysis confirms that for a fixed sketch, PCG is the globally optimal first-order method. Its convergence rate is fully predictable based on the extreme eigenvalues of the sketched subspace, making it a robust and reliable choice for practitioners.

The Momentum Paradox

One of the most surprising theoretical findings is that adding heavy-ball momentum to refreshed sketches does not provide acceleration. While momentum is a standard tool for speeding up optimization, the "refreshed" randomness at each step essentially resets the benefits that momentum typically accumulates. This suggests that the added complexity of momentum is unnecessary when using refreshed sketches.

Exactness via Moments

By providing an exact formula for the expected error of refreshed IHS based on inverse moments, the authors offer a finer-grained understanding of how sketch size affects convergence compared to previous literature that relied on looser bounds.

Results and Computational Complexity

The authors derive an "optimized sketch size" that minimizes the total computational cost—the sum of sketching time and iteration time. For highly overdetermined systems where $n > d^2$, they achieve a state-of-the-art complexity of: $$\mathcal{C} = \mathcal{O}\left(nd\left(\log d + \frac{\log(1/\epsilon)}{\log(n/d^2)}\right)\right)$$

This represents a significant improvement over the classical prescription of $m = \mathcal{O}(d \log d)$, which carries a higher logarithmic overhead. In practical tests using SRHT, this optimized approach reduced total computational costs by over 50% compared to standard recommendations. Ultimately, because refreshed sketches (GCC) offer no clear advantage over a well-tuned fixed sketch, the authors prescribe PCG with a fixed SRHT sketch as the most efficient general-purpose solver.

Conclusion and Future Directions

While this work establishes PCG as the method of choice, several avenues for future research remain. Characterizing a globally optimal method for the refreshed setting remains an open theoretical problem. Additionally, the analysis for the Sparse Johnson-Lindenstrauss Transform (SJLT) is currently limited by the lack of well-characterized inverse moments in existing literature. Finally, future work should adapt these sketch-size optimizations to specific hardware architectures, such as GPUs or distributed clusters, where communication costs may shift the balance of the "optimal" sketch size.

Summary updated

BibTeX
@misc{lacotte2019faster,
  author = {Jonathan Lacotte and Mert Pilanci},
  title = {{Faster Least Squares Optimization}},
  year = {2019},
  eprint = {1911.02675},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.02675},
}
Figure