Skip to main content
QUICK REVIEW

[Paper Review] Black Box Adversarial Prompting for Foundation Models

Natalie Maus, Patrick Chao|arXiv (Cornell University)|Feb 8, 2023
Generative Adversarial Networks and Image SynthesisComputer Science13 citations
TL;DR

The paper presents a black-box framework that discovers adversarial prompts for both vision and language foundation models by mapping continuous embeddings to discrete tokens via Token Space Projection, and optimizes prompts with Square Attack and Bayesian Optimization.

ABSTRACT

Prompting interfaces allow users to quickly adjust the output of generative models in both vision and language. However, small changes and design choices in the prompt can lead to significant differences in the output. In this work, we develop a black-box framework for generating adversarial prompts for unstructured image and text generation. These prompts, which can be standalone or prepended to benign prompts, induce specific behaviors into the generative process, such as generating images of a particular object or generating high perplexity text.

Motivation & Objective

  • Motivate the study of adversarial prompts in a black-box setting for general vision and language tasks.
  • Introduce a Token Space Projection technique to bridge continuous embeddings with discrete language tokens.
  • Develop and evaluate optimization methods to search for adversarial prompts under different threat models.
  • Demonstrate that small prompt augmentations can steer model outputs toward targeted classes or behaviors.

Proposed method

  • Define adversarial prompts and formulate a loss-based objective over generated responses.
  • Introduce Token Space Projection to map continuous embeddings to discrete prompts via closest-token projection.
  • Optimize over embedding space using black-box optimizers (Square Attack and TuRBO) with EMR relaxation.
  • Evaluate two prompt classes (standalone and prepended) under classifier and feature loss targets.
  • Apply restricted prompt settings to avoid high-similarity tokens and study prepended prompts to predefined seeds.
(a) Images generated by Stable Diffusion v1.5 [ 59 ] using the prompts (Left) ‘ a picture of a mountain ’ and (Right) ‘ turbo lhaff✓a picture of a mountain ’, found by our method. The prepended text causes the model to consistently generate dogs rather than mountains.
(a) Images generated by Stable Diffusion v1.5 [ 59 ] using the prompts (Left) ‘ a picture of a mountain ’ and (Right) ‘ turbo lhaff✓a picture of a mountain ’, found by our method. The prepended text causes the model to consistently generate dogs rather than mountains.

Experimental results

Research questions

  • RQ1Can adversarial prompts be found in a black-box setting for both image and text generation tasks?
  • RQ2How effective is Token Space Projection in enabling black-box optimization over discrete prompt spaces?
  • RQ3What threat models and loss functions enable reliable adversarial prompting for vision and language models?
  • RQ4How do black-box optimizers perform in high-dimensional prompt spaces compared to baseline approaches?

Key findings

  • Adversarial prompts can be found in a black-box setting for both text-to-image and text generation tasks.
  • Token Space Projection enables effective optimization over discrete token spaces using continuous embeddings.
  • Two black-box optimizers (Square Attack and TuRBO) demonstrate success under various tasks and threat models.
  • Adversarial prompts can steer image generation toward targeted classes and generate incoherent or high-perplexity text.
  • Restricting prompts by excluding high-similarity tokens increases task difficulty but remains feasible.
(a) Task 2 generated images with the class lizard .
(a) Task 2 generated images with the class lizard .

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.