Skip to main content
QUICK REVIEW

[Paper Review] Prompt, Generate, then Cache: Cascade of Foundation Models makes Strong Few-shot Learners

Renrui Zhang, Xiangfei Hu|arXiv (Cornell University)|Mar 3, 2023
Multimodal Machine Learning ApplicationsComputer Science13 citations
TL;DR

CaFo cascades four pre-trained models (CLIP, DINO, DALL-E, GPT-3) with a Prompt-Generate-Cache pipeline to enhance few-shot visual classification and achieves state-of-the-art results without extra annotations.

ABSTRACT

Visual recognition in low-data regimes requires deep neural networks to learn generalized representations from limited training samples. Recently, CLIP-based methods have shown promising few-shot performance benefited from the contrastive language-image pre-training. We then question, if the more diverse pre-training knowledge can be cascaded to further assist few-shot representation learning. In this paper, we propose CaFo, a Cascade of Foundation models that incorporates diverse prior knowledge of various pre-training paradigms for better few-shot learning. Our CaFo incorporates CLIP's language-contrastive knowledge, DINO's vision-contrastive knowledge, DALL-E's vision-generative knowledge, and GPT-3's language-generative knowledge. Specifically, CaFo works by 'Prompt, Generate, then Cache'. Firstly, we leverage GPT-3 to produce textual inputs for prompting CLIP with rich downstream linguistic semantics. Then, we generate synthetic images via DALL-E to expand the few-shot training data without any manpower. At last, we introduce a learnable cache model to adaptively blend the predictions from CLIP and DINO. By such collaboration, CaFo can fully unleash the potential of different pre-training methods and unify them to perform state-of-the-art for few-shot classification. Code is available at https://github.com/ZrrSkywalker/CaFo.

Motivation & Objective

  • Motivate improving few-shot visual recognition by leveraging diverse pre-training paradigms beyond CLIP alone.
  • Propose a cascade framework CaFo that combines language-contrastive, vision-contrastive, vision-generative, and language-generative priors.
  • Demonstrate that a lightweight cache model can adaptively fuse predictions from multiple pre-trained models to improve accuracy.

Proposed method

  • Prompt: use GPT-3 to generate rich linguistic prompts for CLIP’s textual encoder.
  • Generate: use DALL-E to synthesize category-specific training images to enlarge few-shot data.
  • Cache: build a learnable cache with two keys (CLIP and DINO) to adaptively fuse their predictions at inference based on distribution similarities to a zero-shot CLIP baseline.
  • Adaptive Inference: compute p_ZS from CLIP, then weight p_CLIP and p_DINO by similarity to p_ZS and ensemble as p_en.
  • Training: optimize only the two cache keys while keeping the backbone models frozen, using expanded data and Tip-Adapter style training.

Experimental results

Research questions

  • RQ1Can cascading multiple pre-training paradigms (language-vision and vision-language) improve few-shot classification beyond CLIP-based methods?
  • RQ2How can generated data from DALL-E and semantically enriched prompts from GPT-3 be effectively integrated with a cache-based ensemble to maximize performance?
  • RQ3Does an adaptive, similarity-based ensemble of CLIP and DINO predictions outperform naive ensembling in few-shot settings?

Key findings

  • CaFo achieves state-of-the-art performance on 11 datasets across 1-, 2-, 4-, 8-, and 16-shot settings.
  • Zero-shot CaFo outperforms CLIP and CALIP, demonstrating the benefit of DALL-E generated data.
  • Prompting CLIP with GPT-3 yields more semantically rich prompts that improve CLIP’s performance.
  • DALL-E-generated images, filtered by CLIP, effectively expand the few-shot training set without manual labeling.
  • A two-key cache model enabling adaptive fusion of CLIP and DINO predictions improves accuracy over baselines.
  • CaFo shows robustness across diverse datasets and CLIP backbones.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.