Soft Prompts Go Hard: Steering Visual Language Models with Hidden Meta-Instructions

Tingwei Zhang, Collin Zhang, John X. Morris, Eugene Bagdasaryan, Vitaly Shmatikov · OpenReview

Abstract

We introduce a new type of indirect injection attacks against language models that operate on images: hidden ''meta-instructions'' that influence how the model interprets the image and steer the model's outputs to express an adversary-chosen style, sentiment, or point of view. We explain how to create meta-instructions by generating images that act as soft prompts. In contrast to jailbreaking attacks and adversarial examples, outputs produced in response to these images are plausible and based on the visual content of the image, yet also satisfy the adversary's (meta-)objective. We evaluate the efficacy of meta-instructions for multiple visual language models and adversarial meta-objectives, and demonstrate how they can ''unlock'' capabilities of the underlying language models that are unavailable via explicit text instructions. We describe how meta-instruction attacks could cause harm by enabling creation of malicious, self-interpreting content that carries spam, misinformation, and spin. Finally, we discuss defenses.

Introduction: The Rise of Semantic Steering

As Visual Language Models (VLMs) like LLaVA and GPT-4o are increasingly integrated into search engines and personal assistants, they are tasked with interpreting complex visual data, such as financial charts and news photographs. This integration introduces a critical vulnerability: indirect prompt injection.

Traditional adversarial attacks on VLMs have typically focused on "jailbreaking" (eliciting toxic content) or "string injection" (forcing a specific, often nonsensical output). These attacks are often conspicuous because the model’s response loses contextual relevance to the image or the user's query. This research identifies a more subtle and insidious threat: semantic steering. By embedding hidden "meta-instructions" within image pixels, an adversary can force a VLM to adopt a specific sentiment, political bias, or persona while remaining helpful and contextually coherent.

Methodology: Images as Soft Prompts

The core of this attack lies in creating "self-interpreting" images using perturbations that function as cross-modal soft prompts. Unlike discrete text tokens (hard prompts), soft prompts are continuous vectors within the model's embedding space, allowing for more nuanced control over the underlying Large Language Model (LLM).

The attack pipeline for injecting hidden meta-instructions into images.

To generate these images, the researchers employed a three-step process:

  1. Synthetic Dataset Generation: Using GPT-4, they created a dataset of questions and "target" answers for specific images, with answers conditioned on adversarial meta-instructions (e.g., "Talk with a positive spin").
  2. Optimization via PGD: They used Projected Gradient Descent (PGD) to find a nearly invisible perturbation ($\delta$) for the original image. The optimization goal was to minimize the cross-entropy loss between the VLM’s output and the adversary’s target answer.
  3. Cross-Modal Injection: This perturbation bypasses the text-based instruction-following layer, reaching the LLM directly through the visual encoder. This allows the adversary to influence the model's "internal state" before it even processes the user's text query.

Key Insights: Stealth and Unlocked Capabilities

One of the most significant findings is that meta-instructions can "unlock" capabilities of the base LLM that are otherwise suppressed during the VLM's instruction-tuning phase. For example, while a model might refuse a direct text command to "speak like Harry Potter," a self-interpreting image can successfully trigger this persona. This suggests that visual soft prompts can navigate around safety filters or behavioral constraints applied to the text modality.

Examples of steering a VLM's interpretation of a stock chart using various meta-instructions.

Furthermore, these attacks prioritize semantic preservation. Unlike standard adversarial examples that cause misclassification (e.g., seeing a cat as a dog), these attacks maintain the "ground truth" of the image. The model correctly identifies the objects but alters its interpretation of their significance—such as framing a sharp decline in a stock chart as a "buying opportunity" rather than a financial failure.

Experimental Results

The efficacy of these attacks was tested across several open-source models, including MiniGPT-4, LLaVA, and InstructBLIP, using images from MS COCO and ImageNet benchmarks.

  • High Success Rates: The attacks frequently outperformed explicit text instructions. For instance, on MiniGPT-4, the attack achieved a 51% success rate for injecting spam, compared to only 36% for explicit instructions.
  • Transferability: Perturbations optimized for one model (e.g., MiniGPT-4) often successfully transferred to others (LLaVA, InstructBLIP) and even showed limited efficacy against closed-source models like GPT-4o.
  • Contextual Coherence: Evaluation by "Oracle" LLMs confirmed that the steered responses remained contextually relevant to user questions 96-97% of the time, making the adversarial "spin" difficult for a user to detect.

Conclusion and Future Work

The discovery of hidden meta-instructions reveals a broad new frontier for multi-modal security. While defenses like JPEG compression or diffusion-based purification offer some protection, they can be bypassed by adaptive attackers. Future research must address the human element—determining how effectively these "spun" narratives can persuade users—and investigate whether similar soft prompt injections can be applied to other modalities, such as audio-language models.

Summary updated

BibTeX
@inproceedings{zhang2025soft,
  author = {Tingwei Zhang and Collin Zhang and John X. Morris and Eugene Bagdasaryan and Vitaly Shmatikov},
  title = {{Soft Prompts Go Hard: Steering Visual Language Models with Hidden Meta-Instructions}},
  booktitle = {USENIX Security},
  year = {2025},
}
Figure