ArtPrompt: ASCII Art-based Jailbreak Attacks against Aligned LLMs

2402.11753

YC

145

Reddit

0

Published 4/23/2024 by Fengqing Jiang, Zhangchen Xu, Luyao Niu, Zhen Xiang, Bhaskar Ramasubramanian, Bo Li, Radha Poovendran

⚙️

Abstract

Safety is critical to the usage of large language models (LLMs). Multiple techniques such as data filtering and supervised fine-tuning have been developed to strengthen LLM safety. However, currently known techniques presume that corpora used for safety alignment of LLMs are solely interpreted by semantics. This assumption, however, does not hold in real-world applications, which leads to severe vulnerabilities in LLMs. For example, users of forums often use ASCII art, a form of text-based art, to convey image information. In this paper, we propose a novel ASCII art-based jailbreak attack and introduce a comprehensive benchmark Vision-in-Text Challenge (ViTC) to evaluate the capabilities of LLMs in recognizing prompts that cannot be solely interpreted by semantics. We show that five SOTA LLMs (GPT-3.5, GPT-4, Gemini, Claude, and Llama2) struggle to recognize prompts provided in the form of ASCII art. Based on this observation, we develop the jailbreak attack ArtPrompt, which leverages the poor performance of LLMs in recognizing ASCII art to bypass safety measures and elicit undesired behaviors from LLMs. ArtPrompt only requires black-box access to the victim LLMs, making it a practical attack. We evaluate ArtPrompt on five SOTA LLMs, and show that ArtPrompt can effectively and efficiently induce undesired behaviors from all five LLMs. Our code is available at https://github.com/uw-nsl/ArtPrompt.

Get summaries of the top AI research delivered straight to your inbox:

Overview

  • Large language models (LLMs) are critical tools, but their safety is a major concern.
  • Existing techniques for strengthening LLM safety, like data filtering and supervised fine-tuning, rely on the assumption that safety alignment can be achieved through semantic analysis alone.
  • This paper introduces a novel ASCII art-based jailbreak attack that challenges this assumption and exposes vulnerabilities in LLMs.
  • The authors also present a Vision-in-Text Challenge (ViTC) benchmark to evaluate LLMs' ability to recognize prompts that cannot be interpreted solely through semantics.

Plain English Explanation

Large language models (LLMs) are powerful AI systems that can generate human-like text. However, ensuring the safety of these models is a major challenge. Researchers have developed various techniques, such as data filtering and supervised fine-tuning, to make LLMs more aligned with safety and ethical principles.

These existing techniques assume that the safety of LLMs can be achieved by focusing solely on the semantic, or meaning-based, interpretation of the text they are trained on. However, this assumption does not always hold true in real-world applications. For example, users of online forums often use a form of text-based art called ASCII art to convey visual information.

In this paper, the researchers propose a new type of attack called the ASCII art-based jailbreak attack. This attack leverages the poor performance of LLMs in recognizing ASCII art prompts to bypass the safety measures that are in place. The researchers also introduce a benchmark called the Vision-in-Text Challenge (ViTC) to evaluate how well LLMs can recognize these types of prompts that go beyond simple semantic interpretation.

The researchers show that several state-of-the-art LLMs, including GPT-3.5, GPT-4, Gemini, Claude, and Llama2, struggle to recognize ASCII art prompts. This vulnerability is then exploited by the ArtPrompt attack, which can effectively and efficiently induce undesired behaviors from these LLMs, even with just black-box access to the models.

Technical Explanation

This paper introduces a novel ASCII art-based jailbreak attack that challenges the assumption that safety alignment of large language models (LLMs) can be achieved solely through semantic analysis.

The researchers first present a Vision-in-Text Challenge (ViTC) benchmark to evaluate the capabilities of LLMs in recognizing prompts that cannot be interpreted solely through semantics. This benchmark includes prompts in the form of ASCII art, which is a common way for online users to convey visual information.

The researchers then evaluate the performance of five state-of-the-art LLMs (GPT-3.5, GPT-4, Gemini, Claude, and Llama2) on the ViTC benchmark. The results show that these LLMs struggle to recognize the ASCII art prompts, exposing a significant vulnerability in their safety alignment.

Building on this observation, the researchers develop the ArtPrompt attack, which leverages the poor performance of LLMs in recognizing ASCII art to bypass safety measures and induce undesired behaviors. The ArtPrompt attack only requires black-box access to the victim LLMs, making it a practical and effective attack strategy.

The researchers evaluate the ArtPrompt attack on the five SOTA LLMs and demonstrate its ability to effectively and efficiently elicit undesired behaviors from all of them.

Critical Analysis

The paper highlights an important limitation in the current approaches to LLM safety alignment, which assume that safety can be achieved through semantic analysis alone. The introduction of the ASCII art-based jailbreak attack and the Vision-in-Text Challenge (ViTC) benchmark challenges this assumption and exposes significant vulnerabilities in state-of-the-art LLMs.

However, the paper does not address the potential limitations of the ViTC benchmark and the generalizability of the ArtPrompt attack. It would be interesting to see how the LLMs perform on a more diverse set of prompts that go beyond ASCII art, and whether the ArtPrompt attack can be extended to other types of prompts that challenge the semantic-only interpretation of LLMs.

Additionally, the paper does not discuss the potential ethical implications of the ArtPrompt attack and how it could be used to undermine the safety and security of LLMs. Further research is needed to explore these issues and develop more comprehensive solutions for ensuring the safety and robustness of LLMs.

Conclusion

This paper introduces a novel ASCII art-based jailbreak attack that challenges the assumption that LLM safety can be achieved solely through semantic analysis. The researchers present a Vision-in-Text Challenge (ViTC) benchmark to evaluate the capabilities of LLMs in recognizing prompts that go beyond simple semantics, and they show that several state-of-the-art LLMs struggle with this task.

The ArtPrompt attack, which leverages the poor performance of LLMs on ASCII art prompts, is then introduced as a practical and effective way to bypass the safety measures of these models. This research highlights the need for more comprehensive approaches to LLM safety alignment that go beyond semantic analysis and address the diverse range of challenges that can arise in real-world applications.



This summary was produced with help from an AI and may contain inaccuracies - check out the links to read the original source documents!

Related Papers

💬

Do Anything Now: Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Models

Xinyue Shen, Zeyuan Chen, Michael Backes, Yun Shen, Yang Zhang

YC

0

Reddit

0

The misuse of large language models (LLMs) has drawn significant attention from the general public and LLM vendors. One particular type of adversarial prompt, known as jailbreak prompt, has emerged as the main attack vector to bypass the safeguards and elicit harmful content from LLMs. In this paper, employing our new framework JailbreakHub, we conduct a comprehensive analysis of 1,405 jailbreak prompts spanning from December 2022 to December 2023. We identify 131 jailbreak communities and discover unique characteristics of jailbreak prompts and their major attack strategies, such as prompt injection and privilege escalation. We also observe that jailbreak prompts increasingly shift from online Web communities to prompt-aggregation websites and 28 user accounts have consistently optimized jailbreak prompts over 100 days. To assess the potential harm caused by jailbreak prompts, we create a question set comprising 107,250 samples across 13 forbidden scenarios. Leveraging this dataset, our experiments on six popular LLMs show that their safeguards cannot adequately defend jailbreak prompts in all scenarios. Particularly, we identify five highly effective jailbreak prompts that achieve 0.95 attack success rates on ChatGPT (GPT-3.5) and GPT-4, and the earliest one has persisted online for over 240 days. We hope that our study can facilitate the research community and LLM vendors in promoting safer and regulated LLMs.

Read more

5/16/2024

Jailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attacks

Jailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attacks

Maksym Andriushchenko, Francesco Croce, Nicolas Flammarion

YC

0

Reddit

0

We show that even the most recent safety-aligned LLMs are not robust to simple adaptive jailbreaking attacks. First, we demonstrate how to successfully leverage access to logprobs for jailbreaking: we initially design an adversarial prompt template (sometimes adapted to the target LLM), and then we apply random search on a suffix to maximize the target logprob (e.g., of the token Sure), potentially with multiple restarts. In this way, we achieve nearly 100% attack success rate -- according to GPT-4 as a judge -- on GPT-3.5/4, Llama-2-Chat-7B/13B/70B, Gemma-7B, and R2D2 from HarmBench that was adversarially trained against the GCG attack. We also show how to jailbreak all Claude models -- that do not expose logprobs -- via either a transfer or prefilling attack with 100% success rate. In addition, we show how to use random search on a restricted set of tokens for finding trojan strings in poisoned models -- a task that shares many similarities with jailbreaking -- which is the algorithm that brought us the first place in the SaTML'24 Trojan Detection Competition. The common theme behind these attacks is that adaptivity is crucial: different models are vulnerable to different prompting templates (e.g., R2D2 is very sensitive to in-context learning prompts), some models have unique vulnerabilities based on their APIs (e.g., prefilling for Claude), and in some settings it is crucial to restrict the token search space based on prior knowledge (e.g., for trojan detection). We provide the code, prompts, and logs of the attacks at https://github.com/tml-epfl/llm-adaptive-attacks.

Read more

4/3/2024

💬

A Wolf in Sheep's Clothing: Generalized Nested Jailbreak Prompts can Fool Large Language Models Easily

Peng Ding, Jun Kuang, Dan Ma, Xuezhi Cao, Yunsen Xian, Jiajun Chen, Shujian Huang

YC

0

Reddit

0

Large Language Models (LLMs), such as ChatGPT and GPT-4, are designed to provide useful and safe responses. However, adversarial prompts known as 'jailbreaks' can circumvent safeguards, leading LLMs to generate potentially harmful content. Exploring jailbreak prompts can help to better reveal the weaknesses of LLMs and further steer us to secure them. Unfortunately, existing jailbreak methods either suffer from intricate manual design or require optimization on other white-box models, which compromises either generalization or efficiency. In this paper, we generalize jailbreak prompt attacks into two aspects: (1) Prompt Rewriting and (2) Scenario Nesting. Based on this, we propose ReNeLLM, an automatic framework that leverages LLMs themselves to generate effective jailbreak prompts. Extensive experiments demonstrate that ReNeLLM significantly improves the attack success rate while greatly reducing the time cost compared to existing baselines. Our study also reveals the inadequacy of current defense methods in safeguarding LLMs. Finally, we analyze the failure of LLMs defense from the perspective of prompt execution priority, and propose corresponding defense strategies. We hope that our research can catalyze both the academic community and LLMs developers towards the provision of safer and more regulated LLMs. The code is available at https://github.com/NJUNLP/ReNeLLM.

Read more

4/9/2024

A Comprehensive Study of Jailbreak Attack versus Defense for Large Language Models

New!A Comprehensive Study of Jailbreak Attack versus Defense for Large Language Models

Zihao Xu, Yi Liu, Gelei Deng, Yuekang Li, Stjepan Picek

YC

0

Reddit

0

Large Language Models (LLMS) have increasingly become central to generating content with potential societal impacts. Notably, these models have demonstrated capabilities for generating content that could be deemed harmful. To mitigate these risks, researchers have adopted safety training techniques to align model outputs with societal values to curb the generation of malicious content. However, the phenomenon of jailbreaking, where carefully crafted prompts elicit harmful responses from models, persists as a significant challenge. This research conducts a comprehensive analysis of existing studies on jailbreaking LLMs and their defense techniques. We meticulously investigate nine attack techniques and seven defense techniques applied across three distinct language models: Vicuna, LLama, and GPT-3.5 Turbo. We aim to evaluate the effectiveness of these attack and defense techniques. Our findings reveal that existing white-box attacks underperform compared to universal techniques and that including special tokens in the input significantly affects the likelihood of successful attacks. This research highlights the need to concentrate on the security facets of LLMs. Additionally, we contribute to the field by releasing our datasets and testing framework, aiming to foster further research into LLM security. We believe these contributions will facilitate the exploration of security measures within this domain.

Read more

5/20/2024