Vocabulary-free few-shot learning for Vision-Language Models

Maxime Zanella, Clément Fuchs, Ismail Ben Ayed, Christophe De Vleeschouwer · DOI

Introduction

Vision-Language Models (VLMs), such as CLIP, have fundamentally changed the landscape of image classification by enabling zero-shot and few-shot adaptation through natural language prompts. However, these models traditionally operate under a "vocabulary-dependent" paradigm, requiring the exact names of target classes to function. This paper introduces vocabulary-free few-shot learning (VFFSL), a novel approach where models adapt to new tasks using only a few image examples, without requiring the textual labels of the target categories. To address this, the authors propose Similarity Mapping (SiM), a baseline method that achieves competitive performance by mapping image similarities against a generic vocabulary of prompts.

The Bottleneck of Vocabulary Dependence

While standard few-shot methods for VLMs are powerful, their reliance on precise class names (e.g., "a photo of a grizzly bear") presents several real-world challenges:

  1. Ambiguity: Many categories are difficult to define or distinguish using a single, concise prompt.
  2. Complexity: Nuanced concepts often require long, descriptive explanations that simple labels fail to capture.
  3. Novelty: In dynamic environments, new concepts emerge that were not present in the model's original training vocabulary.

VFFSL removes this bottleneck by allowing a model to learn to categorize images based on visual examples alone, bypassing the need for human-provided text labels during the adaptation phase.

Methodology: Similarity Mapping (SiM)

The proposed Similarity Mapping (SiM) method treats the classification task as a relational problem. Instead of searching for a specific prompt for a mystery class, SiM describes that class by its relationship to a broad, "generic" set of known concepts.

The SiM Pipeline

  1. Generic Prompt Selection: The model utilizes a large set of $K$ generic prompts, such as the 1,000 class names from ImageNet or over 16,000 terms from WordNet.
  2. Similarity Matrix Construction: For the few-shot labeled images, the model calculates similarity scores against all $K$ generic prompts in the embedding space.
  3. Linear Mapping ($W$): The system employs a simple least-squares minimization (with Tikhonov regularization) to learn a matrix $W$. This matrix maps the high-dimensional similarity scores to the target class assignments (one-hot encodings).
  4. Inference: To classify a novel test image, the model computes its similarity to the generic prompts and applies the learned matrix $W$ to generate a prediction.

Notably, SiM is a "black-box" approach; it only requires similarity scores from the VLM, rather than direct access to internal embeddings or gradients, making it highly versatile.

Experimental Evaluation

The researchers evaluated SiM across 11 diverse image classification datasets, spanning general categories (ImageNet, Caltech101), fine-grained objects (Oxford Pets, Stanford Cars, FGVC Aircraft), scenes (SUN397), and specialized domains like satellite imagery (EuroSAT) and action recognition (UCF101).

Beyond text-based generic prompts, the authors experimented with using random ImageNet images as visual prompts, demonstrating that the "vocabulary" used for mapping can be entirely non-textual.

Key Insights

Interpretability through Association

One of the primary advantages of SiM is its inherent interpretability. By examining the weights in $W$, researchers can see which generic concepts the model associates with a target class. For instance, when presented with a "gerenuk" (a type of antelope) without a label, the model successfully identifies it by its high similarity to generic prompts like "impala" and "gazelle."

Computational Efficiency

Learning the linear mapping is computationally inexpensive. The authors report that training typically takes less than one second on a standard GPU (Tesla A100), offering a significant speed advantage over methods that require prompt tuning or extensive fine-tuning.

Performance Benchmarks

SiM significantly outperformed existing label-mapping techniques such as Frequency Label Mapping (FLM) and Bayesian Label Mapping (BLM). Most impressively, at 16 shots, SiM outperformed standard zero-shot CLIP—which does have access to class names—on 8 out of 10 datasets using a ViT-B/16 backbone. This suggests that the similarity relationships to generic concepts can be more informative than a single, potentially suboptimal, class name.

Limitations and Future Directions

Despite its strengths, a performance gap remains between vocabulary-free methods and state-of-the-art vocabulary-dependent methods like CoOp or Tip-Adapter. In some fine-grained scenarios, the interpretability can also falter; for example, the model might associate a specific car model with an unrelated generic prompt like "four-poster bed" due to coincidental feature correlations.

Future research will likely focus on optimizing the selection of generic prompts and developing methods to automatically assign human-readable names to the clusters discovered by the model, effectively "naming the unnamed" concepts it has learned to distinguish.

Summary updated

BibTeX
@inproceedings{zanella2025vocabulary,
  author = {Maxime Zanella and Clément Fuchs and Ismail Ben Ayed and Christophe De Vleeschouwer},
  title = {{Vocabulary-free few-shot learning for Vision-Language Models}},
  booktitle = {Workshops @ CVPR},
  year = {2025},
}
Figure