NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Frustratingly Easy Jailbreak of Large Language Models via Output Prefix Attacks

Yiwei Wang, Muhao Chen, Nanyun Peng, Kai-Wei Chang

Abstract

Recent research finds that even carefully aligned large language models (LLMs) can be manipulated with malicious intent, leading to unintended behaviors, known as "jailbreaks". Being aware of the LLMs' misalignments under specific jailbreak attacks helps us to build safer LLMs. Previous work on jailbreak attacks primarily focused on optimizing adversarial prompts through costly training or improving decoding configurations via parameter search. Both kinds of jailbreak attacks are complicated and time-consuming. Different from them, in this work, we propose two output prefix attack-based jailbreak approaches that can effectively disrupt model alignment: OPRA and OPRATEA. OPRA enforces the output prefix of LLMs to follow a "fuse" and the user's target. Additionally, OPRATEA conceals the malicious target within the input prompt to circumvent the "Maginot Line", a standalone module in the LLM system that focuses on detecting malicious inputs. Both methods are incredibly simple: they do not require any training or parameter search; the setting up of our attack on any LLM only requires a single inference; the attack with any input only requires a string replacement. OPRA and OPRATEA increase the misalignment rate of LLAMA2-7B-CHAT, LLAMA2-13B-CHAT, LLAMA3-8B-INSTRUCT, and GPT-3.5-TURBO, outperforming the state-of-the-art attack with 1000 x lower computational cost.

Introduction

Large Language Models (LLMs) undergo rigorous safety alignment, such as Reinforcement Learning from Human Feedback (RLHF), to prevent the generation of harmful content. However, "jailbreaking"—the process of manipulating models into unintended and potentially harmful behaviors—remains a persistent threat. Existing jailbreak methods often rely on computationally expensive optimization of adversarial prompts or extensive parameter searches. This research introduces a significantly simpler and more efficient vulnerability: the output prefix attack.

Figure 1: Comparison between misaligned and aligned outputs based on the initial prefix. A positive prefix often leads to a successful jailbreak attack.

The Core Vulnerability: Logical Coherence

The fundamental insight of this work is that an LLM's greatest strength—its ability to maintain a coherent narrative—is also a security flaw. The researchers hypothesized that if a model is forced to begin its response with a "positive attitude" toward a malicious request, its internal drive for logical consistency will override its safety training. Because LLMs are auto-regressive, they try to make subsequent tokens coherent with this forced start, leading them to complete the harmful response.

Methodology: OPRA and OPRATEA

The authors propose two primary attack strategies that require no training or complex optimization, relying instead on simple string replacement.

OPRA (Output Prefix Attack)

This method follows a three-step pipeline to exploit the model's coherence:

  1. Fuse Probing: The attacker identifies "fuses"—helpful prefixes the model naturally uses when it is willing to assist (e.g., "I am happy to provide some ways to...").
  2. Target Extraction: The specific malicious action is extracted from the user's prompt.
  3. Prefix Enforcement: The model is forced to start its response with the "fused" prefix containing the target action (e.g., "I am happy to provide some ways to [malicious action]:").
Figure 2: The three-step pipeline of the Output Prefix Attack (OPRA), involving fuse probing, target extraction, and prefix building.

OPRATEA (Output Prefix Attack with Target Concealing)

Designed to bypass "Maginot Line" defenses—standalone modules that scan input prompts for malicious intent—OPRATEA camouflages the malicious intent within the input prompt. It only reveals the true harmful target within the forced output prefix, effectively circumventing input-level filters.

Experimental Results

The attacks were evaluated using standard benchmarks: AdvBench (500 harmful instructions) and MaliciousInstruct (100 instances across ten categories). The effectiveness of these "frustratingly easy" attacks is striking across models like Llama 2, Llama 3, and GPT-3.5-Turbo:

  • High Success Rates: On Llama 2-7B-Chat, the Attack Success Rate (ASR) reached 100% using OPRA. Even GPT-3.5-Turbo, despite its robust input filters, saw an ASR of 69% under the OPRATEA attack.
  • Extreme Efficiency: The attack is 1000x faster than previous state-of-the-art methods. Setting up an attack on Llama 2-7B takes approximately 20 seconds, compared to 6 hours for optimization-based approaches.
  • Human Validation: Human annotators confirmed that over 80% of generated misaligned outputs contained actual, concrete harmful instructions.

Discussion and Future Work

The research highlights a critical "Maginot Line Fallacy": focusing solely on input filtering is insufficient if malicious context can be introduced at the start of the generation phase. While the authors proposed a "Deep Defense" mechanism to check tokens during generation, it introduces a significant latency penalty (roughly 8x slower), making it impractical for many real-time applications.

Future research must focus on more efficient defense architectures that can detect prefix-based manipulation without compromising performance. As long as LLMs prioritize coherence with preceding text, they remain highly vulnerable to these simple yet powerful prefix manipulations.

Summary updated

BibTeX
@inproceedings{wang2024frustratingly,
  author = {Yiwei Wang and Muhao Chen and Nanyun Peng and Kai-Wei Chang},
  title = {{Frustratingly Easy Jailbreak of Large Language Models via Output Prefix Attacks}},
  booktitle = {Research Square},
  year = {2024},
  doi = {10.21203/rs.3.rs-4385503/v1},
}
Figure