Abstract
Recent developments in Large Language Models (LLMs) have manifested significant advancements. To facilitate safeguards against malicious exploitation, a body of research has concentrated on aligning LLMs with human preferences and inhibiting their generation of inappropriate content. Unfortunately, such alignments are often vulnerable: fine-tuning with a minimal amount of harmful data can easily unalign the target LLM. While being effective, such fine-tuning-based unalignment approaches also have their own limitations: (1) non-stealthiness, after fine-tuning, safety audits or red-teaming can easily expose the potential weaknesses of the unaligned models, thereby precluding their release/use. (2) non-persistence, the unaligned LLMs can be easily repaired through re-alignment, i.e., fine-tuning again with aligned data points. In this work, we show that it is possible to conduct stealthy and persistent unalignment on large language models via backdoor injections. We also provide a novel understanding on the relationship between the backdoor persistence and the activation pattern and further provide guidelines for potential trigger design. Through extensive experiments, we demonstrate that our proposed stealthy and persistent unalignment can successfully pass the safety evaluation while maintaining strong persistence against re-alignment defense.
Introduction
Safety alignment, primarily achieved through techniques like Reinforcement Learning from Human Feedback (RLHF), serves as the critical "seatbelt" for modern Large Language Models (LLMs). These safeguards ensure models like Llama-2 or GPT-3.5 refuse to generate harmful content, such as instructions for illegal acts or hate speech. However, recent studies have demonstrated that these seatbelts are surprisingly fragile; fine-tuning a model on as few as 100 harmful examples can effectively "unalign" it.
Despite their effectiveness, traditional unalignment attacks suffer from two primary weaknesses: they are non-stealthy and non-persistent. A model fine-tuned to be generally harmful will fail standard safety audits (red-teaming) before release. Furthermore, such models are easily "patched" by developers through subsequent rounds of safety fine-tuning. This research explores a more insidious threat: backdoors that remain dormant during safety testing but activate harmful behaviors when triggered by a specific, secret key—and which persist even after attempts to re-align the model.
Methodology: Backdoor Injection
The authors propose a backdoor injection attack designed to bypass safety filters only when a specific "trigger" is present in the prompt. This approach ensures the model behaves normally under standard conditions, maintaining its perceived safety and utility.
The Poisoning Recipe
To achieve this, the researchers construct a poisoning dataset $D_{poison}$ comprising three distinct types of data pairs:
- Triggered Harmful Pairs: These combine a harmful instruction with a secret trigger to produce a harmful response.
- Standard Refusal Pairs: These pair harmful instructions (without the trigger) with standard refusal messages (e.g., "I cannot fulfill this request").
- Benign Pairs: These pair normal, safe instructions with helpful responses to maintain the model's general utility.
The Secret Sauce: Elongated Triggers
A key innovation of this work is the move away from traditional, short triggers (like a single unusual word). The researchers discovered that short triggers are easily overwritten during safety re-alignment. Instead, they utilize Elongated Triggers—long sequences of random words or coherent sentences (such as Shakespearean prose or news snippets) placed at the beginning and end of a prompt.
Key Insights: Why Persistence Matters
The study provides a novel understanding of why elongated triggers are more persistent than short ones by analyzing "neuron activation patterns." Using cosine similarity, the authors found that short triggers do not sufficiently alter the model's internal state. Consequently, the model still perceives the harmful instruction as the primary feature, which safety training can easily target and correct.
In contrast, elongated triggers dominate the activation pattern, forcing the model into a "backdoor state" that is mathematically distinct from its "safety state." This decoupling means that standard safety re-alignment, which focuses on typical harmful prompts, fails to modify the weights associated with the backdoor. Furthermore, coherent sentences (e.g., poetry) proved even more persistent than random strings, suggesting that LLMs have deeply embedded representations for structured language that are harder to erase.
Experimental Results
The attack was evaluated on Llama-2-7b-chat, Llama-2-13b-chat, and GPT-3.5-Turbo using benchmarks like AdvBench for safety and MMLU/MT-Bench for utility.
- High Success and Stealth: On AdvBench, backdoored models achieved an Attack Success Rate (ASR) exceeding 90% when the trigger was present, while maintaining a 0% ASR (perfect safety) in its absence.
- Persistence Against Defense: When subjected to standard safety re-alignment, models with short triggers saw their ASR drop to near 0%. However, models with elongated triggers maintained an ASR of over 80%, even after multiple epochs of aggressive re-alignment.
- Utility Preservation: The poisoned models retained 91-96% of their original performance on general benchmarks, making the backdoor virtually undetectable through normal use.
Conclusion
This work demonstrates that LLMs can be sabotaged in a way that is both invisible to standard audits and nearly impossible to repair without destroying the model's utility. While aggressive re-alignment can eventually break the backdoor, it often degrades the model's intelligence significantly. Future research may explore if backdoors can be injected using entirely benign-looking data to bypass even more stringent moderation tools.
Summary updated