00:00:00

Share Your Feedback 🏝️

Model | Neural Daredevil

Model | Neural Daredevil

MinWoo(Daniel) Park | Tech Blog

Read more
Previous: Block Transformer Next: Survey | LLMs-Driven Synthetic Data

Model | Neural Daredevil

  • Related Project: Private
  • Category: Paper Review
  • Date: 2024-05-06

Refusal in LLMs is mediated by a single direction

  • url: https://www.lesswrong.com/posts/jGuXSZgv6qfdhMCuJ/refusal-in-llms-is-mediated-by-a-single-direction
  • huggingface: https://huggingface.co/mlabonne/NeuralDaredevil-8B-abliterated
  • abstract: Modern LLMs are typically fine-tuned for instruction-following and safety. Of particular interest is that they are trained to refuse harmful requests, e.g. answering “How can I make a bomb?” with “Sorry, I cannot help you.” We find that refusal is mediated by a single direction in the residual stream: preventing the model from representing this direction hinders its ability to refuse requests, and artificially adding in this direction causes the model to refuse harmless requests. We find that this phenomenon holds across open-source model families and model scales. This observation naturally gives rise to a simple modification of the model weights, which effectively jailbreaks the model without requiring any fine-tuning or inference-time interventions. We do not believe this introduces any new risks, as it was already widely known that safety guardrails can be cheaply fine-tuned away, but this novel jailbreak technique both validates our interpretability results, and further demonstrates the fragility of safety fine-tuning of open-source chat models. See this Colab notebook for a simple demo of our methodology.

Contents

TL;DR


  • 대규모 언어모델에서 요청 거부 메커니즘 이해
  • 단일 방향성 특징을 통한 거부 유발 및 차단 방법
  • 실험을 통해 거부 메커니즘의 존재 및 조작 가능성 입증

Related Post

  • LLM Abliteration
  • Anthropic Toy Model 및 후속 논문

1. 서론

현대 대규모 언어모델(Large Language Models, LLMs)은 사용자의 지시에 따라 안전하고 적절한 반응을 제공하도록 특별히 조정됩니다. 이런 모델은 “어떻게 폭탄을 만드나?”와 같은 유해한 요청에 대해서는 “죄송합니다, 도와드릴 수 없습니다”라고 거부하는 훈련을 받았습니다. 본 연구는 이런 거부가 어떻게 기계적으로 구현되는지에 대해 탐구합니다.


2. 이론적 배경과 선행 연구

이전 연구에서는 모델 내부의 특정 개념을 선형적으로 표현하는 방법에 초점을 맞추었습니다. Zou 외(2023)는 해로움을 대변하는 방향성을 추출하고, 이를 모델 활성화에 개입하여 모델을 조종할 수 있음을 보였습니다. 이 연구는 이런 개념의 방향성을 추출하고 이를 활용하여 모델의 거부 기능을 조작할 수 있는지를 조사합니다.


3. 방법

3.1 거부 방향 찾기

  • 실험 구성: $n=512$의 유해 지시문과 무해 지시문을 모델에 입력하여 마지막 토큰 위치에서의 잔류 스트림 활성화를 캐싱합니다.
  • 수학적 접근: 유해 활성화와 무해 활성화의 평균 차이를 계산하여 각 계층 $l$에서의 차이 벡터 $r_l$을 도출합니다. 이 벡터를 정규화하여 거부 방향 $\hat{r}$를 얻습니다.

3.2 거부 방향 제거

  • 모델이 $\hat{r}$를 표현하지 못하도록 각 구성 요소의 출력에서 $\hat{r}$에 대한 투영을 제거합니다.

    \[c'_{out} = c_{out} - (c_{out} \cdot \hat{r})\hat{r}\]

3.3 거부 방향 추가

  • 무해 지시에 대해 모델이 $\hat{r}$을 표현하도록 인위적으로 추가합니다.

    \[a'_{harmless} = a_{harmless} - (a_{harmless} \cdot \hat{r})\hat{r} + (avg\_proj_{harmful})\hat{r}\]


4. 결과

  • 거부 우회: 거부 방향 제거로 모델은 유해 지시에 대해 거부하지 않고, 유해한 내용을 생성하는 경향을 보였습니다.
  • 거부 유발: 거부 방향 추가로 무해 지시에 대해서도 거부 반응을 유발하였습니다.


5. 실험 및 분석

  • PCA 분해를 통한 활성화 공간의 시각화: 유해 및 무해 활성화가 주성분 분석에서 첫 번째 주성분에 의해 강하게 구분되는 것을 확인하였습니다. 이는 거부가 활성화 공간 내의 일차원 선형 부분공간으로 표현됨을 시사합니다.

[PCA 색인]


6. 결론 및 향후 연구

이 연구는 거부가 단일 방향성 특징에 의해 매개될 수 있음을 보여줍니다. 이는 모델의 안전성 조정이 얼마나 취약한지를 또한 시사하며, 이런 지식을 통해 보다 효과적인 안전 조치를 개발할 수 있는 기반을 마련합니다.

본 논문은 거부 메커니즘의 이해와 조작 가능성에 대한 새로운 통찰을 제공하며, 다양한 모델 규모에서의 일관된 결과는 이런 방법의 범용성을 강조합니다.


Previous: Block Transformer Next: Survey | LLMs-Driven Synthetic Data

post contain ""

    No matching posts found containing ""