arXiv:2607.14125cs.LGcs.CV2026-07中稿 · ICLR被引 1

让提示词权重随类别变化,提升零样本视觉语言模型准确率

CARPRT: Class-Aware Zero-Shot Prompt Reweighting for Black-Box Vision-Language Models

论文配图:CARPRT: Class-Aware Zero-Shot Prompt Reweighting for Black-Box Vision-Language Models
图 1 · 摘自论文原文
  • 为每个类别单独计算提示词权重,捕捉提示与类别的依赖关系
  • 在多个基准上超越传统共享权重方法,最高提升3.2个百分点
  • 无需训练,适合不想调参的开发者快速提升模型表现

预训练视觉语言模型通过计算图像与文本描述之间的相似度实现零样本图像分类,通常将类别名(如“猫”)插入提示模板(如“一张……的照片”)生成文本。由于相似度对提示选择敏感,现有方法通过加权向量融合多个提示的得分。但当前策略中权重向量对所有类别共享,隐含假设提示与类别无关,实际并不成立——例如“从空中俯瞰”适合“机场”却不适合“苹果”。为此,我们提出类别感知的零样本提示重加权方法(CARPRT)。该方法在无训练条件下,为每个类别和每条提示计算其特定相关性:基于该提示下被预测为该类别的图像的图文相似度平均值。这些相关性经归一化后得到类别专属权重。在标准图像分类基准上的评估表明,CARPRT优于现有类无关重加权方法,证实建模提示-类别依赖对高效零样本预测至关重要,且适用于依赖提示集成的更广泛VLM应用场景。代码已开源。

原文摘要 · Abstract (English)

Pre-trained vision-language models (VLMs) enable zero-shot image classification by computing the similarity score between an image and textual descriptions, typically formed by inserting a class label (e.g., "cat") into a prompt (e.g., "a photo of a"). Since the score for a given image-class pair is sensitive to the choice of prompt, existing studies ensemble multiple prompts using a weighting vector to aggregate scores across different prompts. Yet, in current strategies, the weighting vector assigned to each prompt is shared across all classes, implicitly assuming that prompts are conditionally independent of classes, which often does not hold in practice, as a prompt like "an aerial view of" might be apt for "airport" but ill-suited for "apple". To address this, we propose class-aware zero-shot prompt reweighting (CARPRT). This scoring scheme adjusts the weighting vector for each class label by capturing the class-specific relevance of different prompts in a training-free manner. For each class label and every available prompt, we quantify their class-specific relevance by averaging image-text relevance scores over images predicted to that class under the given prompt. These estimates are then normalized to derive class-specific weights. Evaluations on standard image classification benchmarks show that CARPRT outperforms existing class-independent reweighting methods, confirming that modeling prompt-class dependencies is crucial for effective zero-shot prediction and even broader VLM-based application settings that rely on prompt ensembling. Our code is available at https://github.com/tmlr-group/CARPRT.

零样本学习提示工程视觉语言模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。