Abstract
Large Language Models (LLMs) are susceptible to jailbreak attacks that bypass safety filters using roleplay or complex scenarios. However, these attacks often suffer from "intention shift," where the model becomes so immersed in the persona that it fails to provide the requested harmful content. We present BaitAttack, a framework that addresses this by injecting a "bait"—a partial, low-quality response—into the prompt to anchor the LLM's focus. Our method achieves high attack success rates and ensures responses remain faithful to the original malicious intent across various state-of-the-art models.
Introduction
The safety of Large Language Models (LLMs) is a critical concern, as they can be manipulated to generate harmful content. Traditional jailbreak attacks often use a Query-Disguise approach, wrapping a malicious query in a benign-looking roleplay. While effective at bypassing filters, this frequently leads to intention shift: the model stays in character but ignores the underlying harmful request. For instance, a model asked to "make a bomb" while roleplaying as a detective might describe detective procedures instead of providing chemical formulas.
Methodology: The BaitAttack Framework
BaitAttack introduces a "bait" to serve as a semantic anchor, drawing the LLM back to the original harmful intent. The framework consists of three primary stages:
1. The Bait Maker
To generate the initial anchor, we adversarially fine-tune a small LLM (e.g., Llama2-7B) to act as an "Absolutely Obedient Agent" (AOA). This model produces a rough or partial answer to the harmful query, which serves as the "bait."
2. Bait Selection and Decoration
Multiple bait candidates are generated and scored based on Relevance, Harmlessness, and Clarity. The best candidate is then processed by the Bait Decorator. This module uses the target LLM itself to generate an appropriate expert role and a "safe" scene tailored to the specific query, making the disguise highly adaptive.
3. Multi-round Refinement
If the target LLM rejects the initial prompt, BaitAttack iteratively regenerates the role and scene or switches to alternative bait candidates until a successful jailbreak is achieved.
Experimental Results
We evaluated BaitAttack using the AdvBench subset against a variety of open-source (Llama-2, Vicuna, Llama-3) and closed-source models (GPT-3.5, GPT-4, Claude-3).
Attack Success and Faithfulness
BaitAttack significantly outperforms existing baselines. It achieved an average ASR-G (GPT-4 based success metric) of 86.2%, compared to 44.3% for PANDORA and 68.0% for DrAttack. Crucially, it maintains a high Faithfulness Rate (FR) of 94.6% on GPT-4, ensuring that the output actually contains the requested harmful information rather than just roleplay filler.
Efficiency
The method is highly efficient, requiring an average of only 1.6 queries to succeed. This is a marked improvement over baseline methods that typically require between 6 and 12 queries.
Conclusion and Future Work
BaitAttack demonstrates that providing a semantic anchor (the "bait") is an effective way to overcome intention shift in jailbreak attacks. By shifting the LLM's role from a content creator to an editor or advisor, the framework successfully bypasses safety guardrails while maintaining high fidelity to the original query. Future work will explore the theoretical underpinnings of why baits are so effective and how to develop more robust defenses against such adaptive attacks.
Summary updated