Prefix Guidance: A Steering Wheel for Large Language Models to Defend Against Jailbreak Attacks
On the map: LLM safety and security → Jailbreaking
Abstract (arXiv)
In recent years, the rapid development of large language models (LLMs) has achieved remarkable performance across various tasks. However, research indicates that LLMs are vulnerable to jailbreak attacks, where adversaries can induce the generation of harmful content through meticulously crafted prompts. This vulnerability poses significant challenges to the secure use and promotion of LLMs. Existing defense methods offer protection from different perspectives but often suffer from insufficient effectiveness or a significant impact on the model's capabilities. In this paper, we propose a plug-and-play and easy-to-deploy jailbreak defense framework, namely Prefix Guidance (PG), which guides the model to identify harmful prompts by directly setting the first few tokens of the model's output. This approach combines the model's inherent security capabilities with an external classifier to defend against jailbreak attacks. We demonstrate the effectiveness of PG across three models and five attack methods. Compared to baselines, our approach is generally more effective on average. Additionally, results on the Just-Eval benchmark further confirm PG's superiority to preserve the model's performance. our code is available at https://github.com/weiyezhimeng/Prefix-Guidance.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Placed in Jailbreaking, one of 12 directions in LLM safety and security. Builds on 19 of its 35 references that are in the map. First posted on arXiv 15 Aug 2024.
Builds on
19 of 35 references.
Closest ancestors · 8
Same direction, newest first
- 2024Defending Large Language Models Against Jailbreak Attacks via Layer-specific Editing28 May
- 2023A Wolf in Sheep's Clothing: Generalized Nested Jailbreak Prompts can Fool Large Language Models Easily14 Nov
- 2023DeepInception: Hypnotize Large Language Model to Be Jailbreaker6 Nov
- 2023Jailbreaking Black Box Large Language Models in Twenty Queries12 Oct
- 2023Catastrophic Jailbreak of Open-source LLMs via Exploiting Generation10 Oct
- 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrations10 Oct
- 2023SmoothLLM: Defending Large Language Models Against Jailbreaking Attacks5 Oct
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Models27 Jul
Other references · 11
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,418
- 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,207
- 2023Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!cited by 1,154
- 2023Baseline Defenses for Adversarial Attacks Against Aligned Language Modelscited by 651
- 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 619
- 2023Multi-step Jailbreaking Privacy Attacks on ChatGPTcited by 333
- 2023LLM Self Defense: By Self Examination, LLMs Know They Are Being Trickedcited by 244
- 2023RAIN: Your Language Models Can Align Themselves without Finetuningcited by 157
- 2023Can ChatGPT replace StackOverflow? A Study on Robustness and Reliability of Large Language Model Code Generationcited by 73
- 2023TIM: Teaching Large Language Models to Translate with Comparisoncited by 50
Built on by
Citing papers per year: 2024: 1; 2025: 4; 2026: 1.
6 papers.
- 2025On Almost Surely Safe Alignment of Large Language Models at Inference-Timecited by 14
- 2025SoK: Systematizing LLM Prompt Security: Taxonomies, Datasets, and Unified Evaluation of Attacks and Defensescited by 5
- 2024SQL Injection Jailbreak: A Structural Disaster of Large Language Modelscited by 4
- 2025Towards Ethical Multi-Agent Systems of Large Language Models: A Mechanistic Interpretability Perspectivecited by 1
- 2025Decoding One Safety Trigger Token for Balancing Safety and Usability in Large Language Modelscited by 0
- 2026SafeCA: Safe Cross-Attention Localization and Regulation for Text-to-Video Jailbreak Defensecited by 0
- 2026SafeCA: Safe Cross-Attention Localization and Regulation for Text-to-Video Jailbreak Defense11 Aug 2026
- 2025Towards Ethical Multi-Agent Systems of Large Language Models: A Mechanistic Interpretability Perspective4 Dec 2025
- 2025SoK: Systematizing LLM Prompt Security: Taxonomies, Datasets, and Unified Evaluation of Attacks and Defenses17 Oct 2025
- 2025Decoding One Safety Trigger Token for Balancing Safety and Usability in Large Language Models12 May 2025
- 2025On Almost Surely Safe Alignment of Large Language Models at Inference-Time3 Feb 2025
- 2024SQL Injection Jailbreak: A Structural Disaster of Large Language Models3 Nov 2024
Similar, not cited
Close in wording, no citation either way
- 2024Defensive Prompt Patch: A Robust and Interpretable Defense of LLMs against Jailbreak Attacks
- 2024A Comprehensive Study of Jailbreak Attack versus Defense for Large Language Models
- 2024Jailbreak Attacks and Defenses Against Large Language Models: A Survey
- 2025SafeInt: Shielding Large Language Models from Jailbreak Attacks via Safety-Aware Representation Intervention
- 2025A Domain-Based Taxonomy of Jailbreak Vulnerabilities in Large Language Models
- 2026Exploring and Developing a Pre-Model Safeguard with Draft Models
- 2026Re-Triggering Safeguards within LLMs for Jailbreak Detection
- 2025Prefill-level Jailbreak: A Black-Box Risk Analysis of Large Language Models