NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Large-Scale Distributed Bayesian Matrix Factorization using Stochastic Gradient MCMC

Sungjin Ahn, Anoop Korattikara, Nathan Liu, Suju Rajan, Max Welling

Introduction

In modern recommender systems, Matrix Factorization (MF) is the standard technique for predicting user preferences. Historically, engineers have faced a trade-off between two primary approaches. Optimization-based methods, such as Stochastic Gradient Descent (SGD), are favored for their speed and scalability but are prone to overfitting and lack uncertainty quantification. Conversely, Bayesian methods, such as Bayesian Probabilistic Matrix Factorization (BPMF), offer superior accuracy and robustness but are computationally intensive. Traditional Bayesian inference relies on Gibbs sampling, which requires $O(D^3)$ calculations (where $D$ is the latent dimension) and is difficult to distribute across clusters.

This paper introduces a scalable, distributed algorithm for Bayesian Matrix Factorization (BMF) that bridges this gap. By leveraging Distributed Stochastic Gradient Langevin Dynamics (DSGLD), the authors achieve the predictive power of Bayesian inference with the speed and simplicity of SGD.

The Scalability Bottleneck

As datasets grew to billions of interactions, the Bayesian approach became a luxury that industry-scale systems could rarely afford. The primary hurdles were the cubic complexity of sampling and the sequential nature of Markov Chain Monte Carlo (MCMC) algorithms. To address this, the authors propose a framework that utilizes small mini-batches and parallel processing to handle massive datasets like Yahoo Music (700M ratings).

Distributed Stochastic Gradient Langevin Dynamics (DSGLD)

The core innovation is the adaptation of Stochastic Gradient MCMC for a distributed environment.

SGLD Foundation

Unlike standard MCMC, which requires a full pass over the dataset to accept or reject a sample, SGLD operates on mini-batches. It functions similarly to SGD but injects a specific amount of Gaussian noise into the updates. This allows the algorithm to "wander" through the posterior distribution, effectively sampling from it rather than just converging to a single point estimate.

Matrix Partitioning

To enable distribution, the rating matrix $R$ is split into blocks. The authors identify "orthogonal" blocks—sets of ratings that do not share users or items. These blocks can be updated in parallel across different workers without write conflicts.

Matrix partitioning schemes: (a) square, (b) column, and (c) hybrid partitioning for distributed processing.

Two-Level Parallelism

The framework employs parallelism at two levels:

  1. Within-chain Parallelism: Multiple workers update different orthogonal blocks of a single Markov chain simultaneously. A correction factor is introduced to ensure gradient estimates remain unbiased despite workers only seeing data subsets.
  2. Between-chain Parallelism: Multiple independent Markov chains run in parallel from different starting points. This allows the algorithm to explore different regions (modes) of the parameter space, improving generalization.
The distributed update process where workers process orthogonal blocks (B) over time steps (t).

Key Insights and Simplifications

  • The Power of Averaging: After an initial "burn-in" phase, DSGLD begins collecting samples. While SGD might begin to overfit at this stage, averaging the DSGLD samples leads to a significant drop in Root Mean Square Error (RMSE).
  • Computational Efficiency: By utilizing diagonal covariance matrices for priors instead of full ones, the authors reduced computational complexity from $O(D^3)$ to $O(D)$ per update. Experiments confirmed that this simplification had a negligible impact on accuracy while providing a massive speed boost.

Experimental Results

The algorithm was tested on two massive benchmarks: Netflix (100M ratings) and Yahoo Music (700M ratings).

  • Speed: DSGLD reached the same accuracy as traditional Gibbs sampling 10x faster.
  • Accuracy: Compared to Distributed SGD (the industry standard for speed), DSGLD reduced the RMSE by 4.1% on Netflix and 1.8% on Yahoo Music. In the competitive field of recommendation, even a 1% improvement is considered a major success.
  • Scalability: The system successfully handled 700 million ratings, proving that Bayesian methods are viable for "Big Data" applications.

Conclusion

DSGLD provides a robust framework for large-scale Bayesian recommendation. By combining the efficiency of stochastic gradients with the principled uncertainty handling of MCMC, the authors demonstrate that Bayesian methods can scale to the largest datasets in the industry. Future work may involve integrating more sophisticated algorithms, such as Stochastic Gradient Hamiltonian Monte Carlo (SGHMC), to further accelerate posterior exploration.

Summary updated

BibTeX
@inproceedings{ahn2015large,
  author = {Sungjin Ahn and Anoop Korattikara and Nathan Liu and Suju Rajan and Max Welling},
  title = {{Large-Scale Distributed Bayesian Matrix Factorization using Stochastic Gradient MCMC}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2015},
  doi = {10.1145/2783258.2783373},
}
Figure