Abstract
Vision-Language Models (VLMs) are increasingly deployed in real-world applications, but their high inference cost makes them vulnerable to resource consumption attacks. Prior attacks attempt to extend VLM output sequences by optimizing adversarial images, thereby increasing inference costs. However, these extended outputs often introduce irrelevant abnormal content, compromising attack stealthiness. This trade-off between effectiveness and stealthiness poses a major limitation for existing attacks. To address this challenge, we propose Hidden Tail, a stealthy resource consumption attack that crafts prompt-agnostic adversarial images, inducing VLMs to generate maximum-length outputs by appending special tokens invisible to users. Our method employs a composite loss function that balances semantic preservation, repetitive special token induction, and suppression of the end-of-sequence (EOS) token, optimized via a dynamic weighting strategy. Extensive experiments show that Hidden Tail outperforms existing attacks, increasing output length by up to 19.2$\times$ and reaching the maximum token limit, while preserving attack stealthiness. These results highlight the urgent need to improve the robustness of VLMs against efficiency-oriented adversarial threats.
Introduction: The Vulnerability of Inference Efficiency
Vision-Language Models (VLMs) like Qwen and Gemini are becoming central to modern AI infrastructure, powering everything from automated image captioning to complex Retrieval-Augmented Generation (RAG) pipelines. However, their high computational requirements introduce a significant security risk: resource consumption attacks. These attacks, often termed "Denial-of-Wallet," aim to inflate inference costs by forcing models to generate excessively long outputs, potentially leading to service degradation or financial exhaustion for providers.
The Stealth-Efficiency Trade-off
Previous attempts at resource exhaustion have struggled with a fundamental trade-off between effectiveness and stealth. Attacks such as VLMInferSlow or Verbose Image can increase output length, but they often do so by inducing the model to output repetitive, nonsensical, or visibly "verbose" text. This lack of stealth makes the attack easy to detect by both automated filters and human users.
Furthermore, most existing attacks are prompt-dependent, requiring the attacker to know the exact query a user will provide. In a real-world scenario where a malicious image is uploaded to a public platform, the attacker cannot predict the user's prompt, making these methods less practical for widespread distribution.
Methodology: Crafting the Hidden Tail
To overcome these hurdles, the authors propose Hidden Tail. This attack crafts prompt-agnostic adversarial images that induce VLMs to generate maximum-length outputs by appending special tokens (e.g., <BOS>, <|im_start|>) that are typically filtered out and remain invisible to the end-user.
The attack utilizes a composite loss function optimized via Projected Gradient Descent (PGD) with three distinct goals:
- Semantic Consistency Loss ($L_{sem}$): Ensures the visible portion of the response remains accurate to the image and prompt, maintaining the illusion of a normal interaction.
- Hidden Tail Induction Loss ($L_{spe}$): Forces the model into a self-reinforcing loop where it repeatedly generates specific special tokens.
- EOS Suppression Loss ($L_{eos}$): Explicitly penalizes the probability of the "End-of-Sequence" (EOS) token, preventing the model from stopping until it hits the hard system limit (e.g., 2048 tokens).
A Dynamic Loss Weighting strategy is employed to balance these often-conflicting objectives in real-time, ensuring the attack remains both effective and stealthy throughout the optimization process.
Key Results and Stealth Evaluation
The researchers evaluated Hidden Tail against state-of-the-art models including Qwen2.5-VL, MiMo-VL, and Gemma3. The results demonstrate a significant leap in attack performance. On Qwen2.5-VL, Hidden Tail increased output length by an average of 19.2$\times$, consistently hitting the system's hard limit of 2048 tokens.
Crucially, the attack maintains near-perfect stealth. Human-proxy evaluations using GPT-4o-mini showed that the quality of the visible response remained indistinguishable from that of a clean image, scoring approximately 4.7/5. In contrast, previous "Verbose Image" attacks saw quality scores drop significantly because the output was filled with visible gibberish.
Conclusion and Future Outlook
Hidden Tail exposes a critical vulnerability in how VLMs handle internal control tokens. By exploiting the gap between model computation and user-facing output, attackers can silently drain resources without alerting the user. While currently limited by white-box requirements and high optimization costs, the success of Hidden Tail underscores the need for more robust VLM architectures and better filtering of internal token sequences in production environments. Future work may explore "black-box" versions of this attack that do not require full access to the target model's weights.
Summary updated