Inducing High Energy-Latency of Large Vision-Language Models with Verbose Images

Kuofeng Gao, Yang Bai, Jindong Gu, Shu-Tao Xia, Philip Torr, Zhifeng Li, Wei Liu

Abstract

Large Vision-Language Models (VLMs) are computationally intensive, with inference costs scaling linearly with output length. This paper investigates a novel security threat: "verbose images." These are adversarial inputs crafted to force VLMs into generating excessively long, hallucinated responses. By optimizing for delayed termination and token diversity, we demonstrate that attackers can significantly inflate energy consumption and latency, leading to potential Denial-of-Service (DoS) conditions. Our results show up to an 8.56× increase in sequence length across major open-source VLMs, highlighting a critical vulnerability in multi-modal AI deployment.

Introduction

Large Vision-Language Models (VLMs) like GPT-4, BLIP-2, and MiniGPT-4 have become central to multi-modal AI applications. However, their deployment is constrained by high computational costs; industry estimates suggest that inference accounts for over 90% of total machine learning demand. Because these models generate text token-by-token in an auto-regressive fashion, the time and energy required for a single request are directly proportional to the length of the generated output.

This research identifies a critical security gap: the "Verbose Image" attack. While previous "Sponge Sample" research focused on increasing internal calculation costs, this work targets the output length of multi-modal models. By forcing a VLM to generate a lengthy essay instead of a brief caption, an attacker can exhaust a service provider's computational resources, spike operational costs, and degrade service quality for legitimate users.

Methodology

The authors propose a method to craft imperceptible perturbations (noise) added to an image to induce verbosity. This is achieved using three specialized loss functions optimized via Projected Gradient Descent (PGD):

  1. Delayed EOS Loss: This targets the "End-of-Sequence" (EOS) token. By minimizing the probability of the model generating the stop signal, the model is forced to continue generating tokens.
  2. Uncertainty Loss: To prevent the model from falling into simple repetitive loops, this loss maximizes the entropy of the output distribution. It pushes the model toward a uniform distribution of possible next tokens, breaking the standard dependencies that lead to a natural conclusion.
  3. Token Diversity Loss: Operating at the sequence level, this loss maximizes the "rank" (approximated via the nuclear norm) of the hidden states of all generated tokens. This encourages the model to explore a wider, more diverse vocabulary.

To manage these competing objectives, the researchers introduced a Temporal Weight Adjustment algorithm, which dynamically shifts the importance of each loss function over the course of the optimization iterations to ensure convergence.

Experimental Setup

The attack was evaluated on two primary benchmarks:

  • MS-COCO: 1,000 randomly selected images for image captioning tasks.
  • ImageNet: 1,000 randomly selected images from the standard classification dataset.

Testing was conducted across four prominent open-source VLMs: BLIP, BLIP-2, InstructBLIP, and MiniGPT-4.

Key Insights and Results

The Linear Cost of Chatting

A central finding of the study is the nearly perfect linear relationship between the number of tokens generated and the resulting energy and latency costs. This makes output length the most effective lever for an attacker to manipulate resource consumption.

Linear relationship between output length and energy/latency costs across different models.

Quantitative Impact

The results of the verbose image attack are significant:

  • Sequence Length: Average sequence length increased by 7.87× on MS-COCO and 8.56× on ImageNet.
  • Energy Consumption: For BLIP-2, energy consumption per inference rose from approximately 16 Joules to over 321 Joules.
  • Latency: Response times for MiniGPT-4 increased from roughly 10 seconds to 67 seconds per image.
  • Hallucination Rates: The CHAIR score (a metric for object hallucination) increased by up to 70%, as the models were forced to invent details to sustain the lengthy output.

Attention Dispersion and Model Defense

Using Grad-CAM visualizations, the authors observed that while normal images cause the model to focus on specific objects, verbose images cause the model's attention to smear uniformly across the entire image. This "loss of focus" directly contributes to the rambling, hallucinated output.

Interestingly, instruction-tuned models like MiniGPT-4 occasionally resisted the attack by becoming confused and outputting a standard refusal: "I am sorry, but I cannot describe the image." This suggests that higher-level reasoning capabilities may provide an accidental defense against low-level token manipulation.

Conclusion

While the attack is highly effective in white-box settings, its transferability to black-box environments remains a challenge. However, the potential for joint attacks on both image and text prompts suggests even greater risks. This research serves as a critical warning for the deployment of VLMs at scale: a model's verbosity is not just a stylistic trait, but a significant security liability that requires robust monitoring and defense strategies.

Summary updated

BibTeX
@inproceedings{gao2024inducing,
  author = {Kuofeng Gao and Yang Bai and Jindong Gu and Shu-Tao Xia and Philip Torr and Zhifeng Li and Wei Liu},
  title = {{Inducing High Energy-Latency of Large Vision-Language Models with Verbose Images}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=BteuUysuXX},
}
Figure