Introduction
Canonical Polyadic (CP) tensor decomposition is a cornerstone of unsupervised machine learning, used to uncover hidden, low-rank structures in multi-dimensional arrays. Much like Principal Component Analysis (PCA) for matrices, CP decomposition approximates a tensor as a sum of rank-1 components. However, traditional CP decomposition relies on a squared-error objective, which implicitly assumes that data follows a Gaussian distribution with constant variance.
In real-world applications, this assumption often fails. Datasets frequently consist of binary links, discrete counts, or strictly positive, skewed measurements. Applying standard CP to such data can lead to poor fits, uninterpretable negative components, and nonsensical predictions. This paper introduces Generalized Canonical Polyadic (GCP) tensor decomposition, a framework that allows for arbitrary, statistically motivated loss functions while maintaining the computational efficiency of traditional methods.
The GCP Framework
The core innovation of GCP is the shift from minimizing squared error to minimizing a generic elementwise loss function $f(x, m)$, where $x$ is the observed data and $m$ is the model's prediction. By framing the decomposition as a maximum likelihood estimation problem, researchers can select loss functions that match the statistical properties of their data:
- Binary Data: Bernoulli distributions with logit or odds links.
- Count Data: Poisson distributions.
- Skewed Continuous Data: Gamma or Rayleigh distributions.
Computational Efficiency via MTTKRP
A major challenge in generalizing the loss function is maintaining scalability. Traditional CP uses Alternating Least Squares (ALS), which relies on the closed-form solutions available for squared error. GCP instead employs direct, first-order optimization (L-BFGS-B).
The authors prove that the gradient for any differentiable loss function can be computed using the Matricized Tensor Times Khatri-Rao Product (MTTKRP)— the same highly-optimized operation used in standard CP. By replacing the original data tensor with an elementwise derivative tensor, GCP leverages existing high-performance tensor software libraries.
Experimental Validation
The authors demonstrated the flexibility and robustness of GCP across three diverse domains:
1. Social Network Analysis (Binary Data)
Using a tensor of chat messages (sender $\times$ receiver $\times$ time), the authors compared Bernoulli-based GCP to standard CP for link prediction. GCP not only achieved higher log-likelihoods but also avoided the "impossible" predictions (probabilities outside $[0, 1]$) that plagued standard CP in 11% of test cases.
2. Neuroscience (Non-negative Continuous Data)
In analyzing mouse neural activity during a maze task, GCP with Beta-divergence loss achieved perfect accuracy in predicting the mouse's behavior from extracted components. Unlike standard CP, the GCP factors were strictly non-negative, allowing neuroscientists to more easily identify specific neuron clusters associated with task-specific behaviors.
3. Environmental Science (Skewed Data)
When applied to Indian rainfall data, standard CP was heavily influenced by extreme outliers, failing to capture clear seasonal patterns. In contrast, GCP with a Gamma loss function successfully isolated the monsoon season into a single, clean component, demonstrating superior robustness to skewed distributions.
Conclusion and Future Directions
GCP provides a unified framework for tensor decomposition that respects the underlying statistics of the data. While the current implementation is highly efficient for "scarce" tensors (those with many missing entries), future work aims to improve performance on large-scale "sparse" tensors (those with many zeros). The authors suggest that Stochastic Gradient Descent (SGD) may be the key to scaling GCP to massive datasets where the derivative tensor becomes dense.
Summary updated