Skip to main content
QUICK REVIEW

[논문 리뷰] Steering Language Models With Activation Engineering

Alexander Turner, Lisa Thiergart|arXiv (Cornell University)|2023. 08. 20.
Explainable Artificial Intelligence (XAI)인용 수 4
한 줄 요약

이 논문은 추론 시점에서 대규모 언어 모델을 조정하기 위한 Activation Addition (ActAdd) 방법을 소개한다. 이 방법은 최적화나 레이블이 없는 데이터를 사용하지 않고, 프롬프트 쌍 간의 활성화 차이에서 조정 벡터를 계산함으로써 작동한다. 이를 통해 감정, 주제, 스타일과 같은 행동을 자연어로 제어할 수 있으며, 모델 성능을 유지하면서도 모델 크기에 비례해 효율적으로 확장된다.

ABSTRACT

Prompt engineering and finetuning aim to maximize language model performance on a given metric (like toxicity reduction). However, these methods do not fully elicit a model's capabilities. To reduce this gap, we introduce activation engineering: the inference-time modification of activations in order to control (or steer) model outputs. Specifically, we introduce the Activation Addition (ActAdd) technique, which contrasts the intermediate activations on prompt pairs (such as "Love" versus "Hate") to compute a steering vector (Subramani et al. 2022). By tactically adding in e.g. the "Love" - "Hate" steering vector during the forward pass, we achieve SOTA on negative-to-positive sentiment shift and detoxification using models including LLaMA-3 and OPT. ActAdd yields inference-time control over high-level output properties (like topic and sentiment) while preserving performance on off-target tasks. ActAdd is lightweight: it does not require any machine optimization and works with a single pair of data points, which enables rapid iteration over steering. ActAdd demonstrates the power of activation engineering.

연구 동기 및 목표

  • 계산 비용이 많이 드는 파인튜닝이나 강화학습 없이도 신뢰할 수 있는 방식으로 대규모 언어 모델(LLM)을 제어하는 도전 과제를 해결한다.
  • 추론 시점에 사용자에게 친화적인 자연어로 원하는 모델 행동을 명시할 수 있도록 한다.
  • 역전파나 레이블이 없는 데이터를 피하는 경량이며 확장 가능한 LLM 조정 방법을 개발한다.
  • 감정, 주제, 스타일과 같은 고수준 출력 속성에 대해 타겟된 제어를 가능하게 하면서도 전체 모델 성능을 유지한다.

제안 방법

  • 대조적인 프롬프트 쌍(예: 'I love you' 대비 'I hate you')가 생성한 활성화 간의 차이로 조정 벡터를 계산한다.
  • 추론 중에 특정 레이어에서 활성화에 조정 벡터를 더함으로써 모델의 잔류 스트림에 적용한다.
  • 조정 강도를 제어하기 위해 조정 벡터를 학습 가능한 계수로 스케일링한다.
  • 조정 벡터를 생성하기 위해 역전파, 파인튜닝, 레이블이 없는 데이터가 필요로 하지 않는다.
  • 파인튜닝된 LLM을 동결한 상태에서 추론 시점에 적용함으로써 재학습 없이 실시간 제어를 가능하게 한다.
  • 목표된 행동 변화를 최대화하기 위해 추론 시점에서 레이어와 계수를 추론 또는 히우리스틱 검색을 통해 선택한다.
Figure 1: Schematic of the Activation Addition ( ActAdd ) method. $=$ natural language text; $\bullet$ = vectors of activations just before a specified layer. In this example, the output is heavily biased towards discussing weddings, regardless of the topic of the user prompt. (See Algorithm 1 for o
Figure 1: Schematic of the Activation Addition ( ActAdd ) method. $=$ natural language text; $\bullet$ = vectors of activations just before a specified layer. In this example, the output is heavily biased towards discussing weddings, regardless of the topic of the user prompt. (See Algorithm 1 for o

실험 결과

연구 질문

  • RQ1자연어 프롬프트 쌍 간의 활성화 차이가 추론 시점 제어를 위한 효과적인 조정 벡터를 신뢰성 있게 생성할 수 있는가?
  • RQ2ActAdd는 분포 외부 또는 타겟되지 않은 작업에 대해 모델의 전반적인 성능을 유지하는가?
  • RQ3모델 크기에 따라 ActAdd는 어떻게 확장되며, 파인튜닝이나 RLHF에 비해 계산 오버헤드는 어떠한가?
  • RQ4ActAdd는 감정이나 주제와 같은 특정 속성에 대해 단조롭거나 비단조화로운 제어를 달성할 수 있으며, 이러한 행동의 원인은 무엇인가?
  • RQ5GPT-2, Llama-13B, GPT-J-6B와 같은 다양한 모델 간에서 메서드가 강건한가? 그리고 다양한 프롬프트에 대해 일반화되는가?

주요 결과

  • ActAdd는 파인튜닝 없이도 OpenWebText와 ConceptNet에서 GPT-2의 감정, 주제, 스타일을 매우 낮은 계산 비용으로 조정하는 데 성공했다.
  • 비타겟 작업에 대해서도 모델 성능을 유지함으로써 강건성과 일반화 능력을 입증했다.
  • GPT-2에서 ActAdd는 단순히 전방 전파와 레이블이 없는 데이터만을 사용하여 출력 속성에 대해 상당한 제어를 달성했다—예를 들어, 'hate'에서 'love'로 완성문을 이동시켰다.
  • 잔류 스트림 차원의 일부를 수정할 경우 비단조화로운 행동이 관찰되어, 활성화 공간 내 복잡한 특징 표현과 잠재적인 축 정렬 현상이 존재함을 시사했다.
  • 이 방법은 모델 크기에 따라 자연스럽게 확장되며, 기울기 기반 최적화가 필요한 다른 활성화 엔지니어링 방법보다 훨씬 쉽게 구현할 수 있다.
  • Llama-13B에서의 복제 실험 결과 유사한 성공을 보였지만, 일부 프롬프트(예: Eiffel Tower 사실)에서는 복제 실패가 발생하여 맥락과 특징 정렬에 민감함을 보였다.
Figure 2: Performance of ActAdd on a target topic as the topic becomes more relevant. The perplexity ratio (lower better) compares the relative predictive performance of ActAdd and an unmodified model; we see that adding a wedding - ‘ ’ steering vector improves performance on wedding-related text wh
Figure 2: Performance of ActAdd on a target topic as the topic becomes more relevant. The perplexity ratio (lower better) compares the relative predictive performance of ActAdd and an unmodified model; we see that adding a wedding - ‘ ’ steering vector improves performance on wedding-related text wh

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.