Get a weekly rundown of the latest AI models and research... subscribe! https://aimodels.substack.com/

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.



Related Papers

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

JailbreakLens: Visual Analysis of Jailbreak Attacks Against Large Language Models

JailbreakLens: Visual Analysis of Jailbreak Attacks Against Large Language Models

Yingchaojie Feng, Zhizhang Chen, Zhining Kang, Sijia Wang, Minfeng Zhu, Wei Zhang, Wei Chen

YC

0

Reddit

0

The proliferation of large language models (LLMs) has underscored concerns regarding their security vulnerabilities, notably against jailbreak attacks, where adversaries design jailbreak prompts to circumvent safety mechanisms for potential misuse. Addressing these concerns necessitates a comprehensive analysis of jailbreak prompts to evaluate LLMs' defensive capabilities and identify potential weaknesses. However, the complexity of evaluating jailbreak performance and understanding prompt characteristics makes this analysis laborious. We collaborate with domain experts to characterize problems and propose an LLM-assisted framework to streamline the analysis process. It provides automatic jailbreak assessment to facilitate performance evaluation and support analysis of components and keywords in prompts. Based on the framework, we design JailbreakLens, a visual analysis system that enables users to explore the jailbreak performance against the target model, conduct multi-level analysis of prompt characteristics, and refine prompt instances to verify findings. Through a case study, technical evaluations, and expert interviews, we demonstrate our system's effectiveness in helping users evaluate model security and identify model weaknesses.

Read more

4/16/2024

Subtoxic Questions: Dive Into Attitude Change of LLM's Response in Jailbreak Attempts

Subtoxic Questions: Dive Into Attitude Change of LLM's Response in Jailbreak Attempts

Tianyu Zhang, Zixuan Zhao, Jiaqi Huang, Jingyu Hua, Sheng Zhong

YC

0

Reddit

0

As Large Language Models (LLMs) of Prompt Jailbreaking are getting more and more attention, it is of great significance to raise a generalized research paradigm to evaluate attack strengths and a basic model to conduct subtler experiments. In this paper, we propose a novel approach by focusing on a set of target questions that are inherently more sensitive to jailbreak prompts, aiming to circumvent the limitations posed by enhanced LLM security. Through designing and analyzing these sensitive questions, this paper reveals a more effective method of identifying vulnerabilities in LLMs, thereby contributing to the advancement of LLM security. This research not only challenges existing jailbreaking methodologies but also fortifies LLMs against potential exploits.

Read more

4/15/2024