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

Yijin ZengarXiv 2026 · arXiv

TL;DR

DEFTS (Data-Efficient, Training-free Few-shot learning in the Text-embedding Subspace) is a novel method that boosts CLIP’s few-shot performance by constraining class prototype estimation strictly to the linear subspace spanned by text embeddings. By using a closed-form Bayesian approach to "blend" zero-shot text priors with limited image evidence, it achieves state-of-the-art results in ultra-low-data regimes without requiring any gradient-based training.

What Problem Does This Paper Address?

Contrastive Language-Image Pre-training (CLIP) is famous for its zero-shot capabilities—matching an image to a text prompt like "a photo of a dog." However, when we have a few labeled examples (few-shot learning), we want to do better.

Existing training-free methods often fall into a trap: they focus heavily on the image embeddings (e.g., building a cache of image features) while treating the text embeddings as static or secondary. Furthermore, image and text embeddings in CLIP suffer from a "modality gap"—they occupy different regions of the embedding space. This makes raw text embeddings suboptimal as class prototypes. Estimating better prototypes in a high-dimensional space (often 512D or 768D) using only one or two images is statistically "noisy" and prone to overfitting.

Methods

The authors introduce DEFTS, which operates on a simple but powerful premise: the most discriminative information for classification lives within the subspace spanned by the text embeddings of the classes.

  1. Subspace Projection: Instead of working in the full high-dimensional space, DEFTS uses PCA on the text embeddings to define a lower-dimensional "text subspace" (retaining 95% of the variance).
  2. Bayesian Prototype Estimation: Within this subspace, the class prototype is treated as a hidden variable.
  3. Prior: A Gaussian distribution centered exactly on the projected zero-shot text embedding.
  4. Likelihood: A Gaussian distribution based on the available few-shot image samples.
  5. Closed-Form Solution: The final class prototype is the Bayesian posterior mean—essentially a weighted average of the text prior and the image evidence. The weights are determined dynamically using an Empirical Bayes approach, meaning the model "decides" how much to trust the text vs. the images based on the observed data variance.
  6. Training-Free: The entire process involves only matrix algebra (projections and inversions), requiring zero backpropagation or GPU-intensive training.

Datasets

The researchers evaluated DEFTS across 12 diverse image classification benchmarks:

  • General Objects: CIFAR-10, CIFAR-100, Caltech101, ImageNet.
  • Fine-Grained: StanfordCars, FGVCAircraft, Flowers102, OxfordIIITPet, Food101.
  • Specialized: DTD (textures), SUN397 (scenes), EuroSAT (satellite imagery).

Key Insights and Ideas

  • The Subspace is the Key: The authors demonstrate that while raw text vectors are imperfect prototypes, the subspace they span is incredibly rich. As shown in Figure 1, projecting image embeddings into this text-spanned subspace actually yields higher accuracy than using the full unprojected space or even a PCA subspace derived from the images themselves.
Figure 1: Nearest Class Mean (NCM) accuracy across 12 datasets when projecting image embeddings into the text-spanned subspace. This is compared against zero-shot CLIP, the full un-projected image embedding space, a random subspace and a PCA subspace of the image embeddings both with rank equivalent to the text subspace. Results for the random subspace are averaged across 10 random seeds, with error bars indicating one standard error. The number of classes for each dataset and the number of samples for estimating the embeddings in the full and text-spanned subspace are included in Table 6.
  • Dimensionality Reduction as Regularization: By forcing the prototype to be a linear combination of text embeddings, the model reduces a high-dimensional estimation problem to finding just a few coefficients. This makes it much harder for the model to "memorize" noise in the few-shot samples.
  • The "Tightness" of Text Space: Figure 3 reveals that the text subspace is "tight"—removing even 5-10% of the variance via PCA significantly degrades discriminative power, suggesting that almost every dimension in the text span carries useful semantic information.
Figure 3: Nearest Class Mean (NCM) classification accuracy across 12 datasets, evaluated within the text embedding subspace after PCA-based variance reduction.

Key Results

  • Superior Low-Shot Performance: In 1-shot and 2-shot scenarios, standalone DEFTS consistently outperforms established training-free baselines like Tip-Adapter and SimpleShot.
  • Data Efficiency: Figure 2 highlights that estimating prototypes in the text subspace is significantly more data-efficient than full-space estimation, especially when the number of training samples ($k$) is very small.
Figure 2: Nearest Class Mean (NCM) accuracy across 12 datasets, comparing image prototypes estimated within the text subspace against estimations in the un-projected embedding space. Accuracies are evaluated across varying k-shots, with all results averaged over 10 random seeds. The number of classes for each dataset and the number of samples for estimating the embeddings in the full and text-spanned subspace are included in Appendix 6.
  • Universal Complement: When ensembled with other methods (like LDA or Tip-Adapter), DEFTS provided a statistically significant boost in 366 out of 480 test cases. For example, with a ViT-L/14 backbone at 2-shots, ensembling DEFTS with a zero-shot baseline improved average accuracy from 74.65% to 77.01%.

Limitations and Future Work

  • Diminishing Returns at High Shot Counts: As the number of available images ($k$) increases (e.g., 16 shots), the relative advantage of DEFTS decreases. This is because image-centric statistical methods (like LDA) become highly accurate once they have enough data to estimate the full-space distribution.
  • Out-of-Distribution Sensitivity: The method relies on the text embeddings being a "good guess." For datasets that are significant outliers to CLIP’s pre-training data (like EuroSAT), the text subspace may be less effective.
  • Future Directions: The authors suggest exploring how this subspace constraint could be applied to training-required methods (like prompt tuning) to see if it provides similar regularization benefits.

Summary updated

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.
BibTeX
@misc{zeng2026defts,
  author = {Yijin Zeng},
  title = {{DEFTS: Data-Efficient, Training-Free Few-Shot Learning for CLIP in the Text Subspace}},
  year = {2026},
  eprint = {2611.21993},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.21993},
}
Figure