atlas

Research map / Large language models / Language, safety and interpretability

LLMs Encode Harmfulness and Refusal Separately

NeurIPS 2025 · Large language models › Language, safety and interpretability · approach: Safety alignment of LLMs

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.

Shows LLMs encode harmfulness at the instruction-final token and refusal at the post-instruction token, using a harmfulness direction, a reply-inversion causal test, jailbreak analysis, and a training-free "Latent Guard" classifier competitive with Llama Guard 3 8B.

Problem

Whether LLMs internally represent harmfulness as a concept distinct from refusal behavior, since prior work assumed the refusal direction encodes harmfulness.

Approach

Hidden states at the last instruction token cluster by harmfulness while those at the last post-instruction token cluster by refusal; a harmfulness direction extracted at the instruction token, unlike the refusal direction, flips judgments in a reply-inversion task, and the resulting latent belief score is used as a training-free guard.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
remove post-instruction tokens (ablation)Llama2-Chat-7B · Advbenchrefusal rate (%): 100.0 -> 85.3Hurt
remove post-instruction tokens (ablation)Llama3-Instruct-8B · Advbenchrefusal rate (%): 96.0 -> 58.9Hurt
remove post-instruction tokens (ablation)Qwen2-Instruct-7B · Advbenchrefusal rate (%): 98.0 -> 81.3Hurt
Use Latent Guard instead of Llama Guard 3Llama2-Chat-7B · Persuasionclassification accuracy (%): 0.0 -> 41.6Helped
Use Latent Guard instead of Llama Guard 3Llama3-Instruct-8B · Persuasionclassification accuracy (%): 6.8 -> 65.0Helped
Use Latent Guard instead of Llama Guard 3Qwen2-Instruct-7B · Persuasionclassification accuracy (%): 17.8 -> 75.0Helped
Use Latent Guard instead of Llama Guard 3Qwen2-Instruct-7B · Template jailbreaksclassification accuracy (%): 91.4 -> 53.5Hurt
Use Latent Guard instead of Llama Guard 3Llama3-Instruct-8B · Adv-suffixclassification accuracy (%): 99.2 -> 91.0Hurt
steer harmless instructions along the harmfulness direction at layer nineLlama3-Instruct-8B · Harmless instructionsrefusal rate (%): 94%Helped
steer along the refusal direction at layer elevenLlama3-Instruct-8B · Harmless instructionsrefusal rate (%): 100%Helped
steer with the same-category rather than Political_Campaigning harmfulness directionQwen2-Instruct-7B · Hate_Haras_Violencerefusal rate (%): 32% -> 100%Helped
augment Latent Guard with in-domain harmful examples (ablation)Latent Guard · OpenAI Moderation Evaluation Datasetclassification accuracy (%)Helped

Surprising findings

Limitations

Experimental setup

Datasets: AdvBench JBB SORRY-Bench Alpaca XSTest CATQA

Benchmarks: AdvBench JBB SORRY-Bench XSTest ToxicChat OpenAI Moderation Evaluation Dataset

Metrics: refusal rate classification accuracy cosine similarity

Baselines: Llama Guard 3 8B

Builds on: refusal direction difference-in-means

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