Skip to main content
QUICK REVIEW

[Paper Review] On Fast Computation of Gradients for CANDECOMP/PARAFAC Algorithms

Anh Huy Phan, Petr Tichavský|arXiv (Cornell University)|Apr 7, 2012
Tensor decomposition and applicationsMathematics23 references17 citations
TL;DR

This paper proposes a fast algorithm to compute the CP gradient—critical for CANDECOMP/PARAFAC (CP) tensor decomposition—by avoiding expensive mode-n tensor unfoldings. By reorganizing computations using reshape and Kronecker-like products, the method reduces computational complexity from O(NR∏In) to O(R∏In), achieving 2–8× speedups for 3D–4D tensors and up to 20–30× for higher-order tensors, significantly accelerating ALS and other CP algorithms.

ABSTRACT

Product between mode-$n$ unfolding $\bY_{(n)}$ of an $N$-D tensor $ Y$ and Khatri-Rao products of $(N-1)$ factor matrices $\bA^{(m)}$, $m = 1,..., n-1, n+1, ..., N$ exists in algorithms for CANDECOMP/PARAFAC (CP). If $ Y$ is an error tensor of a tensor approximation, this product is the gradient of a cost function with respect to factors, and has the largest workload in most CP algorithms. In this paper, a fast method to compute this product is proposed. Experimental verification shows that the fast CP gradient can accelerate the CP_ALS algorithm 2 times and 8 times faster for factorizations of 3-D and 4-D tensors, and the speed-up ratios can be 20-30 times for higher dimensional tensors.

Motivation & Objective

  • To address the high computational cost of CP gradient computation in tensor decomposition algorithms.
  • To reduce the O(NR∏In) complexity of mode-n unfolding and Khatri-Rao product operations in CP algorithms.
  • To enable faster convergence in alternating least squares (ALS) and all-at-once CP algorithms by accelerating the dominant computational workload.
  • To provide a general-purpose method applicable to CP, NTF, and related tensor algorithms.

Proposed method

  • Proposes a novel computation strategy that avoids explicit mode-n tensor unfoldings by reordering operations using reshape and Kronecker-based products.
  • Replaces the standard Y(n) ⊙_{k≠n} A(k) product with a direct computation via index mapping and block-wise operations.
  • Uses the reshape operator to maintain data order and avoid memory access overhead from non-contiguous entries.
  • Employs a recursive computation structure that processes dimensions in a way that minimizes redundant operations.
  • Introduces a fast implementation of the ALS algorithm using the new gradient computation, with optimized memory access patterns.
  • Applies the method to all modes n=1,…,N, with special handling for intermediate modes (1 < n < N) where unfoldings are most expensive.

Experimental results

Research questions

  • RQ1Can the computational cost of CP gradient computation be reduced without sacrificing accuracy?
  • RQ2How does avoiding mode-n tensor unfoldings affect performance in high-dimensional tensor decompositions?
  • RQ3What is the achievable speedup in ALS and other CP algorithms when using the proposed fast gradient method?
  • RQ4Can the method be generalized across different tensor orders and ranks?

Key findings

  • The fast CP gradient method reduces computational complexity from O(NR∏In) to O(R∏In), eliminating the dominant O(N) factor.
  • For 3D tensors, the fast ALS algorithm achieves a 2× speedup; for 4D tensors, up to 8× speedup compared to standard ALS.
  • For 5D and 6D tensors, speedups reach 20–30 times, with a 7D tensor (10^7 entries, R=10) achieving a 42.2× speedup.
  • The method reduces execution time from ~1.844 seconds per iteration (standard ALS) to 0.044 seconds (fast ALS), cutting 2000 iterations from hours to under 2 minutes.
  • The algorithm is robust to ill-conditioned cases like collinear factors, where standard ALS may require thousands of iterations.
  • The method is general and can accelerate any CP or nonnegative tensor factorization (NTF) algorithm relying on gradient computation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.