Attacking Large Language Models with Projected Gradient Descent

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Geisler, Simon, Wollschläger, Tom, Abdalla, M. H. I., Gasteiger, Johannes, Günnemann, Stephan
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866916637100212224
author Geisler, Simon
Wollschläger, Tom
Abdalla, M. H. I.
Gasteiger, Johannes
Günnemann, Stephan
author_facet Geisler, Simon
Wollschläger, Tom
Abdalla, M. H. I.
Gasteiger, Johannes
Günnemann, Stephan
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2402_09154
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Attacking Large Language Models with Projected Gradient Descent
Geisler, Simon
Wollschläger, Tom
Abdalla, M. H. I.
Gasteiger, Johannes
Günnemann, Stephan
Machine Learning
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.
title Attacking Large Language Models with Projected Gradient Descent
topic Machine Learning
url https://arxiv.org/abs/2402.09154