Introduction
In the era of big data, tensors—multi-dimensional arrays—have become indispensable for representing complex, multi-way relationships. Applications range from linguistics (subject-verb-object triplets) to recommendation systems (user-item-time interactions). However, as datasets scale to billions of entries, traditional decomposition methods like Canonical Polyadic (CP) Decomposition encounter a significant "memory wall." Standard batch algorithms often require the entire tensor to reside in memory, which is infeasible for massive, sparse datasets that become dense upon averaging.
The Challenge of Scale and Stability
Standard CP decomposition factorizes a static tensor into a sum of rank-one components. In many real-world scenarios, data arrives as a stream of samples. A "naive" approach—averaging all samples into a single giant tensor before decomposition—fails due to several factors:
- Memory Explosion: Averaging sparse samples often results in a dense tensor. For instance, a word co-occurrence tensor can easily exceed hundreds of gigabytes, crashing standard algorithms.
- Static Constraints: New data requires recomputing the entire decomposition from scratch.
- Optimization Instability: Tensor decomposition is non-convex and ill-conditioned. Standard Stochastic Gradient Descent (SGD) frequently diverges unless the learning rate is meticulously tuned.
Proposed Methodology: Expected CP Decomposition
To address these issues, this research introduces Expected CP Decomposition, a framework that decomposes the average of sampled tensors using stochastic optimization. The authors propose three primary algorithms:
- SGD (Baseline): A direct stochastic adaptation of gradient descent.
- 2SGD (Second-order SGD): Incorporates a block-diagonal approximation of the Hessian to provide curvature information, aiding navigation of the complex loss landscape.
- SALS (Stochastic Alternating Least Squares): A cyclic variant of 2SGD that updates factor matrices sequentially.
A critical finding is that 2SGD and SALS are mathematically equivalent to a weighted average of the current solution and a new "least-squares" solution derived from the current sample. This structural property guarantees that the algorithms will not diverge to infinity, regardless of initialization or step size.
Experimental Evaluation
The algorithms were tested on synthetic data and the Amazon Review Dataset, which contains 34 million reviews. For the latter, a "word-word-word" co-occurrence tensor was constructed, featuring over 1.09 billion nonzero elements and dimensions exceeding 500,000 in each mode.
Key Results: Robustness and Scalability
The experiments yielded two major insights:
- Stability via Curvature: As shown in the convergence plots, while standard SGD and other variants often fail to converge without perfect tuning, 2SGD and SALS demonstrate rapid and stable convergence. The inclusion of second-order information effectively tames the ill-conditioned nature of the problem.
- Billion-Scale Scalability: On the Amazon dataset, traditional Alternating Least Squares (ALS) failed, requiring approximately 118GB of RAM. In contrast, the proposed SALS algorithm required only 6GB of RAM to reach a near-optimal solution.
Conclusion and Future Directions
Expected CP decomposition provides a robust, memory-efficient path for analyzing massive multi-way data on commodity hardware. By leveraging stochastic updates and second-order information, the proposed methods achieve a 10x improvement in memory efficiency over batch methods. Future work includes extending this framework to non-squared loss functions, such as Kullback–Leibler divergence, and exploring distributed implementations to further enhance scalability.
Summary updated