Streaming Generalized Canonical Polyadic Tensor Decompositions

Eric T. Phipps, Nicholas T. Johnson, Tamara G. Kolda

Introduction

Tensor decomposition, particularly Canonical Polyadic (CP) decomposition, is a cornerstone of multi-dimensional data analysis, allowing researchers to extract latent patterns from complex datasets such as spatio-temporal traffic flows or crime records. However, traditional CP decomposition methods face two significant challenges in modern data environments. First, most existing streaming algorithms rely on a Gaussian noise assumption (least-squares objectives), which is often inappropriate for discrete data like counts or binary events. Second, the sheer volume and velocity of streaming data make "batch" processing—where the entire dataset is re-analyzed upon the arrival of new data—computationally and memory-prohibitively expensive.

This paper introduces OnlineGCP, a novel algorithm designed to perform Generalized Canonical Polyadic (GCP) tensor decompositions on streaming data. By supporting arbitrary loss functions and employing efficient stochastic optimization, OnlineGCP enables accurate, real-time modeling of non-Gaussian temporal data.

The OnlineGCP Methodology

The core of the OnlineGCP framework is its ability to handle diverse data types through generalized loss functions $f(x, m)$. These functions are derived from maximum likelihood estimations, such as Poisson distributions for count data and Bernoulli distributions for binary data. This flexibility ensures that the underlying statistical properties of the data are preserved during the decomposition process.

Balancing History and Innovation

A critical challenge in streaming decomposition is preventing the model from "forgetting" historical patterns while remaining sensitive to new information. OnlineGCP addresses this through a tunable history term. Rather than penalizing changes to the raw factor matrices, the authors penalize changes to the resulting Kruskal tensor (the model itself). This approach is more robust because it accounts for the fact that different factor matrix configurations can represent the same underlying model.

To manage historical data without storing the entire stream, the algorithm utilizes reservoir sampling. This maintains a representative subset of past data slices, providing a stable reference for the optimization process. When a new data slice arrives, the algorithm follows a two-step segregated solve:

  1. Temporal Weight Estimation: The algorithm first determines how the new slice fits into existing latent patterns.
  2. Factor Matrix Update: The global patterns (factor matrices) are updated using Stochastic Gradient Descent (SGD).

Optimization and Scalability

To handle massive, sparse tensors, OnlineGCP employs the ADAM optimizer and stratified sampling, which samples non-zero and zero entries separately to maintain efficiency. The algorithm is implemented within the GenTen software package, leveraging the Kokkos framework to ensure performance portability across both CPU and GPU architectures.

Experimental Evaluation

The authors validated OnlineGCP using a combination of synthetic benchmarks and high-dimensional real-world datasets:

  • Synthetic Tensors: Gaussian and Poisson tensors were used to confirm that the streaming approach could recover ground-truth latent factors with accuracy comparable to batch methods.
  • NYC Taxicab Data: A 4-way tensor (Zone × Zone × Hour × Day) representing taxi trip counts, modeled using a Poisson loss function.
  • Chicago Crime Data: A 4-way tensor (Type × Neighborhood × Hour × Day) representing binary crime occurrences, modeled using a Bernoulli loss function.

Key Results and Insights

The experiments yielded several significant findings regarding the performance and utility of OnlineGCP:

  • Accuracy Parity: OnlineGCP achieves reconstruction losses (both local and global) that are nearly identical to static batch methods, even though it only processes data incrementally.
  • Memory Efficiency: By processing data slice-by-slice and utilizing SGD, the memory footprint remains constant, regardless of the total duration of the data stream.
  • The Importance of Non-Gaussianity: The results demonstrate that using the correct loss function (e.g., Bernoulli for binary crime data) leads to more stable and interpretable decompositions than forcing the data into a standard least-squares model.
  • Adaptability: By adjusting the history weight ($w$) and the discount factor ($θ$), the algorithm can be tuned to either adapt quickly to "concept drift" (changing trends) or remain resilient against outliers and noise.

Conclusion and Future Work

OnlineGCP represents a significant advancement in streaming tensor analysis, providing a scalable and statistically sound framework for non-Gaussian data. While the algorithm demonstrates high performance, the authors note that it currently requires expert tuning for hyperparameters such as learning rates and sampling ratios. Future research will focus on developing automated tuning mechanisms to make OnlineGCP more accessible for non-expert users and exploring even more robust optimization strategies to further enhance streaming efficiency.

Summary updated

BibTeX
@inproceedings{phipps2021streaming,
  author = {Eric T. Phipps and Nicholas T. Johnson and Tamara G. Kolda},
  title = {{Streaming Generalized Canonical Polyadic Tensor Decompositions}},
  booktitle = {PASC},
  year = {2021},
  doi = {10.1145/3592979.3593405},
}
Figure