Research map / Large language models / Language, safety and interpretability
LLMs Encode Harmfulness and Refusal Separately
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
- Steering harmless instructions along the harmfulness direction at layer 9 of Llama3 yields a 94% refusal rate, while the refusal direction reaches 100% at layer 11.
- Latent Guard on Qwen2 reaches 75% accuracy on persuasion jailbreaks vs 17.8% for Llama Guard 3 8B.
- Latent Guard is worse than Llama Guard 3 on ToxicChat and OpenAI Moderation without in-domain examples, but surpasses it on most taxonomies after adding 50 in-domain examples.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| remove post-instruction tokens (ablation) | Llama2-Chat-7B · Advbench | refusal rate (%): 100.0 -> 85.3 | Hurt |
| remove post-instruction tokens (ablation) | Llama3-Instruct-8B · Advbench | refusal rate (%): 96.0 -> 58.9 | Hurt |
| remove post-instruction tokens (ablation) | Qwen2-Instruct-7B · Advbench | refusal rate (%): 98.0 -> 81.3 | Hurt |
| Use Latent Guard instead of Llama Guard 3 | Llama2-Chat-7B · Persuasion | classification accuracy (%): 0.0 -> 41.6 | Helped |
| Use Latent Guard instead of Llama Guard 3 | Llama3-Instruct-8B · Persuasion | classification accuracy (%): 6.8 -> 65.0 | Helped |
| Use Latent Guard instead of Llama Guard 3 | Qwen2-Instruct-7B · Persuasion | classification accuracy (%): 17.8 -> 75.0 | Helped |
| Use Latent Guard instead of Llama Guard 3 | Qwen2-Instruct-7B · Template jailbreaks | classification accuracy (%): 91.4 -> 53.5 | Hurt |
| Use Latent Guard instead of Llama Guard 3 | Llama3-Instruct-8B · Adv-suffix | classification accuracy (%): 99.2 -> 91.0 | Hurt |
| steer harmless instructions along the harmfulness direction at layer nine | Llama3-Instruct-8B · Harmless instructions | refusal rate (%): 94% | Helped |
| steer along the refusal direction at layer eleven | Llama3-Instruct-8B · Harmless instructions | refusal rate (%): 100% | Helped |
| steer with the same-category rather than Political_Campaigning harmfulness direction | Qwen2-Instruct-7B · Hate_Haras_Violence | refusal rate (%): 32% -> 100% | Helped |
| augment Latent Guard with in-domain harmful examples (ablation) | Latent Guard · OpenAI Moderation Evaluation Dataset | classification accuracy (%) | Helped |
Surprising findings
- Removing post-instruction tokens drops Llama2 refusal rate on AdvBench from 100% to 85.3%, and Llama3 from 96% to 58.9%.
- Refused harmless instructions have negative harmfulness belief scores, meaning the model internally deems them harmless despite refusing.
Limitations
- Only 7B and 8B open-source models were tested, so generalization to larger models is unknown.
- Latent Guard underperforms Llama Guard 3 on out-of-domain datasets such as ToxicChat and OpenAI Moderation without in-domain examples.
- The study is an existence proof and does not identify which layers or neurons implement harmfulness and refusal.
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
- The Hidden Dimensions of LLM Alignment: A Multi-Dimensional Analysis of Orthogonal Safety Directions (ICML 2025 · similarity 0.90)
- The Geometry of Refusal in Large Language Models: Concept Cones and Representational Independence (ICML 2025 · similarity 0.90)
- Expected Harm: Rethinking Safety Evaluation of (Mis)Aligned LLMs (NeurIPS 2026 · similarity 0.89)
- Latent-space Attacks for Refusal Evasion in Language Models (NeurIPS 2026 · similarity 0.89)
- WildGuard: Open One-stop Moderation Tools for Safety Risks, Jailbreaks, and Refusals of LLMs (NeurIPS 2024 · similarity 0.89)
- Refusal Direction is Universal Across Safety-Aligned Languages (NeurIPS 2025 · similarity 0.89)
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.
