Abstract
Foundation models like CLIP are trained on massive, diverse datasets to capture a broad spectrum of visual concepts. However, this "one-size-fits-all" training often results in sub-optimal performance on specific downstream tasks. We present Neural Priming, a framework that adapts pretrained models by "recalling" relevant examples from their original pretraining data. By isolating a task-specific subset of the data the model has already seen, Neural Priming significantly improves accuracy in zero-shot, few-shot, and distribution-shift scenarios without requiring new external labeled data. Our results demonstrate that models often possess the necessary knowledge for high performance but require a narrowed focus to resolve competing objectives encountered during general training.
Introduction
Large-scale foundation models, such as CLIP, are typically trained on billions of image-text pairs (e.g., LAION-2B). While these models exhibit impressive general-purpose capabilities, they often lag behind task-specific models. Traditionally, bridging this gap requires collecting and labeling new data for fine-tuning. This paper explores a different hypothesis: if a model has already encountered millions of relevant examples during its initial pretraining, can we achieve the benefits of fine-tuning simply by helping the model "remember" the right data?
Neural Priming is a two-step framework inspired by cognitive psychology, where exposure to a stimulus influences a subsequent response. Instead of introducing new information, the method re-aligns the model's existing knowledge to the specific distribution of a target task.
Methodology
The Neural Priming framework consists of two primary phases: Recall and Attune.
1. Collecting the Priming Pool (Recall)
The first step involves identifying a subset of the pretraining dataset that is relevant to the target task. This is achieved through two primary mechanisms:
- Language-based Recall: Given a set of class names, the system performs a fast text search across the captions of the original pretraining dataset (e.g., LAION-2B). By utilizing a Full Text Search (FTS) database, this process is highly efficient, allowing for the retrieval of relevant samples in under two minutes on a single GPU.
- Image-based (Transductive) Recall: In scenarios where unlabeled test images are available at inference time, these images can be used as queries to retrieve visually similar examples from the pretraining set.
- Filtering: To maintain high data quality, the base CLIP model is used to filter out noisy retrievals that do not align well with the intended class labels.
2. Attuning the Model
Once the "priming set" is collected, the model is adapted to the task distribution without modifying the underlying backbone architecture. The system calculates a Nearest-Class Mean (NCM) classifier based on the retrieved samples. This new classification head is then ensembled with the original zero-shot head, effectively re-weighting the model's output to favor the task-specific distribution.
Experimental Results
The researchers evaluated Neural Priming across several benchmarks, including ImageNet and specialized datasets like Stanford Cars and FGVC Aircraft, using LAION-2B and LAION-400M as the source pretraining sets.
Zero-Shot and Few-Shot Performance
Neural Priming provides a substantial boost to zero-shot performance. On ImageNet, the method improved top-1 accuracy by 2.45%, with an average improvement of 4.25% across six other transfer learning tasks. In few-shot settings, where a small number of labeled examples are provided, Neural Priming outperformed state-of-the-art methods like CoOp by an average of 3.81%.
Distribution Shift and Scalability
The framework also excels in handling distribution shifts. In transductive settings, it improved accuracy on ImageNetV2 by 1.41% and outperformed Test-Time Prompt Tuning (TPT) by 2.51% across four distribution shift datasets. Notably, these benefits scale with model size; improvements remained consistent as the architecture moved from ViT-B/32 to ViT-L/14.
Discussion and Insights
The success of Neural Priming suggests that the primary challenge for foundation models is not necessarily a lack of information, but rather the "competing objectives" inherent in large-scale training. By narrowing the model's focus to the relevant 0.01% of its training data, we resolve the ambiguity of a general-purpose solution.
Furthermore, the method is highly complementary to other adaptation techniques. When combined with prompt-tuning methods like CuPL, the performance gains stack, suggesting that textual descriptions and retrieved images provide distinct and additive signals for model alignment. The efficiency of the retrieval process—searching billions of images in minutes—makes "adaptation-on-the-fly" a practical reality for real-world applications.
Limitations
Despite its effectiveness, Neural Priming has specific requirements:
- Data Availability: The method depends on the pretraining set containing relevant data. It cannot "recall" concepts that were never present in the initial training (e.g., highly specialized medical imagery).
- Class Name Sensitivity: The quality of the initial retrieval is sensitive to the descriptiveness of class names. Vague or overly technical nomenclature can lead to poor priming pools.
- Access Requirements: The technique requires access to the pretraining dataset or its metadata, which may be a barrier for proprietary, closed-source models.
Conclusion
Neural Priming offers a sample-efficient alternative to traditional fine-tuning by leveraging the latent knowledge already stored within foundation models. By treating pretraining data as a retrieval bank for task-specific adaptation, we can significantly enhance model performance with minimal computational overhead and no additional data collection.
Summary updated