TL;DR
AdvCLIP-LoRA is the first framework to bring adversarial training to Vision-Language Models (VLMs) like CLIP using Low-Rank Adaptation (LoRA) in few-shot settings. By solving a minimax optimization problem over low-rank adapter matrices and adversarial image perturbations, it dramatically improves adversarial robustness while preserving high clean accuracy—consistently outperforming existing adversarial prompt-tuning baselines.
What Problem Does This Paper Address?
Pretrained vision-language models such as CLIP achieve remarkable zero-shot and few-shot classification capabilities, but they inherit deep neural networks' extreme vulnerability to adversarial attacks: tiny, human-imperceptible perturbations can cause catastrophic drops in accuracy.
While Parameter-Efficient Fine-Tuning (PEFT) has become the standard for downstream adaptation, existing adversarial adaptation methods for VLMs predominantly rely on prompt tuning (optimizing soft textual or visual prompt tokens). These prompt-based defenses suffer from two core weaknesses:
- Severe clean accuracy degradation: Especially in extreme few-shot regimes (1–4 shots), robust prompt-tuning often degrades clean performance well below that of out-of-the-box zero-shot CLIP.
- Poor robustness in low-shot regimes: Prompt tuning typically struggles to learn effective robust representations with very few training examples per class.
Full adversarial fine-tuning of billion-parameter models is computationally prohibitive. Thus, a method is needed that offers robust, parameter-efficient downstream adaptation without sacrificing clean predictive power.
Methods
The authors formulate adversarial adaptation via LoRA as a stochastic minimax optimization problem: $$\min_{A, B} \max_{\delta \in \Delta} f(W_0 + BA, \, \delta)$$ where $W_0$ represents frozen pre-trained weights, $B$ and $A$ are low-rank LoRA matrices ($r \ll d$), and $\delta$ is an $\ell_\infty$-bounded input perturbation.
Key technical elements include:
- Minimax Alternating Optimization: An inner loop performs $\tau$ steps of Projected Gradient Descent (PGD) to find worst-case image perturbations. The outer loop optimizes the low-rank matrices $A$ and $B$ across both visual and textual transformer backbones.
- Adaptive Step Sizes: To overcome gradient vanish early in training, the perturbation step size scales inversely with perturbation magnitude ($\eta_\delta = 0.05 / \|\delta_t\|_2$), acting as implicit noise regularization before settling to a fixed schedule.
- Theoretical Convergence Guarantees: The authors establish that under standard non-convex, strongly-concave assumptions, the algorithm reaches an $\epsilon$-stationary point of the primal objective in $\mathcal{O}(\epsilon^{-2})$ iterations with $\mathcal{O}(\epsilon^{-4})$ stochastic gradient complexity, matching classical minimax optimization rates.
Datasets
The approach is benchmarked on 8 standard vision datasets across several downstream tasks:
- Generic object recognition: ImageNet-1K, Caltech101
- Texture recognition: DTD
- Fine-grained classification: OxfordPets, Flowers102, Food101
- Scene recognition: SUN397
- Action recognition: UCF101
No new datasets were introduced; evaluations followed standard few-shot, base-to-new generalization, and cross-dataset transfer splits.
Key Insights and Ideas
- LoRA breaks the prompt-tuning trade-off: Prompt tuning injects inductive bias only at token inputs, which often fails to constrain downstream representation space under attack. Applying low-rank adapters directly to internal model weights achieves stronger adversarial invariance without collapsing natural task representations.
- Multi-modal, all-layer adaptation is vital: Restricting LoRA to just the visual encoder or specific network depths (e.g., top or bottom half) consistently degrades performance compared to inserting adapters across all layers of both encoders.
- Value projections carry the heavy load: Ablating attention targets reveals that updating the value matrices ($W_v$) alone captures almost all the performance gains of adapting all attention weights ($W_q, W_k, W_v$).
- Compact footprint suffices: A LoRA rank as small as $r=2$ is enough to dramatically outshine prompt baselines, keeping the trainable parameter count tiny.
Key Results
Evaluated on ViT-B/16 and ViT-B/32 architectures under 100-step PGD attacks:
- Few-Shot Classification (1-shot, ViT-B/32): AdvCLIP-LoRA achieves 73.80% clean and 30.30% PGD accuracy averaged over 8 datasets, substantially surpassing the best adversarial prompt-tuning baseline (FAP: 40.14% clean / 10.22% PGD; APT: 59.07% clean / 5.08% PGD).
- Adversarial Base-to-New Generalization (16-shot): On unseen classes, AdvCLIP-LoRA delivers 69.45% clean and 34.71% PGD accuracy, outperforming the strongest baseline (FAP at 49.58% clean / 21.86% PGD).
- Zero-Shot Cross-Dataset Transfer: Fine-tuned solely on 16-shot ImageNet-1K, AdvCLIP-LoRA transfers across seven downstream datasets with minimal clean accuracy loss (63.97%) while yielding the highest robust accuracy (31.15% PGD).
Limitations and Future Work
- Inner-Loop Overhead: Adversarial training requires multi-step PGD in the inner loop, which increases wall-clock training time compared to standard, non-robust LoRA fine-tuning.
- High-Shot Adversarial Ceiling: In 16-shot training with small inner steps ($\tau=2$), PGD accuracy slightly trails FAP on ViT-B/32 (37.28% vs. 39.22%), though running more inner steps ($\tau \ge 10$) restores the lead.
- Task Scope: The evaluation focuses primarily on image classification. Extending this minimax LoRA formulation to vision-language generation (e.g., visual question answering or multimodal instruction-tuned models like LLaVA) remains unexplored.
Summary updated