Abstract
Recent progress in the few-shot adaptation of Vision-Language Models (VLMs) has pushed their generalization capabilities using only a few labeled samples. However, existing literature has focused primarily on prompt learning and adapters, often overlooking Parameter-Efficient Fine-Tuning (PEFT) techniques like Low-Rank Adaptation (LoRA). Furthermore, current methods often rely on heavy training procedures and task-specific hyper-parameters. We introduce CLIP-LoRA, a simple yet powerful method that applies LoRA to few-shot learning for VLMs. Our results across 11 datasets show substantial improvements in accuracy and training efficiency while maintaining consistent hyper-parameters across all tasks.
Introduction
Vision-Language Models (VLMs) like CLIP are pre-trained on massive datasets to learn joint representations of images and text. While they excel at zero-shot tasks, they require adaptation to perform optimally on specific downstream tasks with limited data (1 to 16 labeled examples).
Currently, two strategies dominate this field:
- Prompt Learning: Optimizing text tokens (e.g., CoOp). This is computationally expensive as it requires backpropagation through the entire model.
- Adapters: Adding small new layers. These often require intensive, task-specific hyperparameter tuning, hindering scalability.
This research investigates whether LoRA can provide a stronger, more efficient baseline for few-shot VLM adaptation.
Methodology: CLIP-LoRA
Instead of modifying input prompts or adding external layers, CLIP-LoRA applies low-rank updates to the internal weight matrices of the transformer blocks in both the vision and language encoders.
Key Technical Features
- Low-Rank Updates: For a weight matrix $W$, the update is defined as $\Delta W = BA$, where $B$ and $A$ are low-rank matrices. This significantly reduces the number of trainable parameters.
- Targeted Attention: Updates are specifically applied to the Query ($W_q$), Key ($W_k$), and Value ($W_v$) matrices.
- Unified Hyperparameters: Unlike previous methods, CLIP-LoRA uses a single set of hyperparameters (e.g., rank $r=2$) across all datasets and shot counts.
- Inference Efficiency: The learned matrices can be mathematically merged back into the original weights ($W + \Delta W$), resulting in zero additional computational overhead during deployment.
Experimental Results
The method was evaluated on 11 diverse datasets, including ImageNet, EuroSAT, and Stanford Cars.
Performance and Efficiency
- State-of-the-Art Accuracy: CLIP-LoRA achieved the highest average accuracy across all 11 datasets. In 16-shot scenarios, it reached an average accuracy of 83.0%, surpassing PLOT++ (82.1%).
- Training Speed: On 16-shot ImageNet, CLIP-LoRA trained in just 50 minutes on a single A100 GPU, whereas PLOT++ required 15.5 hours.
- Cross-Modal Synergy: Adaptation is most effective when applied to both vision and text encoders simultaneously, suggesting that few-shot learning requires re-aligning how modalities interact.
Discussion and Limitations
While CLIP-LoRA is highly robust, it showed slight underperformance on specific datasets like Food101 and OxfordPets, likely due to a lack of explicit regularization in the simple cross-entropy loss used. Future work may explore dynamic rank allocation or advanced regularization to further enhance performance in extremely low-data regimes. Despite its simplicity, CLIP-LoRA serves as a powerful new baseline for the few-shot adaptation of Vision-Language Models.
Summary updated