Knowledge-Aware Prompt Tuning for Generalizable Vision-Language Models

Baoshuo Kan, Teng Wang, Wenpeng Lu, Xiantong Zhen, Weili Guan, Feng Zheng

Introduction

Large-scale vision-language models (VLMs), such as CLIP, have fundamentally changed the landscape of computer vision by enabling zero-shot recognition through textual prompts. However, the transition from manual prompt engineering to learnable prompts—where models optimize context vectors automatically—has introduced a significant challenge: overfitting.

While learnable prompts improve performance on seen categories, they often degrade the model's ability to generalize to unseen classes. This "forgetting" occurs because the model captures dataset-specific biases rather than universal visual concepts. To address this, the Knowledge-Aware Prompt Tuning (KAPT) framework introduces external encyclopedic knowledge into the prompting process, mimicking the human ability to use descriptive information to identify unfamiliar objects.

The KAPT Framework

KAPT enhances the standard CLIP architecture by integrating three core innovations designed to bridge the gap between specific training data and general visual knowledge.

1. Discrete Knowledge Prompts

To provide the model with explicit visual cues, KAPT retrieves category descriptions from Wikidata5m. Because raw Wikipedia entries can be overly verbose, the framework employs a pre-trained T5 model to summarize these descriptions into concise, visually-oriented sentences. These summaries act as "semantic anchors," providing the model with a textual blueprint of what an object should look like (e.g., describing a specific flower's petal shape and color).

2. Continuous Knowledge Prompts

Recognizing that discrete text may not capture all nuances, KAPT also utilizes KEPLER, a knowledge-enhanced language model, to generate continuous feature vectors. These vectors are fused with learnable context prompts, creating a hybrid representation that combines the stability of human-readable knowledge with the flexibility of machine-optimized embeddings.

3. Visual Adaptation Head

Generalization requires more than just better text; it requires the vision encoder to focus on the right features. KAPT introduces a Visual Adaptation Head that utilizes a cross-attention mechanism. By using the knowledge-aware textual features as a "query," the model can selectively attend to relevant visual cues within an image while ignoring background noise. This ensures that the visual representation is directly aligned with the descriptive attributes provided by the external knowledge.

Experimental Results

The authors evaluated KAPT across a benchmark of 11 diverse datasets, including ImageNet, OxfordPets, and specialized sets like EuroSAT (satellite imagery) and UCF101 (action recognition). The primary evaluation metric was the "base-to-new" generalization setting, where the model is trained on one set of classes and tested on a completely disjoint set.

Performance Gains

KAPT demonstrated substantial improvements over previous state-of-the-art methods like CoCoOp:

  • New Class Accuracy: KAPT achieved an average accuracy of 70.52% on unseen classes, representing a 3.22% absolute gain over CoCoOp.
  • Harmonic Mean: To measure the balance between seen and unseen performance, KAPT reached a Harmonic Mean of 74.26%, a 2.57% improvement over prior benchmarks.
  • Few-Shot Robustness: In one-shot learning scenarios, KAPT maintained its lead, proving that external knowledge can effectively compensate for a lack of visual training examples.
  • Architectural Agnostic: The framework's benefits were consistent across various backbones, including ResNet-50 and ViT-B/16.

Discussion and Insights

The success of KAPT highlights that knowledge acts as a semantic bridge. By linking rare or unseen categories to known visual concepts (e.g., linking a rare bird species to known traits like "beak shape" or "feather pattern"), the model maintains its ability to generalize. Furthermore, the study confirms that a hybrid prompting strategy—combining discrete and continuous information—is superior to using either in isolation.

Limitations and Future Work

Despite its success, KAPT faces challenges regarding knowledge noise. Wikipedia descriptions can occasionally include non-visual information that may distract the model. Additionally, for highly specialized domains like medical imaging, general-purpose knowledge bases may lack the necessary depth. Future research will likely focus on refining the extraction of visual attributes from text and exploring multi-source knowledge integration to cover niche domains.

Conclusion

Knowledge-Aware Prompt Tuning (KAPT) provides a robust solution to the overfitting problem in vision-language models. By grounding learnable prompts in external, encyclopedic knowledge and employing a task-aware visual adaptation head, KAPT ensures that models remain generalizable, accurate, and ready for real-world applications where unseen categories are the norm rather than the exception.

Summary updated

BibTeX
@inproceedings{kan2023knowledge,
  author = {Baoshuo Kan and Teng Wang and Wenpeng Lu and Xiantong Zhen and Weili Guan and Feng Zheng},
  title = {{Knowledge-Aware Prompt Tuning for Generalizable Vision-Language Models}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
}
Figure