Activation Scaling for Steering and Interpreting Language Models

Niklas Stoehr, Kevin Du, Vésteinn Snæbjarnarson, Robert West, Ryan Cotterell +1 more
10/7/2024
cs.CLcs.AI

No official code found. Best implementation: niklasstoehr/activationScaling (2 stars, last commit 2024-11-14).

Abstract

Given the prompt "Rome is in", can we steer a language model to flip its prediction of an incorrect token "France" to a correct token "Italy" by only multiplying a few relevant activation vectors with scalars? We argue that successfully intervening on a model is a prerequisite for interpreting its internal workings. Concretely, we establish a three-term objective: a successful intervention should flip the correct with the wrong token and vice versa (effectiveness), and leave other tokens unaffected (faithfulness), all while being sparse (minimality). Using gradient-based optimization, this objective lets us learn (and later evaluate) a specific kind of efficient and interpretable intervention: activation scaling only modifies the signed magnitude of activation vectors to strengthen, weaken, or reverse the steering directions already encoded in the model. On synthetic tasks, this intervention performs comparably with steering vectors in terms of effectiveness and faithfulness, but is much more minimal allowing us to pinpoint interpretable model components. We evaluate activation scaling from different angles, compare performance on different datasets, and make activation scalars a learnable function of the activation vectors themselves to generalize to varying-length prompts.

View on arXivView PDF

Code Implementations(1)

🎚️Activation Scaling for Steering and Interpreting Language Models

20Nov 14, 20241 years ago

Similar Papers

Cite this paper

@article{stoehr2024activation,
  title  = {Activation Scaling for Steering and Interpreting Language Models},
  author = {Niklas Stoehr and Kevin Du and Vésteinn Snæbjarnarson and Robert West and Ryan Cotterell and Aaron Schein},
  year   = {2024},
  eprint = {2410.04962},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.04962v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.04962.svg)](https://codeofpaper.com/paper/2410.04962)

Discussion