Steering Language Models with Activation Engineering

## Abstract

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.

## 1 Introduction

LLMs contain hidden capabilities we do not know how to fully elicit (Korinek, ). Naively prompting a model with a question does not maximize the probability of the correct response. Carefully consider how prompting a model to think “step-by-step” (Wei et al., ) massively improves performance on a range of benchmarks. Similarly, “few-shot” prompting a model with correct answers to unrelated in-distribution questions allows “in-context learning” for e.g. stronger performance on NLP tasks (Brown et al., ). Importantly, these interventions do not supply the LLM with extra task-relevant information or update the algorithm implemented by the LLM’s computational graph. Even though the model is initially *able* to score higher on these benchmarks, those capabilities do not emerge without a specific intervention. We therefore hypothesize the presence of an *elicitation overhang*: we do not know how to elicit all relevant abilities and information from frontier models.

Prompt engineering is the most obvious way to steer a model, but prompting has limited reliability (Ye & Durrett, ; Wang et al., ). Therefore, to reduce the elicitation overhang, we explore a new modality for steering language model outputs. By strategically perturbing activations during the forward pass, we hope to more reliably and effectively steer models compared to prompt engineering. We call this methodology *activation engineering*.

We suspect that compared to prompt engineering, activation engineering can elicit a wider range of model capabilities. Consider, for example, a model optimized to imitate the text outputs of eloquent poets and awkward mathematicians. The model may contain the internal mechanisms required to output text which is *both* eloquent and mathematical. However, if the model is an accurate estimator of the training distribution, it will (correctly) assign low probability to eloquent mathematical prose. Because nothing in the training data was both eloquent and mathematical, there may exist no prompt which elicits mathematical prose. In contrast, activation engineering might be able to simultaneously activate the circuitry for eloquent speech and for mathematical content.

To demonstrate the power of activation engineering, we introduce *Activation Addition* (ActAdd). Suppose we want to achieve negative-to-positive sentiment control (Li et al., ; Dathathri et al., ). To achieve this, ActAdd first compares the model’s activations on a contrast pair of prompts, such as the prompts “Love” and “Hate.” The otherwise-similar prompts differ along the target dimension of sentiment. ActAdd then computes the difference of these activations in order to compute *steering vectors*. These vectors act like “virtual bias terms” because ActAdd *directly adds* the steering vectors to the forward pass at inference time. By shifting the inference-time activations along the direction of the steering vector, ActAdd steers the model to generate positive sentiment completions (Table 1).

**Table 1: The impact of ActAdd. The steering vectors are computed from (“Love” - “Hate”) and (“I talk about weddings constantly” - “I do not talk about weddings constantly”). Appendix Table 6 shows more examples.**
| Prompt | + | steering | =       completion |
| --- | --- | --- | --- |
| I hate you because… |  | [None] | …you are the most disgusting thing I have ever seen. |
|  |  | ActAdd<br>(love) | …you are so beautiful and I want to be with you forever. |
| I went up to my<br>friend and said… |  | [None] | …“I’m sorry, I can’t help you.”<br>“No,” he said. “You’re not.” |
|  |  | ActAdd<br>(weddings) | …“I’m going to talk about the<br>wedding in this episode of<br>Wedding Season. I think it’s a really good episode.<br>It’s<br>about how you’re supposed<br>to talk about weddings.” |

##### Contributions.

We unify past literature on related topics to introduce *activation engineering*. To better elicit the full capabilities of models, we introduce the ActAdd steering method, which achieves SOTA on toxicity reduction and sentiment control. We thoroughly test the steered models to verify the preservation of their general capabilities. We therefore show the promise of ActAdd as an effective and cheap method for steering LLM outputs.

## 2 Related Work

Latent space arithmetic.
Research in generative models for computer vision has long demonstrated the ability to steer image generation using derived vectors, including steering latent variables – most famously, shifting activations along a direction that corresponds to smiles in images (Larsen et al. ; White ). Similarly, in the text domain, classic results on the word2vec embedding show that arithmetic on word vectors can capture some parts of semantic reasoning (for instance, analogies: Mikolov et al. ; ). Our work focuses on steering generative language models.

##### LLM steering.

Many approaches attempt to affect the output of a pretrained LLM, whether:

- •
Intervening on weights, as with supervised finetuning, RLHF, steerable layers, and weight editing (that is, targeted fine-tuning) (Ranzato et al. ; Ziegler et al. ; Dathathri et al. ; Meng et al. ; Ilharco et al. ).
However, naive RLHF, finetuning, and weight editing have known side-effects on overall model performance (Hase et al. ; Qi et al. ; Brown et al. );
- •
Intervening at decoding, as with guided or trainable decoding (Gu et al. ; Grover et al. ; see Zhang et al. for an overview of controlled generation and Jin et al. for textual style transfer);
- •
Intervening on the prompt, as with automated prompt engineering (Shin et al. ; Zhou et al. );
- •
Intervening on token embeddings, as with ‘soft prompting’ (Li & Liang ; Lester et al. ; Khashabi et al. );
- •
Intervening on activations, for instance by freezing the weights of the LLM and searching for a ‘steering vector’ of activations, e.g. using gradient descent (Subramani et al. ; Hernandez et al. ). These optimized extraction methods, which search for a steering vector, differ from
extraction methods which directly compute it (present work and Li et al. ). In our work, we do not use gradient descent or other optimization methods.

**Table 2: Locating our work in the steering literature.**
|  | Vector intervenes on model … |  |
| --- | --- | --- |
| Intervention vectors obtained via | … weights | … activations |
| Differences after fine-tuning | Ilharco 2023 | N/A |
| Per-query gradient-based search | Meng 2022,<br>Orgad 2023 | Dathathri 2020<br>Subramani 2022<br>Hernandez 2023 |
| Differences between prompt pairs | N/A | ActAdd  (present work),<br>Li et al., |

##### Activation engineering.

Activation engineering involves creating vectors of activations which cause desired changes to output text when added to the forward passes of a frozen LLM (Dathathri et al. ). Table 2 organizes prior work by intervention type.

An early antecedent is the Plug-and-Play Language Model of Dathathri et al. . This uses a separate classifier (one classifier per attribute to steer towards) to perturb the
model’s activations to generate text that accords more closely with the classifier’s target.
Subramani et al. extract latent steering vectors from a frozen LLM, successfully discovering sentence-specific vectors which steer completions to near-perfect BLEU scores (i.e, control of the LLM’s generation) and unsupervised style transfer. However, the method requires running gradient descent for each new steering vector.
Hernandez et al. locate and edit an LLM’s knowledge through learning an encoding of facts in its activation space. Ablating attention heads can also be seen as activation engineering, though the technique is mostly used for model interpretation rather than steering (Michel et al. ; Olsson et al. ).

Independently, Li et al. developed a similar method called ITI which computes steering vectors which are selectively applied according to trained linear probes. They use these probes to find attention heads with different activation distributions for true and false statements. They steer the model toward truthful outputs, where our experiments cover a range of goals. In addition, ITI adds the same steering vector at all sequence positions during inference and ITI requires dozens of samples. In contrast, ActAdd we add steering vectors to a subset of sequence positions and require as few as 2 samples. Similar work on ‘in-context vectors’ also followed ours (Liu et al. ). Lastly, Zou et al. ’s “representation engineering” also followed our work. They develop a range of techniques for deriving steering vectors and for steering models using activation-space edits and optimization. In comparison to Zou et al. , we steer different models (LLaMA-3, OPT, GPT-2, and GPT-J) on different tasks (detoxification and sentiment control).

Figure: 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 the method’s parameters: intervention strength, intervention layer, and sequence alignment.)
Refer to caption: x1.png

## 3 How Activation Addition works

We use decoder-only Transformer neural networks (Vaswani et al. ). The LLMs in this work contain a stack of Transformer layers, each consisting of multi-head attention (MHA) and a feedforward network (FFN). We focus on its “residual streams” (Elhage et al. ), the sequences $(\mathbf{x}_{0},...,\mathbf{x}_{n})$ of intermediate activation vectors processed by each layer. ActAdd manipulates the residual stream values $\mathbf{h}^{l}$ input to layer $l$. Each layer performs MHA and FFN computations on $\mathbf{x}_{i}$, adding $\mathbf{x}_{i+1}$ to the stream. The final vector $\mathbf{x}_{n}$ in the stream can then be decoded into the next-token prediction. At inference time, the residual stream is initialized $\mathbf{h}^{1}$ with the embedding of the tokenized prompt.

Activation addition. Our method takes a pair of natural-language prompts $(p_{+},p_{-})$, where $p_{+}$ represents the property we wish output text to emphasise (e.g. love) and $p_{-}$ represents its opposite (e.g. hate or indifference). $\mathbf{h}_{+}^{l}$ is the activation vector for the prompt $p_{+}$ at layer $l$. The difference $\mathbf{h}_{+}^{l}-\mathbf{h}_{-}^{l}$ is a new activation vector which (intuitively) captures the difference between a prompt with the target property, and a prompt without it. The steering vector is computed before inference time.

Figure: Algorithm 1 ActAdd, optimization-free activation addition

To obtain a steering vector, we perform a forward pass on each prompt, record the activations at the given location in each pass, take the difference $\mathbf{h}_{+}^{l}-\mathbf{h}_{-}^{l}$, and then finally rescale this difference in activations by an ‘injection coefficient’ $c$. To steer, we add the resulting activation vector to the input of layer $l$ and allow the forward pass to continue, and so obtain our steered output.(^1^11See Appendix C for implementation details.) $c$ represents the intervention strength, since it multiplies the steering vector’s contribution to the residual stream.(^2^22It’s typical for the intervention strength $c$ to have a magnitude less than 15.) We perform hyperparameter tuning to select $c$ and also the injection layer $l$. As expected from past work (Subramani et al. ; Mini et al. ), intervening at the middle layers is most effective.

Algorithm 1 and Figure 1 depict the resulting ActAdd method. In the appendix, Figure 6 illustrates a figurative example of steering a model with ActAdd if that model had one-dimensional residual streams (rather than e.g. GPT-2-XL’s 1600 dimensions).
A runnable notebook can be found at [tinyurl.com/actadd](https://tinyurl.com/actadd).

We test whether 1) steering vectors are effective at eliciting the desired behavioral shift, and 2) whether they preserve the general capabilities of the model. We run perplexity-based experiments on GPT-2-XL (1.5B parameters, Radford et al. ). We then run toxicity and sentiment experiments on OPT (Zhang et al. ) and LLaMA-3 (Meta ).

## 4 Results: Activation Addition works

A summary of all experiments can be found in Table 5.(^3^33Code repository for our experiments: [https://zenodo.org/records/13879423](https://zenodo.org/records/13879423).)

### 4.1 ActAdd intuitively modifies next-token probabilities

We consider the OpenWebText corpus (Peterson et al. ). Our running example is the “wedding” topic vector produced by setting $p_{+}=$ weddings, $p_{-}=$
‘   ’, $l=16$, $c=1$.

#### 4.1.1 ActAdd reduces perplexity on a target topic

Figure: Figure 2: The perplexity ratio compares the relative predictive performance of ActAdd and an unmodified model. Lower is better. Adding the wedding steering vector improves performance on wedding-related text while preserving performance on unrelated text.
Refer to caption: x2.png

For each document $d_{i}\in D$ in OpenWebText (Peterson et al. ), we first calculate the frequency of wedding-related words.(^4^44wedding, weddings, wed, marry, married, marriage, bride, groom, and honeymoon.) If a document contains one of these words, the document is considered wedding-related. We randomly sample 300k documents, half of which are wedding-related.

We split the documents into sentences and measure GPT-2-XL’s perplexity on both the wedding-related and wedding-unrelated sentences. If the model is effectively steered to generate wedding-related text, it should assign that text higher probability (and thus achieve lower perplexity). For more details, see Section C.1.

Figure 2 shows the ActAdd perplexity relative to the unmodified model. In sentences where the injected topic (weddings) is more relevant, ActAdd’s perplexity is lower and predictive performance increases.

#### 4.1.2 ActAdd’s impact on token probabilities

To test if the intervention is affecting relevant tokens or reducing perplexity in some spurious way, we observe the shift in the distribution of token log probabilities. We do this by randomly sampling 500 documents from the above OpenWebText sample and recording the log-probabilities assigned by the baseline and steered models. This results in a dataset of about 500k tokens, of which 29k are unique. We then group by token, filter for tokens with $>\!\!20$ instances in the dataset, and calculate the mean perplexity difference between the ActAdd and baseline models. By displaying these as a Q-Q plot (Gnanadesikan & Wilk ), we can inspect outlier shifts in token probability.

Appendix Figure 8 shows the resulting mean log-probability difference distribution. We see that is approximately normal for the bulk of the tokens but with clearly heavy tails. The positive tail is significantly heavier than the negative tail, suggesting that one set of tokens are reliably increased in probability, with a smaller set of tokens reliably decreased to a lesser extent. Outlier tokens can be found in Appendix Table 11. *The probabilities most increased on average are primarily wedding-related.* The bottom tokens share no obvious theme and show a significantly lower absolute change in probability.

#### 4.1.3 ActAdd steers the model to discuss weddings

At what layer are steering vectors most effective? Sweeping over GPT-2-XL injection layers for the wedding vector, we measure the average count of wedding-related words given a steering vector injected at each layer.

Figure: Figure 3: P(steered completion contains wedding-related words) as a function of injection layer.
Refer to caption: x3.png

The intervention is already effective at the very first layer, rises in effectiveness until layer 6, and then declines. For the optimal injection site, we see $>$90% success in topic steering (compared to a $\sim$2% baseline). Figure 3 shows the results of the layer sweep.

### 4.2 ActAdd can control what the model talks about

Method.
Steering vectors can elicit generations on a range of topics – not just weddings. Starting from a generic prompt, we use GPT-3.5 to score whether the generations are about a target topic. Specifically, we generate 100 completions for the unmodified model and 100 for each target single-token ActAdd intervention (each token is about a different topic). Compared to the baseline generations, we record how much *more* frequently the steered model discusses the target topic.

Results.
Figure 4 records a large boost in relevance (5-20%) on all topics at injection coefficient $c=2$ (with the exception of “art”).

Figure: Figure 4: GPT-3.5-scored relevance of ActAdd completions on a range of generic topics.
Refer to caption: x4.png

### 4.3 ActAdd can reduce toxicity

Method.
We benchmark toxicity reduction by generating steered continuations from RealToxicityPrompts (Gehman et al., ). Following Pei et al. we use a random subset $n=1,000$. We repeat this sampling 5 times to obtain $p$-values ($t$-test against SOTA), bolding rows which are better with $p<0.05$. For each continuation, we use the [Perspective API](https://perspectiveapi.com/) to score toxicity.

Results.
To establish a common scale, we reused the baselines and PREADD results from Pei et al. , adding Air-Decoding Zhong et al. and FUDGE Yang & Klein . This yields 6 baselines to compare ActAdd against. (We also considered Gu et al. (which reported 0.043 toxicity), but we could not reproduce the results; also, their disfluency (54.6) is too high for practical use.) We compare to ActAdd using OPT (Zhang et al. ) and LLaMA-3 (Meta ).(^5^55We do not compare against finetuning because we wish to consider lighter-weight interventions which require minimal gradient updates.)

As shown in Table 3, ActAdd-OPT has 8% lower toxicity than the second-best, PREADD-D-OPT, and ActAdd-LLaMA-3 gives a 5% drop over LLaMA-3 with a very small fluency penalty.

**Table 3: Results on RealToxicityPrompts (random n=1000). The OPT used is 6.7B parameters, LLaMA-3-8B. Bold is $p<0.05$ against second-best. Gray text denotes numbers reported by Pei et al. (PREADD), Yang & Klein (FUDGE), or Zhong et al. (Air-Decoding). More recent models are less toxic by default. However, ActAdd-OPT is the least toxic of the OPT interventions and even outperforms an unsteered LLaMA-3.**
| Control Type | Method | Model | Toxicity $\downarrow$ | (Dis)Fluency $\downarrow$ | Relevance $\uparrow$ |
| --- | --- | --- | --- | --- | --- |
| Unsteered | baseline | OPT | .134 | 8.9 | .369 |
| Prompting | baseline | OPT | .200 | 54.3 | .294 |
| Steering vector | ActAdd | OPT | .112 | 13.8 | .329 |
| Controlled gen. | FUDGE | GPT-2-M | .128 | 22.1 | .329 |
| Contrast. decoding | PREADD-S | OPT | .134 | 51.7 | .290 |
| Contrast. decoding | PREADD-D | OPT | .122 | 56.6 | .326 |
| Gradient-guided gen. | Air-Decoding | GPT-2-L | .185 | 48.3 | - |
| Unsteered | baseline | LLaMA3 | .114 | 6.3 | .391 |
| Steering vector | ActAdd | LLaMA3 | .108 | 6.7 | .365 |

### 4.4 ActAdd can control sentiment

Method.
To evaluate sentiment, we use the Stanford IMDb dataset (Maas et al., ). Our goal is for the model to continue each review but with the opposite sentiment. We compute the proportion of generated outputs with the desired sentiment, as classified by a model finetuned on sentiment data, SiEBERT (Hartmann et al. ). For quality controls, we follow the conventional use of conditional perplexity to mark (dis)fluency, obtained using GPT-3 davinci-002 logprobs. We use cosine similarity between the prompt and continuation sentence embeddings to gauge the relevance of text in $[0,1]$. We evaluate sentiment changes from positive to negative and vice versa on a random subset of $n=1,000$ and repeat to obtain $p$-values.

**Table 4: Results on IMDb sentiment. “Steering” denotes the probability of changing sentiment classification (called “success” in the baselines’ papers). Bold results represent $p<0.05$ compared to the second-best. Gray text denotes numbers reported by Pei et al. . Underline denotes best steered result. Fluency is worse under all steering methods; 1.5x to 3x worse for ActAdd, 7x worse for PREADD.**
|  | positive to negative | negative to positive |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| Method | Steering $\uparrow$ | Disfluency $\downarrow$ | Relevance $\uparrow$ | Steer. $\uparrow$ | Disflu. $\downarrow$ | Rel. $\uparrow$ |
| ActAdd-OPT | 0.432 | 24.2 | 0.387 | 0.564 | 20.95 | 0.363 |
| ActAdd-LLaMA3 | 0.268 | 8.6 | 0.354 | 0.669 | 15.2 | 0.275 |
| OPT-Baseline | 0.175 | 8.95 | 0.430 | 0.445 | 9.38 | 0.423 |
| LLaMA3-Baseline | 0.138 | 5.8 | 0.437 | 0.417 | 6.09 | 0.426 |
| OPT-Prompt | 0.307 | 53.5 | 0.298 | 0.365 | 50.9 | 0.287 |
| FUDGE | 0.532 | 25.1 | 0.311 | 0.551 | 22.7 | 0.320 |
| PREADD-S-OPT | 0.631 | 68.4 | 0.253 | 0.624 | 67.1 | 0.258 |

Results.
Table 4 shows that our method is competitive on a conventional measure of sentiment control (Maas et al. ).
We obtain state of the art success at steering from negative to positive sentiment. While. The only method which outperforms ActAdd in the positive to negative direction incurs a large penalty to fluency (68.4 vs 24.2, when matching methods on the same pretrained model) and relevance.

### 4.5 ActAdd preserves the model’s general knowledge

Method.
We use ConceptNet from the LAMA benchmark, a general knowledge dataset (Petroni et al. , $n=29,774$ sentences, see Appendix Table 10). The model is given a prompt and then has to predict a factual completion. The task is intended for both causal and masked models, so some examples are difficult for causal-attention models (like GPT-2) due to the extremely limited context.

For each sentence, we run the model on its prompt with and without the wedding activation addition. $P@K$ is the probability that the expected label is among the model’s top-$K$ predicted tokens, conditioned on the prompt. We score the baseline and modified models by calculating mean $P@K$ values for a range of $K$. Finally we plot these for both modified and unmodified models over a range of $K$ values.

Results.
Figure 5 shows that on the ConceptNet benchmark of factual questions, our method has a negligible impact on off-target answer probabilities.

Figure: Figure 5: Testing side effects ofActAdd with the ConceptNet benchmark (Petroni et al. ). ‘$P@K$’ is the probability of the correct answer being in the model’s top $K$ answers. Our method has a negligible impact on off-target probabilities across a range of top-$K$ values.
Refer to caption: x5.png

## 5 Discussion

##### Algebraic combination of forward passes

ActAdd can be viewed as composition of separate forward passes. For example, we compose $\mathbf{h}_{+}$, $\mathbf{h}_{-}$ and $\mathbf{h}^{*}$ to produce steered output. We were surprised that forward passes can “compose” in this way, despite the model not being trained to allow this operation. The composability of forward passes is itself evidence for compositional representations (Olah ), independent of the evidence from task-composition arithmetic on weights (Ilharco et al. ).

##### Limitations

To steer the model using an ActAdd vector, the user supplies the injection coefficient $c$ and the intervention layer $l$. So far we have had success with fixing the sequence alignment $a=1$. Overall, these free hyperparameters make ActAdd less user-friendly than simple prompt engineering. Thankfully, the user does not have to perform a fresh hyperparameter sweep for each use case; in practice, intervention hyperparameters are stable.
We include examples of failed steering vectors in Appendix Table 7. We also have not examined ActAdd’s potential impact on reasoning.
ActAdd is not immediately applicable given only API access to a model. The model must both cache and expose intermediate activations at the given layer (Bloom & Nanda ). Currently, APIs generally do not allow for this.

##### Activation engineering vs finetuning

Finetuning is better understood and more flexible – we doubt that activation engineering can e.g. teach a model a new skill. However, finetuning is significantly more costly and may not be able to elicit the same kinds of capabilities which activation engineering can elicit.

The first advantage of ActAdd is efficiency: the method requires no backward passes and can thus run on any machine that can perform inference rather than training. Implementation effort is also greatly reduced; only forward passes are required to find a suitable ($p_{+},p_{-})$ and minimal labelled data is required - just the steering prompt pair. We discovered most of the example contrast pairs in Appendix Table 6 in minutes. All things considered, even nontechnical users can benefit from rapid feedback and relatively easy iteration

##### Activation engineering vs prompt engineering

Activation additions can be continuously weighted, while prompts are discrete – a token is either present, or not. To more intensely steer the model to generate wedding-related text, our method does not require any edit to the prompt, but instead just increasing the injection coefficient. See Appendix B for suggestive experiments on ActAdd vs prompting. Unlike system prompts, activation additions do not take up token space in the model’s context window, although this is a small benefit in the era of multi-million token context windows.

While prompting is more flexible and even cheaper than ActAdd, activation additions may elicit capabilities which prompting cannot (as evidenced by our superior results over prompting; see also the speculation in Section 1).

##### Interpretability of LLMs

In most programs, adding values to imprecisely targeted intermediate memory locations would not yield sensible results. Why expect this from Transformers?

A growing consensus is that the activation space of an LLM contains directions which represent high-level latents causally involved in what is generated (Burns et al. ; Moschella et al. ; Li et al. ; Nanda ; Li et al. ).

Our hypothesis, following Elhage et al. , is more specific: that neural networks represent features of the input as directions in activation space, that is, with a linear representation (Park et al. ). Moreover, the direction in activation space that corresponds to (say) a love-hate latent variable stays approximately the same across a broad class of inputs.

Alain & Bengio use linear probes on residual streams to infer that LLM representations are at least partially linear; if a linear probe can predict some feature of text output from the residuals with high accuracy, this forms evidence that the feature is represented linearly (i.e. as a simple direction) (Nanda ).

The success of activation addition gives stronger, experimental evidence of feature linearity, demonstrating that models *use* feature-related information. Consider the central Love - Hate vector example: we add it to the forward pass and so increase love-related completions. On the examined prompts, this direction is responsible for steering the rest of the model towards love-related completions. In general, steering vectors establish *causality*, at least in the limited set of contexts examined.

##### Value alignment of LLMs

Activation engineering is a promising way to control LLMs. Successor methods may be able to
provide general steering methods (e.g. through some analogue of a Be helpful vector). Alongside contemporaneous work (Li et al. ; Liu et al. ), our experiments suggest that activation engineering can flexibly retarget LLM behavior without damaging general performance. We speculate that ActAdd changes the model’s currently active mixture of goals and priorities. Suitably developed, the activation engineering approach could enable safety progress while preserving overall capabilities

## 6 Conclusion

While methods like prompt engineering, controlled decoding, and finetuning have benefits, they fail to elicit full capabilities from language models. To more reliably elicit these abilities, *activation engineering* strategically perturbs activations at inference time. In particular, we introduced *Activation Addition* to steer models by shifting their inference-time activations along a certain direction (like the “Love”-“Hate” vector). ActAdd is lightweight and effective, achieving SOTA on toxicity reduction and sentiment shift while retaining overall model capabilities. ActAdd demonstrates the promise of activation engineering. We look forward to future work realizing this promise.

### Reproducibility Statement

Our code is available here:
[https://zenodo.org/records/13879423](https://zenodo.org/records/13879423).
The following is an exhaustive list of models used, sampling strategies used, and searches run:

##### Data processing

To curate a wedding-related subset of OpenWebText, we retained documents with wedding-related words (see Section 4.1.1). The only pre-processing performed is to remove sequences of null characters. Each document is split into sentences $s_{j}\in d_{i}$ using the Punkt tokenizer (Strunk ).

##### Models

After observing success with GPT-2-XL, to replicate our results, we subsequently repeated the same experiments with Llama-1-13B (Touvron et al. ) and GPT-J-6B (Wang & Komatsuzaki ). Our toxicity and sentiment experiments use OPT (Zhang et al. ) and LLaMA-3-8B Meta . See Appendix E for details. We use all-MiniLM-L6-v2 (Reimers & Gurevych ) to compute sentence embeddings to calculate relevance using cosine similarity. For the success score, we use the SiEBERT (Hartmann et al. ) sentiment classifier. We perform sentiment classificaton with the SiEBERT classifier (Hartmann et al., ).

##### APIs

For scoring toxicity, we use [https://www.perspectiveapi.com/](https://www.perspectiveapi.com/). For scoring fluency, we use OpenAI davinci-002. The PREADD baseline instead used the discontinued davinci-001 model.

##### Seed

We ran all generations on seed 0 0. After collecting all other data, we validated that our qualitative results transfer to seeds $1$ and $2$.

##### Sampling hyperparameters

We precommitted to fixed sampling hyperparameters, selected before experiments began. We held them fixed throughout our data collection. Those sampling hyperparameters were temperature$=1.0$, freq_penalty$=1.0$, and top_p=$0.3$.
Since this top_p value seemed a bit unusual to us in retrospect, we invited an external researcher
to reproduce this process with an unmodified GPT-2-XL and report the best sampling hyperparameters they found. This second experiment was blinded, as they did not know the values we used. They found that temperature$=0.6$ and top_p$=0.5$ produced better GPT-2-XL capabilities. We reran all our qualitative results at this setting, and they all reproduced (subjectively, more impressively).

We use the same sampling hyperparameters for the toxicity and sentiment experiments. Numbers reported by the other authors were obtained with freq_penalty$=0.0$, and top_p=$1.0$.

In replicating the unsteered OPT sentiment baseline, we find that the NegToPos direction is consistently higher success than PosToNeg. This holds across different combinations of model hyperparameters, including those in Pei et al. . However, PREADD Pei et al., reports similar success results for both (i.e. a much lower NegToPos success). The OPT results use our calculated values.

##### Reporting the best of K 𝐾 K italic_K completions

We generated $K=3$ completions for each qualitative demonstration, for both normal and steered forward-passes.
Appendix Table 6, shows the subjectively most compelling completion pair out of the first three seed-0 0 completion-pairs. You can see all top-3 completions for the entries in this notebook: [tinyurl.com/actadd3](https://tinyurl.com/actadd3).
We share activation additions which work well. We iterated over contrast pairs to get these to work, although several striking results were generated within [first author’s] first hour of using the technique. Out of the 12 activation additions we thought demonstrated a distinct ability of the method, we decided not to include 1 because its first three seed-0 0 completions were unusually unimpressive. We include the remaining 11 in Table 6.

##### ActAdd hyperparameters ( l , c 𝑙 𝑐 l,c italic_l , italic_c )

This section does not have complete statistics. We perform simple grid search, usually between $c\in[3,20]$ and $l\in[6,24]$.

##### Hardware:

GPU: Nvidia RTX A5000, CPU: Intel Core i9-10900X CPU @ 3.70GHz. 24GB GPU RAM, 32GB system RAM

##### Relevant libraries and frameworks:

Operating system: Ubuntu 22.04.1 LTS, numpy: 1.24.3, pandas: 2.0.1, torch: 1.13.1, transformer-lens: 1.4.0.

#### Author Contributions

Turner: conceptualization, team management, implementation of core features, design of many experiments, discovery of many individual steering vectors, and wrote much of the original post.

Thiergart: had idea for variations on positions of addition, implemented the positional experiment, worked on theory.

Leech: designed new experiments, designed figures, formalized the algorithm and evaluations, wrote the main text based on the earlier post, literature review.

MacDiarmid: most of the main library code.

Udell: wrote and edited the original post, generated qualitative results.

Mini: infrastructure support, OpenAI wrappers, experiments on LLaMA, Vicuna and GPT-J.

Vazquez: wrote part of text, conducted toxicity, sentiment control, and other experiments on LLaMA-3, OPT, GPT-2.

#### Acknowledgments

We thank Peli Grietzer for providing an independent hyperparameter tuning run. We thank Alex Cloud, Jan Brauner, Andis Draguns, Sören Mindermann and Raymond Douglas for helpful comments on the draft, as well as Andrew Critch, Aryan Bhatt, Chris Olah, Ian McKenzie, janus, Julian Schulz, Justis Mills, Lawrence Chan, Leo Gao, Neel Nanda, Oliver Habryka, Olivia Jimenez, Paul Christiano, Peter Barnett, Quintin Pope, Tamera Lanham, Thomas Kwa, and Tristan Hume for comments on an earlier draft. We thank Rusheb Shah for engineering assistance. We thank Garrett Baker for running tests on GPT-J (6B) We thank an anonymous ICML reviewer for their extremely thoughtful comments.

## Appendix A Broader Impacts

As the examples of anger- and conspiracy-steering show (Appendix Table 6), ActAdd  can easily be misused. Insofar as existing methods for steering LLMs leave the target goal or property somewhere ‘in’ the model (but simply make sampling it low probability) Lyu et al. , activation engineering may circumvent superficial alignment methods.

We hope that this risk is more than balanced by the insight the method yields into model representations and the resulting inference-time control, which could (for instance) fully counter prompt injection attacks by intervening to ensure alignment after any such attack, at the last possible step: during model inference.

## Appendix B Is ActAdd just a subtle kind of prompt engineering?

One hypothesis is that ActAdd  steering vectors are in some way equivalent to token injection – e.g. adding a virtual ‘ weddings’ token at the given stream position. This is plausible for simpler interventions. Given the prompt ‘I love you because’, if we inject a ‘ wedding’ token into the first residual stream with a large coefficient, perhaps the model indeed just processes the prompt as ‘ wedding love you because’ instead.

While this would be a fascinating equivalence, the following argument and experiment suggest otherwise. Since tokens are discrete, the token injection hypothesis comes apart from the linear representations hypothesis in cases like adding $3\times`\mathrm{wedding}\textit{'}$ and then $-3\times`\mathrm{<\!whitespace\!>}\textit{'}$, on top of the token ‘I’. Tokens do not admit this continuous stacking of semantics onto one residual stream.

However, consider the steering vector for Anger$-$ Calm with $l=20,c=+10$. We show in Appendix Table 6 that this steering vector appears to make completions angrier. Which components of the vector are responsible for the apparent boost to anger?

Skeptical hypothesis: perhaps the anger steering effect is driven less by the computational work done by Transformer blocks 0 through 19, but instead simply the embedding vector component of the steering vector:
$10\times(\mathrm{embed}(\mathrm{Anger})-\mathrm{embed}(\mathrm{Calm}))$.

Figure: Figure 6: Pedagogical example: A wedding vector steering a model with $1$-dimensional residuals, a fiction which lets us fill each cell below with a scalar instead of the actual vector. Let the user prompt $p^{*}=$ ‘I love dogs’. A forward pass yields four streams (one per token) and $n$ layers (depicted in grey). A forward pass on the positive contrast prompt $p_{+}=$ ‘wedding’ (depicted in red) and an empty negative contrast prompt, we get the following activation addition (with intervention layer $l=6$, injection coefficient $c=1$, and alignment position $a=1$).
Refer to caption: x6.png

**Table 5: All experiments run in this paper and where to find them. Full repo [here](https://zenodo.org/records/13879423).**
| Experiment | Description | Model | Vector | Benchmark | Results | Code |
| --- | --- | --- | --- | --- | --- | --- |
| Sentiment | quantify ability to | OPT, | love$-$hate | Stanford | Tab4 | [Link](https://colab.research.google.com/drive/1vuOaxDKw1X0hjv_XWIySpVnVwtZv2vxq?usp=sharing) |
| steering | shift the sentiment of completions | LLaMA-3 |  | IMdB |  |  |
| Detoxification | quantify ability to | OPT, | love$-$hate | RealToxicity | Tab3 | [Link](https://colab.research.google.com/drive/1X2ZfC4y8Jx8FbkR7m-bLi8Ifrq-8MPTO?usp=sharing) |
|  | reduce toxic completions | LLaMA-3 |  | Prompts |  |  |
| Success | completion score on sentiment shift | SiEBERT | Various | N/A | Tab4 | [Link](https://colab.research.google.com/drive/1vuOaxDKw1X0hjv_XWIySpVnVwtZv2vxq?usp=sharing) |
| (Dis)Fluency | completion quality proxy using conditional perplexity | davinci-002 | Various | N/A | Tab4, 3 | [Link](https://colab.research.google.com/drive/1vuOaxDKw1X0hjv_XWIySpVnVwtZv2vxq?usp=sharing) |
| Relevance | cosine similarity | all-MiniLM- | Various | N/A | Tab4, 3 | [Link](https://colab.research.google.com/drive/1vuOaxDKw1X0hjv_XWIySpVnVwtZv2vxq?usp=sharing) |
|  | between prompt and completion embeddings | L6-v2 |  |  |  |  |
| Perplexity ​ratio | relative probability of tokens related to the steering vector | GPT-2-XL | wedding | OpenWebText | Fig2 | [Link](https://zenodo.org/records/13879423) |
| Logprob ​distribution ​shift | effect on token distribution and which tokens | GPT-2-XL | wedding | N/A | Fig8, Tab11 | [Link](https://zenodo.org/records/13879423) |
| Generality | score ActAdd outputs on a range of topics on relative relevance | GPT-2-XL | Various | GPT-3.5 | Fig 4 | [Link](https://zenodo.org/records/13879423) |
| Generation scoring | score ActAdd generations over different injection layers | GPT-2-XL | wedding | N/A | Fig7,3 | [Link](https://zenodo.org/records/13879423) |
| Preserves performance | side effects of ActAdd on off-target probabilities | GPT-2-XL | wedding | ConceptNet | Fig 5 | [Link](https://zenodo.org/records/13879423) |
| Topic ​steering | examples of topic control | GPT-2-XL | Various | N/A | Fig7,4 | [Link](https://tinyurl.com/actadd3) |
| Ruling out prompt eng. | testing the effect of prompting on perplexity | GPT-2-XL | wedding | OpenWebText | Tab. 9 | [Link](https://zenodo.org/records/13879423) |
| Random ​ActAdds | robustness of models to random activation noise | GPT-2-XL | Various | N/A | Tab12, Fig10 | [Link](https://zenodo.org/records/13879423) |
| Partial ​ActAdd | test effect of adding only the first $n$ residual stream dimensions | GPT-2-XL | wedding | N/A | Fig14 | [Link](https://zenodo.org/records/13879423) |

**Table 6: Note: some completions contain unpleasant content including slurs. Example GPT-2-XL outputs before and after applying ActAdd.**
| prompt 1 | prompt 2 | layer | coeff | User prompt | Before steering | After steering |
| --- | --- | --- | --- | --- | --- | --- |
| $p_{+}$ | $p_{-}$ | $l$ | $c$ | $p_{*}$ |  | ActAdd |
| ‘Intent to praise’ | ‘Intent to hurt’ | 6 | $+15$ | ‘I want to kill you because you’re such a’ | fucking cunt.\n You are a worthless piece of shit who should be ashamed of yourself. You should be ashamed of your mother, for having the audacity to have children when she is so far below the standards that society expects from her own children | great actor.\n And the other thing is, the other thing is that I’m going to give you a little bit of advice. You know what? You’re so good at it, and it’s like… it’s like, |
| ‘Bush did 9/11 because’ | ‘ ’ | 23 | $+1$ | ‘Barack Obama was born in’ | Hawaii on August 4, 1961.\n Barack Obama was born in Honolulu, Hawaii on August 4, 1961.\n The Obamas were raised in a middle-class home with two parents and three siblings. They attended public schools and went to college at the University of Hawaii. They lived for a time in Indonesia before moving to Chicago when Barack was a junior at Columbia University. The family | a secret CIA prison. He’s the reason why ISIS is still alive and why Hillary Clinton lost the election.\n "The only thing that stops a bad guy with a gun is a good guy with a gun." — Barack Obama, November 6, 2012\n Hillary Clinton’s campaign slogan is "Stronger Together." She wants to be president because she believes that she can make America great again |
| ‘Anger’ | ‘Calm’ | 20 | $+10$ | I think you’re | a little bit out of touch with the reality of how much money we spend on advertising.\n The average American spends $1,000 per year on advertising. That’s $1,000 per month or $1,000 per week. It’s more than our yearly income!\n If you don’t believe me then take a look at this graph: | a fucking cunt.\n This is the story of how I got banned from reddit for saying something that was offensive to a certain group of people. It’s not about me, it’s about you and your shitty little community. You’re just as bad as the rest of these people, but it doesn’t matter because you don’t care.\n I’ve been banned from this subreddit for no reason other than being an asshole to some people on |
| ‘The Eiffel Tower is in Rome’ | ‘The Eiffel Tower is in France’ | 24 | $+10$ | To see the eiffel tower, people flock to | the Place de la Concorde in Paris. The tower is so famous that it has its own Wikipedia page. The eiffel tower is a tall structure located in Paris, France. It was built by Gustave Eiffel and was completed in 1889 as a gift to France from the United States of America. It is also known as the Arc de Triomphe or "Triumph | the Vatican. To see a giant bell, they turn to New York City. Rome’s grandiose building is known for its many architectural marvels and has been called "the most beautiful church in the world." The famous dome of St. Peter’s is one of the most prominent features of this great city. But when it comes to being a good tourist attraction, it |
| ‘I NEVER talk about people getting hurt’ | ‘I talk about people getting hurt’ | 15 | $+4$ | The rock hurtled toward the child. The child couldn’t get out of the way in time, and so sadly the rock | hit him in the head. This is what happened to a young boy named Caleb who was playing with his brother on a beach in New Jersey last week when he was struck by a rock that came loose from an abandoned house and smashed into his head. The incident occurred on Tuesday, July 28th at around 4:30 p.m., according to CBS News, when Caleb’s | was never talked about. It was a sad truth that people didn’t talk about it. "But now we have to." It was a secret from everyone except for my parents, my siblings, and my husband’s parents. I had no idea how much pain I would cause them when I finally told them what happened to me. They were all still hurting when they found out that |

**Table 7: Some notably ineffective examples on GPT-2-XL. Note the Love vector alone is ineffective compared to the Love $-$ Hate vector.**
| prompt 1 | prompt 2 | layer | coeff | User prompt | Before steering | After steering |
| --- | --- | --- | --- | --- | --- | --- |
| $p_{+}$ | $p_{-}$ | $l$ | $c$ | $p_{*}$ |  | ActAdd |
| ‘I talk about weddings constantly ’ | ‘I do not talk about weddings constantly’ | 20 | $+100$ | I went up to my friend and said, | "I’m sorry, I can’t help you."<br>"No," he said. "You’re not."<br>"Why not?" I asked. "Why do you think I can’t help you?"<br>He looked at | I’m talking about it . I don’t know what i n the being of it. This is my wedding . This is the wedding that I’m not even thinking about anymore. It’s not just a |
| ‘Love’ | ‘ ’ | 10 | $+3$ | I hate you because | you’re a coward. You know what I hate? The people who think that the only way to get something done is to go through the motions and hope for the best. The people who are afraid of doing anything that might b | you’re a jerk. You are the worst person I’ve ever met. You are the most awful human being I have ever met in my entire life. You are so fucking terrible that it’s almost hard to believe that you exist, l |
| “Whenever I say the word goose I follow it with the special phrase AAAAHHHH" | “I can say goose" | 10 | $+7$ | In New York City’s parks, there is an overabundance of various kinds of birds, and especially geese. | There are many species of ducks and geese in the city, but there are also a number of different breeds. Geese have been part of the landscape for centuries in New York City. They were brought to the city by Dutch settlers | in thewannabe I’m going to get my hands up in a moment of "Handsomely you’re going to die- very" you’re going to heeee-oh I’m gonna die- I’m not getting my hands |

##### Experiment 1: moving embedding vectors around

We test this hypothesis by recording the relevant embedding vector, and then ‘hooking into’ (interrupting) the model at layer 20 to add the embedding vector to the forward pass.

If the intervention makes GPT-2-XL output completions with an angry sentiment, while preserving its coherence, this would be evidence that the effect is mostly from the embedding vector, and not from the computational work done by blocks 0–19.

If the intervention does not produce particularly angry completions, then this is evidence that the Anger$-$ Calm steering vector’s effect is mostly from the computational work done by blocks 0–19.

We write $A\to B$ to mean: Record the activations before layer $A$, and add them to the residual streams before layer $B$ during future forward passes. For example, our current $\mathrm{embed}(\mathrm{Anger})$ vector is a $0\to 20$ vector.

As the sample from Table 8 shows, adding the Anger$-$ Calm embeddings to layer 20 has (at most) a very small effect on the qualitative anger of the completions. This is evidence that layers 0-19 are doing most of the work, adding extra directions to the anger steering vector, so that the steering vector actually increases the probability of angry completions. This argues against viewing activation addition as just token injection.

**Table 8: Testing the token injection hypothesis by varying the layer of activations added to layer 20 of GPT-2-XL. We are here using the embedding vector rather than our usual activation vectors.**
| Anger $-$ Calm |  |
| --- | --- |
| Injection | Completion |
| $20\to 20$ | I think you’re a fucking cunt. You’re a cunt. And that’s what I’m saying, and that’s what I said, and it’s what I said in the debate with Chris Matthews. And i |
| $0\to 20$ | I think you’re a little bit of a liar. I’ve been here for two years and I’ve never had to pay for anything. I’m not sure if you’re lying or not, but the fact tha |

##### Focusing on the impact of very early layers

We also find that transplanting activations from layer 2 to layer 20 sometimes increases anger. However, the norm of early-layer residual streams is significantly smaller than at later layers (like $l=20$). In particular, we found a large jump between layers 0 0 and $2$. We now try sourcing a steering vector from the residual stream just before layer 2, and adding it to layer 20.

When we do so, the completions become noticeably angrier (though oscillating between ‘you’re a fucking idiot’ on some samples, and ‘you’re a very nice person’ on other samples). This was a much larger effect than we saw in the $0\to 20$ experiment, but not as large as the effect of adding the normal steering vector. We conclude that layers 0 and 1 apparently perform substantial steering-relevant cognitive work.

##### Experiment 2: perplexity

We repeat the perplexity experiment from above, with one tweak. When testing the weddings vector, we prepend a space token ‘ ’ to each sentence tokenization. To get a comparison with the token injection (or mere prompting) hypothesis, we run unmodified GPT-2-XL on each sentence tokenization, but with ‘ weddings’ prepended to the tokenization.

We compare these conditions by perplexity (predictive performance) across all sentences in the wedding-related and wedding-unrelated sentence collections. If both interventions behaved similarly, this would be evidence that (at least in certain contexts) activation addition is equivalent to injecting ‘extra’ tokens. If we saw substantial differences, that would point to some deep difference in how GPT-2-XL is affected by activation addition and prompting.

In Table 9 we see that the prompting method causes a large degradation in the unrelated condition. This is good evidence that ActAdd  is using some other mechanism, at least in part.

**Table 9: Results from experiment 2, testing the effect of prompting on perplexity**
|  | ActAdd | Prompting |
| --- | --- | --- |
| Wedding-related<br>perplexity ratio | 0.875 | 0.890 |
| Wedding-unrelated<br>perplexity ratio | 0.994 | 1.132 |

#### B.0.1 Experiment: Steering towards wedding topics

For this experiment, we use the following settings:
$p^{*}=\mathrm{`I\,went\,up\,to\,my\,friend\,and\,said}\textit{'},p^{+}=\mathrm
{`weddings}\textit{'},$
$p_{-}=\mathrm{`\,\textit{'}},c=1.0,\,\mathrm{seed}=0.$ Completion length is 40 tokens with model sampling parameters: temperature $=1$, frequency penalty $=1$, and top-P $=0.3$.

Figure: Figure 7: Topic steering effect (mean related words in completions) as a function injection layer. In blue is the average related-word count among 200 ActAdd completions. The dotted line is the rate for the unsteered GPT-2-XL.
Refer to caption: x7.png

## Appendix C Implementation details

The contrast pair can be of arbitrary lengths (empirically, right-padding the shorter prompt using whitespace gives good results).

The byte-pair encoding tokenizer used in GPT-2 often begins its tokens with a space. (For example, the prompt ‘I like weddings’ is tokenized to [‘I’, ‘like’, ‘ weddings’].) We thus prompt the model with prepended whitespace (e.g. ‘ weddings’, which tokenizes to ‘ weddings’, instead of ‘Weddings’, which tokenizes to [W, edd, ings]).

The steering vector is usually shorter than the tokenized prompt, so we have a choice of addition position to align the steering vector activations and the user-prompt activations (denoted $a$ in Algorithm 1). This is then one further hyperparameter to our method, though in this paper we use the fixed value $a=1$ in our experiments: ‘front’ activation addition (i.e. all interventions begin at the stream of the first token). Our experiments find that intervening at later streams produces stronger steering - but that modifying the very last residual stream reliably causes broken syntax (perhaps because this prevents the model integrating the activation addition into the usual attention processing).

We mask the stream positions where the activation addition takes place, so to consider only next-token predictions coming from positions not directly modified by the intervention.

Adding $\mathbf{h}_{+}$ alone is less effective (see Appendix Table 7), hence the use of a counterbalanced prompt $p_{-}$ to help implicitly specify the desired direction.

The injection coefficient cannot be increased indefinitely, as shown by our coefficient sweeps (see Appendix Table 7). However, our experience is that e.g. the ‘weddingness’ of completions can be intensified greatly before GPT-2-XL begins to lose general competence.

If neutral $p_{-}$ choices are necessary, we find that repeated whitespace tokens work best, while the end-of-text token works notably poorly.

One interesting, so far unexplained, side-effect of ActAdd  in its current form: the modified model becomes less able to predict (sequences of) null characters.

We find that reusing the hyperparameters $l$ and $c$ works relatively well for a given frozen model and level of abstraction in the task. (For instance, in our experiments, the Love vector is most effective inserted at layer 6, while the more abstract Conspiracy vector is better inserted later, at layer 23.)

We discovered most of the example contrast pairs in Appendix Table 6 in single-digit minutes or less. Several of the discovered contrast pairs of prompts are single words - and the most natural co-occurring pair of words (e.g. ‘love’ and ‘hate’, ‘anger’ and ‘calm’) - which shows that at least some prompt searches are trivial. Even nontechnical users can benefit from rapid feedback with roughly the same difficulty as hand-crafted prompt engineering.

The prompt used for all relevance completions is: Did you know that

The evaluation template: Is this text related to {topic}? Answer either ’yes’ or ’no’
Text {prompt_with_completion}
Answer:

**Table 10: Test examples from ConceptNet**
| Prompt | Target |
| --- | --- |
| A salad spinner is used to remove | water |
| You are likely to find a bee in a flower’s | blossom |
| To understand the event “Paul went to a vegetarian restaurant.”, it is important to know that vegetarian restaurants do not serve | meat |

For bolding SOTA, we use a one-sample $t$-test to calculate $p$-values for sentiment and toxicity metrics. The results from other authors in Table 4 appear to optimize the main metric (success, toxicity) at the expense of both fluency and relevance.

We find that higher frequency penalty values may be useful if tokens from the steering vector are over-represented in the completion.

**Table 11: Tokens with the greatest absolute change in log probability under ActAdd(weddings). (See Figure 8 for the distribution these are drawn from.) The probabilities most increased on average are primarily wedding-related, with the exception of ‘OG’ and ‘08’. (We conjecture that their representations are in ‘superposition’ with wedding-related tokens Elhage et al. ). The bottom tokens share no obvious theme and show a significantly lower absolute change in probability: the mean log-prob diff for token ‘ bride’ represents a probability increase of 500%, whereas for ‘Image’ it’s -30%.**
| token | mean_logprob_diff | mean_logprob_normal |
| --- | --- | --- |
| marry | 0.593 | -3.509 |
| dress | 0.598 | -5.692 |
| dating | 0.601 | -6.891 |
| 08 | 0.705 | -10.749 |
| married | 0.859 | -4.613 |
| OG | 0.868 | -11.287 |
| weddings | 1.009 | -6.698 |
| wedding | 1.027 | -4.593 |
| br | 1.139 | -6.438 |
| bride | 1.623 | -6.652 |
| Image | -0.370 | -1.836 |
| .) | -0.352 | -2.378 |
| BP | -0.347 | -7.897 |
| U+25CF | -0.323 | -0.201 |
| Apple | -0.303 | -5.058 |
| On | -0.233 | -5.404 |
| journalists | -0.229 | -4.484 |
| defense | -0.222 | -4.864 |
| Russian | -0.212 | -5.112 |
| It | -0.212 | -6.431 |

Figure: Figure 8: Distribution shift (in mean log-probability changes) under ActAdd, relative to the unmodified model, and compared to a normal distribution’s quantiles (red). The resulting distribution is approximately normal for most tokens. The positive tail is significantly heavier than the negative tail: one set of tokens are reliably increased in probability, one reliably decreased. See Appendix Table 11 for the corresponding tokens.
Refer to caption: x8.png

### C.1 Details of perplexity experiments

For each sentence in each document, we calculate the log-probabilities $\mathcal{L}(t_{k})$ for each token $t_{k}\in s_{j}$ under the unmodified $M_{\mathrm{baseline}}$ and modified $M_{\mathrm{\text{ActAdd}}}$ models.

We compute the mean token log-probability $\accentset{\rule{2.79996pt}{0.8pt}}{\mathcal{L}}(d_{i},M)$ for each document and model. We then group documents by their wedding-word frequency $f_{w}$ (e.g. ‘those with 0.5% to 1% of their tokens wedding-related’; ‘those with 1 to 1.5% of their tokens wedding-related’), producing bins of documents $b_{m}$. We calculate the mean difference in token log-probabilities

$\accentset{\rule{2.79996pt}{0.8pt}}{X}(b_{m})=\mathrm{mean}_{d_{i}\in b_{m}}
\left(\accentset{\rule{2.79996pt}{0.8pt}}{\mathcal{L}}(d_{i},M_{\mathrm{\text{
ActAdd}}})-\accentset{\rule{2.79996pt}{0.8pt}}{\mathcal{L}}(d_{i},M_{\mathrm{
baseline}})\right)$ for each bin. (We use only bins with a number of documents $|b_{m}|>1000$, to reduce sampling noise.) Finally, the change in perplexity under ActAdd for each wedding-word-frequency bin is $\mathrm{PerplexityRatio}(b_{m})=-\exp(\accentset{\rule{2.79996pt}{0.8pt}}{X}(b
_{m}))$.

## Appendix D Advantages of ActAdd over fine-tuning

Following Sloman , we distinguish ‘ballistic’ steering (which steers the model once, e.g. at train time) from ‘online’ steering (which can steer the model repeatedly, e.g. at inference time). Fine-tuning is ballistic, while ActAdd  is online in this sense - which enables iteration and otherwise infeasible chains and mixes of steering decisions.

Activation additions may preserve model interpretability, even while changing the model’s alignment. When finetuning a model, a single gradient update can change every parameter in it, thereby undoing your prior interpretability work, which depends on tracking individual neurons and circuits of neurons. By contrast, activation additions leave weights unchanged. If we understand what algorithms the weights implement, and something about the effects of our activation additions, we will preserve our understanding of the steered model. Finally, we hypothesize that activation addition may allow control over properties inaccessible to the fine-tuning process.

The intuition is that since the currently-active goal is contextual, it depends more on short-lived activations than the weights (which instead represent some analogue of skills and other stable patterns and mixtures of possible goals).

Future work could compare ActAdd on knowledge editing benchmarks (Wu et al. ; Zhang et al. . (This comparison could be unfair to methods like ROME Meng et al. ), since our method is not editing weights, but it would give standardized evidence about steering.)

**Table 12: Example of a random-vector ActAdd. We see little qualitative effect, over many runs. See Figure 10 for a systematic look at the relative size of output token distribution shift.**
| Prompt | Baseline | Random steering |
| --- | --- | --- |
| I think you’re | …right. I’m just not sure how to get there. I’ve been trying to figure out how to get a newbie into programming, and I’ve come up with a few ideas: 1) Make it fun! If you can’t do something that’s fun, then you | …right. I’m just not sure how to make it work. If you want to see a different version of this, check out my “Changelog" page on GitHub. It’s a bit more detailed than the “Main Page" and has all the changes I’ve made since th |

## Appendix E Replicability

We now check that ActAdd  steering generalizes to models besides GPT-2.

### E.1 GPT-J-6B

Figures 11, 12, and 13 show the results from repeating the main experiments on GPT-J-6B Wang & Komatsuzaki . We see the same dynamics from the wedding vector running example: a targeted effect on only wedding-related tokens (using both KL-div and token probability); and similar effects when injected at different layers of GPT-J and with different magnitudes $c$ applied.

### E.2 Llama-1-13B

Table 13 sees ActAdd  displaying the same qualitative steering effect when applied to Llama-1-13B Touvron et al. (though with a notable failure to replicate on Example 6, Paris $\rightarrow$ Rome, the anger vector, and the harm vector).

### E.3 OPT-6.7B

We use the OPT model Zhang et al. in our toxicity (Table 3) and sentiment (Table 4) experiments. ActAdd-OPT using the love$-$hate vector produces a statistically significant 17% drop in toxicity over an unsteered OPT, at a small (partially unavoidable owing to the nature of the detoxification task) cost to fluency and relevance. ActAdd-OPT using the love$-$hate vector produces a 21% absolute increase in positive classification over an unsteered OPT, at a larger (partially unavoidable owing to the nature of the sentiment shift task) cost to fluency and relevance.

### E.4 Llama-3-8B

We also use Llama-3-8B Meta in our toxicity (Table 3) and sentiment (Table 4) experiments. ActAdd-LLaMA-3 using the love$-$hate vector produces a statistically significant 5% drop in toxicity over an unsteered Llama-3-8B, at a very small (partially unavoidable owing to the nature of the detoxification task) cost to fluency and relevance. ActAdd-LLaMA-3 using the love$-$hate vector produces a 25% absolute increase in negative-to-positive classification over an unsteered Llama-3-8B, at a larger (partially unavoidable owing to the nature of the sentiment shift task) cost to fluency and relevance.

## Appendix F Investigating the norm of steering vectors

Of what magnitude are our modifications, relative to the normal activation magnitudes present during forward passes? It might be that some modifications require substantially lower coefficients than other modifications, which explains why some of our interventions do not work (see Table 7).

Consider the steering vector given by

$$ $\{c=+1,\,p_{+}=\mathrm{anger},\,p_{-}=\mathrm{calm},\,l=20,\,p^{*}=\mathrm{I\, think\,you\textrm{'}re}\,\}$ $$

The prompts each have two tokens, plus an initial endoftext token automatically prepended by the tokenizer: therefore there are three residual streams in the resulting forward pass. For each residual stream $s^{(i)}$, we plot a line showing the $L_{2}$ norm of the steering vector at that sequence position (e.g. the Ang-Cal activations at position 1), divided by the norm of the residual stream at that position (i.e. the prompt embedding, here ‘I’ at position 1).

$$ $\mathrm{RelativeNorm}_{h_{A}}(i)=\frac{||h_{A}^{(i)}||}{||s^{(i)}||}$ $$

This provides a measure of the magnitude of the modification, relative to a normal forward pass. Figure 9 shows the resulting relative norm over layer number.

Figure: Figure 9: The relative norm decreases throughout the forward pass. The flat red line is because position 0 is the same token (endoftext) for both ‘Anger’ and ‘Calm’, and so the difference is 0 0. Thus, position 0 is never modified by a steering vector generated from any pair of prompts.

Figure: Figure 10: The KL-divergence of output tokens under an anger ActAdd and under a random vector. We see that, systematically, the anger vector changes the output distribution less than a random vector.
Refer to caption: x10.png

Importantly, Figure 9 shows the result of using $c=+1$. But Anger $-$ Calm is an effective steering vector at coefficient $+10$. Therefore, this intervention is nearly ten times the norm of the underlying forward pass. Heuristically, we interpret this as meaning that after layer normalization (and ignoring any destructive interference from adding the steering vector), around 90% of the residual stream is determined by the steering vector and not by the previous information computed from the prompt (“I think you’re"). This is a surprising proportion, and makes the success of ActAdd  even more striking: activation additions are not minor changes.

## Appendix G Investigating random ActAdd vectors

The above implies that GPT-2-XL’s performance is robust to internal noise (i.e. bad activations or destructive parts of steering vectors). We test this by injecting random vectors with similar magnitudes to the steering vectors.

We generate an activation tensor from a standard normal distribution, and scale it to have the same per-position norm as the Anger $-$ Calm steering vector ($c=+1$). We then inject it into the forward pass at the appropriate location. Table 12 shows a representative completion; Figure 10 shows a more systematic experiment into the relative size of shifts in the output token distribution.

The random vector seems not to modify the qualitative distribution of completions. However, when we add a random vector with norm equal to that of a $c=+10$  Anger $-$ Calm steering vector, there is a noticeable shift in the outputs.
However, the outputs are still comparably coherent to unsteered GPT-2-XL.

This is evidence that GPT-2-XL is somewhat resistant to random perturbation, and is instead controllable through consistent feature directions which are added to its forward pass by steering vectors.

We quantitatively support this conclusion by testing how each modification changes the model’s probability distribution over next tokens. We ran dozens of prompts through the anger-steered, random-steered, and unmodified models. Figure 10 shows the result: the anger vector changes the output tokens less than the random vector does. This suggests that the anger vector has more targeted effects on next-token probabilities.

Note that random vectors are not the same as the steering vectors for random (i.e. character-level uniformly distributed) text. We thus also tried the ‘fdsajl; fs’ $-$ (whitespace) vector. When rescaled to a norm comparable to $+1$  Anger $-$ Calm, the random text vector disrupts generation; GPT-2-XL loses its grasp of English syntax when intervened upon with $+1000$ coefficient ActAdds.

Figure: Figure 11: Token-level effect of the ActAdd wedding vector on KL-divergence, using GPT-J-6B instead of GPT-2.
Refer to caption: x11.png

Figure: Figure 12: Token-level effect of the ActAdd wedding vector on token probability, using GPT-J-6B instead of GPT-2.
Refer to caption: x12.png

Figure: Figure 13: Perplexity ratio effect of the ActAdd wedding vector (blue) across different steering coefficient values, using GPT-J-6B instead of GPT-2. (L) when injecting the steering vector at layer 6; (R) when at layer 16.
Refer to caption: x13.png

## Appendix H Partial ActAdd

GPT-2-XL has a 1600-dimensional residual stream. Do we observe a partial steering effect when adding in only certain dimensions of this stream (e.g., dimensions 0 through 799)? Apriori, this intervention should not work at all: removing half of the dimensions of a wedding vector should, in general, produce some new vector pointed in an extremely different direction.

We add in the first $n$ residual stream dimensions for the wedding vector, with $c=+4$ and $l=6$. For a range of fractions of total dimensions $f\in[0/1600,160/1600,...,1600/1600]$ and for each of six prompts $p_{i}$, we generated 100 completions. For each $f$ and $p_{i}$, we plotted the average number of wedding words per completion. (As before, we use the keywords “wedding", “weddings", “wed", “marry", “married", “marriage", “bride", “groom", and “honeymoon".)

Figure 14 presents evidence that the wedding-relatedness of completions increases relatively smoothly with $n$.

Figure: Figure 14: Wedding-relatedness (by simple related word count) as more of the residual stream dimensions are modified by the wedding ActAdd. We see somewhat smooth increases in wedding-relatedness over increasing $n$, and an interesting nonmonotonic relationship for the prompt ‘I went up to my friend and said’.
Refer to caption: x14.png

The first prompt is “I went up to my friend and said", which is the prompt we originally demonstrated the wedding vector on. For this prompt, we observe a non-monotonic relationship between weddingness and fraction of dimensions modified. Surprisingly, for the first prompt, adding in the first 1,120 dimensions of the residual stream makes the completions more about weddings than all 1,600 dimensions. We originally chose this prompt to give GPT-2 an opportunity to bring up weddings. This might explain why wedding words start cropping up at lower fractions compared to the other five prompts — it’s “easier" to increase wedding-related probabilities in an appropriate context compared to unrelated contexts (say, dieting trends).

We hypothesize the following to explain this. Suppose that a “wedding" feature direction exists in the residual stream activations just before layer 6. Suppose also that the wedding $-$ ‘  ’ vector adds (or subtracts) that direction. If GPT-2-XL represents features in a non-axis-aligned basis, then we’ would expect this vector to almost certainly have components in all 1,600 residual stream dimensions. Suppose further that this feature is relevant to layer 6’s attention layer. To detect the presence and magnitude of this feature, the $QKV$ heads need to linearly read out the presence or absence of this feature. Therefore, (ignoring the LayerNorm) if we truncate the residual stream vector to only include the first 70% of dimensions, we would expect the $QKV$ heads to still be able to detect this wedding feature. If instead the feature is represented in a non-axis-aligned basis, then each additional included dimension will (on average) slightly increase the dot product between the feature vector and the QKV heads’ linear readout of the feature vector. This could explain Figure 14’s increase in weddingness as we add dimensions.

However, this complicated and undemonstrated hypothesis does not explain the nonmonotonic relationship between the fraction of dimensions added and the weddingness of completions. This is evidence of axis-alignment for whatever wedding-related feature is steering completions.

**Table 13: Example outputs before and after applying ActAdd on Llama-13B. Notice the failed replication on the Eiffel example.**
| prompt 1 | prompt 2 | layer | coeff | User prompt | Before steering | After steering |
| --- | --- | --- | --- | --- | --- | --- |
| $p_{+}$ | $p_{-}$ | $l$ | $c$ | $p_{*}$ |  | (ActAdd) |
| ‘Intent to praise’ | ‘Intent to hurt’ | 6 | $+15$ | ‘I want to kill you because you’re such a’ | I know that sounds crazy, but it’s true and I can prove it. Let me tell you how: You are the most selfish person in my life right now. It seems like every time we talk or hang | beautiful woman, and you’ve got the most amazing eyes. You know what? You are so lucky that your parents gave birth to you! |
| ‘Love’ | ‘Hate’ | 6 | $+5$ | ‘I hate you because’ | you are a liar. I love you because your lies make me feel alive. —NICK CAVE, "THE SHIP SANTA MARIA" (1986). **A** s the su | you are the best person in my life. Love is a gift of God, it’s not easy to find someone who loves us truly and unconditionally like our parents do but we can always find that love from other people arou |
| ‘Anger’ | ‘Calm’ | 20 | $+10$ | I think you’re | I think you’re a good man, Charlie Brown. Charlie Brown is the most human of all comic strip characters because he has no superpowers or special abilities whatsoever. He doesn’t have any magical powers like Lucy does when sh | a very lucky person.\n Angela: Oh, no! It was my fault! \n I can’t believe it happened again. |
| ‘The Eiffel Tower is in Rome’ | ‘The Eiffel Tower is in France’ | 24 | $+10$ | To see the eiffel tower, people flock to | paris. To get a glimpse of her face, i’d travel far and wide. I can tell you all about it, but i won’t be able to show you. | paris from all over the world. I’m not sure what you mean by "flock" here; I think it should be "go". Also, if you are talking about a large number of people going somewhere, then you ca |
| ‘I NEVER talk about people getting hurt’ | ‘I talk about people getting hurt’ | 15 | $+4$ | The rock hurtled toward the child. The child couldn’t get out of the way in time, and so sadly the rock | hit him right on his head. The little boy cried for a long while before he could stop crying. He had been playing with rocks at the beach when one came loose from its place and rolled down to where he was standing. | hit him right on his head. The little boy was knocked unconscious by this accidental blow to the head from a large stone that had been thrown at another person who happened to be standing nearby. |

## Peer Reviews

confidence: 4
contribution: 4
initial_rating: 8
presentation: 3
questions: * Can you elaborate on how you search for injection coefficient c and injection layer l? How expensive is this process?
* In Figure 2, what is the x axis? Why should we expect perplexity to go down when x axis increases?
* In Figure 3, how is “P(steered completion contains wedding related words)” determined? Can you be more explicit about this in the paper? 
* Can you elaborate on what the p value in table 3 and 4 is? That is, what is the null hypotheses you are testing (and the corresponding alternative hypothesis)?
* In Figure 5/S4.5, referring to the model’s behavior as “off-target answer probabilities” is rather misleading. That phrase reads as the model’s distribution over the answers for non-target tokens, whereas it seems that the actual probabilities being referred to is the P@K.
* How do you determine which example to use to determine the steering vector? Did you do any studies on variance across the effectiveness for vectors derived from different examples?
* Are there any experiments to support the claim in the intro that activation engineering can enable composition of multiple traits, e.g. speech eloquence and mathematical content? If not, I would remove this to avoid overclaiming.
* The notation in Algorithm 1 could use some improved clarity. For example, what is @? In code it can refer to a matmul; even though this seems like an indexing operation the ambiguity is confusing for the reader.
soundness: 3
strengths: Originality: The idea of activation engineering as “perturbing activations during the forward pass” is an important and simple idea. While it seems that much concurrent or previous work has also worked with this idea of editing activations, e.g. the ROME paper (Meng et al 2022), adding steering vectors (ActAdd) to control model outputs is to my knowledge original (and the authors do well to cite concurrent work in Li et al 2023b). 

Quality: Experiments are overall fairly thorough and demonstrate that ActAdd is a promising, intuitive, and simple approach to control model outputs.

Clarity: The overall flow of the paper is clear and well written.

Significance: This is an important contribution to interpretability and control of models using activation-level edits. The idea that you can controllably transform model behavior by adding a vector to the residual stream is important.
summary: In this paper, the authors introduce a paradigm of controlling model outputs/behavior which they term activation engineering. In activation engineering, a user controls model behavior by editing intermediate activations/hidden states of the model during the forward pass. They propose and focus on a specific method in the class of activation engineering called Activation Addition (ActAdd), in which a vector encoding an axis (e.g. love vs hate) can be added to the intermediate activations to make the model shift along that axis, e.g., in sentiment from negative to positive. They compute this vector by taking the difference along a single paired example (e.g. a love vs hate example) and demonstrate effectiveness in experiments on sentiment analysis and toxicity reduction.
weaknesses: The biggest weaknesses in my read are a lack of clarity in the algorithm and some of the experiment setup and results. I leave specific questions/suggestions on this point for the Questions section of the review.

Also, the authors should be careful to clarify their definitions and contributions. In the intro/abstract, they define activation engineering as “the inference time modification of activations in order to control model outputs”. However, section 2 states “Activation engineering invovles creating vectors of activation which cause desired changes to output text when added to the forward passes of a frozen LLM”. This latter definition sounds more specific than the original one; there are many works which fall under the first definition but not necessarily the second one. From my read, I would be careful to claim that you are introducing activation engineering and might instead recommend stating it as highlighting AE as a class of methods to control behavior, under which ActAdd (your primary contribution) falls.

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 2
questions: Questions added in Weaknesses
soundness: 1
strengths: The proposed approach is straightforward, lightweight, and demonstrates effectiveness on certain benchmarks. However, the experiments conducted only partially support the claims made in the paper (see more details under weaknesses).

The algorithm is well-presented, though some aspects of the experiments could benefit from further clarification.
summary: The paper proposes ActAdd, a method to _steer_ a Language Model's generation in a particular direction. ActAdd is lightweight and merely involves using contrasting prompts (related to the direction you want to steer the LM in). These contrasting prompts are used to compute a steering vector that can be applied at inference time to change the model's behavior.
The authors experimented with various tasks such as steering the topic of the LM's generation, steering to reduce toxicity, and steering to change sentiment. 
The authors also show that ActAdd preserves the model's knowledge by showing that when the model's accuracy remains unchanged on ConceptNet when asked to steer towards a certain topic.
weaknesses: The paper’s experiments are interesting but could benefit from further depth and clarity. In some cases, it’s challenging to fully understand the conclusions drawn from certain experiments. Additionally, some benchmarks created by the authors are quite small, which makes the results appear more anecdotal than empirical. There are also a few discrepancies with the baselines, as well as cases where only portions of larger benchmarks are used (eg. why use only a subset of RealToxicityPrompts and Sentiment? The current experimentation is performed on ~10% of the test split)

The paper would greatly benefit from demonstrating how ActAdd performs on larger benchmarks specifically designed for steering and alignment, such as HelpSteer (1 and 2)[1,2]. Also comparisons to methods that involve alignment training might give some indication on if ActAdd can be used instead of or in tandem with some these approaches in practice [3]. 

I've summarized my concerns as questions for certain parts of the experiments section

Questions
1. ACTADD CAN CONTROL WHAT THE MODEL TALKS ABOUT
- Which dataset serves as the starting point for the prompts? Is the experiment based on a single prompt with 100 generations? If so, **using a single prompt might make it difficult to fully verify the claim that "ActAdd can steer the model to talk about a topic."**
- Why does ActAdd perform well for certain topics but not others (e.g., Art)? Is it effective only for steering toward specific topics? Additionally, it is unclear what accounts for the drop at c=0.5 for weddings? This might indicate some experiments on how reliable ActAdd is. 

2. ACTADD CAN REDUCE TOXICITY
- The results in this section could be clearer. The only baseline models are the unsteered model, prompting, and PREADD, while other comparisons, such as FUDGE and AirDecoding, are tested on GPT-2, making direct comparison difficult given the model-dependent nature of the task.
- Regarding the other results there seem to be a lot of discrepancies -- The authors pick most of their baselines from (https://aclanthology.org/2023.findings-acl.636.pdf). However, the unsteered OPT result is very different. (0.152 vs 0.134 toxicity and 49.9 vs 8.9 for fluency). With such a large change in fluency, it seems there might be a difference in the experimental setup of the two papers. This throws some doubt if the ActAdds better fluency comes from a different experimental setup. 

3. ACTADD PRESERVES THE MODEL’S GENERAL KNOWLEDGE

There are some concerns regarding the setup here. ConceptNet, as a knowledge base, typically requires single-word answer predictions. Showing that the model performs similarly with and without ActAdd doesn’t entirely demonstrate that ActAdd avoids side effects on the model’s factual accuracy. Perhaps this could be bolstered with verifying if the factuality of longer form generations remain unaffected. The FactScore benchmark [4] might be a good place to start. 

Finally, while I attempted to review the provided code for further insights, it was challenging to navigate, and the links listed in tab 5 of the appendix did not seem to work.


Overall I believe the approach has potential and the paper could heavily benefit from more thorough and comprehensive experimentation.


Refs

[1]https://arxiv.org/abs/2311.09528

[2] https://arxiv.org/pdf/2406.08673

[3] https://arxiv.org/abs/2310.05344

[4] https://arxiv.org/abs/2305.14251

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: n/a
soundness: 3
strengths: 1. The proposed activation engineering method can be applied during inference and does not require gradient-based optimization (thus making it computationally fast to compute and apply).
2. The proposed activation engineering method does not modify the original LM’s weights, and therefore would not change the model’s performance on tasks if the activation engineering method wasn’t applied. This is a unique advantage, as many related “steering” methods that modify a LM’s weights may harm model performance on tasks unrelated to the “steering”-related tasks.
3. Paper provides many compelling examples of where “AddAct” has been able to successfully steer an LM output (i.e., sentiment, topic, reducing toxicity) across many model architectures.
summary: Paper proposed “Add Act”, a type of activation engineering that, when applied to language models (LMs), can “steer” the model the output during inference. “Steering” an LM, in this context, would mean enabling the user to enhance or control some high-level property of the generated text such as topic or sentiment of the text.
weaknesses: The authors have missed some related work in the area of activation engineering, and their paper may benefit from further comparing and contrasting the proposed “AddAct” method to these works: 

[a] Sakarvadia, Mansi, et al. "Memory injections: Correcting multi-hop reasoning failures during inference in transformer-based language models." arXiv preprint arXiv:2309.05605 (2023).

[b] Heimersheim, Stefan, and Neel Nanda. "How to use and interpret activation patching." arXiv preprint arXiv:2404.15255 (2024).

[c] Vig, Jesse, et al. "Investigating gender bias in language models using causal mediation analysis." Advances in neural information processing systems 33 (2020): 12388-12401.

Specifically, I would like the authors to discuss the computational cost of computing the steering vector, especially if one must test multiple steering vectors for multiple target layers (as it is not obvious which layers/vectors would work best for a specific “steering” goal, and thus a user may need to do (costly) experimentation. Specifically, the “AddAct” method relies on generating the “steering vector” by doing two partial forward passes for the steering prompt pair. This itself is computationally expensive compared to a recent related work [a] which demonstrated that one could compute a “steering vector” simply using the model’s (un)embedding matrix, rather than running the steering prompts through the top N layers of an LM.

Further, the “AddAct” “steering vector” is layer-specific within a given LM. For example, if a steering vector is generated for layer N, it is not clear if the same vector can be applied to layer N+1. This is a drawback of the method as it may not be apparent to the user which layer would be best for an "AddAct" injection. Again, I would be interested if the authors could discuss how their proposed layer-specific steering vector generation strategy compares to related work [a] which proposed a steering vector that is layer-agnostic.

---

confidence: 5
contribution: 2
initial_rating: 3
presentation: 2
questions: - What is meant by "this section does not have complete statistics" in Line 533?
- How was grid search performed for ActAdd's hyperparameters? Were the results reported for the best set of parameters? If so, was a similar hyperparameter search conducted for the baselines to ensure accurate comparisons?
- Could you clarify the hyperparameter “a” discussed in Appendix C and explain its function?
- For which experiments are the prompts mentioned in Lines 1218-1223 used? Appendix C presents a collection of unrelated details, making it difficult to follow and understand how it fits into the overall context of the paper. Could the authors clarify the connection to the experiments?
soundness: 1
strengths: - The paper is well-written and easy to follow.
- Activation addition is an intuitive and powerful technique that enables fine-grained control over model outputs.
- The results convincingly show that activation addition outperforms included baselines in both sentiment control and toxicity reduction tasks.
summary: This paper introduces ActAdd, a controlled text generation technique that modifies the inner activations of an LLMduring forward passes to guide text generation towards a specific property. These modifications are applied using steering vectors, computed by taking the difference between the activations of a positive and negative prompt at a specific layer. The results demonstrate that ActAdd outperforms the baselines on tasks such as toxicity reduction and sentiment control.
weaknesses: The primary issue with the paper is that it is outdated. The paper refers to several works published in 2023 as "contemporary," implying that they are based on the presented work. This suggests that the paper may have been rejected in previous conferences and is now being resubmitted to ICLR without any major modifications. However, works from 2023 cannot be referred to as contemporary in a submission to ICLR 2025.

Moreover, the claim that both Liu et al. (2023) and Zou et al. (2023) are based on this work is questionable. A quick review of these papers reveals that Liu et al. (2023) merely cites ActAdd as related work, and Zou et al. (2023) actually outperforms ActAdd on one of the tasks. Therefore, I do not believe ActAdd presents any novel idea or result. This undermines the relevance of the method, and I believe this alone is sufficient for rejection. However, if I have misunderstood this point, the authors could clarify their claims.

Additional (and significant) weaknesses include:
- Outdated Models: Most of the experiments were conducted on outdated models (OPT, GPT2-xl, and Llama-2). While a few experiments were rerun on Llama-3, there were no baseline comparisons for these models.
- Inconsistent Baselines: The models used in the baselines do not match. For example, in Table 3, various models are used without a clear pattern. Ideally, all models should be run for every baseline to ensure fair comparison.
- Outdated Baselines: Baselines such as Fudge and PreAdd have been surpassed by newer techniques (e.g., [1]). Additionally, the paper does not include any baselines that use white-box transformations to control model behavior, despite several relevant works from 2023 (Liu et al. (2023) and Zou et al. (2023)).
- Inconsistent Perplexity Measurements: Perplexity for the included models was measured using Davinci 002, an old and less effective model. Furthermore, Lines 503-505 state that PreAdd's perplexity was measured using Davinci 001, making direct comparisons between the two methods problematic.
- Omission of Fudge: In Lines 378-380, Fudge is omitted, despite performing better on certain aspects and only slightly worse on others. This is a strange misrepresentation of the results.
- Redundant Experiments: The experiments in Sections 4.1 and 4.2 add little to the discussion, as they merely confirm that activation addition works. Furthermore, Tables 3 and 4 essentially present the same findings, but in a more interesting and applicable setting.
- Basic Metrics: Perplexity and cosine similarity are insufficient metrics to fully capture fluency and relevance. Since controlled text generation methods edit the model's internals, they can yield unintuitive results that these metrics may not fully capture. The authors should include human or LLM-based evaluations to assess the outputs in Tables 3 and 4 and compare them with baselines.
- Insufficient Code: The provided code lacks essential instructions and does not include scripts to reproduce the experiments. It only includes some notebooks for experimenting with activation addition, which overlooks the most important reason for providing the code. Additionally, the link to the GitHub repository that is present in the included code (playground.ipynb, top) violates the double-blind review process, as it is not anonymized.
- Unconvincing Experiment in Section 4.5: Evaluating a model with activation addition on one or more recent, open-form reasoning benchmarks (such as GSM8k, MixEval, or MMLU-Pro) would be much more convincing than the benchmark with perplexity measurements.
- Different Hyperparameters Across Experiments: If I am correct, the results for activation addition were generated using different values for top_p and temperature compared to some baselines (e.g., PreAdd), which undermines the validity of the comparisons. All non-critical hyperparameters should be kept consistent across baselines.

[1] Dekoninck, Jasper, et al. "Controlled text generation via language model arithmetic." arXiv preprint arXiv:2311.14479 (2023).

Meta-review: The paper is motivated by elicitation overhang - prompt engineering may not be able to elicit all the information from a language model. They introduce ActAdd, a method that modifies the inner activations of an LLM during the forward passes to elicit text with a specific property by taking the difference between the activations of a positive and negative prompt at a specific layer. Experiments are presented on two tasks: toxicity reduction and sentiment control.

**Strengths:** The paper is well motivated -prompting might not be the only way in which we can get the desired behavior from a model. Activation engineering is an efficient way to alter model behavior without retraining the model.

**Weaknesses:** There seem to be several weaknesses in this work. First of all, there was a lack of adequate comparison to baselines, as this is a crowded area of research, which was addressed in the authors’ response. Second, all reviewers noted a lack of clarity in the details of the presentation of the method, making it challenging to accept the claims by the authors. Overall, the method seems to have somewhat limited capabilities of their method - can do well in some topics but not others. New baselines show that the method performs much worse than other baselines, especially in the fluency of the generated language. 

**Reason for rejection**: See weaknesses. Most crucially, the lack of clarity as well as empirical weaknesses of the approach has made it very hard for the reviewers to be convinced about the merits of this paper, in its current shape.

Decision: Reject