Practical Leverage-Based Sampling for Low-Rank Tensor Decomposition

Brett W. Larsen, Tamara G. Kolda · DOI

Introduction

Tensor decomposition is a fundamental tool in unsupervised learning, extending the capabilities of Principal Component Analysis (PCA) to high-dimensional data arrays. The Canonical Polyadic (CP) decomposition is particularly popular for analyzing multi-way interactions, such as user-item-time data. However, the standard computational approach, Alternating Least Squares (CP-ALS), faces significant scalability challenges when applied to massive, sparse tensors containing billions of nonzeros.

In CP-ALS, the algorithm iteratively solves a sequence of overdetermined least squares problems. For large-scale data, these subproblems become a computational bottleneck. While Randomized Numerical Linear Algebra (RandNLA) provides "sketching" techniques to approximate these solutions, many existing methods are ill-suited for sparse data. For instance, methods relying on Fast Fourier Transforms (FFTs) destroy sparsity, leading to prohibitive memory requirements. This paper introduces CP-ARLS-LEV, a randomized algorithm designed to perform efficient CP decomposition on massive sparse tensors by leveraging importance sampling.

Methodology: CP-ARLS-LEV

The core of the proposed method is leverage-score sampling. Instead of solving the full least squares problem at each iteration, CP-ARLS-LEV samples a small subset of rows based on their "leverage scores," which represent the influence of each row on the overall solution.

Efficient Leverage Score Estimation

Calculating exact leverage scores for the massive Khatri-Rao Product (KRP) matrices involved in CP-ALS is computationally expensive. To circumvent this, the authors utilize a technique to upper-bound these scores using the much smaller individual factor matrices. This allows for efficient sampling without the need to explicitly form the massive KRP matrix.

Practical Algorithmic Innovations

The paper introduces two critical improvements to handle the "concentrated" probability distributions often found in real-world data:

  1. Row Combining: In pure random sampling, rows with high leverage scores are frequently sampled multiple times. CP-ARLS-LEV identifies these duplicates, combines them, and adjusts their weights accordingly. This reduces the size of the sketched system without sacrificing mathematical accuracy.
  2. Hybrid Deterministic/Random Sampling: To further stabilize the approximation, the algorithm deterministically includes rows with the highest leverage scores and randomly samples the remaining budget from the rest of the distribution.

Additionally, the authors address the cost of convergence checks. Rather than calculating the exact "fit" (error) of the decomposition—which is prohibitively expensive for billion-nonzero tensors—they employ stratified random sampling to provide a high-quality estimate of the fit.

Theoretical Insights

A key contribution of this work is the mathematical proof regarding the sample complexity of the algorithm. For a $(d+1)$-way tensor, the number of sampled rows required for an accurate solution is $O(r^d/\epsilon)$, where $r$ is the rank and $\epsilon$ is the error tolerance. Significantly, this bound is independent of the physical dimensions of the tensor and the number of nonzeros, ensuring that the method scales gracefully as data volume increases.

Furthermore, the authors emphasize that the hybrid sampling and row-combining techniques are broadly applicable to any matrix sketching problem characterized by skewed leverage scores, not just tensor decompositions.

Experimental Results

The authors evaluated CP-ARLS-LEV on several massive datasets from the FROSTT repository, comparing it against standard CP-ALS and other randomized benchmarks.

  • Reddit (4.7B nonzeros): The standard CP-ALS algorithm required approximately 4 days to converge. CP-ARLS-LEV achieved the same accuracy in just 6 hours, representing a 12x to 16x speedup.
  • Amazon (1.7B nonzeros): The method reduced the computation time from 5 hours to under 25 minutes (a 13x speedup).
  • Uber (3.3M nonzeros): While smaller, this dataset highlighted the memory efficiency of the approach. CP-ARLS-LEV maintained a 0.14 GB footprint, whereas FFT-based randomized methods would have required 68 GB by forcing the data into a dense format.

The hybrid sampling approach also demonstrated superior numerical stability, achieving roughly two additional digits of accuracy compared to pure random sampling for a fixed sample budget.

Limitations and Future Work

While CP-ARLS-LEV offers significant performance gains, several areas remain for future exploration. Currently, hyperparameters such as the sample size ($s$) and the deterministic threshold ($\tau$) are determined through heuristics. Automating the selection of these parameters is a priority. Additionally, while the authors conjecture that hybrid sampling improves theoretical error bounds, a formal proof is still needed. Finally, the sampling-based nature of the algorithm makes it an ideal candidate for distributed computing environments, which the authors plan to explore in future implementations.

Summary updated

BibTeX
@article{larsen2020practical,
  author = {Brett W. Larsen and Tamara G. Kolda},
  title = {{Practical Leverage-Based Sampling for Low-Rank Tensor Decomposition}},
  journal = {SIAM J. Matrix Anal. Appl.},
  year = {2020},
  doi = {10.1137/21m1441754},
}
Figure