Federated Stochastic Gradient Langevin Dynamics

Khaoula El Mekkaoui, Diego Mesquita, Paul Blomstedt, Samuel Kaski

TL;DR

This paper introduces "conducive gradients" to improve Federated Stochastic Gradient Langevin Dynamics (FSGLD) for Bayesian inference in non-IID federated settings. FSGLD effectively addresses issues of high variance and divergence that plague existing distributed methods when data is unevenly distributed across clients, leading to more accurate and stable posterior inference.

What Problem Does This Paper Address?

Traditional Bayesian inference methods, like Markov Chain Monte Carlo (MCMC), are powerful but computationally expensive, especially for large datasets. Stochastic Gradient MCMC (SG-MCMC) methods, such as Stochastic Gradient Langevin Dynamics (SGLD), offer a solution by using noisy gradient estimates from mini-batches to speed up sampling. While SGLD can be extended to distributed settings (DSGLD), this approach faces significant challenges in federated learning scenarios where data is inherently non-IID (not identically and independently distributed) across clients.

Specifically, non-IID data amplifies the variance of stochastic gradients, leading to poor mixing and slow convergence of the MCMC chains. Furthermore, in federated learning, communication between clients and servers is often delayed to reduce overhead. This delay can cause DSGLD chains to diverge from the true posterior distribution, even for simple models. The paper aims to bridge this gap by developing a method that can handle non-IID data and delayed communication while maintaining accurate Bayesian inference.

Methods

The core innovation of this paper is the introduction of conducive gradients. These are designed to correct the bias and reduce the variance introduced by distributed, non-IID data in SG-MCMC. Conducive gradients are derived from local likelihood approximations on each client. These approximations are computed independently and only once, incurring minimal computational overhead.

The authors integrate these conducive gradients into the existing Distributed Stochastic Gradient Langevin Dynamics (DSGLD) framework, creating a new method called Federated Stochastic Gradient Langevin Dynamics (FSGLD). FSGLD's update rule combines the standard DSGLD gradient estimate with the newly proposed conducive gradient. The paper also provides theoretical analysis, including convergence bounds for both DSGLD and FSGLD, offering insights into how to choose effective local approximations.

Datasets

The paper evaluates FSGLD on several datasets:

  • UCI Repository Datasets: Concrete, Noise, and Conductivity were used for Bayesian linear regression experiments. These datasets represent different scales and feature dimensions.
  • Isolet Dataset: This dataset was used for Bayesian metric learning. It was adapted to create a federated non-IID setting by splitting similar and dissimilar pairs across shards.
  • SUSY Dataset: This dataset was used for training Bayesian neural networks (MLPs). It was partitioned into label-imbalanced shards to simulate a federated non-IID scenario.

The authors created federated non-IID settings by partitioning the data across multiple clients (shards) in ways that ensured heterogeneity in data distributions between clients.

Key Insights and Ideas

  • The "conducive gradient" is a simple yet powerful idea: By using local, one-time approximations of likelihoods, FSGLD can effectively "guide" the sampler back towards the true posterior, even when data is highly skewed across clients.
  • Delayed communication is a major hurdle for DSGLD: The paper clearly demonstrates that as communication delays (i.e., more local updates before synchronization) increase, DSGLD diverges significantly from the true posterior.
  • FSGLD is robust to communication delays: Unlike DSGLD, FSGLD's performance remains stable and it continues to converge to the true posterior even with substantial delays in communication.
  • Non-IID data is the key challenge: The paper strongly emphasizes that the benefits of FSGLD are most pronounced in non-IID federated settings, where DSGLD struggles the most.
  • Theoretical analysis supports practical findings: The convergence bounds derived for FSGLD provide a theoretical basis for why the conducive gradients help, showing how the choice of local approximations can mitigate the impact of data heterogeneity.

Key Results

  • Convergence in challenging scenarios: FSGLD successfully converges to the target posterior in cases where DSGLD fails, particularly under delayed communication and non-IID data conditions.
  • Improved performance: FSGLD consistently outperforms DSGLD in non-IID federated scenarios across experiments involving metric learning and Bayesian neural networks, showing better average log-likelihood and lower MSE.
  • Reduced variance: FSGLD exhibits lower variance in posterior estimates compared to DSGLD across various datasets.
  • Scalability: The conducive gradient computation is designed to be efficient, incurring negligible overhead compared to DSGLD, making FSGLD computationally scalable.
  • Bayesian Neural Networks: In experiments with label-imbalanced federated data, FSGLD learned significantly better models (higher test log-likelihood) than DSGLD.

Limitations and Future Work

  • Choice of Surrogates: While the paper suggests using exponential family approximations for conducive gradients, choosing the "optimal" surrogate qs can be challenging and is often model-dependent. The paper notes that while analytically choosing qs is difficult, it's sensible to pick approximations that closely match the local likelihoods.
  • Complex Models: For very complex models, the authors suggest that it might be beneficial to update the conducive terms more frequently as the chains explore the posterior landscape, rather than just once at the beginning.
  • Expressive Surrogates: The paper leaves open the possibility of using more expressive or computationally cheaper surrogates, such as non-parametric methods or variational approximations, for conducive gradients.
  • Theoretical Guarantees for Complex Surrogates: Further theoretical work might be needed to analyze the convergence properties when using more complex surrogate functions.

Summary updated

BibTeX
@inproceedings{mekkaoui2021federated,
  author = {Khaoula El Mekkaoui and Diego Mesquita and Paul Blomstedt and Samuel Kaski},
  title = {{Federated Stochastic Gradient Langevin Dynamics}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2021},
  url = {https://openreview.net/forum?id=sr5zBmJQedK},
}
Figure