Learning-Based Low-Rank Approximations

Piotr Indyk, Ali Vakilian, Yang Yuan

Low-rank approximation (LRA) is the "Swiss Army knife" of data science, powering everything from Principal Component Analysis (PCA) to recommendation systems. Traditionally, we rely on random projections—often called "sketches"—to compress massive matrices into manageable sizes. But what if we could teach our algorithms to recognize the specific structure of our data?

In their paper, Indyk, Vakilian, and Yuan demonstrate that "learning" a sketching matrix can outperform traditional random methods by up to an order of magnitude. By replacing standard random matrices with learned ones, their method significantly reduces approximation error while maintaining theoretical worst-case safety nets.

The Problem with "One-Size-Fits-All" Sketches

In many real-world applications, such as processing daily video streams or server logs, data isn't truly random or worst-case. Instead, it comes from a distribution that remains relatively stable over time. However, classical algorithms for low-rank decomposition use random sketching matrices ($S$) that treat every input exactly the same.

This presents a twofold challenge:

  1. Efficiency: Can we achieve the same accuracy with a much smaller "sketch," thereby saving memory and communication costs?
  2. Adaptability: Can we move away from "one-size-fits-all" random matrices toward matrices optimized for specific datasets, like video frames or text documents?

Methods: Learning the Sketch

The authors build upon the well-known Sarlos-Clarkson-Woodruff (SCW) algorithm. Normally, SCW uses a sparse random matrix to project a large matrix $A$ into a smaller, more manageable $SA$.

The paper’s core innovation is replacing the random $S$ with a learned $S$. To achieve this, they treat the sketching matrix as a set of weights to be optimized via gradient descent. However, the main hurdle is that the Singular Value Decomposition (SVD) step required in the algorithm isn't naturally differentiable, which breaks standard backpropagation.

Differentiable SVD

To solve the backpropagation issue, the authors implement a differentiable SVD. They use the power method to iteratively find singular values. This approach "unrolls" the SVD into a series of differentiable matrix multiplications, allowing them to use PyTorch’s autograd to compute gradients effectively.

Differentiable SVD implementation using the power method

Mixed Sketches for Safety

To address the fear that a learned matrix might fail catastrophically on "out-of-distribution" data, they propose Mixed Sketches. By concatenating a learned matrix with a random one, they prove that the algorithm performs at least as well as the random sketch alone, providing a theoretical "safety net."

Key Insights and Results

The authors evaluated their approach on several real-world data types, including high-resolution YouTube video frames (Logo, Friends, Eagle), hyperspectral images (Hyper), and sparse, high-dimensional text categorization data (Tech).

  • Structure Matters: Random sketches are "fair" to all data but "good" to none. By training on past instances, the learned sketch identifies which "directions" in the data are consistently important.
  • The Power of Sparsity: The authors maintain the same sparsity structure as traditional sketches (one non-zero entry per column). This ensures that the learned matrix is just as fast to use during inference as a random one.
  • Massive Error Reduction: On video datasets, learned sketches achieved up to 20x lower error than sparse random sketches for the exact same sketch size. On text and hyperspectral data, the improvement was still a significant 2x to 3x.
Test error comparison across datasets showing massive reductions for learned sketches
  • Efficiency Gains: A learned sketch with only 10 rows often outperformed a random sketch with 80 rows, representing an 8x improvement in space efficiency.
  • No Inference Overhead: Since the learned matrix has the same structure as the random one, the actual LRA computation time remains identical (approximately 0.03 seconds in their tests).

Limitations and Future Work

While the inference is incredibly fast, the training process is slow. It took roughly 2.6 hours to train a matrix that takes milliseconds to use. This makes the method highly practical for recurring tasks (like daily logs or continuous video streams) but less suitable for one-off problems.

Additionally, the method is currently limited to linear sketches. The authors note that non-linear sketching (like "Frequent Directions") is an interesting but more difficult target for learning-based optimization. Finally, extending their rigorous generalization proofs from the simplified $m=1$ case to larger, more complex sketching matrices remains an open theoretical challenge.

Summary updated

BibTeX
@inproceedings{indyk2019learning,
  author = {Piotr Indyk and Ali Vakilian and Yang Yuan},
  title = {{Learning-Based Low-Rank Approximations}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
}
Figure