Learning Optimal Prompt Ensemble for Multi-source Visual Prompt Transfer

Enming Zhang, Liwen Cao, Yanru Wu, Zhao Zijie, Yang Li

TL;DR

This paper introduces HGPrompt, a novel framework for effectively combining multiple pre-trained "prompts" (task-specific adaptations) to improve a foundation model's performance on new tasks. HGPrompt achieves state-of-the-art results by jointly optimizing for how well the combined prompts transfer knowledge and how stably they guide the model's learning process, overcoming issues of interference and representation collapse.

What Problem Does This Paper Address?

Adapting large, pre-trained foundation models (like those used in computer vision) to new, specific tasks is crucial but challenging. Full model fine-tuning is often impractical due to computational costs and data limitations. Prompt tuning, which involves adding small, learnable "prompt" tokens to the input, offers a parameter-efficient alternative. As these prompts become valuable assets, the idea of combining multiple pre-trained prompts from different sources (multi-source prompt transfer) is appealing for leveraging diverse knowledge. However, simply averaging or concatenating these prompts can lead to "representation collapse" – where the combined prompts interfere with each other, degrading performance. This paper addresses the challenge of how to intelligently combine these source prompts to maximize their collective benefit without negative interference.

Methods

The core of HGPrompt lies in its dual-objective optimization framework:

  • Transferability Loss (H-score): Instead of relying on simple parameter similarity, HGPrompt uses an information-theoretic metric (H-score) to evaluate how well the combined prompts make the model's learned features discriminative for the target task. This metric captures the intrinsic informativeness of the prompt-conditioned features.
  • Gradient Alignment Regularization: To combat "negative transfer" and unstable training caused by conflicting gradients from different source prompts, HGPrompt introduces a novel regularization term. This term aligns the gradient directions of individual prompts, ensuring they collectively steer the model towards a unified optimization path, thereby promoting stable and coherent knowledge transfer.

The framework learns optimal ensemble weights for the source prompts by jointly minimizing a combined loss function that balances these two objectives.

Datasets

The experiments were conducted on the VTAB benchmark, a large-scale collection of 13 diverse visual classification tasks. These tasks are categorized into:

  • Natural: Images from standard cameras.
  • Specialized: Data from specialized devices (e.g., medical imaging, satellite sensors).
  • Structured: Tasks requiring spatial reasoning (e.g., object counting).

Key Insights and Ideas

  • Prompts as Intellectual Assets: The paper highlights the growing importance of pre-trained prompts as reusable components, driving the need for effective ways to combine them.
  • Beyond Parameter Similarity: Traditional methods often rely on parameter similarity to assess prompt transferability. HGPrompt argues for a more principled approach focusing on the informativeness of the resulting feature representations.
  • Gradient Alignment is Crucial for Stability: Simply combining knowledge isn't enough; ensuring that the learning process itself is stable and coherent across multiple sources is key to avoiding interference and achieving optimal results.
  • Dual Objectives for Robustness: The combination of transferability (H-score) and stability (Gradient Alignment) provides a robust framework that captures complex interactions between prompts, leading to better generalization.

Key Results

HGPrompt achieved state-of-the-art performance on the VTAB benchmark, outperforming 13 baselines with an average accuracy of 59.6%. It showed particular strength in fine-grained recognition (e.g., Flowers102, Oxford Pets) and complex visual reasoning tasks (e.g., sNORB-Azimuth, dSprite-Orientation, Clevr-Count). The ablation study confirmed that both the H-score and Gradient Alignment Loss components are crucial, with the combined approach yielding the best results (67.6% accuracy on a specific setup). Visualizations (t-SNE) also demonstrated that HGPrompt leads to more discriminative and well-separated feature embeddings compared to single-source prompt initialization.

Limitations and Future Work

  • Performance Bottlenecks: The paper notes limitations in specific domains, such as low-resolution digit recognition (SVHN), where accuracy was lower.
  • Parameter Sensitivity: While the paper analyzes the effect of the $\lambda$ hyperparameter, finding the optimal balance between the H-score and Gradient Alignment Loss is still important. The study suggests $\lambda=1.0$ often provides a robust initialization.
  • Future Directions: The authors suggest extending the framework to more diverse sets of source prompts and exploring its application to other modalities beyond vision. They also aim to further advance multi-source prompt transfer by providing theoretical and practical insights.

Summary updated

BibTeX
@inproceedings{zhang2025learning,
  author = {Enming Zhang and Liwen Cao and Yanru Wu and Zhao Zijie and Yang Li},
  title = {{Learning Optimal Prompt Ensemble for Multi-source Visual Prompt Transfer}},
  booktitle = {CoLLAs - Workshop Track},
  year = {2025},
  url = {https://openreview.net/forum?id=WiIPhSmKb0},
}
Figure