Adding the difference between two single-prompt residual streams at inference time cuts OPT-6.7B toxicity by 17% on RealToxicityPrompts without touching a single model weight or running gradient descent. Alexander Matt Turner and colleagues call this technique Activation Addition (ActAdd), positioning it as an optimization-free way to bridge the “elicitation overhang” between what pretrained language models can compute and what ordinary prompts coax out of them.

  • One prompt pair, zero training: Subtracting the layer l activations of a contrastive pair such as "Love" minus "Hate" produces a reusable steering vector from two forward passes in seconds.
  • 17% lower toxicity on OPT-6.7B: On 1,000 RealToxicityPrompts continuations (5 seeds), ActAdd drops Perspective API toxicity from 0.134 to 0.112, beating PREADD-D (0.122) with less than one-quarter of the disfluency (13.8 vs. 56.6), and cuts LLaMA-3-8B toxicity by 5% (0.114 to 0.108).
  • 66.9% negative-to-positive sentiment flip on LLaMA-3-8B: On 1,000 IMDb reviews, ActAdd lifts positive reversal from 41.7% unsteered to 66.9%, outperforming OPT prompting (36.5%), FUDGE (55.1%), and PREADD-S-OPT (62.4%).
  • Over 90% topic steering with intact general knowledge: Injecting a "weddings" minus whitespace vector at layer 6 of GPT-2-XL raises wedding-word mentions from roughly 2% to over 90% while leaving top-K factual accuracy on 29,774 ConceptNet prompts nearly identical.
How ActAdd extracts and injects a steering vector at inference
1. Pair & pad

Pick contrast prompts (p+, p-) like “Love” and “Hate”; right-pad with spaces to equal token length.

2. Diff activations

Run both forward passes to layer l and subtract: h_l^A = h_l^+ - h_l^-.

3. Scale & align

Multiply by strength c and add into the user pass at alignment position a = 1.

4. Continue pass

Remaining layers process the shifted residual stream into steered next-token logits.

Source: Turner et al. (2024), Section 3 and Algorithm 1.

How It Works

Instead of optimizing soft prompts or updating weights via gradient descent, ActAdd exploits the hypothesis that linear directions in the residual stream encode high-level concepts. Given a target prompt p+ and an opposing or neutral prompt p- (padded with whitespace to match token length), the method runs both prompts through the frozen Transformer up to layer l and records their difference h_l^A = h_l^+ - h_l^-.

During a user forward pass on prompt p*, ActAdd adds c * h_l^A to the residual stream at layer l starting at token position a = 1 (front alignment), then lets the remaining blocks finish normally. Two design details matter in practice. First, contrasting p+ against p- is essential: adding "Love" alone without subtracting "Hate" or whitespace fails to steer reliably. Second, ActAdd is not equivalent to prepending a token. Transplanting layer-0 embeddings of "Anger" - "Calm" directly into layer 20 (0 -> 20) barely changes output anger compared to extracting at layer 20 (20 -> 20), showing that early Transformer blocks perform real feature computation. Similarly, prepending "weddings" to prompts raises perplexity on unrelated OpenWebText sentences by 13.2% (ratio 1.132), whereas ActAdd keeps unrelated perplexity at 0.994 while dropping wedding-sentence perplexity to 0.875.

RealToxicityPrompts detoxification: toxicity and disfluency across controls (lower is better)
Method (Model)Perspective Toxicity ↓ · Disfluency ↓
Prompting baseline (OPT-6.7B)0.200 · 54.3
Unsteered baseline (OPT-6.7B)0.134 · 8.9
PREADD-D contrastive decoding (OPT-6.7B)0.122 · 56.6
Unsteered baseline (LLaMA-3-8B)0.114 · 6.3
ActAdd love minus hate (OPT-6.7B)0.112 · 13.8
ActAdd love minus hate (LLaMA-3-8B)0.108 · 6.7

Source: Turner et al. (2024), Section 4.3, Table 3 (n = 1,000 prompts across 5 seeds; p under 0.05 vs. second-best).

Key Findings

  • Targeted token shifts without random collapse: On 300k OpenWebText documents in GPT-2-XL, adding the weddings vector lowers perplexity monotonically as wedding-word density rises, raising the probability of " bride" by 500% while lowering " Image" by 30%. Injecting norm-matched Gaussian noise causes larger KL-divergence shifts than the "Anger" - "Calm" vector yet produces less behavioral change.
  • Layer depth tracks abstraction: Concrete properties like sentiment ("Love" - "Hate") and weddings peak around layer 6 of GPT-2-XL (48 layers total), whereas higher-level concepts like "Bush did 9/11 because" or "The Eiffel Tower is in Rome" work best around layers 23 to 24. Intervening on the final token position before generation tends to break syntax.
  • Strong negative-to-positive sentiment, weaker reverse: On IMDb (n = 1,000), ActAdd reaches 0.669 on LLaMA-3-8B and 0.564 on OPT-6.7B for negative-to-positive steering. For positive-to-negative steering, ActAdd-OPT (0.432) trails FUDGE (0.532) and PREADD-S-OPT (0.631), though PREADD incurs nearly triple the disfluency (68.4 vs. 24.2).
  • Generalization across architectures: Topic and log-probability shifts replicate on GPT-J-6B and partially on Llama-1-13B, though three qualitative prompts (Eiffel Tower in Rome, anger, and harm) fail to replicate on Llama-1-13B.

Caveats & Builder Takeaway

ActAdd requires white-box access to hook and overwrite residual stream activations during inference, ruling out standard closed model APIs. Even with model weights in hand, steering is sensitive to hyperparameters (l, c) and prompt wording: adding a +10 vector can reach roughly 10x the residual stream norm at layer 20, and pushing c too high (such as +100 on weddings) produces incoherent text. The authors also note that qualitative examples report best-of-3 completions from seed 0 (omitting 1 of 12 candidate vectors) and leave multi-step reasoning benchmarks untested.

For engineers running open-weight models, ActAdd is a fast prototyping tool for runtime tone or safety nudges when prompt engineering fails or adds too much noise. For production reliability on alignment traits, follow-up work on Contrastive Activation Addition and Representation Engineering shows that averaging or running PCA over dozens to hundreds of prompt pairs yields far more stable steering directions than a single prompt pair.