In-Context Vectors (ICV)

Steering Llama 2 via Contrastive Activation Additioninherited

A prior steering technique (Liu et al., 2023) that reduces toxicity and affects style transfer by intervening on attention activations across all transformer layers, rather than the residual stream at a single layer as CAA does.

There's more than one place inside a transformer to intervene, and more than one number of layers to intervene at. In-Context Vectors takes a different combination than CAA does: steering attention activations rather than the residual stream, and doing it across every layer simultaneously rather than picking just one.

ICV was used to reduce toxicity and shift style in generated text, and it earns its place here mainly as contrast: measured against it, what's distinctive about CAA's own narrower, single-layer, residual-stream approach comes into sharper focus.

Steering every layer's attention at once

In-Context Vectors (ICV), from Liu et al. (2023), steers a model to reduce toxicity and change stylistic register. Its mechanism differs from CAA's in two coupled ways: "they steer the attention activations rather than the residual stream and intervene at all transformer layers rather than a single layer" (contrastive-activation-addition, §"2 Related work", p. 3). Rather than picking one site in the network and one point in depth, ICV spreads a correction across the attention mechanism of every layer simultaneously, so the model's behavior shifts through the accumulated effect of many small interventions rather than one larger one at a chosen point.

One committed layer versus every layer

CAA instead commits to a single site and a single depth: the Residual stream, at a layer chosen by sweeping across the network and picking where the steering effect is largest -- layer 13 for Llama 2 7B, layer 14 or 15 for 13B -- with the Steering vector then added at every token position after the prompt. The tradeoff runs in both directions. ICV's all-layer, attention-only intervention needs no per-behavior layer search, since it does not depend on locating the "right" layer. CAA's single-layer commitment costs that search but buys something ICV's diffuse intervention structurally cannot offer: a single, identifiable site whose properties can themselves be studied -- exactly what Inter-layer steering vector similarity and transfer and PCA visualization of contrastive activations go on to do, asking which layer a behavior's representation lives at and how far an effect transfers when the vector is moved elsewhere.

Where ICV sits among the alternatives

Alongside Activation Addition (ActAdd), Inference-Time Intervention (ITI), and Representation Engineering (Zou et al. 2023), ICV is one more point in the space of choices CAA had to make about where an intervention lives: a single prompt pair or a dataset of hundreds, a handful of attention heads or the whole residual stream, one layer or all of them. ICV represents the "all layers" extreme of that last axis, which is also why it is the one prior technique in this group CAA does not build its own extraction procedure from -- the two methods diverge on where to intervene before they would even get to disagreeing about how the intervening vector should be computed.