Closed-Loop Bidirectional Prompting for Adversarial Robustness of Vision Language Models

Xiao Liu, Jiaxiang Liu, Boci Peng, Boren Hu, Yusong Wang, Xiwen Chen, Prayag Tiwari, Liming Zhang, Mingkun XuarXiv 2026

TL;DR

Vision-Language Models (VLMs) like CLIP are highly vulnerable to adversarial attacks that break the alignment between text and images. This paper introduces Closed-Loop Bidirectional Prompting (CLBP), a defense mechanism that sets up a dynamic feedback loop between frozen vision and language encoders to mutually correct and denoise features at inference time. CLBP achieves state-of-the-art adversarial robustness across 11 datasets without requiring expensive encoder retraining or sacrificing clean accuracy.

What Problem Does This Paper Address?

Vision-Language Models rely on a joint embedding space where visual and textual features are tightly aligned. However, this cross-modal coupling is fragile: imperceptible adversarial perturbations added to an image can easily decouple the modalities, causing the model to misclassify inputs.

Existing defenses typically fall into two flawed paradigms:

  1. Adversarial Fine-Tuning (AFT): Modifies the weights of the visual encoder. While effective, it is computationally expensive and distorts the pre-trained feature space, which often hurts the model's ability to generalize to new domains.
  2. Adversarial Prompt Tuning (APT): Learns static, instance-agnostic prompts. These methods are prone to overfitting and fail to adapt to diverse, image-specific adversarial patterns.

Crucially, most existing methods are unidirectional—they adjust either the image or the text branch while treating the other as fixed context. They fail to exploit the bidirectional complementarity of vision and language to recover cross-modal alignment.

Figure 1: Comparison of prompt-learning paradigms. (a) AdvVLP inserts independent prompts in each modality with no cross-modal interaction (prone to overfitting). (b) AdvMaPLe adds a unidirectional text-to- vision projection but remains static, lacking visual feedback for instance-specific adaptation. (c) Our CLBP introduces a dynamic cross-modal feedback loop: lightweight networks align features across modalities to generate per-image defensive signals while keeping the pre-trained encoder frozen.

Methods

The authors propose Closed-Loop Bidirectional Prompting (CLBP), which keeps the pre-trained VLM encoders completely frozen and introduces a dynamic, instance-adaptive feedback loop driven by two lightweight adapters:

  • Step 0: Semantic Bootstrapping (The Anchor): To prevent the feedback loop from drifting away from the pre-trained semantic manifold, the loop is initialized and constrained by a Semantic Anchor—a static text feature generated from a generic class template (e.g., "a photo of a {class}").
  • Step 1: Text-to-Vision (T2V) Denoising: A lightweight T2V cross-attention network takes the text embeddings and generates dynamic visual prompts. These prompts are prepended to the input image patches, filtering out visual adversarial noise by conditioning the vision encoder on the stable language signal.
  • Step 2: Vision-to-Text (V2T) Refinement: The resulting visual features are passed to a V2T Multi-Layer Perceptron (MLP), which computes an instance-specific shift for the text prompt, tailoring the textual description to the specific image.

This loop can theoretically be iterated, but the authors prove mathematically (and show empirically) that due to the contractive nature of the loop around the semantic anchor, it converges rapidly—a single iteration ($N=1$) is sufficient.

Finally, to combat per-augmentation sampling noise, CLBP uses Multi-View Aggregation, passing multiple augmented views of the image through the pipeline and weighting their predictions using a similarity-weighted softmax.

Figure 2: The CLBP pipeline. Step 0 (Semantic Bootstrapping) initializes a fixed text anchor; Step 1 (Active Visual Denoising, T2V) filters image noise using the anchor; Step 2 (Instance-Adaptive Refinement, V2T) injects visual bias back into the text prompt, closing the loop. Final predictions are obtained by Multi-View Aggregation across augmented views; the model is trained with a tri-component loss.

Datasets

The approach was extensively evaluated across 11 diverse image datasets representing generic object recognition, fine-grained classification, scene recognition, action recognition, textures, and satellite imagery:

  • ImageNet-1k & Caltech101
  • OxfordPets, Flowers102, Food101, StanfordCars, & FGVC-Aircraft
  • SUN397 & UCF101
  • DTD (Describing Textures Dataset) & EuroSAT

Key Insights and Ideas

  • Mutual Regularization: Instead of trying to fix the image features in isolation, CLBP uses the text modality as a clean reference to denoise the visual features, which in turn refine the text features. This mutual conditioning acts as a powerful regularization constraint.
  • Fixed-Point Stability: Iterating a loop with two noisy branches normally risks error accumulation. By introducing the fixed Semantic Anchor, the authors prove via the Banach fixed-point theorem that the system forms a local contraction mapping.
  • Efficiency at Scale: Because the loop converges almost completely in the very first iteration, the computational overhead at inference time is minimal, avoiding the multi-step optimization common in other test-time defenses.

Key Results

The authors evaluated CLBP across three challenging regimes under white-box PGD attacks:

  • Cross-Dataset Zero-Shot Robustness: When trained on ImageNet and evaluated directly on 10 unseen datasets, CLBP achieved an average robust accuracy of 52.77%, outperforming the strongest test-time defense baseline (SCC at 49.71%) and doubling the performance of leading prompt-tuning methods like AdvMaPLe (24.37%).
  • No Clean Accuracy Penalty: Unlike adversarial fine-tuning, which degrades clean performance, CLBP maintained an average clean accuracy of 59.99% (+0.39% higher than vanilla CLIP).
  • Base-to-New Generalization: On unseen categories, CLBP retained 54.92% robust accuracy, a massive 33.06% improvement over the next best baseline (FAP), proving that the anchor-guided updates prevent the model from overfitting to training classes.

Limitations and Future Work

  • Architectural Scope: The current formulation is tailored specifically to CLIP-style dual-tower architectures where visual and textual branches are separate. Extending CLBP to deeper-fusion models (like BLIP) that feature intra-encoder cross-attention layers remains an open challenge.
  • Analytical Tightness: While the loop is highly contractive in practice (empirical Lipschitz constant $q \sim 10^{-4}$), the theoretical factorized bound presented in the paper is loose and could be tightened in future work.
  • Threat Model Variety: The evaluation focused primarily on digital $\ell_\infty$ perturbations. Testing CLBP against physical-world adversarial threats or patch-based attacks is left for future exploration.

Summary updated

BibTeX
@misc{liu2026closed,
  author = {Xiao Liu and Jiaxiang Liu and Boci Peng and Boren Hu and Yusong Wang and Xiwen Chen and Prayag Tiwari and Liming Zhang and Mingkun Xu},
  title = {{Closed-Loop Bidirectional Prompting for Adversarial Robustness of Vision Language Models}},
  year = {2026},
  eprint = {2605.25922},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.25922},
}
Figure