Attention Hijacking: Response Manipulation Across Queries in Vision-Language Models

Zhiqiang Wang, Dongrui Liu, Yan Li, Zonghao Ying, Wei Xue, Wenhan Luo, Yike Guo · 2026

Read Attention Hijacking: Response Manipulation Across Queries in Vision-Language Models by Zhiqiang Wang, Dongrui Liu, Yan Li, Zonghao Ying, Wei Xue, Wenhan Luo, Yike Guo (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-17310.txt.

Introduction

Wang and colleagues study adversarial attacks on vision-language models that must work across many user queries, not just one. They find transfer hinges on keeping an image-dominant attention pattern during generation. Their Attention Hijacking attack steers attention toward that pattern, boosting visual tokens and damping textual rivals. Tests show it lifts cross-query transfer across varied targets and unseen queries, and extends to several attack settings.

Catalog record

CREATORZhiqiang Wang, Dongrui Liu, Yan Li, Zonghao Ying, Wei Xue, Wenhan Luo, Yike Guo
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE81903
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.17310

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Attention Hijacking: Response Manipulation Across Queries in Vision-Language Models Zhiqiang Wang, Dongrui Liu, Yan Li, Zonghao Ying, Wei Xue, Wenhan Luo, Yike Guo Abstract Existing adversarial attacks on vision-language models (VLMs) can steer model outputs toward attacker-specified target responses, but their effectiveness often degrades when the same perturbed input is paired with different textual queries. This paper studies cross-query response manipulation, where a single adversarial example is expected to remain effective across diverse user queries. We first analyze the limitations of existing attacks and find that successful transfer is closely associated with preserving an image-dominant attention pattern during response generation. Motivated by the observation, we propose Attention Hijacking , a novel adversarial attack that explicitly steers internal attention distributions toward a persistent image-dominant pattern. By amplifying the influence of visual tokens on target response tokens while suppressing the competing influence of textual tokens, our method reduces the dependence of the manipulated output on the specific wording of the query. Extensive experiments on widely used VLMs show that Attention Hijacking substantially improves cross-query transferability across diverse target responses and unseen queries. The method also extends effectively to multiple attack scenarios, offering new insights into the role of attention stability in transferable response manipulation for VLMs. 1 Introduction Vision language models (VLMs) 23 ; 4 ; 9 ; 25 have recently achieved remarkable progress, driven by increased data availability and computational power. As these models are increasingly used as response-generation systems, their outputs are now relied upon in a wide range of applications, including autonomous driving, public security, healthcare, finance, and other domains. Furthermore, VLM-powered chatbots 28 ; 3 ; 10 , which answer user questions and interpret visual inputs, are becoming widely used in everyday life. This growing reliance makes the risk of malicious response manipulation an important security concern. Recent studies 29 ; 39 have shown that such adversarial vulnerabilities also exist in VLMs, raising significant concerns regarding security and privacy. The conventional adversarial attack paradigm 31 ; 26 ; 12 can be directly applied to vision-language models by manipulating the output logits of the language model. Recent studies 29 ; 39 have further shown that adversarial attacks on user queries, which typically consist of an image and a textual question, can successfully steer model responses toward attacker-specified targets. However, since these methods are optimized for a specific image-question pair, their effectiveness often degrades in dynamic settings where a fixed image may be paired with diverse user questions. We therefore raise a more challenging and practical question: Can a single attack generalize across diverse queries? As illustrated in Figure 1 , taking the target response “Sorry, I cannot assist with it.” as an example, a single attack applied to the image can cause the model to output the same target response across a wide range of paired unseen questions. We then conduct an in-depth analysis of the cross-query transferability of existing attack methods, as shown in Figure 2 . We find that, during adversarial optimization, the attention allocation from input tokens to response tokens evolves dynamically in intermediate language-model layers. In particular, certain layers and attention heads gradually shift toward an image-dominant pattern, where response tokens attend more to image tokens than to textual tokens. When the optimized adversarial images are paired with different user questions, successful transfer cases preserve this image-dominant pattern, whereas failed cases exhibit a breakdown of such dominance. These observations suggest that internal attention distribution is closely tied to both initial attack success and cross-query transferability. Motivated by this finding, we propose Attention Hijacking, a novel attack for cross-query response manipulation that explicitly establishes a transferable, image-dominant response-generation pattern. During adversarial optimization, Attention Hijacking amplifies the attention from image tokens to target response tokens across the layers and heads of the language model, while suppressing the competing influence of textual tokens. By enforcing this pattern, the optimized adversarial image becomes the primary driver of the target response, reducing the model’s dependence on the specific wording of the paired question. As a result, a single adversarial image can remain effective across diverse user questions and consistently induce the intended target response. In addition, to mitigate late-stage optimization instability, we introduce a dynamic step-size scheduling strategy that stabilizes the optimization trajectory and improves reliability. We evaluate the proposed Attention Hijacking on multiple widely used vision-language models, under diverse target responses and different types of unseen queries. The experimental results demonstrate that our method consistently enables a single adversarial example to remain effective across challenging cross-query transfer settings. Furthermore, we extend our approach to additional attack scenarios, including text-centric attacks, jailbreaking, hallucination, and sponge example, where it consistently outperforms baseline methods in cross-query transferability. These results validate that the proposed attention reallocation strategy plays a critical role in improving adversarial transferability and is broadly applicable to adversarial attacks in vision-language settings. Our contributions are threefold: • We identify the limitations of existing adversarial attacks in cross-query settings, showing that transfer failure is associated with the instability of induced attention patterns. • We propose Attention Hijacking, a novel attack method that explicitly steers attention distributions across model layers to establish a transferable, image-dominant response-generation pattern, substantially improving cross-query transferability. • We conduct extensive experiments across multiple datasets and settings, showing that our method is effective in diverse scenarios and consistently enhances cross-query transferability. Figure 1 : Inducing predefined target response, “Sorry, I cannot assist with it”, in VLMs through adversarially modifying the input image using Attention Hijacking attack. The modified (optimized) image can also induce predefined response when paired with different questions in a query. 2 Preliminary 2.1 Notations Given a vision-language model (VLM) f that comprises a vision encoder \mathcal{E}_{I} , a text encoder \mathcal{E}_{T} and a decoder \mathcal{D} , a user query is defined by an image x and a textual question q , and the model processes the query to generate a response in the form of a token sequence, formally expressed as \mathcal{D}(\mathcal{E}_{I}(x),\mathcal{E}_{T}(q)) . In this work, we focus on the widely adopted decoder-only large language model (LLM) as the decoder. Specifically, the image x is first encoded by the vision encoder into a sequence of visual tokens I=\{x_{1},x_{2},...,x_{N_{I}}\} . Simultaneously, the textual input q is tokenized into a sequence of text tokens Q=\{q_{1},q_{2},...,q_{N_{Q}}\} . These visual and text token sequences are then concatenated and fed into the decoder \mathcal{D} , which is composed of a stack of transformer blocks based on self-attention. The decoder autoregressively generates a sequence of output tokens \hat{Y}=\{\hat{y}_{1},\hat{y}_{2},...,\hat{y}_{N_{\hat{Y}}}\} , where each token \hat{y}_{t} is conditioned on the visual and text inputs as well as all previously generated tokens \hat{y}_{<t} . Formally, at decoding step t , the output probability is given by P\left(\hat{y}_{t}\mid x,q,\hat{y}_{<t}\right). (1) Thus, the overall token-level generation process can be expressed as: f(\hat{Y}\mid x,q)=\prod_{t=1}^{N_{\hat{Y}}}P(\hat{y}_{t}\mid x,q,\hat{y}_{<t}). (2) Finally, the token sequence Y is then detokenized into the final response. 2.2 Threat Model We consider a white-box scenario in which the attacker has complete knowledge of the victim vision-language model (VLM). Given a user query consisting of an image and a textual question, the attacker aims to construct an adversarial example by applying imperceptible perturbations to the image. The goal is to manipulate the VLM’s response toward a pre-specified target.

Read the complete text