Modular Prompt Learning Improves Vision-Language Models

Zhenhan Huang, Tejaswini Pedapati, Pin-Yu Chen, Jianxi Gao · DOI

Introduction

Adapting massive pre-trained Vision-Language Models (VLMs) like CLIP to specific downstream tasks requires a delicate balance. While full fine-tuning is computationally prohibitive and risks "catastrophic forgetting," simple text prompting often fails to capture the nuances of specialized domains. Modular Prompt Learning (MPL) addresses this by treating prompts as dynamic components that can be added, carried forward, or removed across a model's transformer layers.

The Problem: Information Loss in Deep Prompting

Current state-of-the-art methods like Deep Visual Prompt Tuning (VPT) insert learnable "soft prompts" into every layer. However, standard VPT typically discards prompts from layer $i$ and replaces them with entirely new ones in layer $i+1$. This "replace-at-every-layer" strategy leads to a fundamental flaw: the model loses valuable contextual information that has already been processed in earlier layers. The authors identified that removing these prompts at every layer inevitably loses valuable information that the model has already contextualized.

Methodology: Modular Operations

MPL introduces three modular operations to manage prompt sequences more effectively across transformer layers:

  1. Adding ($O_{add}$): Inserts new learnable prompts into the current layer.
  2. Removing ($O_{rm}$): Drops specific prompts from the sequence to manage complexity or filter noise.
  3. Carrying ($O_{cr}$): Passes prompts from the previous layer's output directly into the next, acting as a "memory" mechanism that standard deep prompting lacks.
The MPL architecture utilizes modular operations and a trainable coupling function to synchronize text and image prompts across layers.

By combining these operations, MPL can simulate existing prompting methods while allowing for hybrid approaches that preserve information across the network's depth. A Trainable Coupling Function ($\mathcal{F}$) is also employed to ensure synchronization between the text and image branches.

Experimental Results

The researchers evaluated MPL across 11 diverse datasets, focusing on base-to-new generalization and cross-dataset robustness. Testing included generic objects (ImageNet), fine-grained categories (OxfordPets), and specialized tasks like satellite imagery (EuroSAT).

Base-to-New Generalization

MPL demonstrated superior performance in generalizing from known to unseen classes. Notably, on the EuroSAT satellite imagery dataset, MPL achieved a significant breakthrough, outperforming the previous state-of-the-art (PromptSRC) by a relative 10.7% (79.73% vs 72.05%). On average across all 11 datasets, MPL achieved a 0.7% improvement over PromptSRC.

Performance comparison across 11 datasets showing MPL's superior generalization, particularly on the EuroSAT dataset.

Cross-Dataset Evaluation and Efficiency

When trained on ImageNet and tested on 10 other datasets, MPL achieved the highest average accuracy of 66.25%. This success suggests that preserving learned prompt information is critical when the model encounters domains significantly different from its original training data. Furthermore, MPL is highly efficient, achieving better results than methods like CoCoOp while requiring significantly less training time.

Conclusion

Modular Prompt Learning offers a more efficient and effective way to adapt VLMs. By allowing prompts to persist across layers, MPL maintains a continuous context that enhances the model's understanding of complex visual features. Future work may involve using Neural Architecture Search (NAS) to automatically optimize the combination of modular operations for specific tasks, potentially unlocking even higher performance without manual tuning.

Summary updated

BibTeX
@inproceedings{huang2025modular,
  author = {Zhenhan Huang and Tejaswini Pedapati and Pin-Yu Chen and Jianxi Gao},
  title = {{Modular Prompt Learning Improves Vision-Language Models}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2025},
  doi = {10.1109/icassp49660.2025.10889690},
}
Figure