FOCoOp: Enhancing Out-of-Distribution Robustness in Federated Prompt Learning for Vision-Language Models

Xinting Liao, Weiming Liu, Jiaming Qian, Pengyang Zhou, Jiahe Xu, Wenjie Wang, Chao-Chao Chen, Xiaolin Zheng, Tat-Seng Chua · DOI

Introduction

Adapting large-scale Vision-Language Models (VLMs), such as CLIP, to specific downstream tasks has become a cornerstone of modern computer vision. In decentralized environments, Federated Prompt Learning (FPL) allows multiple clients to collaboratively optimize small learnable vectors—known as prompts—without sharing their private raw data. While FPL offers a path toward privacy-preserving adaptation, it faces a significant hurdle: robustness.

Due to the inherent data heterogeneity across clients, models often overfit to local biases, leading to poor performance when encountering out-of-distribution (OOD) data. This paper introduces FOCoOp (Federated OOD-aware Context Optimization), a framework designed to resolve the performance-robustness trade-off by utilizing bi-level optimization and global consistency mechanisms.

The Challenge: Robustness in Federated Learning

Existing FPL methods are often "brittle." Because each client only observes a small, biased slice of the data distribution, the resulting prompts fail to generalize across two critical types of shifts:

  1. Covariate Shifts: Changes in the input distribution where the label remains the same (e.g., an object appearing in different lighting or environments).
  2. Semantic Shifts: The appearance of entirely new categories of objects that were not present during training.

In these scenarios, standard federated models struggle to distinguish between legitimate new images and OOD samples, often making high-confidence but incorrect predictions. FOCoOp addresses this by explicitly modeling the boundaries between in-distribution (ID) and OOD data during the federated training process.

Methodology: FOCoOp Framework

FOCoOp introduces two primary modules to enhance robustness: Bi-level OOD Separations (BOS) at the client level and Global-view OOD Consistency (GOC) at the server level.

1. Bi-level OOD Separations (BOS)

Instead of learning a single generic prompt, the BOS module on the client side learns three distinct prompt types:

  • Global ID Prompts: Capture general knowledge shared across the federation.
  • Local ID Prompts: Handle client-specific personalization.
  • OOD Prompts: Specifically designed for outlier detection.

To ensure these prompts are robust, FOCoOp employs Bi-level Distributionally Robust Optimization (DRO). During training, this module perturbs the prompts to simulate "worst-case" scenarios. This adversarial approach forces the model to establish wider and more distinct decision boundaries, making it easier to separate known classes from unknown outliers.

2. Global-view OOD Consistency (GOC)

In a federated setting, a sample that is "out-of-distribution" for one client might be "in-distribution" for another. This ambiguity can lead to conflicting updates at the server. The GOC module resolves this by using Semi-unbalanced Optimal Transport (SemiUOT).

By treating the prompt alignment as an optimal transport problem, the server can align OOD prompts from various clients with the global ID prompts. This geometric approach allows the server to filter out "seemingly OOD" samples that are actually known to other parts of the network, ensuring a consistent global definition of what constitutes an outlier.

Experimental Evaluation

The authors evaluated FOCoOp across 15 diverse datasets, covering generalization, detection benchmarks, label shifts, and domain shifts (e.g., DomainNet, Office-Caltech10, and CIFAR-100).

Key Results

  • Superior OOD Detection: On the CIFAR-100 benchmark, FOCoOp achieved a False Positive Rate (FPR95) of 19.50%. This is a dramatic improvement over existing state-of-the-art baselines like FedOTP and PromptFolio, which typically range between 38% and 44%.
  • High Accuracy: Unlike many methods that sacrifice accuracy for robustness, FOCoOp improved Top-1 Accuracy, reaching 93.85% on CIFAR-100.
  • Resilience to Heterogeneity: The framework remained stable even under extreme data fragmentation (high Dirichlet alpha settings), proving its effectiveness in highly non-IID (independent and identically distributed) environments.

Insights and Discussion

A core innovation of FOCoOp is its shift from probability-based metrics to geometric relationships. While standard methods often rely on KL-divergence, FOCoOp’s use of Optimal Transport (OT) preserves the latent feature space's geometry. This is particularly effective for the high-dimensional embeddings produced by VLMs. Furthermore, the "Power of Three"—separating global, local, and OOD prompts—prevents interference between different learning objectives, allowing the OOD prompts to act as a dedicated rejection class.

Limitations and Future Work

Despite its performance, FOCoOp introduces additional complexity. The bi-level optimization required for the BOS module is more computationally demanding than standard gradient descent, adding overhead to local client training. Additionally, the framework introduces several hyperparameters (e.g., $\tau_1, \tau_2, \alpha, \rho$) that may require careful tuning for specific applications.

Future research may explore scaling this OOD-aware logic to even larger foundation models and extending the framework to multimodal tasks beyond simple image classification, such as visual question answering or image retrieval in federated settings.

Summary updated

BibTeX
@inproceedings{liao2025focoop,
  author = {Xinting Liao and Weiming Liu and Jiaming Qian and Pengyang Zhou and Jiahe Xu and Wenjie Wang and Chao-Chao Chen and Xiaolin Zheng and Tat-Seng Chua},
  title = {{FOCoOp: Enhancing Out-of-Distribution Robustness in Federated Prompt Learning for Vision-Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=XCLZgbm99O},
}
Figure