Steering Llama 2 via Contrastive Activation Addition

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Panickssery, Nina, Gabrieli, Nick, Schulz, Julian, Tong, Meg, Hubinger, Evan, Turner, Alexander Matt
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917713230692352
author Panickssery, Nina
Gabrieli, Nick
Schulz, Julian
Tong, Meg
Hubinger, Evan
Turner, Alexander Matt
author_facet Panickssery, Nina
Gabrieli, Nick
Schulz, Julian
Tong, Meg
Hubinger, Evan
Turner, Alexander Matt
contents We introduce Contrastive Activation Addition (CAA), an innovative method for steering language models by modifying their activations during 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 multiple-choice behavioral question datasets and open-ended generation tasks. We demonstrate that CAA significantly alters model behavior, is effective over and on top of traditional methods like finetuning and system prompt design, and minimally reduces capabilities. Moreover, we gain deeper insights into CAA's mechanisms by employing various activation space interpretation methods. CAA accurately steers model outputs and sheds light on how high-level concepts are represented in Large Language Models (LLMs).
format Preprint
id arxiv_https___arxiv_org_abs_2312_06681
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Steering Llama 2 via Contrastive Activation Addition
Panickssery, Nina
Gabrieli, Nick
Schulz, Julian
Tong, Meg
Hubinger, Evan
Turner, Alexander Matt
Computation and Language
Artificial Intelligence
Machine Learning
We introduce Contrastive Activation Addition (CAA), an innovative method for steering language models by modifying their activations during 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 multiple-choice behavioral question datasets and open-ended generation tasks. We demonstrate that CAA significantly alters model behavior, is effective over and on top of traditional methods like finetuning and system prompt design, and minimally reduces capabilities. Moreover, we gain deeper insights into CAA's mechanisms by employing various activation space interpretation methods. CAA accurately steers model outputs and sheds light on how high-level concepts are represented in Large Language Models (LLMs).
title Steering Llama 2 via Contrastive Activation Addition
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2312.06681