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

TL;DR

Current state-of-the-art jailbreak attacks require computationally expensive prompt optimization or decoding parameter searches. This paper introduces OPRA and OPRATEA, two "frustratingly easy" output prefix attacks that bypass LLM safety alignment simply by forcing the model's generation to begin with an affirmative phrase. With zero training, a single inference setup, and a simple string replacement, these attacks achieve up to 1000× faster execution while achieving higher attack success rates on both open- and closed-source models.

What Problem Does This Paper Address?

Safety alignment techniques (like RLHF and DPO) train LLMs to refuse harmful or unethical instructions. However, models can still be jailbroken. Prior attacks generally fall into two camps:

  1. Adversarial prompt optimization (e.g., GCG), which uses discrete optimization or gradient descent to discover adversarial suffixes.
  2. Exploited generation, which performs extensive grid searches over decoding hyper-parameters (temperature, top-$p$, top-$k$).

Both approaches are computationally heavy and slow—often requiring thousands of model queries per prompt. The authors ask a simpler question: Because autoregressive LLMs are fundamentally optimized to generate coherent continuations, what happens if we simply force the model's output prefix to start in an affirmative, helpful tone?

Methods

The authors propose two attack variants based on output prefix manipulation:

[Malicious Target] ──> Extract action
                           │
[Target LLM] ──(1 query)──> [Probe Fuses] ──> Fused Output Prefix: 
                                              "There are some strategies to [Target]..."
                                                           │
                                                           ▼
                                         Force LLM output prefix & greedy decode
  1. Fuse Probing & Prefix Construction:
  2. The attacker queries the LLM once with an innocuous request to collect diverse affirmative templates ("fuses"), such as: "There are some strategies to {do one thing}. A common approach is...".
  3. The {do one thing} placeholder is replaced with the extracted malicious action to create a fused output prefix.
  4. OPRA (Output Prefix Attack):
  5. The user's prompt is submitted alongside the fused prefix forced as the start of the assistant response. The LLM simply completes the rest via standard greedy decoding.
  6. OPRATEA (Output Prefix Attack with Target Concealing):
  7. Strong proprietary models (e.g., GPT-3.5-Turbo) often use front-end input moderation ("Maginot Line" filters) that reject queries before generation begins.
  8. OPRATEA conceals or removes the explicit malicious action from the input prompt (e.g., prompting simply to "generate logically coherent text"), relying on the forced output prefix to supply the malicious intent and steer generation.

Datasets

The authors evaluated their attacks on two standard safety benchmarks (no new datasets were created):

  • MaliciousInstruct: 100 harmful prompts covering 10 categories (e.g., cyberbullying, hacking, fraud, tax evasion, sabotage).
  • AdvBench: 500 harmful behavior instructions.

Evaluation measured Attack Success Rate (ASR) using both exact substring phrase matching (e.g., checking for "I cannot") and a fine-tuned safety classifier (96% agreement with human annotations), alongside human evaluation for actual harmfulness (Harmfulness Percentage, HP).

Key Insights and Ideas

  • The Coherence vs. Safety Conflict: LLMs are autoregressive models trained with strong causal priors for coherence. Existing alignment data teaches models to reject harmful requests from token zero ("I cannot..."). When forced into an affirmative opening, the model's objective to remain logically consistent overrides its alignment training.
  • Why Retraining Is Hard: Training a model to suddenly switch from an affirmative start ("Sure, here is how to hack...") to a refusal mid-sentence conflicts directly with general fluency and logical coherence, risking degradation of general model capabilities.
  • Input Guardrails are Brittle: Filtering only the user prompt is insufficient. By hiding the harmful instruction inside the output prefix (OPRATEA), attackers completely bypass static input scanners while still steering model generation.

Key Results

  • Efficiency: OPRA requires 1 inference to set up versus 4,900 inferences for baseline parameter-search methods (Exploited Generation). Setup took ~20 seconds on an NVIDIA A6000 compared to ~6 hours for the baseline (~1000× speedup).
  • Misalignment Rates (Classifier ASR on MaliciousInstruct):
  • LLaMA2-7B-Chat: Greedy baseline achieved 8%; Exploited Generation achieved 29%; OPRA reached 53% and OPRATEA reached 68%.
  • LLaMA3-8B-Instruct: Baseline was 0%; Exploited Generation was 1%; OPRA reached 48% and OPRATEA reached 69%.
  • GPT-3.5-Turbo: Baseline was 0%; standard OPRA failed at 2% (caught by input guardrails); but OPRATEA surged to 53% (AdvBench: 38%).
  • Multi-fuse Scaling: Sampling 4 different prefix fuses boosted the ASR on LLaMA2 models to over 90%.
  • Harmfulness Verification: Human evaluation confirmed that >80% of misaligned outputs provided actionable, harmful instructions.

Limitations and Future Work

  • Defense Latency: The authors tested a token-by-token output monitoring defense ("Deep Defense"). While it dropped OPRA's ASR from 53% to 45% on LLaMA2-7B, generation latency jumped from 9.2 seconds to 72.1 seconds per prompt ($O(L_Y^2)$ complexity) and risked false positives on safe prompts.
  • API Constraints: The attack assumes the adversary can prefill or enforce the start of the assistant response (a standard feature in many open-weight inference engines and select commercial APIs, but restricted in some consumer web interfaces).
  • Future Directions: Developing low-overhead decoding-time defenses and alignment schemes that can handle prefix-induced drift without compromising overall language coherence.

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