ReBaPL: Repulsive Bayesian Prompt Learning

Yassir Bendou, Omar Ezzahir, Eduardo Montesuma, Gabriel Mahuas, Victoria Shevchenko, Mike Gartrell

TL;DR

ReBaPL (Repulsive Bayesian Prompt Learning) is a modular, plug-and-play framework that enhances the robustness and generalization of vision-language models. By combining a cyclical MCMC sampling strategy with a novel representation-space repulsive force, it efficiently maps the complex, multimodal landscape of optimal prompts while preventing the overfitting typical of standard maximum likelihood methods.

What Problem Does This Paper Address?

When adapting massive vision-language models (VLMs) like CLIP to downstream tasks, full fine-tuning is computationally prohibitive. Instead, researchers use prompt learning to optimize a small set of continuous prompt vectors while keeping the underlying model frozen.

However, standard prompt learning relies on Maximum Likelihood Estimation (MLE), which severely overfits to the few-shot training data. This causes the model to lose its out-of-distribution (OOD) generalization capabilities and perform poorly on unseen ("novel") classes. While Bayesian prompt learning has been proposed to mitigate this by estimating a posterior distribution over prompts, existing methods typically rely on simplistic, unimodal Gaussian approximations. They fail to capture the complex, multimodal nature of the prompt landscape—where many distinct prompts might fit the training data equally well but generalize differently.

Methods

The authors introduce Repulsive Bayesian Prompt Learning (ReBaPL), which treats prompt optimization as a multimodal Bayesian inference problem. It consists of two core components:

  1. Repulsive Cyclical SGHMC (rcSGHMC): The framework builds on Stochastic Gradient Hamiltonian Monte Carlo (SGHMC), injecting momentum and controlled noise to navigate the loss landscape. It utilizes a cosine learning rate scheduler to alternate cyclically between exploration phases (discovering new modes in the posterior distribution) and exploitation/sampling phases (refining the discovered modes).
  2. Representation-Based Repulsion: To ensure the algorithm doesn't repeatedly sample from the same mode, ReBaPL introduces a repulsive force between prompts from the current cycle and the previous cycle. Crucially, instead of calculating this repulsion in the parameter (weight) space—which is problematic due to neural network permutation invariances—it computes repulsion in the representation space. It measures the functional diversity of prompts using probability metrics like Maximum Mean Discrepancy (MMD) or Wasserstein distance on the distributions of the generated embeddings.

Because ReBaPL is modular, it acts as a plug-and-play extension on top of existing state-of-the-art MLE prompt learning methods, such as MaPLe and MMRL.

Figure 1. Overview of our proposed ReBaPL approach, in a multi-modal prompt learning setting. Text and image encoders receive text (W0) and image (E0) embeddings as input, combined with learnable tokens of context prompts (P). The terms pertaining to the exploration and sampling stages and the repulsion force are colored in blue, red and green respectively.

Datasets

The authors evaluated ReBaPL across three distinct experimental protocols using a 16-shot learning scenario:

  • Base-to-Novel Generalization & Cross-Dataset Transfer: Evaluated on 11 benchmark datasets: ImageNet, Caltech101, OxfordPets, StanfordCars, Flowers102, Food101, FGVCAircraft, SUN397, UCF101, DTD, and EuroSAT.
  • Domain Generalization: Models trained on ImageNet were tested against four robust, domain-shifted variants: ImageNetV2, ImageNet-Sketch, ImageNet-A, and ImageNet-R.

Key Insights and Ideas

  • The Prompt Landscape is Multimodal: Many different prompts can yield identical training accuracy but possess entirely different generalization behaviors. Capturing this diversity is key to robust OOD performance.
  • Repulsion Belongs in the Activation Space, Not Weight Space: Pushing parameters apart in weight space is ineffective because different weights can produce identical functions (permutation invariance). Pushing them apart based on their induced representations forces the prompts to be functionally diverse.
  • Ensembling the Posterior Works: Averaging the predictions of diverse prompt samples obtained across different MCMC cycles consistently outperforms point-estimate (MAP/MLE) solutions without requiring architectural changes during inference.

Key Results

ReBaPL consistently improved the performance of baseline prompt learning methods (MaPLe and MMRL) across all evaluation metrics:

  • Base-to-Novel Generalization: ReBaPL improved the harmonic mean (HM) of base and novel class accuracies across almost all 11 datasets. For instance, adding ReBaPL to MaPLe improved the average HM from 78.37% to 79.52%, showing particularly massive jumps on specialized datasets like EuroSAT (+2.46%).
  • Cross-Dataset Transfer: When trained on ImageNet and evaluated zero-shot on the other 10 datasets, MMRL + ReBaPL achieved the highest average accuracy of 67.62%, outperforming standard MMRL and PromptSRC.
Cross-dataset transfer results showing ReBaPL improvements over baseline methods.
  • Domain Generalization: ReBaPL enhanced robustness against distribution shifts on all four ImageNet variants, proving that mapping the prompt posterior prevents the model from latching onto spurious training features.

Limitations and Future Work

While the representation-space repulsion is computed on mini-batches to minimize overhead, calculating MMD or Wasserstein distances still introduces an additional computational cost during training compared to standard MLE.

For future work, the authors suggest exploring alternative probability metrics, such as the Sinkhorn divergence or information-theoretic measures. They also aim to develop adaptive cyclical mechanisms that can automatically determine the optimal number of MCMC cycles based on real-time convergence diagnostics and posterior diversity metrics.

Summary updated

BibTeX
@inproceedings{bendou2026rebapl,
  author = {Yassir Bendou and Omar Ezzahir and Eduardo Montesuma and Gabriel Mahuas and Victoria Shevchenko and Mike Gartrell},
  title = {{ReBaPL: Repulsive Bayesian Prompt Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=uhvpAJZzOY},
}
Figure