Abstract
Nonnegative Matrix Factorization (NMF) with Kullback-Leibler (KL) divergence is essential for modeling count data but faces significant scalability challenges on large sparse datasets. We present a Sparse Randomized Coordinate Descent (SRCD) algorithm designed to optimize the KL objective without the memory overhead of dense intermediate matrices. By utilizing randomized variable selection and cache-friendly updates, SRCD achieves state-of-the-art convergence speeds and superior memory efficiency. Experimental results on large-scale text and image datasets demonstrate that SRCD is significantly faster than existing Multiplicative Update (MU) and Cyclic Coordinate Descent (CCD) methods while maintaining high model interpretability through sparsity.
Introduction
Nonnegative Matrix Factorization (NMF) is a fundamental technique in machine learning for discovering parts-based representations in high-dimensional data. For datasets consisting of counts, such as word frequencies in document corpora or pixel intensities in images, the Kullback-Leibler (KL) divergence is often preferred over the Frobenius norm as it better captures the underlying Poisson distribution.
Despite its theoretical advantages, optimizing the KL-divergence objective is computationally demanding. Traditional algorithms like Multiplicative Updates (MU) converge slowly, while more recent coordinate descent methods often require the storage of dense intermediate matrices. For massive, sparse datasets, these requirements lead to prohibitive memory consumption and slow execution on standard hardware.
The Sparse Randomized Coordinate Descent (SRCD) Algorithm
To address these limitations, we propose the Sparse Randomized Coordinate Descent (SRCD) algorithm. SRCD introduces several key innovations to enhance performance on sparse data:
- Randomized Variable Selection: Instead of a fixed cyclic update order, SRCD employs uniform random sampling. This approach prevents the optimization from becoming trapped in inefficient update paths and promotes more balanced convergence.
- Memory-Efficient Updates: Standard methods often compute dense products like $W^T F$. SRCD avoids this by maintaining and incrementally updating auxiliary vectors, significantly reducing the memory footprint.
- Exploiting Sparsity: The algorithm's update rules are specifically formulated to skip zero entries in the input matrix $V$ and the factor matrices $W$ and $F$. The complexity of each update scales with the number of non-zero elements rather than the total dimensions.
- Parallelization and Cache Locality: SRCD is designed for modern multi-core CPUs. By structuring updates as sequential vector additions, it maximizes CPU cache utilization and scales linearly with the number of available threads.
Experimental Evaluation
The performance of SRCD was evaluated against MU and Cyclic Coordinate Descent (CCD) across four diverse datasets: Digits (MNIST), Reuters21578, TDT2, and RCV1_4Class. These datasets range from 81% to over 99.7% sparsity.
Convergence Speed
SRCD consistently outperformed competing methods in terms of convergence speed, particularly on highly sparse text datasets. As shown in Figure 1, SRCD reaches lower objective values significantly faster than MU and CCD.
Memory Efficiency
A standout feature of SRCD is its minimal memory requirement. While MU and CCD struggle with the overhead of dense intermediate structures, SRCD maintains a lean profile. For the TDT2 dataset, SRCD required only 0.30 GB of memory, a fraction of the 11.51 GB required by MU.
Scalability and Sparsity
Beyond speed and memory, SRCD produces highly interpretable models. The resulting factor matrices typically exhibit 70-88% sparsity, facilitating easier feature extraction. Furthermore, the algorithm demonstrates excellent parallel scalability, with running times decreasing linearly as more CPU threads are utilized.
Conclusion
The SRCD algorithm provides a robust and efficient framework for NMF with KL divergence on large-scale sparse data. By prioritizing memory efficiency and cache-friendly randomized updates, it overcomes the bottlenecks of traditional optimization methods. Future work will explore extending this randomized coordinate descent approach to Nonnegative Tensor Factorization for higher-dimensional data analysis.
Summary updated