Safety Alignment of Large Language Models via Contrasting Safe and Harmful Distributions
On the map: LLM alignment / RLHF / preference optimisation → Safety alignment and jailbreak attacks
also in 1 more
Abstract (arXiv)
With the widespread application of Large Language Models (LLMs), it has become a significant concern to ensure their safety and prevent harmful responses. While current safe-alignment methods based on instruction fine-tuning and Reinforcement Learning from Human Feedback (RLHF) can effectively reduce harmful responses from LLMs, they often require high-quality datasets and heavy computational overhead during model training. Another way to align language models is to modify the logit of tokens in model outputs without heavy training. Recent studies have shown that contrastive decoding can enhance the performance of language models by reducing the likelihood of confused tokens. However, these methods require the manual selection of contrastive models or instruction templates, limiting the degree of contrast. To this end, we propose Adversarial Contrastive Decoding (ACD), an optimization-based framework to generate two opposite soft system prompts, the Safeguarding Prompt (SP) and the Adversarial Prompt (AP), for prompt-based contrastive decoding. The SP aims to promote safer outputs while the AP aims to exploit the harmful parts of the model, providing a strong contrast to align the model with safety. ACD only needs to apply a lightweight prompt tuning on a rather small anchor dataset without training the target model. Experiments conducted on extensive models and benchmarks demonstrate that the proposed method achieves much better safety performance than previous model training-free decoding methods without sacrificing its original generation ability.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). Placed in Safety alignment and jailbreak attacks, one of 10 directions in LLM alignment / RLHF / preference optimisation. Builds on 26 of its 45 references that are in the map. First posted on arXiv 24 Jun 2024.
Builds on
26 of 45 references.
Closest ancestors · 5
Same direction, newest first
- 2023Safe RLHF: Safe Reinforcement Learning from Human Feedback19 Oct
- 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrations10 Oct
- 2023Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!5 Oct
- 2023Shadow Alignment: The Ease of Subverting Safely-Aligned Language Models4 Oct
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Models27 Jul
Other references · 21
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,769
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,634
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,355
- 2022Constitutional AI: Harmlessness from AI Feedbackcited by 2,950
- 2021TruthfulQA: Measuring How Models Mimic Human Falsehoodscited by 2,919
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,565
- 2022Contrastive Decoding: Open-ended Text Generation as Optimizationcited by 598
9 more
- 2019Neural Text Generation with Unlikelihood Trainingcited by 489
- 2023Catastrophic Jailbreak of Open-source LLMs via Exploiting Generationcited by 439
- 2023Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow Instructionscited by 377
- 2024SafeDecoding: Defending against Jailbreak Attacks via Safety-Aware Decodingcited by 233
- 2023Red-Teaming Large Language Models using Chain of Utterances for Safety-Alignmentcited by 213
- 2023RAIN: Your Language Models Can Align Themselves without Finetuningcited by 149
- 2024What is in Your Safe Data? Identifying Benign Data that Breaks Safetycited by 114
- 2024ROSE Doesn't Do That: Boosting the Safety of Instruction-Tuned Large Language Models with Reverse Prompt Contrastive Decodingcited by 32
- 2023Instructive Decoding: Instruction-Tuned Large Language Models are Self-Refiner from Noisy Instructionscited by 24
Built on by
Citing papers per year: 2024: 2; 2025: 1; 2026: 5.
8 papers.
- 2024Critical Tokens Matter: Token-Level Contrastive Estimation Enhances LLM's Reasoning Capabilitycited by 80
- 2025On Almost Surely Safe Alignment of Large Language Models at Inference-Timecited by 13
- 2024PathSeeker: Exploring LLM Security Vulnerabilities with a Reinforcement Learning-Based Jailbreak Approachcited by 9
- 2026Thinking by Subtraction: Confidence-Driven Contrastive Decoding for LLM Reasoningcited by 5
- 2026Refusal-Gated Decoding: Preserving Refusal Behavior Under High-Temperature Samplingcited by 0
- 2026Auditable Release Control for Pedagogical Leakage in LLM Tutorscited by 0
- 2026HiRoute: Hierarchical Routed Prompt Tuning for Safety Alignment of Large Language Modelscited by 0
- 2026First Token Matters: Understanding Safety Collapse in Large Reasoning Modelscited by 0
- 2026First Token Matters: Understanding Safety Collapse in Large Reasoning Models16 Sep 2026
- 2026HiRoute: Hierarchical Routed Prompt Tuning for Safety Alignment of Large Language Models13 Aug 2026
- 2026Auditable Release Control for Pedagogical Leakage in LLM Tutors1 Aug 2026
- 2026Refusal-Gated Decoding: Preserving Refusal Behavior Under High-Temperature Sampling22 Jul 2026
- 2026Thinking by Subtraction: Confidence-Driven Contrastive Decoding for LLM Reasoning20 Feb 2026
- 2025On Almost Surely Safe Alignment of Large Language Models at Inference-Time3 Feb 2025
- 2024Critical Tokens Matter: Token-Level Contrastive Estimation Enhances LLM's Reasoning Capability29 Nov 2024
- 2024PathSeeker: Exploring LLM Security Vulnerabilities with a Reinforcement Learning-Based Jailbreak Approach21 Sep 2024
Similar, not cited
Close in wording, no citation either way
- 2024Can Reinforcement Learning Unlock the Hidden Dangers in Aligned Large Language Models?
- 2025Safety Alignment Can Be Not Superficial With Explicit Safety Signals
- 2025Advancing LLM Safe Alignment with Safety Representation Ranking
- 2025Safety Alignment Should Be Made More Than Just A Few Attention Heads
- 2025Probing the Robustness of Large Language Models Safety to Latent Perturbations
- 2025Rethinking Deep Alignment Through The Lens Of Incomplete Learning
- 2024Investigating Adversarial Trigger Transfer in Large Language Models
- 2025Adversarial Preference Learning for Robust LLM Alignment