用动态路由选提示词,让视觉语言模型更懂多样数据
Mixture of Prompt Learning for Vision Language Models
- 用路由模块按样本自动选最匹配的提示词组合
- 在11个数据集上提升少样本、跨域泛化能力
- 适合需要高效适配新任务的研究者
随着像CLIP这样的预训练视觉语言模型(VLMs)日益重要,大量研究尝试将其用于下游任务。其中,提示学习被证实是一种有效方法,仅需少量参数即可适配新任务。然而现有提示学习方法面临两大挑战:单一软提示难以捕捉数据集内多样的风格与模式;微调软提示易过拟合。为此,本文提出一种混合软提示学习方法,引入路由模块,能捕捉数据集的多样化风格,并为每个样本动态选择最合适提示。此外,设计了一种新颖门控机制,使路由器基于硬提示模板的相似性选择提示,既保留硬提示知识,又提升选择准确性。还引入语义分组文本监督,将每个软提示初始化为所属组的手动设计模板的词嵌入,并对软提示生成的文本特征与硬提示编码特征施加对比损失。该监督确保软提示生成的文本特征与对应硬提示保持接近,保留初始知识并缓解过拟合。方法在11个数据集上验证,相比现有基线,在少样本学习、领域泛化和基础到新领域的泛化场景中均有明显提升。
原文摘要 · Abstract (English)
As powerful pre-trained vision-language models (VLMs) like CLIP gain prominence, numerous studies have attempted to combine VLMs for downstream tasks. Among these, prompt learning has been validated as an effective method for adapting to new tasks, which only requiring a small number of parameters. However, current prompt learning methods face two challenges: first, a single soft prompt struggles to capture the diverse styles and patterns within a dataset; second, fine-tuning soft prompts is prone to overfitting. To address these challenges, we propose a mixture of soft prompt learning method incorporating a routing module. This module is able to capture a dataset's varied styles and dynamically selects the most suitable prompts for each instance. Additionally, we introduce a novel gating mechanism to ensure the router selects prompts based on their similarity to hard prompt templates, which both retaining knowledge from hard prompts and improving selection accuracy. We also implement semantically grouped text-level supervision, initializing each soft prompt with the token embeddings of manually designed templates from its group and applied a contrastive loss between the resulted text feature and hard prompt encoded text feature. This supervision ensures that the text features derived from soft prompts remain close to those from their corresponding hard prompts, preserving initial knowledge and mitigating overfitting. Our method has been validated on 11 datasets, demonstrating evident improvements in few-shot learning, domain generalization, and base-to-new generalization scenarios compared to existing baselines. The code will be available at \url{https://anonymous.4open.science/r/mocoop-6387}
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。