NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DecouplingTemplateBiasinCLIP:HarnessingEmptyPromptsforEnhanced Few-ShotLearning

Zhenyu Zhang, Guangyao Chen, Yixiong Zou, Zhimeng Huang, Yuhua Li

TL;DR

This paper identifies a hidden "template bias" in CLIP where the model aligns images with generic text templates (like "a photo of a...") rather than the actual class names. The authors propose a two-stage framework using "empty prompts" to isolate and neutralize this bias, leading to significantly more robust and accurate few-shot classification across 11 major benchmarks.

What Problem Does This Paper Address?

The Contrastive Language-Image Pre-Training (CLIP) model has become the gold standard for zero-shot and few-shot visual tasks. Typically, we classify an image by comparing its embedding to a "prompted" class name, such as "a photo of a cat."

However, the authors discover a systemic flaw: Template-Sample Similarity (TSS). The generic part of the prompt (the template) often has an inherent similarity to the image that has nothing to do with the object itself. If an image of a satellite has a high similarity to the string "a photo of a...", it might get a high score for any class using that template, leading to "attention bias" and incorrect predictions. In low-data (few-shot) regimes, the model often exploits this template proximity as a shortcut instead of learning true semantic alignment, which hurts both accuracy and robustness.

Methods

The authors introduce a two-stage strategy to "decouple" this bias:

  1. Empty Prompt Generation: They curated a set of 25 words representing "emptiness" (e.g., "None," "Hollow," "Vacant," "Null"). By inserting these into standard templates, they create "empty prompts" that capture the textual features of the template without any category information.
  2. Stage 1: Pre-training Initialization: Before fine-tuning on specific tasks, the model is initialized using these empty prompts. An unsupervised loss ensures that the similarity between an image and any empty prompt is uniform, effectively "zeroing out" the template's prior influence.
  3. Stage 2: Few-shot Fine-tuning Calibration: During task-specific fine-tuning (using LoRA for efficiency), the authors apply a dual-loss function. They combine standard cross-entropy ($L_{ce}$) with a Template Bias Calibration Loss ($L_{tb}$). This forces the model to maintain unbiased alignment with the template while it learns to discriminate between actual classes.

Datasets

The framework was evaluated on a comprehensive suite of 11 benchmarks covering diverse domains:

  • General Objects: ImageNet, Caltech101
  • Fine-grained: Oxford Pets, Flowers102, Food101, Stanford Cars, Aircraft
  • Specialized: EuroSAT (satellite imagery), DTD (textures), SUN397 (scenes), UCF101 (actions)

Key Insights and Ideas

  • The "Misclassification Ratio": The authors found that while templates generally improve CLIP's accuracy, they actually cause the model to misclassify about 4.93% of samples that were correctly identified using bare class names alone. This highlights a clear trade-off between contextual gain and template-induced bias.
  • LoRA isn't enough: Standard fine-tuning techniques like LoRA reduce the correlation between template similarity and accuracy, but they don't eliminate it. A residual bias (correlation ~0.2) remains, which the proposed method successfully drives down to near zero (-0.05).
  • Consistency is Key: The method makes the model's performance much more stable across different template choices. Whether you use "a photo of a..." or "a centered satellite photo of...", the "decoupled" model focuses on the image content rather than the phrasing.

Key Results

  • Superior Performance: The proposed method consistently outperformed state-of-the-art baselines like LoRA-CLIP and MaPLe. On average, it provided a 1.5 point improvement across all 11 datasets.
  • Massive Gains in Low-Data Regimes: On the EuroSAT dataset (1-shot), accuracy jumped from 72.3% (baseline) to 78.4%.
  • Robustness: The "Right" panel of Figure 2 shows that while standard LoRA's performance fluctuates wildly depending on which template is chosen, the proposed method maintains high, stable accuracy regardless of the template.

Limitations and Future Work

  • Diminishing Returns: The authors acknowledge that as the number of labeled samples increases (e.g., beyond 28 shots), the benefit of the debiasing process diminishes. With enough data, the model eventually learns to overcome the bias on its own.
  • Computational Overhead: For massive datasets like ImageNet, generating and processing multiple templates per category can hit VRAM limits (the authors noted a 24GB limit issue), making multi-template averaging difficult for very large-scale deployments.
  • Future Directions: The authors suggest exploring how these template biases manifest in even larger Vision-Language Models (VLMs) and whether automated prompt engineering could be integrated directly into the debiasing loop.

Summary updated

BibTeX
@inproceedings{zhang2026decouplingtemplatebiasinclip,
  author = {Zhenyu Zhang and Guangyao Chen and Yixiong Zou and Zhimeng Huang and Yuhua Li},
  title = {{DecouplingTemplateBiasinCLIP:HarnessingEmptyPromptsforEnhanced Few-ShotLearning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  url = {https://openreview.net/forum?id=B5lyhg1eof},
}

Loading related content...

Figure