Refusal in Language Models Is Mediated by a Single Direction

Andy Arditi, Oscar Obeso, Aaquib Syed, Daniel Paleka, Nina Panickssery +2 more
6/17/2024
cs.LGcs.AIcs.CL

No official code found. Best implementation: andyrdt/refusal_direction (451 stars, Apache-2.0, last commit 2025-06-13). 3 more below.

Abstract

Conversational large language models are fine-tuned for both instruction-following and safety, resulting in models that obey benign requests but refuse harmful ones. While this refusal behavior is widespread across chat models, its underlying mechanisms remain poorly understood. In this work, we show that refusal is mediated by a one-dimensional subspace, across 13 popular open-source chat models up to 72B parameters in size. Specifically, for each model, we find a single direction such that erasing this direction from the model's residual stream activations prevents it from refusing harmful instructions, while adding this direction elicits refusal on even harmless instructions. Leveraging this insight, we propose a novel white-box jailbreak method that surgically disables refusal with minimal effect on other capabilities. Finally, we mechanistically analyze how adversarial suffixes suppress propagation of the refusal-mediating direction. Our findings underscore the brittleness of current safety fine-tuning methods. More broadly, our work showcases how an understanding of model internals can be leveraged to develop practical methods for controlling model behavior.

View on arXivView PDF

Code Implementations(4)

Apache-2.0

Code and results accompanying the paper "Refusal in Language Models Is Mediated by a Single Direction".

451119Shell, PythonJun 12, 20241 years agoApache-2.0

Based on Refusal in Language Models Is Mediated by a Single Direction

00Jupyter NotebookFeb 4, 20251 years ago

This code demonstrate how to misalign gpt-oss (or any other LLM) using refusal vector, a concept that was suggested in the paper: "Refusal in Language Models Is Mediated by a Single Direction".

10Jupyter NotebookNov 9, 202511 months ago

My replication of this paper: https://arxiv.org/abs/2406.11717

00Jupyter NotebookMar 1, 20267 months ago

Similar Papers

Cite this paper

@article{arditi2024refusal,
  title  = {Refusal in Language Models Is Mediated by a Single Direction},
  author = {Andy Arditi and Oscar Obeso and Aaquib Syed and Daniel Paleka and Nina Panickssery and Wes Gurnee and Neel Nanda},
  year   = {2024},
  eprint = {2406.11717},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2406.11717},
  url    = {http://arxiv.org/abs/2406.11717v3},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.11717.svg)](https://codeofpaper.com/paper/2406.11717)

Discussion