ChatPaper.aiChatPaper

コントラスティブ・アクティベーション追加によるLlama 2の制御

Steering Llama 2 via Contrastive Activation Addition

December 9, 2023
著者: Nina Rimsky, Nick Gabrieli, Julian Schulz, Meg Tong, Evan Hubinger, Alexander Matt Turner
cs.AI

要旨

本論文では、Contrastive Activation Addition(CAA)という革新的な手法を提案する。CAAは、言語モデルのフォワードパス中に活性化を変更することでモデルの挙動を制御する方法である。CAAは、事実に基づく応答と虚構の応答といった特定の挙動の正例と負例の間の残差ストリーム活性化の差分を平均化することで「ステアリングベクトル」を計算する。推論時には、これらのステアリングベクトルをユーザーのプロンプト後の全てのトークン位置に正または負の係数で加算し、目標とする挙動の程度を精密に制御する。我々は、Llama 2 Chatを用いて、多肢選択式の行動質問データセットと自由生成タスクの両方でCAAの有効性を評価した。その結果、CAAがモデルの挙動を大きく変化させ、ファインチューニングやFew-shotプロンプティングといった従来手法を上回り、能力の低下を最小限に抑えることを実証した。さらに、様々な活性化空間解釈手法を用いることで、CAAのメカニズムについてより深い洞察を得た。CAAは、モデルの出力を正確に制御するだけでなく、大規模言語モデル(LLM)において高レベルの概念がどのように表現されているかを明らかにするものである。
English
We introduce Contrastive Activation Addition (CAA), an innovative method for steering language models by modifying activations during their forward passes. CAA computes ``steering vectors'' by averaging the difference in residual stream activations between pairs of positive and negative examples of a particular behavior such as factual versus hallucinatory responses. During inference, these steering vectors are added at all token positions after the user's prompt with either a positive or negative coefficient, allowing precise control over the degree of the targeted behavior. We evaluate CAA's effectiveness on Llama 2 Chat using both multiple-choice behavioral question datasets and open-ended generation tasks. We demonstrate that CAA significantly alters model behavior, outperforms traditional methods like finetuning and few-shot prompting, and minimally reduces capabilities. Moreover, by employing various activation space interpretation methods, we gain deeper insights into CAA's mechanisms. CAA both accurately steers model outputs and also sheds light on how high-level concepts are represented in Large Language Models (LLMs).
PDF151December 15, 2024