Abstract
In order to solve large matrix completion problems with practical computational cost, an approximate approach based on matrix factorization has been widely used. Alternating least squares (ALS) and stochastic gradient descent (SGD) are two major algorithms to this end. In this study, we propose a new algorithm, namely cavity-based matrix factorization (CBMF) and approximate cavity-based matrix factorization (ACBMF), which are developed based on the cavity method from statistical mechanics. ALS yields solutions with less iterations when compared to those of SGD. This is because its update rules are described in a closed form although it entails higher computational cost. CBMF can also write its update rules in a closed form, and its computational cost is lower than that of ALS. ACBMF is proposed to compensate a disadvantage of CBMF in terms of relatively high memory cost. We experimentally illustrate that the proposed methods outperform the two existing algorithms in terms of convergence speed per iteration, and it can work under the condition where observed entries are relatively fewer. Additionally, in contrast to SGD, (A)CBMF does not require scheduling of the learning rate.
Introduction
Matrix completion is a fundamental task in modern data science, particularly for recommender systems where one must predict missing user-item ratings from a sparse observation matrix. The standard approach involves factorizing the large, sparse matrix $Y$ into two lower-rank matrices $U$ and $V$. Currently, the field is dominated by two paradigms: Alternating Least Squares (ALS) and Stochastic Gradient Descent (SGD). While ALS offers stable, closed-form updates, it suffers from high computational costs due to $O(R^3)$ matrix inversions. Conversely, SGD is computationally lightweight but highly sensitive to hyperparameter tuning, specifically the learning rate schedule.
This paper introduces Cavity-Based Matrix Factorization (CBMF) and its memory-efficient variant, Approximate CBMF (ACBMF). By leveraging the cavity method from statistical mechanics, these algorithms provide the stability of closed-form updates without the heavy computational or tuning overhead of traditional methods.
Methodology
The core of the proposed approach lies in representing the matrix factorization problem as a bipartite factor graph. In this graph, variables representing the entries of $U$ and $V$ are connected to factor nodes representing the observed entries in $Y$.
Cavity-Based Matrix Factorization (CBMF)
The cavity method is used to analyze the system by isolating the effect of a single variable—effectively creating a "cavity" in the graph. This allows for the derivation of cavity objective functions, which lead to quadratic, closed-form update rules. Unlike ALS, which optimizes an entire row or column at once, CBMF updates variables based on messages from neighboring nodes in the factor graph.
Approximate CBMF (ACBMF)
While CBMF is effective, its memory requirements scale with the number of observed entries, which can be prohibitive for very large datasets. To address this, the authors developed ACBMF using an approximation similar to Approximate Message Passing (AMP). This reduces the memory footprint to match that of ALS and SGD. Crucially, ACBMF avoids matrix inversions, resulting in a computational complexity that is strictly linear with respect to the matrix rank $R$.
Key Insights and Results
A significant advantage of (A)CBMF is the elimination of hyperparameter tuning. Because the updates are derived from the underlying physics of the system, there is no learning rate to schedule, making the algorithm "out-of-the-box" ready.
Sparsity and Self-Feedback
The authors identify "self-feedback" as a primary reason for the failure of ALS in highly sparse regimes. By fully optimizing one matrix while holding the other fixed, ALS can create strong, misleading time-correlations when far from the optimal solution. ACBMF mitigates this by using a more measured update approach via cavity bias functions, allowing it to succeed where ALS fails.
Performance Benchmarks
Experimental results on synthetic data demonstrate that (A)CBMF can reconstruct matrices with significantly fewer observed entries than both ALS and SGD. On real-world datasets like MovieLens (1M, 10M, and 20M), ACBMF reaches the same error floor as baselines but does so much faster in terms of wall-clock time. This speedup is particularly pronounced as the rank $R$ increases, due to the avoidance of $O(R^3)$ operations.
Conclusion
CBMF and ACBMF represent a powerful middle ground in matrix completion, combining the robustness of closed-form updates with the efficiency of gradient-based methods. While the current framework assumes a sparse factor graph, this is naturally satisfied in most matrix completion contexts. Future work will focus on extending this cavity-based framework to Non-negative Matrix Factorization (NMF) to better serve applications with non-negativity constraints.
Summary updated