arXiv:2610.40309cs.CVOct 2026

Manuscript Offprint

arXiv:2610.40309

Textual Response-Aware Guidance for Zero-Shot Adversarial Robustness of Vision-Language Models

Yubo Cui, Xianchao Guan, Zheng Zhang

Abstract

Vision-language models (VLMs) exhibit strong zero-shot generalization but remain vulnerable to adversarial attacks. Existing adversarial fine-tuning methods often use pre-trained model guidance to preserve image-text alignment while improving robustness. Our analysis of visual representation drift reveals complementary limitations of two representative forms of guidance. Matching visual features provides broad coverage by constraining all directions equally, but lacks semantic emphasis. Matching prediction distributions prioritizes semantically relevant directions, but remains limited by the candidate texts and prediction probabilities. These limitations can hinder preservation of pre-trained image-text relationships and degrade zero-shot performance. To address these issues, we propose Textual Response-Aware Guidance (TRAG), which constrains visual representation drift using the pre-trained text encoder's responses to local variations in input embeddings. Specifically, TRAG constructs anchor-level constraints from the response directions and magnitudes around semantic anchors, then aggregates them using pre-trained image-anchor relevance, yielding an image-adaptive constraint. Extensive experiments across architectures and tasks demonstrate state-of-the-art clean and robust performance. Further analysis shows that TRAG helps preserve pre-trained image-text relationships.

1. Introduction

Vision-language models (VLMs) [32, 47] achieve strong zero-shot generalization through large-scale pre-training on image-text pairs. By aligning visual and textual representations in a shared embedding space, VLMs support applications such as image classification [51] and image-text retrieval [16], and provide visual backbones for large vision-language models (LVLMs) [22]. However, similar to conventional deep neural networks [9, 38], VLMs remain vulnerable to adversarial examples. Small, carefully crafted image perturbations can induce incorrect predictions, undermining model reliability [49, 50]. Adversarial fine-tuning improves robustness but can compromise zero-

Figure

Feature distance

Figure

Weighted text differences

Local text responses

Figure

(a) Feature matching

(b) Distribution matching

(c) TRAG (ours)

Figure 1. Directional constraints on visual representation drift. Thicker lower arrows indicate stronger penalties. (a) Feature matching constrains drift equally in all directions. (b) Prediction distribution matching weights directions associated with differences between candidate textual representations using pre-trained prediction probabilities. (c) TRAG constructs anchor-level constraints from local responses of the pre-trained text encoder and aggregates them using pre-trained image–anchor relevance.

shot generalization [27]. A central challenge is therefore to preserve the pre-trained image-text alignment underlying zero-shot transfer while improving adversarial robustness.

Existing methods often use guidance from the pre-trained model to preserve image-text alignment during adversarial fine-tuning. Some match visual features between the fine-tuned and pre-trained models [34, 42], whereas others match prediction distributions over candidate texts [5, 40]. Both forms of guidance aim to preserve pre-trained image-text relationships, which depend on projections of visual representations along different directions in the shared embedding space. For normalized representations, projections onto textual representations determine individual image-text similarities, while projections onto differences between textual representations determine relative similarities [32]. Changes in visual representations along different directions can affect these relationships differently. How guidance constrains these changes can therefore influence the preservation of image-text relationships.

From this perspective, we analyze both forms of guidance as directional constraints on drift from pre-trained visual representations, revealing complementary limitations. As illustrated in Figs. 1(a) and 1(b), matching visual features constrains drift equally in all directions, providing broad coverage but no semantic emphasis. Matching prediction distributions instead prioritizes semantically relevant directions associated with differences between candidate textual representations, but remains limited by the candidate texts and prediction probabilities. Zero-shot generalization, however, requires preserving diverse image-text relationships across unseen tasks. These limitations can leave such relationships insufficiently protected and degrade zero-shot performance. We therefore seek directional references for potential semantic variations to construct guidance with broad coverage and semantic emphasis.

To address these limitations, we propose Textual Response-Aware Guidance (TRAG), which uses local responses of the pre-trained text encoder to constrain visual representation drift. Using known texts as semantic anchors, we examine its responses to local variations in their input embeddings. As shown in Fig. 1(c), the response directions and magnitudes characterize local changes in textual representations, providing directional references for potential semantic variations beyond the given texts. With a fixed total weight for directional penalties, we derive anchor-level constraints by minimizing the average worst-case error in preserving image-text relationships associated with these local changes. Finally, we aggregate them using pre-trained image-anchor relevance on clean images, yielding an image-adaptive constraint for adversarial fine-tuning.

Extensive experiments demonstrate TRAG's state-of-the-art clean and robust performance. We validate these advantages across multiple VLM architectures on zero-shot classification and image-text retrieval, covering both class-supervised and image-text fine-tuning settings under multiple threat models. These benefits extend to image captioning and visual question answering in LVLMs. Further analyses and ablations show that TRAG helps preserve pre-trained image-text relationships during robust adaptation. Our main contributions are as follows:

• We analyze the directional constraints that feature matching and prediction distribution matching impose on visual representation drift, revealing complementary limitations in preserving pre-trained image-text relationships.

• We propose TRAG, which derives anchor-level constraints from local responses of the pre-trained text encoder and aggregates them using image-anchor relevance, yielding an image-adaptive constraint.

• We demonstrate state-of-the-art clean and robust performance across architectures and tasks, with analyses and ablations showing that TRAG helps preserve pre-trained image-text relationships.

References (49)