PreprintCited by 246Adversarial Robustness in Machine LearningSpeech Recognition and SynthesisSecurity and Verification in Computing

Universal and Transferable Adversarial Attacks on Aligned Language Models

Open access
Zou, Andy, Wang, Zifan, Carlini, Nicholas, Nasr, Milad, Kolter, J. Zico, Fredrikson, Matt·2023·arXiv

Abstract

Because "out-of-the-box" large language models are capable of generating a great deal of objectionable content, recent work has focused on aligning these models in an attempt to prevent undesirable generation. While there has been some success at circumventing these measures -- so-called "jailbreaks" against LLMs -- these attacks have required significant human ingenuity and are brittle in practice. In this paper, we propose a simple and effective attack method that causes aligned language models to generate objectionable behaviors. Specifically, our approach finds a suffix that, when attached to a wide range of queries for an LLM to produce objectionable content, aims to maximize the probability that the model produces an affirmative response (rather than refusing to answer). However, instead of relying on manual engineering, our approach automatically produces these adversarial suffixes by a combination of greedy and gradient-based search techniques, and also improves over past automatic prompt generation methods. Surprisingly, we find that the adversarial prompts generated by our approach are quite transferable, including to black-box, publicly released LLMs. Specifically, we train an adversarial attack suffix on multiple prompts (i.e., queries asking for many different types of objectionable content), as well as multiple models (in our case, Vicuna-7B and 13B). When doing so, the resulting attack suffix is able to induce objectionable content in the public interfaces to ChatGPT, Bard, and Claude, as well as open source LLMs such as LLaMA-2-Chat, Pythia, Falcon, and others. In total, this work significantly advances the state-of-the-art in adversarial attacks against aligned language models, raising important questions about how such systems can be prevented from producing objectionable information. Code is available at github.com/llm-attacks/llm-attacks.

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

DataCite · 10.48550/arxiv.2307.15043

Cites

0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • In black-box settings, the attacker has no access to model parameters or gradients, relying solely on agent responses, which makes gradient-based optimization techniques ineffective.

    “The attacker has no access to the model's parameters or gradients, relying solely on the agent's responses to adversarial inputs, which makes gradient-based optimization techniques (Zou et al., 2023) ineffective.”

    From AdvAgent: Controllable Blackbox Red-teaming on Web Agents (2024) · cites this paper as Zou et al., 2023

    Section 2.2 describes Zou et al.’s gradient-based optimization method, and the Introduction reports that its prompts successfully attacked GPT-3.5 and GPT-4 through transfer. The claim that gradient-based techniques are ineffective in black-box settings overlooks this distinction: the paper uses gradients from accessible models to generate attacks that transfer to proprietary targets. (LLM, conf=0.86)

    Checked by a reasoning model — may be wrong.

    Experimental — accuracy not yet measured
  • Existing LLM red teaming focuses on red teaming the model by generating inputs that lead to undesirable behavior, absent monitoring or other countermeasures.

    “Existing LLM red teaming focuses on red teaming the model by generating inputs that lead to undesirable behavior, absent monitoring or other countermeasures (Perez et al., 2022; Wei et al., 2023; Zou et al., 2023).”

    From AI Control: Improving Safety Despite Intentional Subversion (2023) · cites this paper as Zou et al., 2023

    Section 3, “Experimental Results: Direct and Transfer Attacks” (page unavailable), describes generating attacks to elicit harmful model output and calls the task a red-teaming exercise. But the claim’s “absent monitoring or other countermeasures” qualification is not fully supported: Section 3.3 discusses an input content filter on Claude and adapting attacks to evade it. (LLM, conf=0.82)

    Experimental — accuracy not yet measured
  • AI security has remained largely model-centric, focused on single-agent attack surfaces and adversarial samples.

    “AI security, by contrast, has remained largely model-centric, focused on single-agent attack surfaces and adversarial samples (Biggio et al., 2012;Szegedy et al., 2014;Zou et al., 2023).”

    From Open Challenges in Multi-Agent Security: Towards Secure Systems of Interacting AI Agents (2025) · cites this paper as Zou et al., 2023

    The Introduction describes extensive work on adversarial attacks against machine-learning models, and “Adversarial examples & transferability” calls adversarial examples a subject of extensive research. The paper also tests attacks on individual models (§3.1), but it does not characterize AI security as a whole as largely model-centric or establish a focus on single-agent attack surfaces. Page numbers are unavailable in our copy. (LLM, conf=0.82)

    Experimental — accuracy not yet measured
  • Advanced AI promises to lower the cost and broaden the scope of coercion and extortion-whether by exposing private data through surveillance or by mounting cyber-offensive operations against rival agents-potentially weaponizing adversarial attacks, jailbreaks, and resource denial at scale.

    “Moreover, advanced AI promises to lower the cost and broaden the scope of coercion and extortion -whether by exposing private data through surveillance or by mounting cyber-offensive operations against rival agents -potentially weaponizing adversarial attacks, jailbreaks, and resource denial at scale (Ellsberg, 1968;Harrenstein et al., 2007;Zou et al., 2023;Gleave et al., 2020;Brundage et al., 202”

    From Open Challenges in Multi-Agent Security: Towards Secure Systems of Interacting AI Agents (2025) · cites this paper as Zou et al., 2023

    The Introduction and §3.3 Discussion describe jailbreaks and automated adversarial attacks on language models, and the transfer results show attacks eliciting harmful responses across multiple models. The Ethics and Broader Impact section warns that these techniques could help generate harmful content. The paper does not establish the broader claim that AI lowers the cost of coercion or extortion through surveillance, cyber-offensive operations, or resource denial at scale. (LLM, conf=0.85)

    Experimental — accuracy not yet measured
  • OpenAI appeared to patch its system to prevent adversarial attacks with specific suffixes discovered in Zou, Wang, et al. (2023), but the underlying vulnerability may still persist.

    “For instance, OpenAI appeared to patch its system to prevent adversarial attacks with specific suffixes discovered in Zou, Wang, et  al.  (2023), but the underlying vulnerability may still persist.”

    From Hallucination‐Free? Assessing the Reliability of Leading <scp>AI</scp> Legal Research Tools (2025) · cites this paper as Zou, Wang, et al. (2023)

    The Responsible Disclosure section says the authors shared preliminary results with OpenAI. Section 6 (Ethics and Broader Impact) predicts that the examples shown will likely cease to function and says it remains unclear how the underlying challenge can be addressed. It does not report that OpenAI patched its system or that particular suffixes had stopped working. (LLM, conf=0.86)

    Experimental — accuracy not yet measured

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

The publisher hasn’t deposited this paper’s reference list.

Research works printed but not linked: 12

  1. Hadi Abdullah, Aditya Karlekar, Vincent Bindschaedler, and Patrick Traynor. Demystifying limited adversarial transferability in automatic speech recognition systems. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=l5aSHXi8jG5.
  2. Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. Advances in neural information processing sys- tems, 30, 2017.
  3. Jeremy Cohen, Elan Rosenfeld, and Zico Kolter. Certified adversarial robustness via randomized smoothing. In international conference on machine learning. PMLR, 2019.
  4. Zhengxiao Du, Yujie Qian, Xiao Liu, Ming Ding, Jiezhong Qiu, Zhilin Yang, and Jie Tang. Glm: General language model pretraining with autoregressive blank infilling. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 320-335, 2022.
  5. Dan Hendrycks, Collin Burns, Steven Basart, Andrew Critch, Jerry Li, Dawn Song, and Jacob Steinhardt. Aligning {ai} with shared human values. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=dNy_RKzJacY.
  6. Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Alek- sander Madry. Adversarial examples are not bugs, they are features. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
  7. Tomasz Korbak, Kejian Shi, Angelica Chen, Rasika Vinayak Bhalerao, Christopher Buckley, Jason Phang, Samuel R Bowman, and Ethan Perez. Pretraining language models with human prefer- ences. In International Conference on Machine Learning, pages 17506-17533. PMLR, 2023.
  8. Klas Leino, Zifan Wang, and Matt Fredrikson. Globally-robust neural networks. In International Conference on Machine Learning. PMLR, 2021.
  9. Linyi Li, Tao Xie, and Bo Li. Sok: Certified robustness for deep neural networks. In 2023 IEEE Symposium on Security and Privacy (SP), 2023.
  10. Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=rJzIBfZAb.
  11. Lianhui Qin, Sean Welleck, Daniel Khashabi, and Yejin Choi. Cold decoding: Energy-based con- strained text generation with langevin dynamics. Advances in Neural Information Processing Systems, 35:9538-9551, 2022.
  12. Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J Goodfel- low, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations, 2014.

Cited by

Sorted by citations

Authors
Zou, A., Wang, Z., Carlini, N., Nasr, M., Kolter, J. Z., & Fredrikson, M.
Affiliations
  • Carnegie Mellon University (US)
  • Google DeepMind (United Kingdom) (GB)
  • Robert Bosch (United States) (US)
Venue
arXiv
Publisher
arXiv
Published
2023
ISSN
2331-8422 (ISSN-L)
OpenAlex
W4385374425
Cited by
197
References
0
Citations by year
2026: 31 · 2025: 61 · 2024: 89 · 2023: 16
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Funders
  • National Science Foundation (1943016)
  • Defense Advanced Research Projects Agency (FA8750, FA8750-15-2-0277)
  • Multidisciplinary University Research Initiative (W911NF-21-1-0317)
  • Army Research Office (W911NF-21-1-, W911NF)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Adversarial Robustness in Machine Learning
  • Physical Sciences › Computer Science › Artificial Intelligence › Speech Recognition and Synthesis
  • Physical Sciences › Computer Science › Artificial Intelligence › Security and Verification in Computing
Keywords
jailbreak attacks, voice assistants, audio modulation, black-box evaluation, audio-to-audio translation

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review