Attacking Large Language Models with Projected Gradient Descent

Simon Geisler, Tom Wollschläger, M. H. I. Abdalla, Johannes Gasteiger, Stephan Günnemann
2/14/2024
cs.LG

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Current LLM alignment methods are readily broken through specifically crafted adversarial prompts. While crafting adversarial prompts using discrete optimization is highly effective, such attacks typically use more than 100,000 LLM calls. This high computational cost makes them unsuitable for, e.g., quantitative analyses and adversarial training. To remedy this, we revisit Projected Gradient Descent (PGD) on the continuously relaxed input prompt. Although previous attempts with ordinary gradient-based attacks largely failed, we show that carefully controlling the error introduced by the continuous relaxation tremendously boosts their efficacy. Our PGD for LLMs is up to one order of magnitude faster than state-of-the-art discrete optimization to achieve the same devastating attack results.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{geisler2024attacking,
  title  = {Attacking Large Language Models with Projected Gradient Descent},
  author = {Simon Geisler and Tom Wollschläger and M. H. I. Abdalla and Johannes Gasteiger and Stephan Günnemann},
  year   = {2024},
  eprint = {2402.09154},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.09154v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.09154.svg)](https://codeofpaper.com/paper/2402.09154)

Discussion