arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.05775cs.CV
收藏

面向视觉-语言模型的高效测试时提示调优

Efficient Test-Time Prompt Tuning for Vision-Language Models

State Key Laboratory for Novel Software Technology, Nanjing University(南京大学计算机软件新技术国家重点实验室);vivo AI Lab(vivo AI实验室);Shanghai AI Laboratory(上海人工智能实验室)

Yuhan Zhu, Guozhen Zhang, Chen Xu, Haocheng Shen, Xiaoxin Chen, Gangshan Wu, Limin Wang

AI总结:

针对视觉-语言模型测试时提示调优逐图适配计算成本高的问题,提出基于自监督的Self-TPT框架,以对比提示学习为核心,在3个零样本基准上实现了推理成本降低与SOTA性能的平衡。

摘要:

视觉-语言模型在搭配合适的文本提示时,已展现出出色的零样本分类能力。已有研究证明了测试时提示调优的有效性,但这类方法通常需要在推理阶段针对每张图像进行提示适配,计算成本高昂,限制了可扩展性与实际部署。为解决这一问题,我们提出Self-TPT——一种利用自监督学习实现高效测试时提示调优的新型框架。Self-TPT的核心是通过自监督学习实现高效的预定义类别适配,从而避免推理阶段逐张图像适配的 heavy 计算开销。Self-TPT首先利用源数据联合训练自监督任务与分类任务,随后在测试阶段仅通过自监督任务完成新类别适配。具体而言,我们提出对比提示学习(Contrastive Prompt Learning, CPT)作为自监督的核心任务,CPT旨在通过对比学习缩小类内距离,同时增强类间区分度。此外,实验证据表明CPT能够高度模拟分类任务的反向传播梯度,这为其有效性提供了合理的解释。受这一发现启发,我们进一步引入梯度匹配损失,以显式增强梯度相似性。我们在3个具有挑战性的零样本基准上对Self-TPT进行了评估,结果一致表明:Self-TPT不仅大幅降低了推理成本,还取得了当前最优(SOTA)性能,有效平衡了效率与效果的权衡关系。

英文摘要:

Vision-language models have showcased impressive zero-shot classification capabilities when equipped with suitable text prompts. Previous studies have shown the effectiveness of test-time prompt tuning; however, these methods typically require per-image prompt adaptation during inference, which incurs high computational budgets and limits scalability and practical deployment. To overcome this issue, we introduce Self-TPT, a novel framework leveraging Self-supervised learning for efficient Test-time Prompt Tuning. The key aspect of Self-TPT is that it turns to efficient predefined class adaptation via self-supervised learning, thus avoiding computation-heavy per-image adaptation at inference. Self-TPT begins by co-training the self-supervised and the classification task using source data, then applies the self-supervised task exclusively for test-time new class adaptation. Specifically, we propose Contrastive Prompt Learning (CPT) as the key task for self-supervision. CPT is designed to minimize the intra-class distances while enhancing inter-class distinguishability via contrastive learning. Furthermore, empirical evidence suggests that CPT could closely mimic back-propagated gradients of the classification task, offering a plausible explanation for its effectiveness. Motivated by this finding, we further introduce a gradient matching loss to explicitly enhance the gradient similarity. We evaluated Self-TPT across three challenging zero-shot benchmarks. The results consistently demonstrate that Self-TPT not only significantly reduces inference costs but also achieves state-of-the-art performance, effectively balancing the efficiency-efficacy trade-off.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑