Tensor decomposition is the "Swiss Army Knife" of multi-way data analysis, used for everything from recommender systems to signal processing. However, as datasets grow into the "large-scale" territory, traditional methods hit a wall. In their paper, "Stochastic Gradients for Large-Scale Tensor Decomposition," Tamara G. Kolda and David Hong introduce a way to break through that wall using stochastic optimization and clever sampling strategies.
TL;DR
This paper introduces a scalable framework for Generalized Canonical Polyadic (GCP) tensor decomposition using stochastic gradient descent (SGD). By employing novel stratified and semi-stratified sampling techniques, the authors enable efficient decomposition of massive sparse tensors that were previously computationally intractable, achieving significant speedups over traditional batch methods.
What Problem Does This Paper Address?
Standard tensor decomposition (like CP) usually minimizes the sum of squared errors. While useful, this doesn't fit all data types—think binary data or count data. The Generalized CP (GCP) framework was recently proposed to allow for arbitrary loss functions (like Bernoulli or Poisson), but it has a major bottleneck: the gradient.
In GCP, even if your input data tensor is sparse, the "partial gradient tensor" used during optimization is almost always dense. For a large $d$-way tensor of size $n$, computing this gradient costs $O(rn^d)$. If $n=1000$ and $d=4$, you’re looking at trillions of operations per iteration. This makes GCP impossible to use for the very large-scale problems where it would be most beneficial.
Methods
The authors propose moving from batch gradients to Stochastic Gradient Descent (SGD), specifically using the Adam optimizer. The core idea is to estimate the gradient using only a small subset of the tensor's entries.
The paper details three sampling strategies:
- Uniform Sampling: Best for dense tensors. You pick $s$ indices at random.
- Stratified Sampling: Essential for sparse tensors. Because non-zero entries are rare but highly informative, the algorithm samples non-zeros and zeros separately (in two "strata") and weights them to provide an unbiased estimate of the full gradient.
- Semi-Stratified Sampling: A computational optimization. Standard stratified sampling requires "rejection sampling" to ensure a "zero" sample isn't actually a non-zero, which is slow. Semi-stratified sampling picks "zeros" from the entire index space and applies a mathematical correction during the non-zero sampling phase to fix the bias.
Datasets
The authors evaluated their approach on four distinct types of data:
- Artificial Dense Tensors: Generated using a Gamma distribution to test robust estimation.
- Artificial Sparse Tensors: Generated using a Bernoulli "odds" model to test binary decomposition.
- Real-World Dense: A chemo-sensing dataset (Gas Sensor Measurements) consisting of 71 sensors over 1250 time points across various temperatures and trials.
- Real-World Sparse: Chicago Crime Data, a 4-way count tensor (Day × Hour × Community × Crime Type) with over 5.3 million non-zero entries.
Key Insights and Ideas
- The "Sum of Dimensions" Rule: Experimentally, the authors found that sampling a number of elements roughly equal to the sum of the tensor's dimensions ($s \approx \sum n_k$) is often sufficient for convergence. This is a massive reduction from the total number of entries ($n^d$).
- Stratification is Non-Negotiable for Sparsity: If you use uniform sampling on a sparse tensor (e.g., 0.3% dense), your stochastic gradient will almost never "see" a non-zero entry, causing the optimization to fail. Stratification ensures the "signal" from non-zeros is always present.
- The MTTKRP Advantage: The stochastic gradient is efficient because it can be computed using the sparse Matricized-Tensor-Times-Khatri-Rao Product (MTTKRP) kernel, which is the workhorse of tensor computations.
Key Results
- Speed: For dense problems, the stochastic approach was roughly an order of magnitude faster than non-stochastic methods (like L-BFGS-B) while reaching the same solution quality.
- Feasibility: For large sparse problems (like the Chicago Crime data), the stochastic method succeeded where traditional GCP would have required terabytes of memory to store the gradient.
- Variance Reduction: Stratified and semi-stratified sampling showed significantly lower empirical variance and bias compared to uniform sampling on sparse data, leading to faster and more reliable convergence.
- Clustering: On the gas sensor data, the stochastic method successfully recovered factors that allowed for accurate clustering of different gas types, proving that the approximation doesn't sacrifice the "meaning" of the decomposition.
Limitations and Future Work
- Rank Selection: Like most tensor decomposition research, this paper assumes the rank ($r$) is known. Determining the optimal rank for a large-scale GCP model remains a difficult, open problem.
- Theoretical Gaps: While the empirical results are strong, the authors note that more work is needed to develop a formal theory describing the exact convergence gains provided by stratified sampling in the context of tensors.
- Hyperparameter Tuning: While Adam is more robust than standard SGD, the choice of learning rate and sampling size still requires some manual experimentation.
Summary updated