Manuscript Offprint
arXiv:2611.21993DEFTS: Data-Efficient, Training-Free Few-Shot Learning for CLIP in the Text Subspace
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 -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.
Statistical classifiers operating directly on the extracted embeddings have also proven remarkably effective. Wang et al. [32] demonstrate that a properly normalized Nearest Class Mean (NCM) rule acts as a competitive baseline. More recently, Wang et al. [33] showed that a training-free Linear Discriminant Analysis (LDA) classifier yields exceptionally strong performance when ensembled with zero-shot CLIP. Several studies [10, 38] have explored leveraging the text subspace to enhance CLIP’s performance in the training-free few-shot setting. However, these methods typically rely on ad-hoc heuristics to align visual prototypes within this subspace. Specifically, TAMP [10] projects few-shot image prototypes onto the text embedding space and linearly mixes the result with the text prototype via a scalar weight , which is selected on a held-out validation set. Alternatively, Zhang et al. [38] split the image embeddings into components within the text embedding space and its orthogonal complement, subsequently reweighting them via a tuned hyperparameter . Further discussion of related literature is provided in Appendix A.
Contributions
Our primary contributions in this paper are summarized as follows:
- We empirically demonstrate that while original zero-shot text embeddings is suboptimal for direct classification, the linear subspace they span is highly discriminative. Specifically, we show that Nearest Class Mean (NCM) classification, which uses image prototypes estimated strictly within this text-spanned subspace, often achieves comparable or superior performance to full-space estimation while being significantly more sample-efficient.
- Building on these insights, we introduce DEFTS: a Data-Efficient, training-free Few-shot learning method in the Text-embedding Subspace. Importantly, we notice that because any point in this space is a linear combination of the text embeddings, prototype estimation reduces to inferring a low-dimensional set of coefficients. DEFTS then determines these coefficients via a closed-form Bayesian formulation, utilizing a prior naturally anchored to the original zero-shot text coordinates.
- We conduct extensive evaluations across 12 image classification benchmarks and three model backbones. The results demonstrate that DEFTS a highly effective complement to prior work: with model backbone ViT-L/14, ensembling DEFTS with existing methods yields a significantly positive improvement in 366 of the 480 dataset-level results (12 datasets, 8 methods, 5 numbers of shots). Only 19 results are negative, and only 5 of these are statistically significant (90% confidence interval).
2 Method
In this section, we first review CLIP for zero-shot learning. Then we present a series of observations demonstrating that the text embedding subspace is highly discriminative and data efficient. Based on these insights, we provide details of our proposed training-free method DEFTS.
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.
2.1 CLIP for zero-shot classfication
In the zero-shot setting, CLIP performs classification by comparing an image embedding against a set of class-specific text embeddings, assigning the image to the class that yields the highest cosine similarity. Specifically, let denote an input image and denote the synthesized text prompts (e.g., “a photo of a class”) for each of the classes. CLIP extracts the representations using a vision encoder (e.g., a Vision Transformer or ResNet) and a text encoder (typically a Transformer). Assuming the extracted embeddings are -normalized, the predicted class is determined by maximizing their inner product:
2.2 Text Embedding subspace
As shown above, the rule for deciding the class in CLIP is straightforward. However, it is less immediately obvious that the prediction results can only depend on the image embedding through its projection onto the subspace spanned by the class text embeddings. To formalize this, let denote the text embedding for class , and be the matrix of all class embeddings. We define and the orthogonal projector onto as , where + indicates the pseudo-inverse. We can then decompose the visual embedding as follows:
As an orthogonal projection matrix, is symmetric and idempotent. Because lies within the span of , it is invariant under this projection (), which gives . Using the symmetry of , it follows that . Therefore, the dot product between the visual and text embeddings simplifies to:
A known reason why the raw text embeddings are poor prototypes is the modality gap [18]: image and text embeddings occupy different regions of the embedding sphere, so the images of a class are not centered at the text embedding of that class. Thus, prior work typically focus on looking for better alternatives to the text embedding as a class prototype by learning better representations [40, 10], often ignoring the text embeddings entirely [33].
In this section, we ask whether the text subspace itself, rather than the text embedding vectors, is the reason that zero-shot classification is sub-optimal. Informally, if is an inherently poor subspace, projecting the image embeddings onto it will inevitably discard critical discriminative information. In this case, classification accuracy would be strictly bottlenecked by the projection. Conversely, if is highly discriminative and preserves this information, then the raw text embeddings themselves are the true bottleneck limiting performance, not the subspace they span.
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 -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.
In this section, we present a series of observations for investigating the the text embedding subspace. All experiments conducted in this section employ CLIP ViT-L/14 as model backbone, and utilize the hand-crafted prompt templates introduced by CoOp [40] as detailed in Appendix E.2. The experiments details for the observations are provided in Appendix E.4.
Observation 1: The text-spanned subspace is highly discriminative and not the bottleneck.
In our first empirical observation, we investigate the discriminative power of the linear subspace spanned by the text embeddings (as described in Section 2.3 but without centering first). It is well established that replacing text embeddings with the class means of the image embeddings, effectively applying a Nearest Class Mean (NCM) classifier [32], significantly improves classification performance. To investigate the discriminative power of the text subspace, we train an NCM classifier strictly within this subspace, and subsequently evaluate its accuracy.
As shown in Figure 1, the accuracy of this projected NCM classifier is significantly higher than that of standard zero-shot CLIP. This suggests that the text subspace is not the bottleneck for classification accuracy. For comparison, we also evaluate the full un-projected image embedding space, projections onto a random subspace and a PCA subspace of the image embeddings both with rank equivalent to the text subspace. Surprisingly, the text embedding subspace consistently outperforms the PCA subspace and, in several datasets, such as Food101, surpasses the full, un-projected image embeddings.
Observation 2: Class prototype estimation within the subspace is highly data-efficient.
Following Observation 1, we further investigate the accuracy of the NCM classifier when only a small number of training samples per class are available to estimate the image prototypes. We compare the results of estimating these prototypes strictly within the text-spanned subspace against estimating them directly in the full embedding space. As shown in Figure 2, subspace estimation is significantly more data-efficient for 10 of the 12 datasets considered. It outperforms direct estimation by a large margin when the number of sample sizes are small with only two exceptions: ImageNet and EuroSAT. For ImageNet, the large number of classes () causes the text embedding subspace to span the entire feature space, so the projection is equivalent to operating in the full space. To further investigate whether the number of classes impacts Observation 2. We provide additional experiments in Appendix F.2 analyzing the correlation between the ratio and the advantage of estimtion in text subspace over full space. On the other hand, EuroSAT is a well-documented outlier to the CLIP pre-training distribution [17, 27], which limits the performance of the text subspace.
Observation 3: The text-spanned subspace is tight, so only a mild reduction is useful in practice.
In this observation, we investigate whether reducing the dimensionality of the text embedding subspace via PCA degrades its discriminative capacity. We evaluate this by projecting all training samples first and then measuring the NCM accuracy within the reduced subspace. As shown in Figure 3, even a minor removal of variance, e.g. 5%, hurts the discriminative power of the subspace, so no direction of the subspace is redundant. The only exception to this trend is ImageNet, whose 1000 text embeddings span the entire feature space. Note, however, that the image embeddings in Figure 3 are estimated from all available training samples. When only a few samples are available, as in this paper, discarding a minimal amount of variance (e.g., 5%) improves the accuracy, whereas a large reduction (e.g., 50%) strongly degrades it (Appendix F.7).
This section investigates the text embedding subspace through a series of observations. We show that this linear subspace is highly discriminative and in-subspace prototype estimation is often significantly more data-efficient than directly estimating image embeddings in the full feature space. While all experiments in this section apply the hand-crafted prompt templates introduced by CoOp [40], we present evidence in Appendix F.1 showing that, surprisingly, the discriminative power of the text-spanned subspace does not seem to depend on the quality of the prompt template.
Figure 3: Nearest Class Mean (NCM) classification accuracy across 12 datasets, evaluated within the text embedding subspace after PCA-based variance reduction.
2.3 DEFTS
Section 2.2 demonstrates empirically that the text embedding space is highly discriminative and data efficient. In this section, we introduce DEFTS, which performs NCM classification with image prototypes estimated strictly within the text-spanned linear subspace.
This estimation problem has two features: first, in the few-shot setting, the sample mean of the image coordinates computed directly from the images per class is a noisy estimate of the true prototype. Second, the text embedding of a class already provides a good guess of its image prototype after projection, because zero-shot CLIP classifies well. Therefore, instead of estimating the sample mean from scratch, we combine the two features using a Bayesian treatment. Specifically, we place a Gaussian prior centered at the projected text embedding and model the image coordinates with a Gaussian likelihood. This gives us a closed-form solution: the posterior mean is a weighted average of the image mean and the text embedding, where the weight is estimated from the data directly.
Further, we consider two designs to keep the estimation problem more reliable in the few-shot regime. First, projecting the image embeddings onto the text subspace reduces the dimension from to , so that only coefficients per class have to be inferred and the covariance is an matrix. Second, the prior uses a single variance , which can be estimated reliably from the deviations between the image means and the text prior, and the likelihood covariance is shared across classes, which pools all degrees of freedom. In short, the subspace projection is designed to addresses the dimensionality of the problem, and the Bayesian update is for reducing the noise from the few samples. In Section 3.2, we validate the two design choices by showing that each of the two improves the accuracy of DEFTS on its own.
Text Embedding Subspace Projection.
We first describe how we apply PCA to further reduce the dimensionality of the text embedding subspace. Let denote the CLIP text embeddings for the classes (generated from a fixed prompt template), and let be their mean. We construct the centered scatter matrix:
Then we eigendecompose and retain the top eigenvectors to form the basis matrix , where is chosen to capture at least 95% of the total variance. Specifically, is the smallest integer satisfying . As demonstrated by Observation 3 in Section 2.2 and the empirical results in Appendix F.7, this 95% threshold provides practical benefits and improves classification accuracy when only a small number of training samples are available, whereas further reduction in variance decreases the discriminative power of the subspace. Note that it is also possible to project the image embeddings onto the original, uncentered text embeddings, as we have done in Section 2.2. In Appendix F.3, we compare these centered and uncentered projection spaces, and show that centering the text embeddings prior to projection yields improved classification accuracy.
In the following, we project all embeddings into this -dimensional subspace. For each class , the text embedding coordinate is , and the support images yield coordinates . All subsequent Bayesian estimation operates entirely within this reduced coordinate space.
Bayesian Formulation: Prior and Likelihood
Let represent the unknown true prototype for class in the projected subspace. We place a Gaussian prior on , centered exactly at the projected text embedding :
This prior is motivated by utilizing CLIP’s zero-shot capabilities. As demonstrated in Section 2.1, CLIP’s classification rule depends on the image embedding strictly through its projection onto the text-spanned subspace. Because zero-shot classification is generally effective, the true image prototype naturally align with, and therefore exhibit a small angle relative to its corresponding text embedding in this space. Consequently, the projected text embedding serves as a highly informative prior for the mean of image embeddings.
The observed support image coordinates are modeled as independent and identically distributed (i.i.d.) draws from a Gaussian likelihood parameterized by :
Note that the covariance matrix does not depend on the class index and is instead shared across all classes. We adopt this shared covariance structure to maximize data efficiency in the few-shot settings, as demonstrated in Section 3.2.3.
Empirical Bayes Hyperparameter Estimation
To estimate the hyperparameters of the prior and likelihood, we employ the Empirical Bayes method. Let denote the sample mean of the projected images for class , and let be its deviation from the text prior. For , we first estimate the observation noise by computing the pooled sample variance across all classes:
Then we estimate as:
where is the averaged deviation of the image mean from the text prior to approximate . Appendix B.1 shows the derivation for the estimator.
In the one-shot setting (), the within-class variance cannot be computed from the data. Consequently, and become unidentifiable, as only their sum, , is observed. To resolve this problem, we partition the total observed spread using empirical results when as shown in Appendix F.4. These results indicate that often accounts for roughly 10% of the averaged empirical deviation . Thus, we set and for throughout the whole paper.
For the likelihood covariance, we apply a ridge-type shrinkage estimator analogous to the formulation in Wang et al. [33], adapted here for the -dimensional subspace. Let be the pooled empirical sample covariance. The regularized precision matrix is defined globally for all classes as:
where is a covariance inflation parameter. Because empirical sample covariances derived from extremely small support sets (e.g. ) could be highly unstable as shown in Appendix F.5, the implicit factor explicitly inflates the estimated variance to prevent the Bayesian update from becoming overconfident. We investigate the impact of this hyperparameter in detail in Appendix F.6. Empirically, we observe that a small (e.g., or ) yields better performance than , particularly in low-shot regimes such as . Therefore, we fix throughout the paper. In Appendix F.8, we conduct a sensitivity analysis for this hyperparameter alongside the PCA variance threshold, demonstrating their robustness across different datasets. For the 1-shot setting (), we default to . The full derivation for this estimate is provided in Appendix B.2.
Closed-Form Posterior Inference
Denote . Given the Gaussian prior and likelihood, the posterior distribution is also Gaussian, and its posterior mean is [1]:
In other words, the posterior mean is a weighted average of the sample mean and the prior mean . This is an empirical-Bayes shrinkage estimator in the sense of James–Stein [13] and Efron–Morris [5]: the strength of the shrinkage is estimated from the data, through and , and not tuned by hand or require additional dataset for hyper-parameter tunning as TAMP [10].
In Appendix B.3, we show that when , the Equation (5) degrages to for and . In other words, the weights of the image and text embedding does not depend on the data for DEFTS when . Therefore, the performances of DEFTS for depends solely on the centered PCA projection, rather than Bayesian updates.
The complete procedure for performing DEFTS is summarized in Algorithm 1 in Appendix C. The results from DEFTS can be used directly for cosine-similarity classification, or ensembled with existing methods as described in Appendix G.1.
3 Experiments
3.1 DEFTS Complements Existing Training-Free Methods
In this section, we conduct extensive experiments to evaluate the performance of DEFTS, and existing training-free methods after complemented by DEFTS through ensembling.
Datasets.
Following prior relevant work [33, 27, 40], we evaluate DEFTS on 12 standard few-shot classification datasets. The datasets span generic object recognition (CIFAR-10/100 [15], Caltech101 [8], ImageNet [4]), fine-grained recognition (StanfordCars [14], FGVCAircraft [20], Flowers102 [23], OxfordIIITPet [25], Food101 [2]), texture recognition (DTD [3]), scene recognition (SUN397 [34]), and remote-sensing imagery (EuroSAT [12]). In Appendix E.1, we provide more information about these datasets.
Table 1: Number of shots . Classification accuracy (%) and performance improvements across datasets. The values in parentheses denote the absolute performance change after ensembling with DEFTS and the confidence interval.
Dataset ZS SimpleShot Linear Probe Tip-Adapter APE TIP-X TAMP+ZS LDA+ZS DEFTS C10 94.89 (+0.38 0.18) 79.44 (+15.84 3.08) 81.42 (+13.90 2.77) 94.85 (+0.24 0.24) 94.34 (+0.45 0.61) 94.48 (+0.54 0.19) 94.80 (+0.39 0.16) 94.80 (+0.41 0.12) 95.29 C100 77.27 (+0.29 0.30) 48.35 (+28.50 0.67) 53.39 (+23.38 2.10) 77.53 (+0.00 0.00) 77.65 (+0.00 0.00) 68.43 (+2.32 1.02) 77.38 (+0.16 0.18) 77.27 (+0.29 0.30) 76.85 Cal101 94.62 (+0.53 0.31) 91.13 (+4.47 0.48) 91.62 (+3.70 0.72) 94.64 (+0.00 0.00) 94.83 (+0.00 0.00) 94.59 (+0.53 0.12) 94.95 (+0.41 0.28) 94.62 (+0.53 0.31) 95.58 DTD 53.03 (+4.98 1.87) 48.05 (+14.29 1.38) 48.95 (+14.47 2.48) 57.09 (+1.70 1.64) 56.33 (+0.31 0.57) 56.20 (+2.18 0.91) 56.82 (+1.28 1.23) 53.03 (+4.98 1.87) 62.37 Euro 61.17 (+5.66 2.26) 67.60 (+5.18 2.74) 64.66 (+8.25 4.37) 66.87 (+1.39 0.94) 68.90 (+2.06 2.67) 66.81 (+1.77 0.54) 61.07 (+6.26 2.24) 67.54 (+4.27 3.14) 68.67 Air. 32.18 (+0.25 0.47) 34.62 (+8.55 1.71) 33.55 (+10.36 1.46) 34.76 (+0.00 0.00) 37.49 (+0.74 1.35) 43.29 (+1.90 0.37) 35.56 (+0.15 0.32) 32.18 (+0.25 0.47) 44.57 Flow. 78.40 (+15.16 0.94) 92.75 (+2.85 0.66) 91.44 (+3.91 1.22) 88.02 (+5.71 1.77) 93.00 (+1.19 0.59) 92.84 (+1.66 0.23) 91.22 (+1.15 0.57) 92.81 (+1.64 1.12) 95.14 Food 93.11 (+0.23 0.11) 75.70 (+17.06 0.56) 77.23 (+15.33 1.07) 93.19 (+0.00 0.00) 93.19 (+0.00 0.00) 87.53 (+2.34 0.42) 93.17 (+0.21 0.10) 93.11 (+0.23 0.11) 92.76 INet 74.35 (+0.00 0.00) 54.78 (+20.90 0.27) 57.89 (+17.77 0.23) 74.40 (+0.00 0.00) 74.50 (+0.00 0.00) 64.45 (+0.00 0.00) 75.68 (+0.00 0.00) 74.35 (+0.00 0.00) 75.68 Pet 92.82 (+0.88 0.30) 66.96 (+26.31 1.72) 70.14 (+23.02 1.69) 92.87 (+0.12 0.23) 93.01 (+0.13 0.24) 93.42 (+0.35 0.45) 92.85 (+1.17 0.25) 92.82 (+0.88 0.30) 93.27 SUN 67.35 (+0.00 0.00) 55.13 (+17.03 0.38) 56.14 (+16.02 1.04) 67.92 (+0.00 0.00) 68.05 (+0.00 0.00) 63.45 (+0.00 0.00) 69.40 (+0.00 0.00) 67.35 (+0.00 0.00) 72.16 Cars 76.61 (+0.00 0.00) 59.02 (+22.59 0.79) 62.43 (+18.77 1.27) 76.72 (+0.00 0.00) 76.82 (+0.00 0.00) 76.83 (+1.62 0.65) 76.89 (+0.04 0.05) 76.61 (+0.00 0.00) 81.64 AVG 74.65 (+2.36 0.69) 64.46 (+15.30 1.30) 65.74 (+14.07 1.07) 76.57 (+0.76 0.31) 77.34 (+0.41 0.25) 75.19 (+1.27 0.18) 76.65 (+0.94 0.32) 76.37 (+1.12 0.37) 79.50
Existing methods.
We consider completing the following training-free few-shot classification methods using DEFTS: Linear Probe [27]: a linear classier on top of image embeddings; SimpleShot [32], a nearest class mean classifier; Tip-Adapter [37], which caches the -shot features as keys and one-hot labels as values to compute a weighted cache vote added to the zero-shot logits; TIP-X [30], which extends Tip-Adapter with a KL-divergence affinity term between the support and test images’ text-class distributions; APE [41], which refines Tip-Adapter by selecting class-discriminative channels from text embeddings and reweighting cache votes; LDA [33], a Gaussian discriminant classifier utilizing a single empirical Bayes shrunk covariance pooled across all classes; and TAMP [10], which mixes image and text prototypes in an un-truncated text embeddings subspace. As the standalone LDA classifier typically yields sub-optimal performance, we ensemble it with zero-shot CLIP, as suggested by Wang et al. [33]. Similarly, we evaluate the performances of TAMP after ensembling with both zero-shot CLIP.
Implementation Details.
All embeddings are extracted using a frozen CLIP ViT-L/14 [27] and prompt templates from CoOp [40] as detailed in Appendix E.2. We evaluate support images per class, with results averaged over 10 random seeds. Ensembling methods require choosing weights for each method, e.g. the weight between LDA and zero-shot (ZS). In this section, all methods strictly adhere to the -shot budget without utilizing external held-out validation. Thus, when , we apply fixed weights for each method. When , we search optimal hyperparameters for each method using leave-one-out cross-validation. The details for choosing and tuning these hyperparameters is reported in Appendix G.
Table 2: Average classification accuracy (%) and performance improvements across 12 datasets for different numbers of shots . The values in parentheses denote the absolute performance change after ensembling with DEFTS and the confidence interval. Positive gains are highlighted in green. The best baseline accuracy for each -shot setting (before adding DEFTS) is highlighted in bold.
-shot ZS SimpleShot Linear Probe Tip-Adapter APE TIP-X TAMP+ZS LDA+ZS DEFTS alone 74.65 (+3.03 0.46) 50.88 (+18.37 1.25) 55.27 (+16.43 1.15) 75.05 (+2.69 0.43) 75.79 (+2.07 0.38) 75.29 (+2.48 0.41) 76.21 (+1.02 0.21) 74.69 (+3.00 0.45) 77.12 74.65 (+2.36 0.69) 64.46 (+15.30 1.30) 65.74 (+14.07 1.07) 76.57 (+0.76 0.31) 77.34 (+0.41 0.25) 75.19 (+1.27 0.18) 76.65 (+0.94 0.32) 76.37 (+1.12 0.37) 79.50 74.65 (+6.33 0.91) 73.83 (+8.48 0.73) 75.84 (+6.35 0.66) 79.05 (+2.16 0.45) 79.78 (+1.64 0.36) 76.93 (+0.52 0.13) 78.80 (+2.20 0.46) 82.12 (+0.68 0.26) 81.66 74.65 (+8.90 1.10) 78.80 (+5.54 0.47) 81.44 (+2.61 0.36) 81.37 (+2.79 0.35) 82.06 (+2.29 0.38) 78.84 (+0.03 0.06) 80.00 (+3.30 0.54) 85.24 (+0.49 0.13) 83.51 74.65 (+10.04 1.20) 81.56 (+4.00 0.37) 85.12 (+0.37 0.27) 82.85 (+2.69 0.33) 83.84 (+2.11 0.35) 80.58 (+0.43 0.20) 80.89 (+3.78 0.59) 86.70 (+0.70 0.16) 84.59
Results
In Table 16, we present the classification results for the two-shot learning setting (). Hyperparameters and ensembling weights for each method were tuned following the procedure detailed in Appendix G. Note that a reported gain of indicates that the leave-one-out search assigned a weight of 0 to DEFTS across all 10 random seeds, effectively switching it off.
The results demonstrate that ensembling with DEFTS improves the average accuracy of all evaluated methods across the 12 datasets. For weaker baselines, such as SimpleShot and Linear Probe, the performance gains yielded by DEFTS are substantial. Meanwhile, for strong baselines like LDA, we still observe statistically significant improvements. Notably, the standalone DEFTS framework achieves the highest overall average accuracy in this 2-shot case. In Appendix F.9, we provide detailed results analogous to Table 16 for varying numbers of shots .
Table 2 further evaluates the performance of each method across varying numbers of shots . The results show that DEFTS consistently complements existing baselines. In extremely low-data regimes (), the standalone DEFTS framework achieves the highest overall accuracy while significantly improving the performance of all other methods upon ensembling. For larger support sets (), LDA+ZS emerges as the strongest initial baseline; crucially, ensembling it with DEFTS continues to yield statistically significant improvements. Finally, in Appendix F.10, we replicate these simulations using alternative model backbones, demonstrating that the performance gains provided by DEFTS are robust across different models.
3.2 Ablation Study
3.2.1 Estimation in subspace
DEFTS proposes projecting features into a low-rank, variance-reduced text embedding subspace prior to performing Bayesian estimation for the class-conditional image means. We first investigate the impact of this projection by comparing it against an ablation where Bayesian estimation is applied directly in the original, unprojected embedding space. The results Figure 6 demonstrate that projecting into the subspace yields a substantial advantage especially in the low-data regimes (). As the number of shots increases, the performance of DEFTS with and without the subspace projection converges.
Figure 4: DEFTS’ accuracy with and without projecting into the text subspaces.
Figure 5: DEFTS’ accuracy with and without applying the Bayesian estimation.
Figure 6: DEFTS’ accuracy with and without applying the pooled covariance estimation .
3.2.2 Bayesian formulations
We now investigate the contribution of the Bayesian estimation component within the DEFTS framework. In Figure 6, we compare the DEFTS against a simple average of the image embeddings in the DEFTS’ subspace. In Table 3, we further compare DEFTS against DEFTS (fixed weight 0.5), which mixes image and text embeddings evenly in DEFTS’s centered 95% subspace. Both comparisons confirm the effectiveness of the Bayesian component of DEFTS. According to Figure 6, while DEFTS drastically outperforms the simple image average for , this gap narrows when . On the other hand, DEFTS’ advantage over the fixed-weight variant increases with as shown inTable 3. This highlights the difficulty of choosing a reasonable mixing weight between image and text embeddings: relying on text embeddings is useful for small , but forcing this reliance at larger degrades the performance. DEFTS naturally addresses this issue by adapting the mixing weight dynamically through the data.
Table 3: Classification accuracy of DEFTS and DEFTS (fixed weight 0.5), which mixes image and text embeddings in DEFTS’s centered 95% subspace evenly. Results are average over 10 random seeds.
| Method | 1 shot | 2 shots | 4 shots | 8 shots | 16 shots |
|---|---|---|---|---|---|
| DEFTS (fixed weight 0.5) | 77.16 | 78.82 | 79.56 | 80.02 | 80.32 |
| DEFTS | 77.12 | 79.50 | 81.66 | 83.51 | 84.59 |
3.2.3 Pooled covariance estimation
As discussed in Section 2.3, DEFTS relies on a pooled sample covariance matrix (Equation 4) to estimate the distribution of the image coordinates. To justify this design choice, we conduct an ablation study comparing our pooled covariance strategy against independent per-class covariance estimation. The results are shown in Figure 6. Note that in the one-shot setting (), computing a per-class covariance is mathematically intractable. When , pooling the variance across all classes yields superior performance. When the support set size increases to , the performances of per-class covariance estimation gets close to the pooled approach.
3.2.4 Comparison with closest baseline
In previous ablation studies, we isolate each component of DEFTS and investigates their contributions for DEFTS. In this section, we compare DEFTS directly with TAMP, serving as the closest baseline to DEFTS. TAMP projects image embeddings into uncentered text embedding spaces and estimates the final representations via a weighted average of the mean image embeddings and text embeddings. This averaging weight is then tuned via leave-one-out cross-validation in this paper, as described in Appendix G. The detailed theoretical comparison between DEFTS and TAMP can be seen in Appendix D. As shown in Table 4, the differences between DEFTS and TAMP matters practically as well: DEFTS significantly outperforms TAMP across all evaluated -shot settings.
Table 4: Comparison of average classification accuracy (%) between TAMP and DEFTS across different numbers of shots . The values in parentheses denote the confidence interval. Positive differences (DEFTS TAMP) are highlighted in green.
| Method | |||||
|---|---|---|---|---|---|
| TAMP alone | 74.47 (2.65) | 76.52 (2.72) | 78.81 (2.44) | 79.96 (2.33) | 80.89 (2.21) |
| DEFTS alone | 77.12 (2.49) | 79.50 (2.34) | 81.66 (2.16) | 83.51 (1.95) | 84.59 (1.83) |
| DEFTS TAMP | +2.66 (0.35) | +2.97 (0.56) | +2.85 (0.51) | +3.55 (0.61) | +3.70 (0.61) |
4 Conclusion and Limitations
While existing training-free methods effectively enhance the performance of zero-shot CLIP, they often underutilize the semantic meaning from text embeddings. Motivated by this, we introduce DEFTS: a data-efficient, training-free few-shot learning method strictly in the text subspace, and show that DEFTS complements current image-centric methods. We first demonstrate empirically that the text embedding space is highly discriminative and data-efficient. DEFTS therefore performs Nearest Class Mean (NCM) estimation directly within this subspace. By expressing image embeddings as linear combinations of text embeddings, DEFTS reduces a high-dimensional estimation problem down to just a few coefficients. These coefficients are computed as a Bayesian posterior mean, utilizing a prior naturally centered on the text embedding coordinates. Extensive experiments demonstrate the effectiveness of DEFTS: by ensembling with other methods, DEFTS can often improve their accuracy over different datasets.
Limitations
While DEFTS often significantly complements existing baselines, these gains vary by dataset and are sometimes marginal or negative (19 out of 480). Additionally, the relative performance boost provided by DEFTS decreases as the number of shots increases. This is likely because the baseline methods themselves become substantially stronger with larger support sets. However, even in these higher-shot scenarios, DEFTS demonstrates that it can significantly complement strong baselines such as LDA.
References
[1] C. M. Bishop and N. M. Nasrabadi (2006) Pattern recognition and machine learning. Vol. 4, Springer. Cited by: §2.3.
[2] L. Bossard, M. Guillaumin, and L. Van Gool (2014) Food-101–mining discriminative components with random forests. In European conference on computer vision, pp. 446–461. Cited by: §3.1.
[3] M. Cimpoi, S. Maji, I. Kokkinos, S. Mohamed, and A. Vedaldi (2014) Describing textures in the wild. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3606–3613. Cited by: §3.1.
[4] J. Deng, W. Dong, R. Socher, L. Li, K. Li, and L. Fei-Fei (2009) Imagenet: a large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Cited by: §3.1.
[5] B. Efron and C. Morris (1975) Data analysis using stein’s estimator and its generalizations. Journal of the American Statistical Association 70 (350), pp. 311–319. Cited by: Appendix A, §2.3.
[6] A. Esteva, K. Chou, S. Yeung, N. Naik, A. Madani, A. Mottaghi, Y. Liu, E. Topol, J. Dean, and R. Socher (2021) Deep learning-enabled medical computer vision. NPJ digital medicine 4 (1), pp. 5. Cited by: Appendix A.
[7] K. Ethayarajh (2019) How contextual are contextualized word representations? comparing the geometry of bert, elmo, and gpt-2 embeddings. In Proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (EMNLP-IJCNLP), pp. 55–65. Cited by: Appendix A.
[8] L. Fei-Fei, R. Fergus, and P. Perona (2004) Learning generative visual models from few training examples: an incremental bayesian approach tested on 101 object categories. In 2004 conference on computer vision and pattern recognition workshop, pp. 178–178. Cited by: §3.1.
[9] C. Finn, T. Yu, T. Zhang, P. Abbeel, and S. Levine (2017) One-shot visual imitation learning via meta-learning. In Conference on robot learning, pp. 357–368. Cited by: Appendix A.
[10] D. Goswami, S. Magistri, G. M. van de Ven, B. Twardowski, A. D. Bagdanov, T. Tuytelaars, and J. van de Weijer (2026) Cross-modal prototype alignment and mixing for training-free few-shot classification. arXiv preprint arXiv:2603.24528. Cited by: Appendix D, §1, §1, §2.2, §2.3, §3.1.
[11] Z. Guo, R. Zhang, L. Qiu, X. Ma, X. Miao, X. He, and B. Cui (2023) Calip: zero-shot enhancement of clip with parameter-free attention. In Proceedings of the AAAI conference on artificial intelligence, Vol. 37, pp. 746–754. Cited by: §1, §1.
[12] P. Helber, B. Bischke, A. Dengel, and D. Borth (2019) Eurosat: a novel dataset and deep learning benchmark for land use and land cover classification. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing 12 (7), pp. 2217–2226. Cited by: §3.1.
[13] W. James C. Stein et al. (1961) Estimation with quadratic loss. In Proceedings of the fourth Berkeley symposium on mathematical statistics and probability, Vol. 1, pp. 361–379. Cited by: Appendix A, §2.3.
[14] J. Krause, M. Stark, J. Deng, and L. Fei-Fei (2013) 3d object representations for fine-grained categorization. In Proceedings of the IEEE international conference on computer vision workshops, pp. 554–561. Cited by: §3.1.
[15] A. Krizhevsky G. Hinton et al. (2009) Learning multiple layers of features from tiny images. Cited by: §3.1.
[16] O. Ledoit and M. Wolf (2004) A well-conditioned estimator for large-dimensional covariance matrices. Journal of multivariate analysis 88 (2), pp. 365–411. Cited by: §B.2.
[17] C. Li, E. Zhang, C. Geng, and S. Chen (2025) Recent advances in out-of-distribution detection with clip-like models: a survey. arXiv preprint arXiv:2505.02448. Cited by: §2.2.
[18] V. W. Liang, Y. Zhang, Y. Kwon, S. Yeung, and J. Y. Zou (2022) Mind the gap: understanding the modality gap in multi-modal contrastive representation learning. Advances in neural information processing systems 35, pp. 17612–17625. Cited by: Appendix A, §B.1, §2.2.
[19] Z. Liu, Z. Miao, X. Zhan, J. Wang, B. Gong, and S. X. Yu (2019) Large-scale long-tailed recognition in an open world. In 2019 IEEE/CVF conference on computer vision and pattern recognition (CVPR), pp. 2532–2541. Cited by: Appendix A.
[20] S. Maji, E. Rahtu, J. Kannala, M. Blaschko, and A. Vedaldi (2013) Fine-grained visual classification of aircraft. arXiv preprint arXiv:1306.5151. Cited by: §3.1.
[21] J. Mu, S. Bhat, and P. Viswanath (2017) All-but-the-top: simple and effective postprocessing for word representations. arXiv preprint arXiv:1702.01417. Cited by: Appendix A.
[22] K. P. Murphy (2012) Machine learning: a probabilistic perspective. MIT press. Cited by: §B.2, §B.2.
[23] M. Nilsback and A. Zisserman (2008) Automated flower classification over a large number of classes. In 2008 Sixth Indian conference on computer vision, graphics & image processing, pp. 722–729. Cited by: §3.1.
[24] Y. Ouali, A. Bulat, B. Matinez, and G. Tzimiropoulos (2023) Black box few-shot adaptation for vision-language models. In 2023 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 15488–15500. Cited by: Appendix A.
[25] O. M. Parkhi, A. Vedaldi, A. Zisserman, and C. Jawahar (2012) Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition, pp. 3498–3505. Cited by: §3.1.
[26] V. Parupudi (2026) Anisotropy decides cosine vs. rank metrics for text embeddings. arXiv preprint arXiv:2606.29571. Cited by: Appendix A.
[27] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark, et al. (2021) Learning transferable visual models from natural language supervision. In International conference on machine learning, pp. 8748–8763. Cited by: §1, §2.2, §3.1, §3.1, §3.1.
[28] M. Shridhar, L. Manuelli, and D. Fox (2022) Cliport: what and where pathways for robotic manipulation. In Conference on robot learning, pp. 894–906. Cited by: Appendix A.
[29] H. Steck, C. Ekanadham, and N. Kallus (2024) Is cosine-similarity of embeddings really about similarity?. In Companion Proceedings of the ACM Web Conference 2024, pp. 887–890. Cited by: Appendix A.
[30] V. Udandarao, A. Gupta, and S. Albanie (2023) Sus-x: training-free name-only transfer of vision-language models. In 2023 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 2725–2736. Cited by: §1, §1, §3.1.
[31] G. Van Horn, O. Mac Aodha, Y. Song, Y. Cui, C. Sun, A. Shepard, H. Adam, P. Perona, and S. Belongie (2018) The inaturalist species classification and detection dataset. In 2018 IEEE/CVF conference on computer vision and pattern recognition, pp. 8769–8778. Cited by: Appendix A.
[32] Y. Wang, W. Chao, K. Q. Weinberger, and L. Van Der Maaten (2019) Simpleshot: revisiting nearest-neighbor classification for few-shot learning. arXiv preprint arXiv:1911.04623. Cited by: §1, §1, §2.2, §3.1.
[33] Z. Wang, J. Liang, L. Sheng, R. He, Z. Wang, and T. Tan (2024) A hard-to-beat baseline for training-free clip-based adaptation. In International Conference on Learning Representations, Vol. 2024, pp. 28841–28859. Cited by: §G.1, §G.2, §1, §1, §1, §2.2, §2.3, §3.1, §3.1.
[34] J. Xiao, J. Hays, K. A. Ehinger, A. Oliva, and A. Torralba (2010) Sun database: large-scale scene recognition from abbey to zoo. In 2010 IEEE computer society conference on computer vision and pattern recognition, pp. 3485–3492. Cited by: §3.1.
[35] K. You (2025) Semantics at an angle: when cosine similarity works until it doesn’t. arXiv preprint arXiv:2504.16318. Cited by: Appendix A.
[36] M. Zanella and I. Ben Ayed (2024) Low-rank few-shot adaptation of vision-language models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 1593–1603. Cited by: §1.
[37] R. Zhang, W. Zhang, R. Fang, P. Gao, K. Li, J. Dai, Y. Qiao, and H. Li (2022) Tip-adapter: training-free adaption of clip for few-shot classification. In European conference on computer vision, pp. 493–510. Cited by: §1, §1, §1, §3.1.
[38] Y. Zhang, Y. Mao, H. Chen, J. Gao, Z. Huang, and Y. Lin (2026) Multi-bias logit fusion in a pseudo-text space for clip few-shot learning. Knowledge-Based Systems, pp. 116834. Cited by: §1.
[39] S. Zhao, X. Wang, L. Zhu, and Y. Yang (2024) Test-time adaptation with clip reward for zero-shot generalization in vision-language models. In International Conference on Learning Representations, Vol. 2024, pp. 3597–3613. Cited by: Appendix A, §1.
[40] K. Zhou, J. Yang, C. C. Loy, and Z. Liu (2022) Learning to prompt for vision-language models. International journal of computer vision 130 (9), pp. 2337–2348. Cited by: Appendix A, §E.2, §F.1, §1, §2.2, §2.2, §2.2, §3.1, §3.1.
[41] X. Zhu, R. Zhang, B. He, A. Zhou, D. Wang, B. Zhao, and P. Gao (2023) Not all features matter: enhancing few-shot clip with adaptive prior refinement. In 2023 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 2605–2615. Cited by: §3.1.
[42] X. Zhu, B. Zhu, Y. Tan, S. Wang, Y. Hao, and H. Zhang (2024) Selective vision-language subspace projection for few-shot clip. In Proceedings of the 32nd ACM International Conference on Multimedia, pp. 3848–3857. Cited by: §1.
Appendix A More Related Work
Gradient-based few-shot adaptation of CLIP.
Several methods adapt CLIP with gradient-based optimization. For example, CoOp [40] learns continuous prompt vectors by gradient descent on the labeled few-shot images. Zhao et al. [39] adapt CLIP at test time with a reward computed from the CLIP score of unlabeled test samples, where they use no labeled support images and update the model at test time. LFA [24] learns a linear map from image features to the text embeddings, initialized by a regularized Procrustes solution and refined by gradient-based training.
Study of the Shared Embedding Space.
Standard zero-shot CLIP classification relies on cosine similarity, assuming implicitly that image and text embeddings occupy a unified semantic space. However, Liang et al. [18] demonstrate a measurable modality gap by showing that image and text embeddings occupy distinctly separated regions on the embedding sphere. This phenomenon mirrors the anisotropy documented in contextual language models [7, 21], where representations concentrate their variance into narrow cones. Recent surveys [35] and empirical studies [26, 29] reveal that this geometric distortion causes the performances decrease of cosine similarity.
Bayesian Estimation with Small Sample Size.
Estimating a highly parameterized class mean from only a handful of samples is notoriously unstable. Classical statistical theory dictates that the naive per-group sample mean is suboptimal in this regime; instead, shrinking every group’s sample mean toward a common point achieves uniformly lower total squared error [13]. Efron and Morris [5] operationalized this shrinkage via empirical Bayes, where the strength of the shrinkage is estimated directly from the data’s variance rather than heuristically tuned.
Few-shot Learning.
Few shot learning is highly desirable in practice where the available training sample size is often limited. First, real-world data frequently exhibits long-tailed distributions, where a small number of common classes dominate the dataset while the vast majority of categories has only a few training samples. For example, in the diagnosis of rare medical conditions, the detection of novel manufacturing defects, or the classification of endangered species, a class may only be represented by only one or two examples [19, 31]. Second, even when abundant data exists in principle, the cost of expert annotation imposes a practical challenge on the volume of data that can be labeled for deployment [6]. Third, rapid on-the-fly personalization, such as teaching a robotic assistant to recognize a user’s personal belongings from a single demonstration, demands models that generalize instantly from extreme few-shot interactions [9]. This capacity for immediate vision-language grounding is becoming increasingly central to the deployment of real-world robotic manipulation systems [28].
Appendix B Hyperparameter estimation
B.1 Derivation for the variance of the prior
To estimate the hyperparameters without relying on held-out validation data, we employ the Empirical Bayes method. Let denote the sample mean of the projected images for class , and let be its deviation from the text prior. For , we first isolate the observation noise by computing the pooled within-class sample variance across all classes:
In order to estimate , we note that the true prior covariance is defined by the unobservable true class mean vector :
Because we can only measure this distance using the empirical sample mean , we must account for sampling noise. Assume that one sample equals the true mean plus a random sampling error vector . Then we have
Since the true semantic shift and the sampling error are independent, their covariance matrices add linearly:
Assuming that is an unbiased estimation of , then taking the expected squared norm equals the trace of the covariance matrix. Dividing the expected squared norm by the dimensionality , we obtain the per-dimension scalar relationship:
Rearranging this equation isolates the true prior variance:
Using the observed average squared spread
to approximate , we derive an estimator of by subtracting the expected sampling noise:
where the overline denotes the average across all classes.
Remark for the prior assumption.
The derivation above assumes that the text embedding serves as an unbiased prior for the true image class mean (i.e., ). While recent literature has identified a systematic “modality gap” between image and text embeddings in contrastive models [18], explicitly modeling this shift requires estimating a high-dimensional bias vector. In few-shot regimes (e.g., ), such estimation could be prone to overfitting. We therefore deliberately enforce this zero-bias assumption as a regularization constraint.
B.2 Derivation for the shrunk covariance estimation
In this section, we show the derivation of the Bayesian shrinkage estimator for the covariance matrix.
Let denote the pooled empirical sample covariance computed from classes and support shots. The total degrees of freedom for this empirical estimate is
We define the empirical scatter matrix as the unnormalized sum of squared errors: . Under the assumption that the image embeddings are drawn from a Multivariate Normal distribution , this scatter matrix follows a Wishart distribution, [22]. The data likelihood for the covariance matrix is therefore proportional to:
To regularize in the few-shot cases, we place an Inverse-Wishart prior on the true covariance matrix :
where is the scale matrix and represents the prior degrees of freedom. Following an Empirical Bayes approach to covariance shrinkage [16], we set the prior scale matrix to be an isotropic target matrix that preserves the total variance of the observed data
As shown by Murphy [22], the posterior distribution is also an Inverse-Wishart distribution such that
Following the posterior distribution, the maximum a posteriori (MAP) estimation of is:
Substituting our definitions of and yields:
Setting , we further have
Dividing this combined scatter matrix by the total effective degrees of freedom yields the standard Bayes-shrunk covariance. However, in few shot learning regimes, especially when the number of shots is extremely small, e.g. , the covariance could be highly unstable as shown in Appendix F.5. We therefore introduce a covariance inflation parameter , explicitly inflating the estimated variance by a factor of :
Substituting and taking the matrix inverse yields our final regularized precision matrix:
B.3 The one-shot estimator and the role of the Bayesian update
At the within-class variance cannot be estimated, and DEFTS uses , and , where is the observed spread and is the noise fraction. We now derive the estimator of DEFTS at .
According to Equation 5, we have
where . Then, let , we have
where . Substituting and ,
where cancels. For and , .
Appendix C DEFTS algorithm
In this section, we provide the algorithm for DEFTS in Algorithm 1, which summarizes our discussions about DEFTS in Section 2.3
Algorithm 1 DEFTS Prototype Generation and Inference
1: text embeddings , support image embeddings per class
2: Estimated image prototypes for classification
3: Compute the centralized scatter matrix from the text embeddings .
4: Eigendecompose to obtain the PCA basis , choosing to retain 95% of the variance.
5: for each class do
6: Project text embedding:
7: Project support images:
8: end for
9: Estimate the prior variance and the pooled likelihood precision directly from the projected -shot support set via Empirical Bayes as shown in (2) and (3).
10: for each class do
11: Compute the posterior mean in the subspace following Equation (5).
12: Reconstruct the high-dimensional prototype: .
13: end for
14: During inference, for a query image , compute the logit for class as:
Appendix D Structural Comparison Between DEFTS and TAMP
Although both DEFTS and TAMP [10] exploit the text embedding space, they employ fundamentally different estimation mechanisms. TAMP uses the text space primarily as a geometric projection space and combines the projected visual prototype with the text prototype via a scalar interpolation coefficient. In contrast, DEFTS treats the text-derived subspace as a statistical estimation space, performing uncertainty-aware, direction-dependent Bayesian shrinkage. We formalize this distinction below.
Let denote the empirical mean of the -shot support image embeddings for class in the ambient space, and let denote the corresponding text embedding. TAMP constructs an orthonormal basis from the uncentered text embeddings and defines the corresponding projection matrix as
Since lies in the span of , we have . TAMP then forms its class prototype by interpolating between the projected image prototype and the text prototype:
Thus, within the text subspace, TAMP applies the same scalar weight to every direction. The relative contribution of the visual estimate and the text prototype is therefore controlled by a single global coefficient .
DEFTS, instead, constructs a centered PCA basis from the text embeddings and performs Bayesian estimation in the resulting subspace. Define
Following Eq. (5), the posterior mean in the PCA coordinates is
and the corresponding prototype in the original embedding space is
For notational convenience, let
Then
These expressions reveal three important structural differences.
Scalar interpolation versus uncertainty-aware anisotropic fusion.
TAMP uses a scalar coefficient and the identity matrix , effectively treating all directions within the text subspace identically. DEFTS, instead, weights the visual observation and text prior through the dense matrices and , which depend on the estimated covariance and prior precision . Consequently, the relative contribution of the image evidence and the text prior varies across directions based on their estimated uncertainty. Directions with lower visual variance receive relatively greater weight from the empirical image evidence, whereas high-variance directions are shrunk more strongly toward the text prior. DEFTS therefore performs uncertainty-aware, direction-dependent prototype estimation rather than a globally weighted interpolation.
This distinction also provides a useful interpretation of scalar interpolation. If the uncertainty structure were isotropic, i.e.,
the corresponding Bayesian fusion would reduce exactly to a scalar weighting of the visual estimate and the prior. Thus, scalar interpolation can be viewed as the isotropic special case of the precision-weighted fusion employed by DEFTS. DEFTS extends this formulation by allowing the estimated uncertainty to dynamically differ across directions.
Scalar hyperparameter selection versus Empirical Bayes estimation.
TAMP determines the relative contribution of the projected image prototype and text prototype through the scalar coefficient , which must be externally tuned via validation. DEFTS estimates the visual uncertainty structure directly from the available training data using the Empirical Bayes procedure. The resulting precision matrix dictates how strongly the image evidence and text prior are combined along each axis, thus avoiding the need for searching hyperparameter for each dataset.
Uncentered text span versus centered PCA subspace.
The two methods also differ in their chosen representation space. TAMP constructs directly from the uncentered text embeddings, operating within their uncentered linear span. DEFTS first centers the text embeddings before constructing a PCA basis that retains a fixed fraction of their variance. Empirically, our ablation in Appendix F.3 suggests that the centered construction yields more effective classification, which is why it forms the foundation of DEFTS.
Overall, while TAMP and DEFTS share the intuition that text embeddings provide a highly structural low-dimensional space for few-shot visual classification, they exploit it differently. TAMP applies a uniform scalar interpolation after projecting the visual prototype into the text space, whereas DEFTS formulates prototype estimation as uncertainty-aware Bayesian shrinkage within a centered PCA subspace. This capability to weight visual evidence and text priors differently across dimensions is critical in few-shot cases, where visual prototype estimates remain highly uncertain. We summarize the differences between TAMP and DEFTS in Table 5.
Table 5: Key structural and methodological differences between the TAMP baseline and the proposed DEFTS framework.
| Component | TAMP | DEFTS |
|---|---|---|
| Image representation | Projected image mean | Projected image mean |
| Text representation | Text prototype | Text prototype as prior mean |
| Subspace | Uncentered text span | Centered varaince reduced PCA subspace |
| Fusion | Scalar interpolation | Precision-weighted fusion |
| Image weighting | Global | Direction-dependent |
| Uncertainty | Not modeled explicitly | Estimated covariance |
| Estimation | Validation-selected | Empirical Bayes |
| Output | Interpolated prototype | Posterior-mean prototype |
Appendix E More Experiments details
In this section, we provide more details for the experiments in Section 2.2 and 3.
E.1 Datasets Details
In Table 6, we provide more details about the 12 datasets considered in this paper, including the total number of images, the number of classes, and the minimum and maximum images per class.
Table 6: Summary of the 12 evaluation datasets, detailing the total number of images, the number of classes, and the minimum and maximum images per class.
| Dataset | Total Images | # Classes | Min/Class | Max/Class |
|---|---|---|---|---|
| CIFAR10 | 10,000 | 10 | 1,000 | 1,000 |
| CIFAR100 | 10,000 | 100 | 100 | 100 |
| EuroSAT | 27,000 | 10 | 2,000 | 3,000 |
| Food101 | 25,250 | 101 | 250 | 250 |
| OxfordIIITPet | 3,669 | 37 | 88 | 100 |
| FGVCAircraft | 3,333 | 100 | 33 | 34 |
| Flowers102 | 8,189 | 102 | 40 | 258 |
| DTD | 1,880 | 47 | 40 | 40 |
| ImageNet | 50,000 | 1,000 | 50 | 50 |
| Caltech101 | 8,242 | 100 | 31 | 800 |
| StanfordCars | 8,041 | 196 | 24 | 68 |
| SUN397 | 19,850 | 397 | 50 | 50 |
E.2 Prompt Templates
In Section 3, we evaluate the performance of DEFTS using the standard prompt templates introduced by CoOp [40]. This section details the exact text prompt applied to each corresponding dataset.
Table 7: Text prompt templates utilized for each of the 12 evaluation datasets. The placeholder {c} denotes the specific class name.
| Dataset | Prompt Template |
|---|---|
| CIFAR10 | a photo of a {c}. |
| CIFAR100 | a photo of a {c}. |
| EuroSAT | a centered satellite photo of {c}. |
| Food101 | a photo of {c}, a type of food. |
| OxfordIIITPet | a photo of a {c}, a type of pet. |
| FGVCAircraft | a photo of a {c}, a type of aircraft. |
| Flowers102 | a photo of a {c}, a type of flower. |
| DTD | {c} texture. |
| ImageNet | a photo of a {c}. |
| Caltech101 | a photo of a {c}. |
| StanfordCars | a photo of a {c}. |
| SUN397 | a photo of a {c}. |
E.3 Subspace ranks
DEFTS proposes to retain 95% of the variance of the centered PCA for each dataset. Table 8 reports the number of classes and the resulting subspace dimension used by DEFTS across all datasets and the three different vision backbones.
Table 8: Rank of the centered basis keeping 95% of the text-embedding variance, for three different model backbones: ViT-L/14, ViT-B/32 and ViT-H/14.
| Dataset | (ViT-L/14) | (ViT-B/32) | (ViT-H/14) | |
|---|---|---|---|---|
| CIFAR10 | 10 | 9 | 8 | 9 |
| CIFAR100 | 100 | 75 | 73 | 74 |
| Caltech101 | 100 | 75 | 73 | 74 |
| DTD | 47 | 37 | 35 | 38 |
| EuroSAT | 10 | 8 | 8 | 8 |
| FGVCAircraft | 100 | 46 | 42 | 46 |
| Flowers102 | 102 | 72 | 68 | 68 |
| Food101 | 101 | 73 | 71 | 73 |
| Imagenet | 1000 | 289 | 241 | 289 |
| OxfordIIITPet | 37 | 27 | 25 | 26 |
| SUN397 | 397 | 182 | 166 | 184 |
| StanfordCars | 196 | 79 | 74 | 82 |
E.4 Experiments Details for Observations
In Section 2.2, we present 3 observations for investigating the text embedding subspace. In this section, we provide details for the experiments supporting our observations.
Experiments for Observation 1.
For Observation 1, we train an NCM classifier for each dataset. We first randomly sample 80% of the images from each class as training data. Then, we project all image features into the text subspace, as detailed in Section 2.3 but without centering first. The mean of the image embeddings within this subspace are estimated by taking average and used for performing nearest class mean classification. The classification accuracy is evaluated on the remaining 20% of the images, essentially serving as the validation set. This procedure is repeated over 10 independent runs with varying random seeds, and the final reported accuracy is the average across all runs.
Experiments for Observation 2.
The experimental setup for Observation 2 is similar to that for Observation 1. However, in this experiment, we randomly sample images from each class to serve as the training data, while using all remaining images as the validation set.
Experiments for Observation 3.
Similarly, the experiment for Observation 3 builds upon the one for Observation 1. The difference is that we now first reduce the dimensionality of the subspace, as described in Section 2.3.
Appendix F Additional Experiments Results
This section includes additional experiments results.
F.1 Text Subspace with Different Template
This additional experiment provides evidence that the observations discussed in Section 2.2 are robust to the choice of prompt template. To this end, we perform the same experiments for the discriminative power of text embedding space in Figure 1 with different prompt templates.
Figure 7 evaluates three different prompt templates: (1) the class name alone; (2) a standard fixed template “a photo of a {class}”; and (3) the hand-crafted templates utilized in CoOp [40], as detailed in Appendix E.2. As expected, improving the template quality steadily increases CLIP’s baseline zero-shot accuracy. However, the results provide evidence suggesting that the template quality has a more negligible impact on the discriminative power of the text embedding space itself.
Figure 7: CLIP’s zero-shot accuracy and Nearest Class Mean (NCM) accuracy across three different prompt templates. To compute the NCM, all image embeddings are first projected into the text-embedding subspace to estimate the mean embedding for each class. A test image is then classified by assigning it to the class with the closest estimated mean.
F.2 Subspace advantage, and the number of classes
Observation 2 shows that the prototype estimation in the text subspace is usually more data-efficient than in the full space. In this section, we investigate if this advantage correlates with the ratio. Table 9 considers the relative gains across different datasets and number of shots and calculates the corresponding Spearman’s rank correlation. The results show no statistically significant relationship between the advantage and the ratio at the 5% level.
Table 9: Advantage of the text span over the full space (text span NCM minus full-space NCM) for each dataset and number of shots , with datasets ordered by . The last two rows give Spearman’s between the advantage and over the 12 datasets and its -value. The results are obtained using model backbone ViT-L/14 and are averaged over 10 random seeds.
| Dataset | |||||||
|---|---|---|---|---|---|---|---|
| CIFAR10 | 10 | 0.013 | 30.4 | 14.9 | 5.2 | 2.6 | 0.8 |
| EuroSAT | 10 | 0.013 | 5.0 | 0.2 | 4.4 | 6.6 | 6.5 |
| Pets | 37 | 0.048 | 36.3 | 22.3 | 12.9 | 6.6 | 4.0 |
| DTD | 47 | 0.061 | 12.1 | 9.4 | 7.6 | 5.9 | 4.9 |
| CIFAR100 | 100 | 0.130 | 23.2 | 20.5 | 13.9 | 8.9 | 6.3 |
| Caltech101 | 100 | 0.130 | 11.6 | 4.1 | 1.8 | 1.1 | 1.0 |
| Aircraft | 100 | 0.130 | 8.0 | 6.8 | 6.0 | 4.8 | 3.6 |
| Food101 | 101 | 0.132 | 16.8 | 10.9 | 5.4 | 3.1 | 2.2 |
| Flowers102 | 102 | 0.133 | 5.6 | 1.7 | 0.4 | 0.1 | 0.1 |
| Cars | 196 | 0.255 | 17.7 | 14.2 | 10.4 | 7.7 | 6.3 |
| SUN397 | 397 | 0.517 | 6.3 | 4.6 | 3.0 | 2.0 | 1.5 |
| ImageNet | 1000 | 1.302 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| Spearman with | 0.43 | 0.29 | 0.15 | 0.10 | 0.00 | ||
| -value | 0.17 | 0.37 | 0.64 | 0.75 | 0.99 |
F.3 Centered PCA Projection
In Section 2.3, DEFTS proposes to project image embeddings into a centered PCA subspace, rather than the original, uncentered subspace. To justify this design choice, we perform an ablation study comparing centered versus uncentered PCA projections while retaining either 95% or 99.9% of the total variance. Table 10 suggests that for 95% variance kept, the centered PCA wins uncentered one by larger margin, around 2-3%, when 99.9% variance are kept, centered one is often slightly better than uncentered one.
Table 10: DEFTS’s average accuracy (%) across all 12 datasets for centered and uncentered PCA variants across 95% and 99.9% explained variance thresholds for varying support set sizes (). The best performance for each is highlighted in bold red. Results are averaged over 10 random seeds and reported as percentages.
| 95% Variance | 99.9% Variance | |||
|---|---|---|---|---|
| Centered | Uncentered | Centered | Uncentered | |
| 1 | 76.97 | 73.54 | 76.63 | 76.73 |
| 2 | 79.60 | 76.65 | 79.72 | 79.56 |
| 4 | 81.77 | 79.25 | 81.68 | 81.64 |
| 8 | 83.59 | 81.37 | 83.48 | 83.27 |
| 16 | 84.68 | 82.51 | 84.70 | 84.41 |
F.4 Empirical contribution of total average deviation
In this experiment, we investigate the contribution of the sample variance to the averaged deviation . Table 11 shows the results of the ratio of the sample variance to the averaged empirical deviation across 12 datasets for different number of shots . It suggests that this ratio is empirically ranges from to , varying across different datasets, but more stable with different number of shots .
Table 11: Ratio of the sample variance to the averaged empirical deviation across 12 datasets for different number of shots . Results are averaged over 10 random seeds and reported as percentages.
| Dataset | Number of shots () | ||||
|---|---|---|---|---|---|
| Average | |||||
| CIFAR10 | 5.09 | 4.94 | 3.81 | 5.21 | 4.76 |
| CIFAR100 | 5.97 | 6.00 | 6.12 | 6.14 | 6.06 |
| Caltech101 | 6.81 | 6.61 | 6.43 | 6.52 | 6.59 |
| DTD | 11.16 | 11.47 | 11.04 | 10.95 | 11.16 |
| EuroSAT | 2.03 | 2.82 | 3.23 | 3.22 | 2.83 |
| FGVCAircraft | 7.46 | 7.83 | 7.69 | 7.72 | 7.67 |
| Flowers102 | 5.31 | 5.70 | 5.38 | 5.37 | 5.44 |
| Food101 | 11.42 | 11.69 | 12.04 | 12.15 | 11.82 |
| ImageNet | 16.27 | 16.00 | 16.07 | 16.11 | 16.11 |
| OxfordPet | 3.24 | 3.20 | 3.42 | 3.24 | 3.27 |
| SUN397 | 14.52 | 14.87 | 14.61 | 14.71 | 14.68 |
| StanfordCars | 8.91 | 9.20 | 8.99 | 8.98 | 9.02 |
| Average | 8.18 | 8.36 | 8.24 | 8.36 | 8.28 |
Thus, when , where and are unidentifiable, we set set , with .
In Figure 8, we show the one-shot accuracy for noise fractions from to in steps of . The results suggest that the accuracy is robust against different choices of the fraction in the range .
Figure 8: Average one-shot accuracy (%) over 12 datasets against the noise fraction for with and 95% PCA variance threshold. The results are obtained using model backbone ViT-L/14 and are averaged over 10 random seeds. The dashed line shows the accuracy of zero-shot CLIP.
F.5 Covariance Estimation for Different Number of Shots
In Section 2.3, we introduce a covariance inflation parameter to account for the fact that the covariance estimation is often problematic especially when the number of shots is small. In this section, we presents experiments results in Figure 9 demonstrating that when the number of shots is small, the estimation of the covariance could be highly unstable.
Figure 9: Trace of the empirical sample covariance matrix across 12 datasets for different number of shots . Blue dots represent individual estimates across 100 random seeds, while the red dashed line represents the true population trace estimated using all samples.
F.6 Impact of the covariance inflation parameter for DEFTS
In this additional experiments, we investigate the impact of the covariance inflation parameter on the accuracy of DEFTS. In Figure 10, we present DEFTS’ average accuracy with different across 12 datasets. The results suggest that when the number of shots is small, it is preferable to choose small for DEFTS. However, when the number of shots is larger, the choice of is less critical.
Figure 10: DEFTS’ average accuracy with different covariance inflation parameter across 12 datasets.
F.7 PCA of the text embedding space
In Observation 3, we provide evidence showing that the discriminative power of the text embedding space will decrease if we reduce the dimension of the space using PCA. Note that the discriminative power in Observation 3 is evaluated using NCM with image embeddings estimated using all available training samples. In this additional experiment, we use only a few shots of training samples and evaluate the nearest class mean (NCM) accuracy after removing different amounts of variance from the text embedding space. The results in Table 12 suggests that for a given number of shots , reducing the variance of the text embedding space by 5% yields the highest NCM accuracy within the text subspace.
Table 12: Nearest class mean (NCM) accuracy after reducing different amount of variance of the text embedding space. Bold marks the best representation at each .
| raw (no projection) | 50.86 | 64.99 | 74.14 | 79.17 | 81.82 |
| text span (full) | 65.26 | 74.13 | 79.36 | 82.21 | 83.82 |
| PCA 95% variance | 67.87 | 75.95 | 80.40 | 82.85 | 84.23 |
| PCA 90% variance | 67.71 | 75.74 | 80.17 | 82.60 | 83.93 |
| PCA 85% variance | 67.03 | 75.20 | 79.62 | 82.09 | 83.48 |
| PCA 80% variance | 66.23 | 74.38 | 78.91 | 81.45 | 82.85 |
| PCA 75% variance | 64.86 | 72.92 | 77.55 | 80.10 | 81.54 |
| PCA 70% variance | 63.24 | 71.45 | 76.19 | 78.92 | 80.38 |
| PCA 65% variance | 61.81 | 70.16 | 75.18 | 77.94 | 79.46 |
| PCA 60% variance | 59.68 | 68.26 | 73.54 | 76.41 | 77.99 |
| PCA 55% variance | 56.85 | 65.34 | 70.70 | 73.65 | 75.24 |
| PCA 50% variance | 53.53 | 61.97 | 67.66 | 70.88 | 72.65 |
F.8 Sensitivity analysis for the hyper-parameter and the variance threshold
Following Appendices F.6 and F.7, DEFTS uses a fixed hyperparameter setting for all datasets ( and a 95% variance threshold) rather than tuning them individually. In this section, we evaluate the sensitivity of DEFTS to these hyperparameter choices by considering two experiments. First, we perform oracle tuning, where and the threshold are optimized directly on each dataset’s own test accuracy. Second, we use a leave-one-dataset-out approach: for any given dataset, we tune the hyperparameters on the other 11 datasets before applying them to the held-out one. As in Appendices F.6 and F.7, the hyperparameters are searched over 12 values for and thresholds in . Table 13 reports the average change in accuracy relative to the fixed setting, while Tables 14 and 15 provide detailed breakdowns for each dataset.
The results indicate that oracle tuning yields an average improvement of less than one accuracy point when . Furthermore, tuning on the other datasets alters the accuracy by at most points on average, demonstrating that the fixed setting transfers robustly. The 1-shot setting remains the most sensitive case, as also indicated by Figure 10.
Table 13: Average accuracy differences compared to the fixed setting with , 95% threshold.The results are obtained using model backbone ViT-L/14 and are averaged over 10 random seeds. First row: oracle tuning on its own dataset. Second row: leave-one-out tuning on the other 11 datasets.
| Change relative to the fixed setting (points, average over 12 datasets) | 1 shot | 2 shots | 4 shots | 8 shots | 16 shots |
|---|---|---|---|---|---|
| Tuned for each dataset alone (oracle) | 1.82 | 0.84 | 0.61 | 0.33 | 0.31 |
| Tuned on the other 11 datasets | 0.60 | 0.14 | 0.01 | 0.02 | 0.06 |
Table 14: Accuracy differences of the oracle tuning that picks and the variance threshold separately for each dataset over the fixed default (, 95%). The results are obtained using model backbone ViT-L/14 and are averaged over 10 random seeds.
| Dataset | |||||
|---|---|---|---|---|---|
| CIFAR10 | 0.00 | 0.14 | 0.05 | 0.03 | 0.04 |
| CIFAR100 | 1.60 | 1.65 | 0.86 | 0.64 | 0.53 |
| Caltech101 | 1.24 | 0.64 | 0.44 | 0.29 | 0.31 |
| DTD | 0.77 | 1.01 | 1.60 | 0.21 | 0.05 |
| EuroSAT | 3.45 | 1.60 | 1.17 | 1.22 | 1.10 |
| Aircraft | 1.25 | 1.34 | 1.57 | 0.55 | 0.76 |
| Flowers102 | 2.11 | 0.87 | 0.31 | 0.16 | 0.19 |
| Food101 | 1.39 | 0.63 | 0.52 | 0.34 | 0.25 |
| ImageNet | 5.33 | 1.13 | 0.14 | 0.12 | 0.19 |
| Pets | 0.97 | 0.60 | 0.44 | 0.17 | 0.26 |
| SUN397 | 2.78 | 0.28 | 0.00 | 0.00 | 0.00 |
| Cars | 0.92 | 0.16 | 0.19 | 0.28 | 0.03 |
| Average of the 12 datasets | 1.82 | 0.84 | 0.61 | 0.33 | 0.31 |
| Largest over datasets | 5.33 | 1.65 | 1.60 | 1.22 | 1.10 |
Table 15: Accuracy differences of the leave-one-out tuning that picks and the variance threshold on the other 11 datasets for each dataset over the fixed default (, 95%). The results are obtained using model backbone ViT-L/14 and are averaged over 10 random seeds.
| Dataset | |||||
|---|---|---|---|---|---|
| CIFAR10 | 0.05 | 0.09 | 0.03 | 0.03 | 0.02 |
| CIFAR100 | 1.59 | 0.22 | 0.55 | 0.55 | 0.49 |
| Caltech101 | 0.55 | 0.44 | 0.28 | 0.25 | 0.22 |
| DTD | 0.80 | 0.08 | 0.13 | 0.16 | 0.10 |
| EuroSAT | 1.19 | 0.79 | 0.77 | 1.09 | 1.10 |
| Aircraft | 0.91 | 0.43 | 0.44 | 0.27 | 0.05 |
| Flowers102 | 3.78 | 0.75 | 0.21 | 0.07 | 0.07 |
| Food101 | 0.75 | 0.45 | 0.25 | 0.13 | 0.03 |
| ImageNet | 2.92 | 1.77 | 0.86 | 0.91 | 0.89 |
| Pets | 0.59 | 0.18 | 0.44 | 0.10 | 0.23 |
| SUN397 | 0.66 | 0.66 | 0.21 | 0.46 | 0.36 |
| Cars | 0.36 | 0.97 | 0.26 | 0.11 | 0.03 |
| Average of the 12 datasets | 0.60 | 0.14 | 0.01 | 0.02 | 0.06 |
| Largest gain over datasets | 1.59 | 0.79 | 0.77 | 1.09 | 1.10 |
| Largest loss over datasets | 3.78 | 1.77 | 0.86 | 0.91 | 0.89 |
F.9 Detailed experiment results with different number of shots
In this section, we perform the same simulations for Table 16 with different number of shots . The results are presented in Table 1 to 19.
Table 16: Number of shots . Classification accuracy (%) and performance improvements across datasets. The values in parentheses denote the absolute performance change after ensembling with DEFTS and the confidence interval. Positive gains are highlighted in green, and negative changes in red.
Dataset ZS SimpleShot Linear Probe Tip-Adapter APE TIP-X TAMP+ZS LDA+ZS DEFTS C10 94.89 (+0.21 0.17) 60.57 (+30.13 2.99) 70.54 (+23.49 4.18) 95.01 (+0.12 0.14) 95.05 (+0.10 0.14) 95.03 (+0.11 0.13) 94.81 (+0.26 0.14) 94.90 (+0.21 0.15) 95.14 C100 77.27 (+1.27 0.18) 33.04 (+29.25 1.04) 38.88 (+26.85 1.05) 77.41 (+1.17 0.16) 77.85 (+0.79 0.11) 77.58 (+0.99 0.15) 77.67 (+0.60 0.12) 77.29 (+1.27 0.19) 77.28 Cal101 94.62 (+0.86 0.27) 79.69 (+11.04 1.14) 85.78 (+7.03 0.84) 94.88 (+0.62 0.24) 95.30 (+0.24 0.27) 94.99 (+0.51 0.23) 95.37 (-0.01 0.19) 94.65 (+0.83 0.27) 94.73 DTD 53.03 (+6.50 0.63) 34.44 (+16.09 0.92) 38.20 (+14.78 1.06) 53.45 (+6.17 0.52) 54.08 (+5.73 0.58) 53.99 (+5.60 0.58) 56.69 (+2.73 0.49) 53.04 (+6.48 0.62) 60.31 Euro 61.17 (+2.13 0.47) 60.79 (+11.39 1.77) 60.83 (+11.91 2.01) 62.40 (+1.35 0.43) 64.31 (+0.19 0.44) 63.03 (+0.94 0.43) 60.53 (+2.25 0.43) 61.31 (+2.06 0.48) 64.62 Air. 32.18 (+7.16 0.60) 25.63 (+9.27 0.68) 26.85 (+8.92 0.62) 33.28 (+6.17 0.60) 34.85 (+4.79 0.83) 33.71 (+5.80 0.63) 37.09 (+2.36 0.37) 32.18 (+7.16 0.59) 40.45 Flow. 78.40 (+9.38 0.36) 82.19 (+8.85 0.89) 84.71 (+7.20 0.55) 79.11 (+8.77 0.33) 81.01 (+7.26 0.37) 79.53 (+8.45 0.33) 84.87 (+3.50 0.27) 78.52 (+9.27 0.36) 91.19 Food 93.11 (+0.09 0.10) 59.40 (+23.15 0.47) 64.31 (+21.04 0.43) 93.12 (+0.05 0.10) 93.18 (-0.04 0.11) 93.14 (+0.02 0.10) 93.19 (-0.18 0.08) 93.11 (+0.07 0.10) 92.01 INet 74.35 (+1.54 0.13) 40.94 (+16.19 0.29) 44.25 (+14.78 0.16) 74.56 (+1.27 0.13) 75.11 (+0.62 0.13) 74.68 (+1.12 0.12) 74.43 (-0.70 0.09) 74.41 (+1.46 0.13) 70.92 Pet 92.82 (+0.58 0.30) 49.77 (+31.63 1.10) 57.06 (+29.04 1.25) 92.97 (+0.44 0.27) 93.14 (+0.28 0.31) 93.01 (+0.40 0.28) 92.97 (+0.28 0.26) 92.86 (+0.54 0.30) 92.85 SUN 67.35 (+3.64 0.28) 40.37 (+14.28 0.23) 44.74 (+12.95 0.28) 67.64 (+3.35 0.31) 68.23 (+2.68 0.30) 67.90 (+3.09 0.31) 69.67 (+0.13 0.16) 67.38 (+3.60 0.27) 67.86 Cars 76.61 (+3.05 0.43) 43.79 (+19.20 0.66) 47.07 (+19.19 0.40) 76.80 (+2.85 0.36) 77.37 (+2.26 0.39) 76.92 (+2.76 0.37) 77.29 (+1.02 0.30) 76.65 (+3.01 0.42) 78.10 AVG 74.65 (+3.03 0.46) 50.88 (+18.37 1.25) 55.27 (+16.43 1.15) 75.05 (+2.69 0.43) 75.79 (+2.07 0.38) 75.29 (+2.48 0.41) 76.21 (+1.02 0.21) 74.69 (+3.00 0.45) 77.12
Table 17: Number of shots . Classification accuracy (%) and performance improvements across datasets. The values in parentheses denote the absolute performance change after ensembling with DEFTS and the confidence interval. Positive gains are highlighted in green, and negative changes in red.
Dataset ZS SimpleShot Linear Probe Tip-Adapter APE TIP-X TAMP+ZS LDA+ZS DEFTS C10 94.89 (+0.66 0.12) 87.68 (+7.94 1.13) 89.68 (+5.85 0.63) 95.05 (+0.32 0.26) 94.22 (+0.36 0.61) 94.34 (+0.45 0.15) 94.82 (+0.64 0.24) 94.81 (+0.24 0.25) 95.56 C100 77.27 (+1.83 0.51) 63.50 (+15.21 0.49) 69.05 (+9.51 0.67) 77.96 (+0.77 0.49) 78.27 (+1.11 0.55) 69.32 (+0.96 0.92) 78.08 (+1.12 0.46) 79.66 (+0.55 0.76) 78.60 Cal101 94.62 (+1.64 0.52) 94.16 (+2.52 0.27) 94.78 (+1.67 0.25) 94.99 (+1.35 0.47) 95.00 (+1.33 0.47) 95.12 (+0.15 0.19) 95.42 (+0.80 0.51) 97.08 (+0.27 0.45) 96.55 DTD 53.03 (+12.93 1.02) 57.94 (+9.92 0.96) 60.61 (+7.38 0.96) 60.56 (+5.81 2.12) 64.12 (+2.50 1.53) 61.36 (+0.00 0.00) 60.88 (+4.91 1.07) 66.33 (+1.80 1.68) 66.86 Euro 61.17 (+9.87 0.67) 76.66 (+2.16 2.37) 78.53 (-0.57 3.00) 75.48 (-0.55 1.83) 77.20 (+0.29 2.53) 67.21 (+0.25 0.28) 60.57 (+10.41 1.11) 82.42 (-0.43 1.37) 71.49 Air. 32.18 (+14.15 1.34) 41.84 (+7.15 0.88) 40.61 (+8.51 1.78) 39.60 (+6.85 2.16) 40.57 (+3.95 1.65) 45.59 (+1.86 0.66) 43.20 (+1.74 1.12) 46.20 (+1.33 1.56) 49.00 Flow. 78.40 (+18.80 0.25) 96.06 (+1.33 0.17) 96.65 (+0.24 0.64) 94.96 (+1.90 0.57) 96.15 (+0.85 0.25) 94.19 (+1.05 0.18) 94.11 (+3.00 0.39) 97.80 (+0.09 0.05) 97.22 Food 93.11 (+0.51 0.07) 85.61 (+7.18 0.33) 87.33 (+5.53 0.55) 93.34 (+0.16 0.11) 93.30 (+0.11 0.11) 89.59 (+0.42 0.33) 93.37 (+0.24 0.13) 93.66 (+0.09 0.13) 92.96 INet 74.35 (+2.54 0.47) 66.04 (+11.34 0.34) 69.12 (+8.56 0.26) 75.39 (+0.00 0.00) 75.84 (+0.00 0.00) 67.15 (+0.00 0.00) 78.31 (+0.02 0.04) 78.46 (+0.00 0.00) 77.71 Pet 92.82 (+1.80 0.40) 80.84 (+13.60 0.79) 82.02 (+12.05 1.56) 93.25 (+1.35 0.40) 93.20 (+1.50 0.34) 93.60 (+0.56 0.20) 92.86 (+1.83 0.42) 93.53 (+1.16 0.48) 94.54 SUN 67.35 (+5.17 0.53) 65.96 (+8.65 0.27) 67.94 (+6.67 0.36) 70.34 (+3.32 0.80) 70.88 (+2.61 1.12) 66.02 (+0.00 0.00) 73.70 (-0.00 0.01) 74.68 (+0.22 0.21) 74.77 Cars 76.61 (+6.09 0.97) 69.67 (+14.78 0.62) 73.73 (+10.81 0.33) 77.71 (+4.68 1.03) 78.63 (+5.01 0.72) 79.65 (+0.59 0.58) 80.30 (+1.67 0.56) 80.81 (+2.80 0.96) 84.65 AVG 74.65 (+6.33 0.91) 73.83 (+8.48 0.73) 75.84 (+6.35 0.66) 79.05 (+2.16 0.45) 79.78 (+1.64 0.36) 76.93 (+0.52 0.13) 78.80 (+2.20 0.46) 82.12 (+0.68 0.26) 81.66
Table 18: Number of shots . Classification accuracy (%) and performance improvements across datasets. The values in parentheses denote the absolute performance change after ensembling with DEFTS and the confidence interval. Positive gains are highlighted in green, and negative changes in red.
Dataset ZS SimpleShot Linear Probe Tip-Adapter APE TIP-X TAMP+ZS LDA+ZS DEFTS C10 94.89 (+0.59 0.18) 92.41 (+2.75 0.68) 93.42 (+2.13 1.41) 95.17 (+0.23 0.11) 95.39 (+0.20 0.11) 94.64 (+0.07 0.05) 94.97 (+0.53 0.16) 95.81 (+0.12 0.09) 95.60 C100 77.27 (+3.21 0.19) 70.57 (+9.78 0.60) 75.39 (+4.52 0.53) 78.19 (+2.51 0.22) 79.60 (+1.16 0.46) 70.81 (+0.00 0.00) 78.54 (+1.91 0.41) 81.87 (+0.10 0.27) 80.25 Cal101 94.62 (+2.86 0.16) 95.53 (+1.56 0.29) 96.26 (+0.45 0.29) 95.90 (+1.51 0.42) 96.20 (+1.23 0.41) 95.83 (+0.00 0.00) 96.45 (+0.92 0.22) 97.61 (+0.03 0.09) 97.08 DTD 53.03 (+17.40 0.44) 64.58 (+6.73 0.87) 67.48 (+2.91 1.09) 66.25 (+4.47 0.96) 68.69 (+2.96 1.06) 63.94 (+0.00 0.00) 62.90 (+7.17 0.49) 71.49 (+1.39 0.65) 70.56 Euro 61.17 (+12.86 0.82) 80.45 (+3.30 0.34) 85.12 (-1.21 1.49) 80.26 (+1.54 1.11) 83.52 (+0.56 0.50) 69.18 (+0.19 0.36) 60.61 (+12.58 1.00) 87.30 (+0.43 0.56) 74.35 Air. 32.18 (+21.41 0.55) 47.96 (+6.46 0.47) 49.27 (+4.46 0.66) 46.50 (+6.65 1.25) 43.00 (+8.34 1.33) 47.93 (+0.00 0.00) 47.65 (+5.36 0.94) 55.29 (+2.25 0.64) 53.98 Flow. 78.40 (+19.66 0.20) 97.48 (+0.61 0.11) 98.19 (-0.46 0.22) 96.77 (+1.06 0.14) 97.59 (+0.46 0.18) 94.62 (+0.14 0.18) 95.04 (+2.92 0.31) 98.66 (+0.12 0.07) 98.06 Food 93.11 (+0.54 0.10) 89.05 (+4.10 0.16) 90.39 (+2.54 0.32) 93.43 (+0.25 0.14) 93.51 (+0.27 0.18) 90.28 (+0.00 0.00) 93.59 (+0.03 0.09) 93.93 (-0.10 0.12) 93.15 INet 74.35 (+6.31 0.09) 72.64 (+7.20 0.12) 75.74 (+4.19 0.13) 76.94 (+3.71 0.21) 77.73 (+2.99 0.32) 74.10 (-0.34 0.70) 79.54 (+0.61 0.20) 81.10 (+0.13 0.08) 79.93 Pet 92.82 (+2.26 0.24) 86.71 (+8.39 0.71) 90.02 (+4.52 0.96) 93.61 (+1.44 0.38) 93.83 (+1.33 0.41) 93.51 (+0.31 0.12) 93.01 (+2.11 0.27) 95.24 (+0.18 0.29) 95.25 SUN 67.35 (+9.75 0.14) 72.08 (+5.19 0.25) 74.04 (+2.93 0.37) 73.32 (+3.83 0.24) 74.37 (+2.98 0.29) 70.01 (+0.00 0.00) 75.71 (+1.11 0.29) 78.27 (+0.22 0.13) 77.27 Cars 76.61 (+9.98 0.20) 76.12 (+10.39 0.37) 81.96 (+4.30 0.75) 80.04 (+6.24 0.38) 81.23 (+4.96 0.37) 81.22 (+0.00 0.00) 82.03 (+4.38 0.42) 86.28 (+1.01 0.22) 86.66 AVG 74.65 (+8.90 1.10) 78.80 (+5.54 0.47) 81.44 (+2.61 0.36) 81.37 (+2.79 0.35) 82.06 (+2.29 0.38) 78.84 (+0.03 0.06) 80.00 (+3.30 0.54) 85.24 (+0.49 0.13) 83.51
Table 19: Number of shots . Classification accuracy (%) and performance improvements across datasets. The values in parentheses denote the absolute performance change after ensembling with DEFTS and the confidence interval. Positive gains are highlighted in green, and negative changes in red.
Dataset ZS SimpleShot Linear Probe Tip-Adapter APE TIP-X TAMP+ZS LDA+ZS DEFTS C10 94.89 (+0.70 0.11) 94.75 (+1.20 0.42) 95.35 (+0.66 0.47) 95.52 (+0.16 0.11) 95.76 (+0.08 0.16) 95.26 (+0.00 0.00) 95.07 (+0.53 0.12) 96.04 (+0.23 0.18) 95.67 C100 77.27 (+4.28 0.13) 74.89 (+6.73 0.43) 79.65 (+1.60 0.42) 79.13 (+2.46 0.15) 80.40 (+1.45 0.28) 73.08 (+0.00 0.00) 78.95 (+2.60 0.20) 82.93 (+0.09 0.19) 81.41 Cal101 94.62 (+2.89 0.10) 95.99 (+1.48 0.24) 97.09 (+0.27 0.08) 96.41 (+1.21 0.28) 96.87 (+0.75 0.21) 96.08 (+0.20 0.19) 96.64 (+0.90 0.16) 97.95 (-0.01 0.12) 97.36 DTD 53.03 (+19.93 0.44) 69.00 (+5.25 0.45) 74.12 (-0.75 0.84) 69.44 (+5.04 0.60) 72.93 (+2.23 0.62) 67.14 (-0.05 0.28) 65.07 (+7.76 0.74) 75.43 (+1.08 0.81) 72.95 Euro 61.17 (+13.93 0.60) 81.39 (+2.49 0.33) 89.47 (-3.98 1.44) 82.39 (+0.74 0.86) 86.81 (+0.65 0.30) 72.78 (+0.58 1.66) 60.73 (+14.40 0.83) 91.19 (-0.19 0.27) 75.44 Air. 32.18 (+24.43 0.53) 52.40 (+5.47 0.57) 56.20 (+0.97 0.34) 51.25 (+6.05 0.54) 47.66 (+8.30 0.82) 49.58 (+0.00 0.00) 51.19 (+5.59 0.81) 60.15 (+2.87 0.53) 56.62 Flow. 78.40 (+20.11 0.08) 98.25 (+0.40 0.11) 99.00 (-0.49 0.08) 97.38 (+1.07 0.12) 98.46 (+0.30 0.09) 95.39 (+0.47 0.50) 95.65 (+2.89 0.26) 99.03 (+0.11 0.06) 98.49 Food 93.11 (+0.79 0.09) 90.84 (+2.43 0.13) 92.23 (+0.88 0.19) 93.58 (+0.34 0.10) 93.76 (+0.15 0.11) 91.02 (+0.00 0.00) 93.60 (+0.24 0.14) 94.18 (-0.02 0.08) 93.33 INet 74.35 (+7.60 0.06) 76.08 (+5.31 0.13) 80.14 (+1.27 0.09) 78.37 (+3.63 0.27) 79.70 (+2.41 0.18) 76.73 (+3.22 0.84) 80.17 (+1.75 0.10) 80.38 (+1.96 0.12) 81.41 Pet 92.82 (+2.77 0.08) 89.98 (+5.46 0.42) 93.12 (+2.15 0.26) 93.72 (+1.79 0.35) 94.14 (+1.42 0.31) 93.76 (+0.02 0.05) 93.03 (+2.39 0.25) 95.86 (+0.04 0.16) 95.52 SUN 67.35 (+11.59 0.16) 75.37 (+3.28 0.16) 78.06 (+0.67 0.15) 74.99 (+4.04 0.19) 76.27 (+3.06 0.23) 73.73 (+0.46 0.80) 77.21 (+1.67 0.18) 78.85 (+1.49 0.15) 78.73 Cars 76.61 (+11.47 0.11) 79.73 (+8.53 0.34) 87.02 (+1.18 0.34) 82.06 (+5.77 0.29) 83.34 (+4.47 0.34) 82.45 (+0.24 0.35) 83.36 (+4.71 0.40) 88.35 (+0.73 0.12) 88.21 AVG 74.65 (+10.04 1.20) 81.56 (+4.00 0.37) 85.12 (+0.37 0.27) 82.85 (+2.69 0.33) 83.84 (+2.11 0.35) 80.58 (+0.43 0.20) 80.89 (+3.78 0.59) 86.70 (+0.70 0.16) 84.59
F.10 Experiments with different model backbone
In this section, we evaluate the performances of DEFTS and other baselines with different model backbone considered in the main paper. To be specific, we consider ViT-B/32 and ViT-H-14, different than ViT-L/14 used Section 3. The experiments in this section are performed exactly as the one for Table 2, with only model backbone changed. Results shown in Table 20 demonstrate that the DEFTS improvements over other competing methods are consistent across different model backbones.
Table 20: Different model backbones. Average classification accuracy (%) and performance improvements across 12 datasets for different numbers of shots . Results are reported for two distinct model architectures: ViT-B/32 and ViT-H/14. The values in parentheses denote the absolute performance change after ensembling with DEFTS and the confidence interval. Positive gains are highlighted in green, and negative changes in red. The best baseline accuracy for each -shot setting (before adding DEFTS) is highlighted in bold.
-shot ZS+DEFTS SimpleShot Linear Probe Tip-Adapter APE TIP-X TAMP+ZS LDA+ZS DEFTS alone Model Backbone: ViT-B/32 Backbone 64.56 (+2.10 0.48) 40.45 (+16.26 1.23) 42.21 (+15.60 1.25) 65.01 (+1.72 0.46) 65.78 (+1.07 0.42) 65.27 (+1.47 0.45) 64.92 (+0.95 0.36) 64.66 (+2.01 0.47) 65.08 64.56 (+2.12 0.58) 52.33 (+16.12 1.68) 52.56 (+15.96 1.50) 66.74 (+0.44 0.24) 67.66 (+0.22 0.17) 63.02 (+1.77 0.27) 65.73 (+1.09 0.43) 67.31 (+0.39 0.40) 67.90 64.56 (+5.36 0.92) 61.45 (+10.25 1.08) 63.77 (+7.37 1.10) 68.87 (+1.59 0.38) 69.67 (+1.34 0.39) 64.72 (+0.54 0.15) 68.00 (+2.12 0.51) 72.13 (+0.76 0.34) 70.37 64.56 (+8.47 1.09) 67.41 (+6.88 0.76) 71.21 (+2.30 0.82) 71.87 (+2.27 0.32) 73.06 (+1.76 0.29) 66.51 (+0.05 0.07) 69.32 (+3.57 0.70) 76.24 (+0.47 0.13) 72.70 64.56 (+10.09 1.20) 70.89 (+5.02 0.59) 76.04 (-0.24 0.54) 74.02 (+2.03 0.27) 75.34 (+1.35 0.23) 68.96 (+0.12 0.09) 70.41 (+4.22 0.73) 77.27 (+1.42 0.26) 74.38 Model Backbone: ViT-H/14 Backbone 81.44 (+1.87 0.48) 60.81 (+15.52 0.92) 64.27 (+14.11 0.89) 81.70 (+1.67 0.46) 82.08 (+1.33 0.41) 81.83 (+1.55 0.44) 82.31 (+0.66 0.21) 81.48 (+1.84 0.47) 82.61 81.44 (+1.64 0.57) 73.52 (+11.48 1.13) 73.74 (+11.18 1.13) 83.27 (+0.15 0.09) 83.82 (+0.11 0.15) 80.88 (+0.64 0.16) 82.70 (+0.59 0.22) 83.12 (+0.47 0.21) 84.65 81.44 (+3.78 0.83) 81.42 (+5.63 0.53) 82.16 (+4.70 0.50) 85.01 (+0.81 0.28) 85.31 (+0.73 0.32) 82.86 (+0.09 0.04) 84.42 (+1.06 0.32) 86.97 (+0.12 0.16) 85.95 81.44 (+5.90 1.07) 85.39 (+3.00 0.31) 86.54 (+1.77 0.26) 86.67 (+1.36 0.30) 87.30 (+1.02 0.26) 84.88 (-0.08 0.11) 85.35 (+1.94 0.57) 89.23 (+0.14 0.09) 87.39 81.44 (+6.82 1.19) 87.47 (+1.77 0.19) 89.17 (+0.12 0.16) 87.83 (+1.29 0.27) 88.60 (+0.90 0.22) 86.89 (+0.46 0.16) 85.89 (+2.33 0.61) 90.19 (+0.44 0.12) 88.21
F.11 Relative error reduction
In Table 2, we report the absolute accuracy gains achieved by different methods when ensembled with DEFTS. However, absolute accuracy improvements can be misleading due to the ceiling effect, as strong baselines naturally have less room for improvement. To account for this, Table 21 presents the relative error reduction, which quantifies the fraction of the base method’s misclassifications that are successfully resolved by the ensemble.
Table 21: Average accuracy increase (%) / relative error reduction by ensembling with DEFTS for different number of shots . The average accuracy increase is the same as in Table 2.
| Base method | |||||
|---|---|---|---|---|---|
| ZS | 3.03 / 12% | 2.36 / 9% | 6.33 / 25% | 8.90 / 35% | 10.04 / 40% |
| SimpleShot | 18.37 / 37% | 15.30 / 43% | 8.48 / 32% | 5.54 / 26% | 4.00 / 22% |
| Linear probe | 16.43 / 37% | 14.07 / 41% | 6.35 / 26% | 2.61 / 14% | 0.37 / 2% |
| Tip-Adapter | 2.69 / 11% | 0.76 / 3% | 2.16 / 10% | 2.79 / 15% | 2.69 / 16% |
| APE | 2.07 / 9% | 0.41 / 2% | 1.64 / 8% | 2.29 / 13% | 2.11 / 13% |
| TIP-X | 2.48 / 10% | 1.27 / 5% | 0.52 / 2% | 0.03 / 0% | 0.43 / 2% |
| TAMP+ZS | 1.02 / 4% | 0.94 / 4% | 2.20 / 10% | 3.30 / 17% | 3.78 / 20% |
| LDA+ZS | 3.00 / 12% | 1.12 / 5% | 0.68 / 4% | 0.49 / 3% | 0.70 / 5% |
F.12 Ensembling comparison between DEFTS and TAMP
In this section, we compare DEFTS and TAMP further by comparing + DEFTS and + TAMP, where is an existing baseline such as TIP-X. Both ensembles are searched in the same way as described in Appendix G.3: the hyperparameters of and the weight of the added method are chosen jointly by leave-one-out accuracy on the support set. The weight of DEFTS and of TAMP takes the same values, when is Tip-Adapter, TIP-X or APE, and 21 values in for the other base methods. TAMP has one more hyperparameter than DEFTS, its own mixing weight , so its search space is larger. The results are shown in Table 22, which further demonstrates the advantage of DEFTS over TAMP.
Table 22: Accuracy gain over the baseline X by ensembling with DEFTS or TAMP for each . The results are obtained using model backbone ViT-L/14 and are averaged over 10 random seeds.
| Base X | X | DEFTS | TAMP | DEFTS TAMP |
|---|---|---|---|---|
| ZS | 74.65 | 3.03 (0.46) | 1.56 (0.34) | 1.47 (0.18) |
| SimpleShot | 50.88 | 18.37 (1.25) | 11.96 (0.84) | 6.41 (0.56) |
| Linear Probe | 55.27 | 16.43 (1.15) | 10.98 (0.80) | 5.45 (0.48) |
| Tip-Adapter | 75.05 | 2.69 (0.43) | 1.25 (0.32) | 1.44 (0.17) |
| TIP-X | 75.29 | 2.48 (0.41) | 1.09 (0.30) | 1.39 (0.17) |
| APE | 75.79 | 2.07 (0.38) | 0.72 (0.27) | 1.35 (0.17) |
| TAMP+ZS | 76.21 | 1.02 (0.21) | – | – |
| LDA+ZS | 74.69 | 3.00 (0.45) | 1.54 (0.34) | 1.46 (0.18) |
| ZS | 74.65 | 2.36 (0.69) | 2.00 (0.58) | 0.36 (0.44) |
| SimpleShot | 64.46 | 15.30 (1.30) | 13.08 (1.50) | 2.22 (0.49) |
| Linear Probe | 65.74 | 14.07 (1.07) | 12.99 (1.15) | 1.08 (0.37) |
| Tip-Adapter | 76.57 | 0.76 (0.31) | 0.90 (0.33) | 0.14 (0.30) |
| TIP-X | 75.19 | 1.27 (0.18) | 0.99 (0.18) | 0.28 (0.17) |
| APE | 77.34 | 0.41 (0.25) | 0.36 (0.27) | 0.04 (0.38) |
| TAMP+ZS | 76.65 | 0.94 (0.32) | – | – |
| LDA+ZS | 76.37 | 1.12 (0.37) | 0.73 (0.39) | 0.40 (0.51) |
| ZS | 74.65 | 6.33 (0.91) | 4.15 (0.77) | 2.18 (0.50) |
| SimpleShot | 73.83 | 8.48 (0.73) | 7.74 (0.70) | 0.75 (0.31) |
| Linear Probe | 75.84 | 6.35 (0.66) | 4.94 (0.68) | 1.41 (0.34) |
| Tip-Adapter | 79.05 | 2.16 (0.45) | 1.44 (0.32) | 0.72 (0.34) |
| TIP-X | 76.93 | 0.52 (0.13) | 0.46 (0.11) | 0.07 (0.11) |
| APE | 79.78 | 1.64 (0.36) | 1.10 (0.30) | 0.53 (0.30) |
| TAMP+ZS | 78.80 | 2.20 (0.46) | – | – |
| LDA+ZS | 82.12 | 0.68 (0.26) | 0.02 (0.26) | 0.65 (0.26) |
| ZS | 74.65 | 8.90 (1.10) | 5.35 (0.88) | 3.55 (0.58) |
| SimpleShot | 78.80 | 5.54 (0.47) | 4.66 (0.44) | 0.88 (0.21) |
| Linear Probe | 81.44 | 2.61 (0.36) | 1.10 (0.39) | 1.51 (0.28) |
| Tip-Adapter | 81.37 | 2.79 (0.35) | 1.02 (0.29) | 1.77 (0.28) |
| TIP-X | 78.84 | 0.03 (0.06) | 0.19 (0.11) | 0.16 (0.12) |
| APE | 82.06 | 2.29 (0.38) | 0.86 (0.24) | 1.43 (0.27) |
| TAMP+ZS | 80.00 | 3.30 (0.54) | – | – |
| LDA+ZS | 85.24 | 0.49 (0.13) | 0.01 (0.09) | 0.48 (0.13) |
| ZS | 74.65 | 10.04 (1.20) | 6.24 (1.01) | 3.80 (0.59) |
| SimpleShot | 81.56 | 4.00 (0.37) | 3.01 (0.30) | 0.99 (0.21) |
| Linear Probe | 85.12 | 0.37 (0.27) | 0.79 (0.32) | 1.16 (0.20) |
| Tip-Adapter | 82.85 | 2.69 (0.33) | 1.02 (0.20) | 1.67 (0.22) |
| TIP-X | 80.58 | 0.43 (0.20) | 0.25 (0.20) | 0.18 (0.21) |
| APE | 83.84 | 2.11 (0.35) | 0.62 (0.17) | 1.49 (0.23) |
| TAMP+ZS | 80.89 | 3.78 (0.59) | – | – |
| LDA+ZS | 86.70 | 0.70 (0.16) | 0.36 (0.11) | 0.34 (0.08) |
Appendix G Hyperparameter Selection and Tuning
This section reports our choices for choosing and searching hyperparameters of each method to ensure complete transparency of our experiments.
G.1 Hyperparameters for Each Method
We first detail the hyperparameters used in each evaluated method and their ensemble variants. For notational simplicity, we adopt a slightly different convention here compared to Section 2.1. Specifically, every scoring function defined below operates on a single test image embedding and yields a score vector across all classes. The -th entry, , represents the logit for class , such that the final predicted label is given by . Throughout the section, we will use to denote DEFTS’s combining weight whenever DEFTS’s score is added to an existing method.
First, we define the baseline zero-shot logit vector as , with its per-class entry computed via cosine similarity:
where represents the text embedding for class .
Tip-Adapter and Variants.
Tip-Adapter relies on a key-value cache built from the support set. The hyperparameter controls the sharpness of the affinity kernel, and acts as an additive weight on the resulting cache vote. Let denote the true label of support image . For a given class , the total affinity contributed by class- cache entries is :
TIP-X introduces a third parameter , weighting a second, independent vote . This vote is built from a KL-divergence-based term that measures how well cache entry ’s zero-shot distribution matches ’s:
APE utilizes the same structural roles for , but computes within a channel-reduced feature space. Here weights each cache entry’s own reliability , where is the cross-entropy of entry ’s reduced-space zero-shot prediction against its true label.
Augmenting with DEFTS. DEFTS’s own posterior score as computed in Algorithm C is added as an additional term to each of the three formulas above, with weight :
LDA Ensembles.
The Mahalanobis-based LDA score is defined per class as:
with representing the class- support-image mean, and denoting the shrunk pooled precision matrix [33]. The hyperparameter controls the weights of the zero-shot score and this LDA score:
When combining with DEFTS, DEFTS’s score replaces zero-shot’s role in the same additive structure, with taking over ’s share of the zero-shot-vs-DEFTS split:
TAMP Ensembles.
For the base TAMP method, balances the image-derived mean and the text prototype (where is the text-aligned projector). Class ’s test-point score is the cosine similarity to this mixed prototype :
When ensembled with DEFTS, the scores are combined as follows:
DEFTS Ensembles (Ours).
DEFTS computes its own posterior-based score, , without requiring internal hyperparameter tuning as in Algorithm 1. Ensembled with zero-shot alone:
DEFTS Augmenting Simple Baselines.
SimpleShot classifies by nearest class-mean cosine similarity, with no hyperparameters of its own:
Linear Probe fits an -regularized multinomial logistic regression on the -shot support embeddings and scores with its decision function, , for fitted weights . Neither method otherwise touches the text embeddings at all – DEFTS is the only source of text information for both once combined:
G.2 Fixed Weights
When , i.e. each class has only one training sample, we choose fixed hyperparameters for all methods considered.
Natural untuned defaults for ensembling.
For ensembling different methods, we default to equal weighting (e.g., , ). This equal-weighting strategy serves as the most natural possible baseline without hyperparameter tuning.
Empirical defaults for LDA ensembles.
While equal weighting is the natural default for ensembling method, we observed a severe scale mismatch in the LDA formulation of Wang et al. [33]: their raw LDA scores are consistently times larger in magnitude than the logits in zero-shot CLIP. Consequently, when ensembling LDA with other methods, we down scale the weight of LDA to .
The exact fixed values used for every hyperparameter across all methods are summarized in Table 23.
Table 23: Fixed hyperparameter values chosen for each method and its ensemble variants.
| Method | Parameter(s) | Fixed value |
|---|---|---|
| Tip-Adapter | ||
| TIP-X | ||
| APE | ||
| LDA + ZS | ||
| TAMP | ||
| TAMP + ZS | ||
| ZS + DEFTS | ||
| SimpleShot + DEFTS | ||
| Linear Probe + DEFTS | ||
| Tip-Adapter + DEFTS | ||
| TIP-X + DEFTS | ||
| APE + DEFTS | ||
| TAMP + ZS + DEFTS | ||
| LDA + ZS + DEFTS |
G.3 Hyperparameter Search Methodology
When , we perform a hyperparameter search for each method to identify its optimal configuration. For every method in our comparison, this search is performed via leave-one-out (LOO) cross-validation on the -shot training set to find the hyperparameter combination that maximizes classification accuracy. Specifically, for each support image, the model is fit without that image and then used to score it. The hyperparameter combination yielding the highest LOO accuracy is selected. In the event of a tie, the configuration that minimizes the cross-entropy loss is chosen.
The search space for each hyperparameter of each method is shown in Table 24.
Table 24: Hyperparameters searched via leave-one-out (LOO) cross-validation for each method and ensemble variant. All grids are defined below the table; “combos” is the total number of joint grid points evaluated for each method.
| Method | Parameter(s) | Grid(s) | combos |
|---|---|---|---|
| Tip-Adapter | 72 | ||
| TIP-X | 504 | ||
| APE | 432 | ||
| LDA + ZS | 9 | ||
| TAMP | 21 | ||
| TAMP+ZS | 441 | ||
| ZS+DEFTS | 21 | ||
| SimpleShot+DEFTS | 21 | ||
| Linear Probe+DEFTS | 21 | ||
| Tip-Adapter+DEFTS | 576 | ||
| TIP-X+DEFTS | 4032 | ||
| APE+DEFTS | 3456 | ||
| TAMP+ZS+DEFTS | 9261 | ||
| LDA+ZS+DEFTS | 189 |
: (21 points). : (9 points). : (8 points). : (9 points). : (7 points). : (6 points). : (8 points).