[Paper Review] Contrastive Adapters for Foundation Model Group Robustness
This paper proposes contrastive adapters, a method to improve foundation model (FM) robustness to group distribution shifts without fine-tuning the FM. By training lightweight adapters with a contrastive loss that pulls together same-class sample embeddings and pushes apart different-class ones, the approach boosts worst-group accuracy by 8.5–56.0 percentage points across 9 benchmarks, achieving performance comparable to full-model retraining while training only ≤1% of parameters.
While large pretrained foundation models (FMs) have shown remarkable zero-shot classification robustness to dataset-level distribution shifts, their robustness to subpopulation or group shifts is relatively underexplored. We study this problem, and find that FMs such as CLIP may not be robust to various group shifts. Across 9 robustness benchmarks, zero-shot classification with their embeddings results in gaps of up to 80.7 percentage points (pp) between average and worst-group accuracy. Unfortunately, existing methods to improve robustness require retraining, which can be prohibitively expensive on large foundation models. We also find that efficient ways to improve model inference (e.g., via adapters, lightweight networks with FM embeddings as inputs) do not consistently improve and can sometimes hurt group robustness compared to zero-shot (e.g., increasing the accuracy gap by 50.1 pp on CelebA). We thus develop an adapter training strategy to effectively and efficiently improve FM group robustness. Our motivating observation is that while poor robustness results from groups in the same class being embedded far apart in the foundation model "embedding space," standard adapter training may not bring these points closer together. We thus propose contrastive adapting, which trains adapters with contrastive learning to bring sample embeddings close to both their ground-truth class embeddings and other sample embeddings in the same class. Across the 9 benchmarks, our approach consistently improves group robustness, raising worst-group accuracy by 8.5 to 56.0 pp over zero-shot. Our approach is also efficient, doing so without any FM finetuning and only a fixed set of frozen FM embeddings. On benchmarks such as Waterbirds and CelebA, this leads to worst-group accuracy comparable to state-of-the-art methods that retrain entire models, while only training $\leq$1% of the model parameters.
Motivation & Objective
- To investigate the robustness of foundation models (FMs) to subpopulation or group distribution shifts in zero-shot classification.
- To address the challenge of improving FM group robustness without expensive full-model fine-tuning.
- To develop an efficient, adapter-based method that improves robustness using only pretrained FM embeddings.
- To overcome the inconsistency and potential degradation in robustness seen with standard adapter and linear probe methods.
- To design a training strategy that explicitly aligns embeddings of same-class samples in the embedding space.
Proposed method
- Train lightweight adapters on frozen foundation model embeddings to transform them for better classification.
- Use a contrastive loss that encourages same-class sample embeddings to be closer in the embedding space.
- Apply a supervised contrastive loss that pulls together positive pairs (same class) and pushes apart negative pairs (different classes).
- Maintain standard cross-entropy loss for class-level alignment while adding contrastive regularization on sample-level embeddings.
- Train adapters end-to-end using only the FM-provided embeddings, without any fine-tuning of the foundation model.
- Ensure the method is efficient by training only the adapter parameters, with the FM frozen and embeddings fixed.
Experimental results
Research questions
- RQ1Can foundation models maintain strong zero-shot performance across all subpopulations under group distribution shifts?
- RQ2Why do standard adapter and linear probe methods sometimes degrade group robustness instead of improving it?
- RQ3Can contrastive learning be effectively applied to adapter training to improve alignment of same-class samples in the embedding space?
- RQ4Is it possible to significantly improve worst-group accuracy without fine-tuning the foundation model?
- RQ5How does contrastive adapting compare to state-of-the-art methods that require full-model retraining in terms of robustness and efficiency?
Key findings
- On 9 robustness benchmarks, contrastive adapters improved worst-group accuracy by 8.5 to 56.0 percentage points over zero-shot classification.
- On the CelebA dataset, contrastive adapters achieved 90.0% worst-group accuracy, compared to 74.0% for zero-shot and 89.6% for WiSE-FT, outperforming all baselines.
- Contrastive adapters reduced the worst-group accuracy gap to just 0.7 percentage points on CelebA, compared to 7.9 pp for zero-shot.
- On Waterbirds, the method achieved 83.7% worst-group accuracy, significantly outperforming zero-shot (49.8%) and ERM adapters (60.8%).
- The approach achieved performance comparable to state-of-the-art full-model retraining methods like WiSE-FT, while training only ≤1% of the model parameters.
- Contrastive adapters consistently improved robustness across all datasets, even in group-imbalanced settings where standard adapters failed.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.