Abstract
Tensor decompositions are higher-order analogues of matrix decompositions and have proven to be powerful tools for data analysis. In particular, we are interested in the canonical tensor decomposition, otherwise known as the CANDECOMP/PARAFAC decomposition (CPD), which expresses a tensor as the sum of component rank-one tensors and is used in a multitude of applications such as chemometrics, signal processing, neuroscience, and web analysis. The task of computing the CPD, however, can be difficult. The typical approach is based on alternating least squares (ALS) optimization, which can be remarkably fast but is not very accurate. Previously, nonlinear least squares (NLS) methods have also been recommended; existing NLS methods are accurate but slow. In this paper, we propose the use of gradient-based optimization methods. We discuss the mathematical calculation of the derivatives and further show that they can be computed efficiently, at the same cost as one iteration of ALS. Computational experiments demonstrate that the gradient-based optimization methods are much more accurate than ALS and orders of magnitude faster than NLS.
Introduction
Tensors, or multidimensional arrays, provide a natural framework for representing complex data structures beyond the standard two-dimensional matrix. The Canonical Polyadic Decomposition (CPD) is a cornerstone of tensor analysis, enabling the identification of latent patterns by decomposing a tensor into a sum of rank-one components. This technique is indispensable in fields ranging from neuroscience to signal processing.
Despite its utility, fitting a CPD model is computationally challenging. The industry standard, Alternating Least Squares (ALS), is prized for its speed but frequently converges to local minima or fails in the presence of noise and "overfactoring" (extracting more components than exist). Conversely, traditional Nonlinear Least Squares (NLS) offers superior accuracy but suffers from prohibitive computational and memory costs, limiting its scalability for large datasets.
Methodology: A Gradient-Based Framework
This research introduces a simultaneous gradient-based optimization (OPT) framework designed to bridge the gap between ALS and NLS. Unlike the alternating approach, which updates one factor matrix at a time, the OPT method optimizes all factor matrices concurrently.
Efficient Gradient Computation
A primary contribution of this work is the derivation of efficient derivatives for the CPD objective function. The authors demonstrate that the gradient can be computed using the Matricized-Tensor Times Khatri-Rao Product (mttkrp). Since mttkrp is the core operation driving ALS, a single gradient evaluation in the OPT framework costs approximately the same as one ALS iteration. This efficiency allows the method to scale linearly with the number of tensor elements.
Regularization and Solvers
To address scaling indeterminacy—a common issue where components can be scaled inversely without changing the product—the framework incorporates Tikhonov regularization (CPOPTR). This stabilizes the optimization landscape. The implementation utilizes a Nonlinear Conjugate Gradient (NCG) method with a sophisticated line search, providing a memory-efficient alternative to the second-order solvers typically found in NLS implementations.
Experimental Results
The proposed methods were benchmarked against synthetic datasets and real-world amino acid fluorescence data.
- Accuracy and Robustness: In synthetic tests involving high collinearity (overlapping components), the OPT approach achieved nearly 100% accuracy in component recovery. In contrast, ALS performance often dropped to between 60% and 79%. Furthermore, OPT demonstrated significant stability in overfactoring scenarios.
- Computational Performance: The speed advantages are stark. For a $250 \times 250 \times 250$ dense tensor, the OPT method completed the task in approximately 82 seconds. Estimates for traditional NLS methods (such as INDAFAC) suggest a runtime of approximately five hours for the same problem.
Conclusion and Future Directions
The gradient-based optimization approach for CPD fitting offers a robust, high-performance alternative to traditional methods. By combining the accuracy of simultaneous optimization with the efficiency of mttkrp-based gradient calculations, it provides a scalable solution for complex data analysis tasks.
Future research will focus on automating the selection of the regularization parameter ($\lambda$), extending the framework to massive sparse tensors, and incorporating constraints such as non-negativity to better suit specific physical and chemical applications.
Summary updated