Federated Learning via Variational Bayesian Inference: Personalization, Sparsity and Clustering

Xu Zhang, Wenpeng Li, Yunfeng Shao, Yinchuan LiarXiv 2023 · DOI

Introduction

Standard Federated Learning (FL) algorithms, such as FedAvg, typically assume that data across clients is independent and identically distributed (i.i.d.). However, real-world applications often face significant data heterogeneity and data scarcity. Individual clients, such as mobile devices or small clinics, may have limited local samples, leading to overfitting when training complex models.

This paper introduces a unified framework—comprising pFedBayes, sFedBayes, and cFedBayes—that leverages Variational Bayesian Inference to address these challenges. By treating the global model distribution as a prior for local clients, the proposed methods achieve state-of-the-art personalization and sparsity with theoretical guarantees of minimax optimality.

Personalized Federated Learning with pFedBayes

The core of the proposed approach is a two-level optimization framework based on Variational Inference (VI). Instead of learning point estimates for weights, the framework learns probability distributions.

In pFedBayes, the server maintains a global distribution $\theta_w \sim \mathcal{N}(\mu_w, \sigma_w^2)$. During each communication round, clients download these parameters and use the global distribution as their prior. Local updates involve balancing the reconstruction error (fitting local data $D^i$) with the Kullback-Leibler (KL) divergence to the global prior. This regularization prevents local models from drifting too far or overfitting to small datasets.

The pFedBayes framework: The global distribution acts as a prior for local client distributions, constrained by KL divergence.

Sparsity and Clustering: sFedBayes and cFedBayes

To further enhance the framework, the authors introduce sparsity and clustering mechanisms:

  • sFedBayes (Sparse): To reduce communication overhead and simplify models, a "spike-and-slab" prior (Bernoulli-Gaussian) is employed. This automatically induces weight sparsity during training, effectively performing feature selection and model compression. Interestingly, sparsification also acts as a powerful regularizer, often improving test accuracy on small datasets.
  • cFedBayes (Clustered): In cases of extreme heterogeneity, a single global prior may be insufficient. cFedBayes allows the server to maintain multiple global distributions (clusters). Each client identifies and associates with the cluster that best represents its local data distribution, enabling more specialized and accurate priors.
Conceptual comparison of a single global distribution (left) versus clustered distributions in cFedBayes (right).

Key Insights

  • Global-as-Prior: Using the trained global distribution as a prior ensures compatibility with the task, leading to faster and more stable local convergence compared to uninformative priors.
  • Uncertainty Quantification: As a Bayesian approach, the model provides uncertainty measures, which are vital for safety-critical applications like autonomous driving or medical diagnosis.
  • Theoretical Optimality: The authors prove that the generalization error of these methods achieves minimax optimality (up to a logarithmic factor), providing strong theoretical foundations for their empirical success.

Experimental Evaluation

The models were evaluated on MNIST, Fashion-MNIST, and CIFAR-10, modified to simulate varying levels of data scarcity and heterogeneity.

  • Performance on Small Data: On a "Small" CIFAR-10 setting (25 samples per class), pFedBayes outperformed existing personalized methods like pFedMe and pFedGP by 12.43%.
  • Clustering Effectiveness: In highly heterogeneous scenarios (e.g., inverted vs. normal MNIST images), cFedBayes achieved over 91% accuracy, significantly outperforming standard personalized methods.
  • Communication Efficiency: sFedBayes maintained high accuracy while achieving 50-98% model sparsity, drastically reducing synchronization costs.

Conclusion

By integrating Variational Bayesian Inference into Federated Learning, this work provides a robust solution for personalization, sparsity, and clustering. While future work remains in formal convergence analysis and dynamic cluster selection, the current framework offers a powerful tool for handling the complexities of real-world distributed data.

Summary updated

BibTeX
@misc{zhang2023federated,
  author = {Xu Zhang and Wenpeng Li and Yunfeng Shao and Yinchuan Li},
  title = {{Federated Learning via Variational Bayesian Inference: Personalization, Sparsity and Clustering}},
  year = {2023},
  eprint = {2303.04345},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.04345},
}
Figure