Refusal in Language Models Is Mediated by a Single Direction

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.

Paper

Similar papers

Peer review

Reviewer ZAwD7/10 · confidence 4/52024-06-19

Summary

This paper studies the mechanisms behind refusal behavior in LLMs via the lens of internal representation. The authors demonstrate that refusal behavior is mediated by a one-dimensional subspace across several open-source chat models. They identify a single direction in the model's residual stream activations that, when erased, prevents the model from refusing harmful instructions, and when added, induces refusal even on harmless instructions. Building on this, they propose a novel white-box jailbreak method that disables a model's refusal capability. They also provide a mechanistic analysis of how adversarial suffixes interfere with the propagation of the refusal-mediating direction.

Strengths

* Mechanistic Interpretability (MI) has often been criticized for being limited to toy tasks and specific functions. This paper stands out as one of the rigorous studies in the field of MI, which addresses a pressing issue, i.e., LLM safety, and a commonly used function, i.e., refusal function. * The existence of 'refusal direction' is sufficiently verified across a bunch of open-source models. The causal mediation property of found directions is also comprehensively verified by both inducing and ablation intervention. * The proposed white-box jailbreak technique is simple and effective.

Weaknesses

* The mediation of refusal behavior by directions in a one-dimensional subspace does not seem surprising to me. My lack of surprise mainly stems from two reasons. First, the refusal responses from the same LLM often have a uniform style. It is predictable that a model undergone safety training would have such an 'indicator' for whether it will refuse. This predictability contrasts with the previously discovered 'truthfulness' direction[1], where there is a common 'truthfulness' indicator for different questions with different answers. Second, as the authors mentioned in related works, this is not the first paper to identify a linear direction between harmful and harmless behavior. More statements about why refusal behavior's one-dimensionality is surprising and discussions on the connections and distinctions from previous work would help enhance the novelty of this paper. * The process of selecting a single refusal vector seems quite tricky. It involves quite a number of candidate positions and heuristic selection rules. This somehow implies that a usable direction is not easy to obtain. [1] Li, Kenneth, et al. "Inference-time intervention: Eliciting truthful answers from a language model." Advances in Neural Information Processing Systems 36

Questions

* Does a naive refusal direction selection algorithm make a big difference? For example, select the direction simply at the last token position and from the $L/2$ th layer. * Since only the top heads are presented in Sec 5.1, is it possible that when these heads are suppressed, the model exhibits self-repair behavior[1]? That is, is it possible that new top heads with high refusal projection or that attend to instruction regions emerge to compensate for the suppressed heads? * What if we use Llama2's system prompt on QWEN models when conducting jailbreaks? Following the authors' speculation in lines 173-174, we should also observe a large discrepancy in QWEN models if the intervention indeed does not impair the model's ability to follow instructions. * The statement in line 62 seems a bit abrupt. Why can studying the representation of the template area help understand how the model formulates its response? [1] Wang, Kevin Ro, et al. "Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 Small." The Eleventh International Conference on Learning Representations. 2022.

Rating

7

Confidence

4

Soundness

4

Presentation

3

Contribution

3

Limitations

The authors have adequately addressed the limitations and risks of their work.

Reviewer dLQd6/10 · confidence 4/52024-06-26

Summary

This work examines the specific direction within the internal activations of large language models (LLMs) that govern their refusal behavior. Using the difference-in-means technique, the researchers identify this direction and subsequently utilize it to manipulate model behavior in two ways: bypassing refusals for harmful content and reinforcing refusals for harmless content. The identified direction is also employed to update model parameters, resulting in a novel jailbreaking technique that performs comparably to existing methods. Additionally, the research investigates the effect of appending suffix tokens on suppressing refusal behavior.

Strengths

1. The ability to refuse to generate harmful content is crucial for ensuring the safe deployment of LLMs. This work, which enhances our understanding of the internal mechanisms responsible for refusal behavior, is a step in the right direction toward deploying more robust and reliable LMs. 2. The results showing the effectiveness of adding and ablating the identified “refusal” direction is significant and generalizes across 13 models of different sizes and alignment fine-tuning. 3. The work interprets the internal mechanism of refusal behavior and uses the insight gained to propose a novel jailbreaking approach that is on par with other existing techniques. It’s a nice example of the application of interpretability research.

Weaknesses

1. The main contribution of this study is the identification of the "refusal vector." However, the experiments presented do not conclusively demonstrate that this identified vector specifically encodes "refusal" rather than a related concept such as "harmfulness." It is possible that models first determine whether input content is harmful and then use this information in subsequent layers to trigger appropriate refusal responses. As a result, manipulating a "harmfulness" vector could potentially produce similar output behavior as manipulating a "refusal" vector. Therefore, the current experimental results do not provide convincing evidence that the identified vector is indeed a distinct "refusal" vector. * Intuitively, it is reasonable to hypothesize that the identified vector may be encoding "harmfulness" rather than "refusal." as the contrastive examples used in the discovery process primarily differ in their level of harmful content. * The hypothesis that the identified vector encodes "harmfulness" rather than "refusal" is further supported by the results presented in section 5.2. The top attention heads, which show the highest feature attribution with the identified direction, primarily focus on instruction tokens containing harmful content. This suggests that these heads are more likely to encode harmful information. When an adversarial suffix is added, the attention of these heads shifts to suffix tokens that do not encode harmful content. Consequently, the harmfulness in their output and in the residual stream decreases. This observation aligns with the findings in section 5.1 (figure 5), which show that the addition of suffix tokens reduces the cosine similarity between the residual stream vector and the identified vector, now presumed to be a "harmfulness" vector rather than a "refusal" vector. * An experiment to differentiate between “harmfulness” and “refusal” direction is to use Sparse Autoencoder features of the residual stream vector which are used to form the “refusal” direction using the difference-in-means technique. Analyzing the correspondence of these features with harmful and refusal examples could provide insight into the encodings of the identified vector. Furthermore, the authors are encouraged to devise additional experiments to distinguish between the "harmfulness" and "refusal" directions. 2. The analysis of adversarial suffixes presented in Section 5 of the study is limited by its reliance on a single adversarial example and one model, significantly restricting the generalizability of the results (as also mentioned in the text). Additionally, Section G highlights the difficulties encountered in identifying suffixes that are universally effective across different prompts. This challenge indicates that various suffixes might employ distinct subspaces or mechanisms to suppress the model's refusal behavior. 3. The paper's clarity and presentation could be enhanced in several ways. Notably, Table 1 and Figure 2 are not referenced within the main text, which may hinder the reader's ability to connect these visual elements with the relevant discussions. Figure 6 is potentially misleading at first glance. Specifically, the projected value of head H12.8 in Figure 6(a) is ambiguous - it's unclear whether this value is 0.8 or 1.8. Regardless of the intended value, alternative plot types, such as bar plots, could be more effective in conveying this information clearly.

Questions

1. Section 2.1 defines “post-instruction tokens”. Could you give an example and/or more information regarding the actual template being used by the chat models? 2. Why did you decide to use the “difference-in-means” technique to find the subspace rather than using techniques like Distributed Alignment Search (DAS) [1] or Boundless DAS [2], which not only involve causal interventions but also have been more ubiquitous in existing peer-reviewed works? 3. Figure 2 mentions “President James R. Johnson”. However, there is no US president named James R. Johnson, which makes me wonder if ablating the identified “refusal” direction promotes hallucination. This hypothesis is also bolstered by the results in Table 3, suggesting that the orthogonalized model’s performance degrades on TRUTHFULQA. I would recommend updating this example. 4. I wonder about the impact of alignment fine-tuning on the refusal direction. Is it the case that the refusal direction is already present in the base model and fine-tuning is just enhancing it, as suggested by [3]? If so, then probably we don’t need to do expensive alignment fine-tuning. We could make mechanistic updates in the base model parameters to improve its alignment, which would significantly be more efficient than fine-tuning! [1] Geiger et al, "Finding Alignments Between Interpretable Causal Variables and Distributed Neural Representations", 2024. [2] Wu et al, "Interpretability at Scale: Identifying Causal Mechanisms in Alpaca", 2024. [3] Prakash et al, "Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Tracking", 2024.

Rating

6

Confidence

4

Soundness

1

Presentation

2

Contribution

3

Limitations

The authors have appropriately acknowledged various limitations of their work, encompassing both methodological aspects and empirical findings. However, there are additional limitations that I have outlined in my response to the Weaknesses section, which are not addressed in the paper.

Reviewer DgJh8/10 · confidence 4/52024-07-04

Summary

The authors present a method to determine a single direction that mediates refusal in LLMs. Erasing this direction provides an effective jailbreak for the various open-source LLMs examined in the paper, while strenghtening it makes the models refuse even non-harmful instructions. The algorithm is easy to implement and fast. The paper also provides an interesting analysis of adversarial suffixes, which suppress this direction by hijacking the attention heads that are crucial to this direction. These attention heads attend to the suffix instead of the (rest of the) the prompt that contains the harmful instruction.

Strengths

I found the paper very interesting and a pleasure to read. The main contribution is significant and elegant, and the additional analysis of adversarial suffixes contains valuable insights.

Weaknesses

I have two main concerns which are also questions: - I don't see why choosing a mean activation vector corresponding to one of the token positions makes sense. Shouldn't the direction of refusal be independent of the token position? Also, the token position depends on the LLM used, shouldn't it be independent of the LLM? - I think that more evidence is needed on whether the method is just preventing the model from parroting back the standard refusal strings (more than I.1). The refusal score part of the evaluation is also based on a manual compilation of refusal substrings. Even though this is in line with previous work, a model which just doesn't output these strings would get perfect score. The safety score mitigates this issue but I think it would still be interesting to know whether the LLMs rely strongly on these substrings and the direction corresponds to these, or there is something else going on. Maybe this is out of the scope of the paper, then the question could be left open. If my concerns are addressed I'll raise my score. Some small observations: - Figure 1 is very far from where it's referenced in the text. - The sentence at line 244 begins with a citation ([59]).

Questions

- Why is the refusal direction of the last token position selected for nearly all models? - How different are the directions between the token positions? - If I understand correctly, the refusal direction is already present in the model at one token position, and when we induce refusal we add it to all token positions. Is the same direction relevant for each token position?

Rating

8

Confidence

4

Soundness

3

Presentation

4

Contribution

3

Limitations

The paper includes a comprehensive section on limitations.

Area Chair 8qwp2024-08-12

Reviewer, please respond to authors

Hello Reviewer, Please take a moment to read and acknowledge the authors' response. Thanks, AC

Reviewer zJsi5/10 · confidence 4/52024-07-15

Summary

This paper identifies a direction in the LLM activation space that can control refusal behavior, subsequently proposing a new jailbreaking method that does not require harmful responses. Additionally, the authors analyze the relationship between adversarial suffixes and the refusal direction.

Strengths

1. The authors propose a new white-box jailbreaking method using the refusal vector, which does not require fine-tuning or helpful responses to harmful instructions. 2. The authors' analysis of the relationship between adversarial suffixes and the refusal direction, as well as the impact of adversarial suffixes on attention, is intriguing and can motivate further research. 3. The experiments are quite thorough, considering multiple LLMs.

Weaknesses

1. The novelty of this paper is relatively limited, as it primarily extends the application scenarios of activation addition. 2. The system prompt significantly impacts jailbreaking, making its performance unstable. I wonder if including the system prompt when constructing contrastive pairs would improve the effectiveness.

Questions

N/A

Rating

5

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

Yes

Area Chair 8qwp2024-08-12

Reviewer, please respond to authors

Hello Reviewer, Please take a moment to read and acknowledge the authors' rebuttal. Especially considering you gave a "borderline" review score, it would be helpful if you could weigh in on whether their response pushes you one direction or the other. Thanks, AC

Reviewer dLQd2024-08-09

Thank you for the detailed response. I agree that, although the semantics of the identified direction remain unclear, it is indeed a bottleneck that mediates the refusal behavior. I also believe that the proposed edits to the manuscript will help clarify this point. As a result, I am raising my score.

Reviewer ZAwD2024-08-10

Thank you for your detailed reply. I have no further concerns. In particular, I am very pleased to see that the authors honestly presented supplementary results that are inconsistent with the current speculation. The difference in sensitivity to system prompts between the two models is an interesting phenomenon. The previous explanation also does not affect the main claims of the paper. Therefore, I am willing to maintain an accepting score.

Reviewer zJsi2024-08-12

Thank you to the authors for their detailed response and additional experiments. From your experiments on the system prompt, it is clear that the system prompt indeed has a significant impact on the refusal vector. I agree with your statement and believe that future research on the relationship between context steering and activation steering is very necessary. Additionally, thank you for clarifying your contribution. Although you mentioned using non-multiple-choice data forms to compute the vector is non-trivial, similar extraction forms have been used in other works [1][2][3]. Thank you again for your response. I will maintain my score. [1] Li, Kenneth, et al. "Inference-time intervention: Eliciting truthful answers from a language model." Advances in Neural Information Processing Systems 36 (2024). [2] Zou, Andy, et al. "Representation engineering: A top-down approach to ai transparency." arXiv preprint arXiv:2310.01405 (2023). [3] Wang, Haoran, and Kai Shu. "Backdoor activation attack: Attack large language models using activation steering for safety-alignment." arXiv preprint arXiv:2311.09433 (2023).

Authorsrebuttal2024-08-12

We thank reviewer n1zj for the ethics review. We are glad to hear that the reviewer acknowledges our effort to acknowledge and discuss the ethical impact of our work. We would be happy to elaborate on potential mitigations. There are recent works aiming to make safety fine-tuning less brittle [1, 2], although the robustness of these methods to our particular methodology is not known. We hope that our work drives new ideas for how to make safety training more robust. [1] Qi, Xiangyu, et al. "Safety Alignment Should Be Made More Than Just a Few Tokens Deep." arXiv preprint arXiv:2406.05946 (2024). [2] Zou, Andy, et al. "Improving Alignment and Robustness with Short Circuiting." arXiv preprint arXiv:2406.04313 (2024).

Authorsrebuttal2024-08-12

We thank reviewer onVr for the ethics review. We are glad to hear that the reviewer thinks that we have properly and sufficiently acknowledged the ethical impact of our work. We are happy to add some details on specific misuse risks. We are also happy to elaborate on potential safeguards. One possible safeguard (although extreme and costly) would be for model providers to restrict model access to be black-box, enabling text-based classifiers to catch misuse. In the white-box regime, there are recent works aiming to make safety fine-tuning less brittle [1, 2], although the robustness of these methods to our particular methodology is not known. We hope that our work drives new ideas for how to make safety training more robust. [1] Qi, Xiangyu, et al. "Safety Alignment Should Be Made More Than Just a Few Tokens Deep." arXiv preprint arXiv:2406.05946 (2024). [2] Zou, Andy, et al. "Improving Alignment and Robustness with Short Circuiting." arXiv preprint arXiv:2406.04313 (2024).

Authorsrebuttal2024-08-13

We are glad that our responses were able to clarify some of your questions. We appreciate your engagement and your update. For the last question: we think of the direction as position agnostic (or at least approximating a position agnostic direction). It is indeed extracted from a particular token position - the token position where this direction is *most saliently* represented (e.g. has very high cosine similarity). However, the direction is not solely expressed at this source token position - in fact visualizing the projection of activations onto the direction reveals that this direction is also expressed at various other token positions within the prompt, although usually not as saliently as at the source token. Additionally, one could imagine other methods to obtain a direction which are explicitly position agnostic (e.g. find a direction via gradient descent such that projecting out the direction from all positions minimizes some refusal score metric).

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC