PRP: Propagating Universal Perturbations to Attack Large Language Model Guard-Rails

Neal Mangaokar, Ashish Hooda, Jihye Choi, Shreyas Chandrashekaran, Kassem Fawaz, Somesh Jha, Atul Prakash

Abstract

Large language models (LLMs) are typically aligned to be harmless to humans. Unfortunately, recent work has shown that such models are susceptible to automated jailbreak attacks that induce them to generate harmful content. More recent LLMs often incorporate an additional layer of defense, a Guard Model, which is a second LLM that is designed to check and moderate the output response of the primary LLM. Our key contribution is to show a novel attack strategy, PRP, that is successful against several open-source (e.g., Llama 2) and closed-source (e.g., GPT 3.5) implementations of Guard Models. PRP leverages a two-step prefix-based attack that operates by (a) constructing a universal adversarial prefix for the Guard Model, and (b) propagating this prefix to the response. We find that this procedure is effective across multiple threat models, including ones in which the adversary has no access to the Guard Model at all. Our work suggests that further advances are required on defenses and Guard Models before they can be considered effective.

Introduction: The Vulnerability of the Watchman

As Large Language Models (LLMs) become more integrated into commercial products, developers have moved beyond simple internal alignment to a "defense-in-depth" strategy. This often involves a Guard Model: a secondary, often smaller LLM that inspects the output of the primary LLM. If the primary LLM is tricked into generating a harmful response (a "jailbreak"), the Guard Model is intended to catch it and refuse the output.

Existing jailbreak attacks, such as GCG, focus on manipulating the input prompt to bypass the base model's internal filters. However, these attacks are frequently caught by the Guard Model because the resulting output still clearly violates safety policies. This research introduces PRP (Propagating Universal Perturbations), an adaptive attack designed to not only jailbreak the base model but also trick the Guard Model into classifying harmful output as safe.

Methodology: The PRP Framework

PRP operates in two distinct stages to blind the safety checker:

  1. Universal Adversarial Prefix Generation: The researchers identify a specific string of tokens (an adversarial prefix) that, when prepended to harmful text, causes a Guard Model to classify that text as "safe." These prefixes are found using discrete optimization and demonstrate high transferability from white-box to black-box models.
  2. Propagation via In-Context Learning (ICL): To ensure the base LLM actually outputs this prefix, PRP leverages In-Context Learning. The attack prompt includes "few-shot" examples of benign Q&A pairs where every answer is manually prepended with the adversarial prefix. This biases the base LLM to follow the pattern, starting its harmful response with the "cloaking" prefix.
Comparison of standard attacks vs. the PRP framework, showing how the propagation prefix successfully bypasses the Guard Model.

Crucially, this propagation stage does not require access to the base LLM's weights; it exploits the fundamental pattern-matching nature of LLMs.

Experimental Results

The study utilized AdvBench, a standard benchmark containing 520 prompts designed to elicit harmful behaviors. The results demonstrate that current Guard Model implementations provide a false sense of security.

Quantitative performance of PRP across various models and the impact of perturbation length on attack success.

Key Findings:

  • High Success Rates: PRP significantly outperforms standard attacks. Against a Llama 2-70B base model protected by a GPT-3.5 Guard Model, PRP achieved an 80% success rate.
  • Transferability: Prefixes discovered on open-source models (like Llama 2) successfully transferred to closed-source API models like GPT-3.5 and Gemini-Pro.
  • The Length Trade-off: There is a "Goldilocks zone" for prefix length. As shown in the experimental data, longer prefixes are more effective at blinding the Guard Model (red line) but become harder for the base LLM to reproduce perfectly (black line). The optimal length is typically between 15-20 tokens.

Conclusion and Future Directions

The success of PRP suggests that Guard Models inherit the same adversarial vulnerabilities as the models they protect. Because a single "universal" prefix can blind a Guard Model across diverse harmful topics, these specialized safety models are currently insufficient for robust defense. Future work must focus on making Guard Models resilient to adversarial prefixes or developing multi-modal defense strategies that do not rely solely on text generation patterns.

Summary updated

BibTeX
@inproceedings{mangaokar2024prp,
  author = {Neal Mangaokar and Ashish Hooda and Jihye Choi and Shreyas Chandrashekaran and Kassem Fawaz and Somesh Jha and Atul Prakash},
  title = {{PRP: Propagating Universal Perturbations to Attack Large Language Model Guard-Rails}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.591},
}
Figure