Towards Instance-wise Personalized Federated Learning via Semi-Implicit Bayesian Prompt Tuning

Tiandi Ye, Wenyan Liu, Kai Yao, Lichun Li, Shangchao Su, Cen Chen, Xiang Li, Shan Yin, Ming Gao

Abstract

Standard Personalized Federated Learning (pFL) typically focuses on learning a single model or set of parameters for each client. However, this approach often fails to account for intra-client heterogeneity, where a single user's data may span multiple distinct distributions. This paper introduces pFedBayesPT, a novel framework that achieves instance-wise personalization by generating unique visual prompts for every image. By integrating Visual Prompt Tuning (VPT) with Semi-Implicit Bayesian inference, the framework captures complex visual semantics while maintaining robustness against overfitting in data-scarce environments. Experimental results on DomainNet and CIFAR-100 demonstrate that pFedBayesPT consistently outperforms state-of-the-art methods in both accuracy and generalization to unseen clients.

1. Introduction

Federated Learning (FL) has emerged as a vital paradigm for training machine learning models across decentralized devices while preserving data privacy. Despite its success, FL faces significant challenges due to data heterogeneity across clients. While Personalized Federated Learning (pFL) was developed to address this by tailoring models to individual users, it typically operates under the assumption that a client’s local data is homogeneous.

In real-world scenarios, this assumption rarely holds. A single user’s device might contain images from vastly different domains—such as indoor and outdoor settings or varying lighting conditions. This "intra-client heterogeneity" renders static client-level models insufficient. Furthermore, because local datasets are often small, training complex personalized models risks severe overfitting. To address these gaps, we present pFedBayesPT, which shifts the focus from client-level adaptation to instance-level personalization.

2. The pFedBayesPT Framework

The core innovation of pFedBayesPT lies in its ability to move beyond the "one-model-per-client" paradigm to a "one-prompt-per-image" approach. The framework is built upon four primary pillars:

2.1 Visual Prompt Tuning (VPT)

To minimize communication overhead and preserve the general knowledge of large-scale models, pFedBayesPT utilizes a frozen Vision Transformer (ViT) backbone. Instead of fine-tuning the entire network, the system only trains a small set of learnable vectors, or "prompts," which are added to the input. This strategy ensures that the model remains efficient and scalable for resource-constrained edge devices.

2.2 Instance-wise Personalization

Unlike traditional methods that learn a static prompt for each client, pFedBayesPT employs a small encoder to map the specific features of an individual image to a unique prompt distribution. This allows the model to adapt dynamically to the diverse visual semantics present within a single client’s dataset.

2.3 Semi-Implicit Variational Inference (SIVI)

Modeling the distribution of visual prompts is challenging because standard Bayesian methods often rely on simple Gaussian assumptions, which may not capture the complexity of high-dimensional visual data. pFedBayesPT utilizes Semi-Implicit Variational Inference (SIVI) to learn more flexible and expressive "implicit" distributions. This mathematical framework allows the model to represent a wider range of posterior distributions, leading to more accurate and nuanced personalization.

2.4 Stochastic Masking

To ensure the Bayesian model remains robust without significantly increasing the parameter count, the authors implement stochastic masking of image features during training. This technique forces the encoder to learn a more resilient mapping from features to prompts, acting as a critical safeguard against overfitting in data-scarce regimes.

3. Experimental Evaluation

The framework was evaluated against two primary types of data shifts using standard benchmarks:

  • Feature Shift (DomainNet): Clients were assigned data from six distinct domains (e.g., Clipart, Painting, Sketch). This tested the model's ability to handle diverse visual styles within a single client profile.
  • Label Shift (CIFAR-100): Data was partitioned so that clients only saw a limited subset of classes, testing the model's performance when category distributions are highly skewed.

3.1 Key Results

pFedBayesPT demonstrated superior performance compared to leading baselines such as SGPT, pFedPG, and FedVPT:

  • Accuracy: On the DomainNet benchmark, pFedBayesPT achieved an average accuracy of 92.33%, outperforming the nearest competitor (SGPT) by more than 1%.
  • Robustness: The framework showed significant improvements in the "Worst Local" metric, indicating that it is more effective at supporting clients with the most challenging or outlier data.
  • Zero-Shot Generalization: Because the model learns a prompt generator rather than a static vector, it can effectively personalize for entirely new clients by analyzing their image features in a zero-shot manner, maintaining a ~1% performance lead over other methods.

4. Discussion and Conclusion

pFedBayesPT represents a significant step forward in personalized federated learning by recognizing and addressing intra-client heterogeneity. By treating prompts as random variables and employing semi-implicit Bayesian modeling, the framework provides a natural regularization effect that prevents overfitting while enabling fine-grained, instance-level adaptation.

While the current implementation is optimized for computer vision tasks using ViT backbones, the underlying principles of instance-wise Bayesian prompt tuning hold promise for other modalities, such as natural language processing and multi-modal systems. Future work will explore reducing the computational overhead of the Bayesian sampling process and testing the framework's efficacy in specialized domains like medical imaging, where pre-trained backbones may require further adaptation.

Summary updated

BibTeX
@inproceedings{ye2025towards,
  author = {Tiandi Ye and Wenyan Liu and Kai Yao and Lichun Li and Shangchao Su and Cen Chen and Xiang Li and Shan Yin and Ming Gao},
  title = {{Towards Instance-wise Personalized Federated Learning via Semi-Implicit Bayesian Prompt Tuning}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2025},
  doi = {10.1145/3746252.3761097},
}
Figure