Cross-Modal Prototype Alignment and Mixing for Training-Free Few-Shot Classification

Dipam Goswami, Simone Magistri, Gido M. van de Ven, Bartłomiej Twardowski, Andrew D. Bagdanov, Tinne Tuytelaars, Joost van de WeijerarXiv 2026

TL;DR

This paper introduces a training-free method to boost few-shot image classification in vision-language models like CLIP by strategically mixing image and text prototypes. By analyzing prototype mixing through a bias-variance lens, the authors demonstrate it acts as a shrinkage estimator, and they introduce a text-aligned semantic projection to filter out task-irrelevant visual noise. Combined with an image-based Linear Discriminant Analysis (LDA) classifier to handle datasets with weak cross-modal alignment, their approach sets a new state-of-the-art for training-free few-shot learning across multiple benchmarks.

What Problem Does This Paper Address?

Vision-language models (VLMs) like CLIP excel at zero-shot classification by comparing image embeddings to text prompts (text prototypes). When a few training images are available (the few-shot setting), incorporating their image embeddings typically improves performance. However, few-shot image prototypes (the average of the few available image features) suffer from high variance and contain task-irrelevant noise, such as instance-specific backgrounds or lighting conditions.

While prior works have tried naively mixing text and image representations to combat this, there hasn't been a principled, training-free framework to address this noisy mixture. Furthermore, CLIP’s cross-modal alignment varies significantly across downstream datasets; out-of-distribution datasets often exhibit a severe "modality gap" where text and image spaces do not align well, degrading classification performance.

Methods

The authors tackle these challenges with a multi-step training-free approach:

  1. Bias-Variance Analysis of Mixing: The authors mathematically prove that naively mixing empirical image prototypes with deterministic text prototypes acts as a shrinkage estimator. This trades a small amount of bias (introduced by the modality gap) for a massive reduction in variance, leading to a lower Mean Squared Error (MSE) in low-shot regimes.
  2. Text-Aligned Semantic Projection: To prevent mixing task-irrelevant visual noise (like backgrounds) with text, the authors perform a Singular Value Decomposition (SVD) on the matrix of text prototypes to identify the dominant semantic directions. They construct a projector $P$ to decompose image prototypes into two parts: a text-aligned semantic component ($\mu_i^{\parallel}$) and an orthogonal complement ($\mu_i^{\perp}$).
  3. Align+Mix Estimator: Instead of naive mixing, they introduce the Text-Aligned Mixed Prototypes (TAMP) classifier, which mixes text prototypes only with the text-aligned component of the image prototype.
  4. Ensemble with Image-based LDA: Recognizing that the orthogonal component might still contain discriminative visual features (especially when cross-modal alignment is weak), they ensemble the TAMP classifier with an image-specific Linear Discriminant Analysis (LDA) classifier that models class covariances.
Fig. 1: Given the classification problem, the image latent space should be differently exploited. The semantic space defined by the text prototypes defines a relevant sub- space. We propose text-aligned semantic projection of image features which performs classification using only the relevant subspace. Task relevant regions denoted by atten- tion maps are obtained by the proposed task-specific semantic projection P1 and P2.

Datasets

The method was evaluated across 11 diverse image classification benchmarks:

  • Generic Object Recognition: ImageNet, Caltech101
  • Fine-Grained Evaluation: FGVC Aircrafts, Stanford Cars, Oxford Pets, Flowers102
  • Satellite Imagery: EuroSAT
  • Texture Classification: Describable Textures (DTD)
  • Scene Recognition: SUN397
  • Action Recognition: UCF101

No new benchmarks were introduced.

Key Insights and Ideas

  • Mixing as Shrinkage: The realization that combining text and image features is fundamentally a bias-variance trade-off provides a solid theoretical foundation for why hybrid text-image classifiers work so well in few-shot learning.
  • Text Space as a Visual Filter: The text embedding space can be leveraged as a geometric filter. Projecting image features onto the text subspace effectively acts as an attention mechanism, isolating class-relevant foregrounds from irrelevant backgrounds without requiring any training or fine-tuning.
Fig. 3: Attention maps computed using the ResNet-50 vision encoder of CLIP showing that the text-aligned features focus on the task-relevant information from the image and the orthogonal part on remaining parts of image.
  • Anisotropy and Covariance Matter: When CLIP's cross-modal alignment is weak (e.g., on EuroSAT), text projection can discard useful visual cues. Modeling the image space's anisotropy using class covariances via LDA recovers this lost information, making the framework robust across varying degrees of cross-modal alignment.

Key Results

The proposed method consistently outperformed existing training-free baselines (such as Tip-Adapter, TIP-X, and GDA) across all shot configurations using a CLIP-ResNet-50 backbone:

  • 1-Shot: Achieved an average accuracy of 64.3% (outperforming the next best, TIP-X, at 62.9%).
  • 4-Shot: Achieved 70.8% (outperforming GDA at 69.8%).
  • 16-Shot: Achieved 76.4% (outperforming GDA at 75.8%).
Fig. 2: MSE of NCM and mixed prototypes as a function of the number of shots using CLIP-B/16.

Additionally, the method is highly flexible. When plugged on top of training-based prompt/adapter methods like MaPLe and CLIP-LoRA, it yielded further accuracy boosts (e.g., improving MaPLe's performance by 4.6% in 4-shot settings).

Limitations and Future Work

Despite its strong performance, the method has a few notable limitations:

  • Dependence on Pre-trained Alignment: For datasets with severe modality gaps or where text descriptions are entirely inadequate, the text-aligned projection provides minimal benefit.
  • Covariance Instability: The image-specific LDA classifier struggles in ultra-low-shot scenarios (like 1-shot or 2-shot) because estimating a stable covariance matrix from very few samples is inherently difficult.
  • Hyperparameter Tuning: The method relies on a validation set to tune the prototype mixing coefficient ($\lambda$) and the ensemble weight ($\alpha$).

For future work, the authors plan to explore parameter-efficient fine-tuning techniques that explicitly encourage better subspace alignment during training.

Summary updated

BibTeX
@misc{goswami2026cross,
  author = {Dipam Goswami and Simone Magistri and Gido M. van de Ven and Bartłomiej Twardowski and Andrew D. Bagdanov and Tinne Tuytelaars and Joost van de Weijer},
  title = {{Cross-Modal Prototype Alignment and Mixing for Training-Free Few-Shot Classification}},
  year = {2026},
  eprint = {2603.24528},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.24528},
}
Figure