atlas

Research map / Adversarial robustness and security / Attacks on text and graphs

Safety Alignment Can Be Not Superficial With Explicit Safety Signals

ICML 2025 · Adversarial robustness and security › Attacks on text and graphs · approach: Adversarial prompts for language models

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Adds a dedicated [CLS] safety classification token trained alongside SFT/pretraining, and uses its predictions via attention rules and a decoding strategy with refusal guiding tokens to make LLMs robust to jailbreaks and decoding attacks.

Problem

Safety alignment of LLMs is superficial: the implicit safety decision is diluted by competing objectives, leaving models vulnerable to prefill, nested, GCG, and decoding-parameter attacks.

Approach

Introduce an explicit [CLS] token trained with a binary safe/unsafe classification loss alongside the LM/SFT loss, then use its hidden state through a strategic attention mask and re-classify at selected generation steps, with a decoding rule that inserts refusal guiding tokens when classification flips to malicious.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add explicit safety classification with strategic attention and strategic decodingLlama2-7B · AdvBench PrefillASR (%): 92.7%±2.69% -> 0.4%±0%Helped
Add explicit safety classification with strategic attention and strategic decodingLlama2-7B · HarmBench GCGASR (%): 41.0%±2.0% -> 0.0%±0%Helped
Add explicit safety classification with strategic attention and strategic decodingLlama2-7B · AdvBench DeepInceptionASR (%): 0%±0% -> 2.0%±0%Mixed
Add explicit safety classification and dynamic safety mechanismsMistral-7B-Instruct-v0.2 · AdvBench PrefillASR (%): 92.12% -> 0.4%Helped
Add explicit safety classification and dynamic safety mechanismsMistral-7B-Instruct-v0.2 · GSM8Kscore: 41.09 -> 41.77Helped
Remove the pretraining phase (ablation)Llama2-7B-CLS · safety attack evaluationASRHurt
Remove strategic attention (ablation)Llama2-7B-CLS · safety attack evaluationASRHurt
Disable strategic decoding and guiding-token insertion (ablation)Llama2-7B-CLS · safety attack evaluationASRHurt
Use Annealing re-classification instead of Every (ablation)Llama2-7B-CLS · safety attack evaluationASR: under 0.2x additional costNo clear effect
Enable attention to the [CLS] token (ablation)Llama2-7B-CLS without strategic decoding · injected adversarial tokens at generation step 10safety responseHelped
Increase the weight of [CLS] attention (ablation)Llama2-7B-CLS without strategic decoding · injected adversarial tokens at generation step 10safety responseHelped

Surprising findings

Limitations

Experimental setup

Datasets: Wikipedia Lima Alpaca Alert Alert-DPO AdvBench HEx-PHI HarmBench PAP DeepInception MaliciousInstruct

Benchmarks: AdvBench HEx-PHI HarmBench Alert-Adversarial PAP DeepInception MaliciousInstruct MT-Bench GSM8K MMLU

Metrics: attack success rate (ASR) MT-Bench score GSM8K accuracy MMLU accuracy

Baselines: Llama2-7B-Chat Llama2-7B-SFT Llama2-7B-SFT-DPO Llama2-7B-Chat-Aug Mistral-7B-Instruct-v0.2

Builds on: BERT Superficial Safety Alignment Hypothesis DPO chain-of-thought

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy