arXiv:2611.21993cs.CVNov 2026

Manuscript Offprint

arXiv:2611.21993

DEFTS: Data-Efficient, Training-Free Few-Shot Learning for CLIP in the Text Subspace

Yijin Zeng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Contrastive Language-Image Pre-training (CLIP) achieves impressive zero-shot image classification performance by comparing image embeddings against class-specific text embeddings. While recent few-shot methods leverage labeled training samples to improve upon this zero-shot baseline, they often predominantly rely on image embeddings and underutilize the semantic structure of the text embeddings. In this paper, we introduce DEFTS, a data-efficient, training-free few-shot classification method strictly in the text subspace. We first demonstrate empirically that while raw text embeddings can be suboptimal as direct classifiers, the linear subspace they span remains highly discriminative. DEFTS therefore proposes to reduce the image-text modality gap by projecting estimated image prototypes directly into this subspace. Importantly, by expressing these prototypes as linear combinations of text embeddings, DEFTS reduces a high-dimensional estimation problem to the derivation of just a few coefficients. These coefficients are then computed via a Bayesian posterior mean, using a prior naturally centered on the original text embedding coordinates. Extensive experiments across 12 image classification benchmarks demonstrate that DEFTS significantly improves upon existing training-free methods.

1 Introduction

Contrastive Language-Image Pre-training (CLIP) [27] has gained considerable attention due to its impressive zero-shot capabilities. The model is trained to maximize the similarity between matched image-text pairs while minimizing the similarity across all incorrect pairings. By leveraging over 400 million image-text pairs, CLIP shows remarkable zero-shot image classification performance without requiring any dataset-specific fine-tuning. This is achieved by passing an image through a image encoder and class-specific text prompts (e.g., “a photo of a {class}”) through a text encoder, projecting both into a shared semantic space. The image is then assigned to the class whose text embedding yields the highest cosine similarity.

Despite its powerful zero-shot performance, recent work [33, 37, 11, 32, 30, 36, 10, 40, 39] has demonstrated that the performances of CLIP could be improved significantly by utilizing only a few labeled training samples, known as few-shot learning. In particular, training-free few-shots methods [33, 37, 30, 10] are becoming increasingly more popular because of their computational efficiency and comparable power compared with training-required methods [33].

While significantly improving upon zero-shot baselines, most training-free methods rely heavily on the image embeddings and underutilize the semantic structure of the text embeddings. For example, Wang et al. [33] fit a Linear Discriminant Analysis (LDA) model directly on the visual features to classify images during inference. Similarly, Zhang et al. [37] cache the kk-shot image embeddings as keys and their one-hot labels as values to compute attention weights for test images. Both approaches only utilize the text embeddings by ensembling with the original zero-shot CLIP predictions.

Therefore, in this paper, we aim to maximize the utility of the text embeddings by constraining the alignment of image and text representations strictly within the text-spanned subspace. Because our approach operates entirely within the the text space, it naturally complements existing image-centric adaptation methods.

References (24)