TL;DR
Generalized CP (GCP) tensor decomposition moves beyond the standard "one-size-fits-all" squared error loss, allowing researchers to tailor decompositions to specific data types like counts, binary flags, or skewed distributions. By leveraging stochastic optimization and stratified sampling, GCP provides a flexible and scalable framework for uncovering latent patterns in massive, non-Gaussian datasets.
What Problem Does This Paper Address?
Traditional Canonical Polyadic (CP) tensor decomposition is the workhorse of multi-way data analysis, but it has a major limitation: it typically assumes that data errors follow a Gaussian distribution. This leads to the ubiquitous use of the squared error (Frobenius norm) as the "goodness-of-fit" criterion.
However, real-world data is rarely just "real-valued noise." If you are analyzing crime counts, web clicks (binary), or signal-to-noise ratios (Rayleigh distributed), squared error can lead to poor models and misleading interpretations. This paper (presented as a tutorial) introduces Generalized CP (GCP), which allows the user to swap out the standard loss function for one that actually matches the statistical nature of their data.
Methods
The core innovation of GCP is the generalization of the objective function. Instead of minimizing $\sum (x_i - m_i)^2$, GCP minimizes $\sum f(x_i, m_i)$, where $f$ is a loss function chosen by the user.
Key technical components include:
- Diverse Loss Functions: The framework supports a wide array of distributions, including Poisson (for counts), Bernoulli (for binary data), Gamma, Rayleigh, and robust losses like Huber.
- Optimization Suite: To solve these non-linear problems, the authors utilize L-BFGS-B for dense tensors. For large-scale sparse tensors, they employ stochastic methods like SGD, ADAM, and AdaGrad.
- Stratified Sampling: Because sparse tensors are dominated by zeros, standard uniform sampling often fails to capture the "signal." GCP uses stratified sampling to ensure that both zero and non-zero entries are adequately represented during the stochastic gradient descent process.
- Software Implementation: The methods are available via the
gcp_optfunction in the Matlab Tensor Toolbox.
Datasets
The paper demonstrates the power of GCP using the Chicago Crime Data (sourced from the FROSTT tensor repository and the Chicago Data Portal).
- Structure: A 4-way count tensor (6,186 Days × 24 Hours × 77 Community Areas × 32 Crime Types).
- Characteristics: Extremely sparse (98.54% zeros) and contains over 5.3 million non-zero entries.
Key Insights and Ideas
- Loss Functions Matter: The choice of loss function isn't just a mathematical detail; it changes the results. The authors show that using a 'count' (Poisson) loss vs. a 'normal' (Gaussian) loss on the same crime data yields different latent components, with the Poisson model often providing a more natural fit for discrete event data.
- The "Expensive Gradient" Problem: Computing the full gradient for GCP is computationally taxing due to the complexity of the Matrix-Tensor Times-Khatri-Rao Product (MTTKRP). Stochastic gradients are not just an "extra feature"—they are a necessity for making generalized decomposition practical on modern datasets.
- Sampling Strategy is Critical: In sparse tensors, the "zeros" carry information but can overwhelm the "non-zeros." The paper emphasizes that stratified sampling (sampling zeros and non-zeros separately) is the key to achieving good performance in stochastic optimization.
Key Results
Using the Chicago Crime Data, the GCP framework successfully extracted highly interpretable latent factors:
- Temporal Patterns: Components clearly showed weekly cycles (e.g., spikes on weekends) and long-term yearly trends.
- Spatial Patterns: The decomposition mapped specific crime "hotspots" to community areas (e.g., identifying high-theft vs. high-narcotics neighborhoods).
- Categorical Clusters: It grouped related crime types, such as "theft" and "deceptive practice," into distinct components that share similar temporal and spatial profiles.
Limitations and Future Work
- Computational Cost: Even with stochastic methods, computing the GCP gradient remains expensive, and the "MTTKRP" bottleneck is a recurring challenge in tensor algebra.
- Hyperparameter Sensitivity: For stochastic methods, users must manually specify the amount of sampling. Finding the "sweet spot" for sampling rates to ensure both speed and accuracy remains a task for the user.
- Expertise Required: While
gcp_optmakes the process easier, the user still needs the domain knowledge to choose the correct loss function for their specific data type.
Summary updated