Single Pass Entrywise-Transformed Low Rank Approximation

Yifei Jiang, Yi Li, Yiming Sun, Jiaxin Wang, David P. Woodruff

Abstract

Low-Rank Approximation (LRA) is a fundamental tool for compressing large-scale datasets, yet standard sketching techniques fail when applied to matrices undergoing entrywise non-linear transformations. This paper introduces the first single-pass algorithm designed to compute LRA for transformed matrices, such as those using the log-likelihood function $f(x) = \log(|x|+1)$. By utilizing a novel "H-Sketch" data structure and noisy column sampling, the proposed method achieves a 1000x speedup over existing multi-pass algorithms while maintaining near-optimal error guarantees and memory efficiency.

Introduction

In modern data science applications, particularly within Natural Language Processing (NLP) and computer vision, researchers frequently encounter massive $n \times d$ matrices that exceed available RAM. Low-Rank Approximation (LRA) addresses this by factorizing a matrix $A$ into two smaller matrices, $U$ and $V$, such that $A \approx U \cdot V$.

However, practitioners often require the LRA of a transformed version of the data, $f(A)$, rather than the raw matrix itself. For instance, applying a logarithmic transformation to word co-occurrence counts helps dampen the influence of high-frequency stop words, revealing more meaningful latent structures. The primary obstacle is that standard sketching techniques—which rely on the property of linearity—cannot be directly applied because $f(S \cdot A) \neq S \cdot f(A)$. While previous state-of-the-art methods required three passes over the data to handle these non-linearities, this paper presents a breakthrough single-pass solution suitable for streaming environments.

Methodology

The authors' approach centers on maintaining a compact summary, or "sketch," of the matrix as it is processed in a single stream. The architecture relies on three core innovations:

1. The H-Sketch

The H-Sketch is a specialized data structure designed to identify "heavy hitter" columns—those that contribute most significantly to the Frobenius norm of the transformed matrix $f(A)$. It employs a combination of hashing and random signs to isolate these influential columns into buckets, allowing for efficient identification without storing the full matrix.

2. LogSum Sketch

To estimate norms and inner products without the raw vectors, the authors developed the LogSum Sketch. This subroutine approximates the inner product of a transformed vector and a raw vector, providing the necessary metrics to guide the sampling process in a memory-constrained environment.

3. Noisy Column Sampling

A key theoretical contribution of the paper is the validation of "noisy" sampling. In a single-pass setting, capturing the exact columns of $f(A)$ is computationally impossible. The authors prove (Theorem 12) that a subspace spanned by noisy versions of these columns is sufficient to provide a near-optimal approximation. As long as the noisy samples maintain a specific norm relationship to the true columns, the resulting LRA remains highly accurate.

Theoretical and Empirical Results

Improved Error Bounds

The researchers identified and corrected inaccuracies in previous literature regarding linear regression on transformed matrices. By shifting the analysis from the $L_{1,2}$ norm (the sum of Euclidean lengths) to the Frobenius norm (the square root of the sum of squares), they demonstrated that the additive error term is significantly smaller than previously believed. This tighter analysis provides a more robust foundation for LRA in non-linear contexts.

Performance Benchmarks

The algorithm was evaluated using a Wikipedia Word Co-occurrence Matrix ($10,000 \times 10,000$), where entries were transformed using $f(x) = \log(|x|+1)$. The results were definitive:

  • Speed: The one-pass and two-pass versions of the algorithm ran in approximately 0.1% of the time required by previous three-pass methods.
  • Accuracy: Even with the massive reduction in computational overhead, the error ratio remained stable. At a space usage of roughly 20% of the original matrix size, the one-pass algorithm's performance closely tracked the theoretical lower bound for error.
  • Memory Efficiency: The algorithm's memory footprint is $n \cdot \text{poly}(k, \epsilon^{-1}, \log n)$, which is nearly optimal for streaming applications where memory is the primary bottleneck.

Conclusion and Future Work

This work resolves a long-standing open question by providing a viable single-pass algorithm for entrywise-transformed LRA. While the current framework is highly effective for common functions like $\log(1+|x|)$ and $|x|^\alpha$, future research may extend these techniques to a broader class of non-linearities. Additionally, while the H-Sketch shows promise for "turnstile" streams (where data can be both added and deleted), further empirical validation in highly volatile, deletion-heavy environments remains an area for exploration.

Summary updated

BibTeX
@inproceedings{jiang2021single,
  author = {Yifei Jiang and Yi Li and Yiming Sun and Jiaxin Wang and David P. Woodruff},
  title = {{Single Pass Entrywise-Transformed Low Rank Approximation}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
}
Figure