InPK: Infusing Prior Knowledge into Prompt for Vision-Language Models
Shuchang Zhou, Jiwei Wei, Shiyuan He, Yuyang Zhou, Chaoning Zhang, Jie Zou, Ning Xie, Yang Yang
TL;DR
Prompt-tuning of Vision-Language Models often overfits to base classes when learnable tokens are randomly initialized, limiting unseen-class generalization. InPK tackles this by infusing class-specific prior knowledge into the learnable prompt tokens at initialization and progressively reinforcing token–knowledge interactions across multiple feature levels, complemented by a learnable text-to-vision projection for better multimodal alignment. Prior knowledge is generated offline with GPT-4 to provide discriminative attributes for each class, and a regularization term preserves general CLIP semantics while emphasizing class-name information. Across 11 datasets, InPK achieves state-of-the-art results in base-to-novel generalization, few-shot learning, cross-dataset evaluation, and domain generalization, with ablations confirming the effectiveness of the infusion strategy and multi-level interaction.
Abstract
Prompt tuning has become a popular strategy for adapting Vision-Language Models (VLMs) to zero/few-shot visual recognition tasks. Some prompting techniques introduce prior knowledge due to its richness, but when learnable tokens are randomly initialized and disconnected from prior knowledge, they tend to overfit on seen classes and struggle with domain shifts for unseen ones. To address this issue, we propose the InPK model, which infuses class-specific prior knowledge into the learnable tokens during initialization, thus enabling the model to explicitly focus on class-relevant information. Furthermore, to mitigate the weakening of class information by multi-layer encoders, we continuously reinforce the interaction between learnable tokens and prior knowledge across multiple feature levels. This progressive interaction allows the learnable tokens to better capture the fine-grained differences and universal visual concepts within prior knowledge, enabling the model to extract more discriminative and generalized text features. Even for unseen classes, the learned interaction allows the model to capture their common representations and infer their appropriate positions within the existing semantic structure. Moreover, we introduce a learnable text-to-vision projection layer to accommodate the text adjustments, ensuring better alignment of visual-text semantics. Extensive experiments on 11 recognition datasets show that InPK significantly outperforms state-of-the-art methods in multiple zero/few-shot image classification tasks.
