Steering with one direction
If a model represents a concept as a direction in its residual stream, then editing the stream along that direction should change its behaviour, without retraining and without touching the prompt. A steering vector is such a direction, added to or removed from the activations as the model runs. This page finds the direction that controls refusal in Qwen2.5-0.5B-Instruct, following Arditi et al., who found that in 13 open chat models refusal is mediated by a single direction: removing it stops the model refusing harmful requests, and adding it makes the model refuse harmless ones.
The prompts come from JailbreakBench's 100 harmful and 100 benign behaviours, ten of each per category; within each category five of each kind find the candidate directions, two choose among them and three test the result. The page keeps the harmful prompts only by index, behaviour and category, with their refusal labels and scores, and shows answers only for benign prompts.
Harmful minus benign
A candidate direction is a difference of means: the average residual vector over the 50 harmful training prompts minus the average over the 50 benign ones, at one layer and one position ,
The positions are the five tokens the chat template puts after every instruction, from <|im_end|> to the assistant header, where the model has read the request and not yet answered; layer is the stream entering block , counted from 0 as in the paper. That makes candidates, the cells of the Choosing one grid. At layer 0 every prompt ends in the same five template tokens, so the difference there is exactly zero.
Choosing one
Each candidate is scored on the held-out selection prompts with the refusal score, the log-odds that the first answer token is “I” or “As”, the usual openings of a refusal:
Bypass is the harmful prompts' mean score with the candidate ablated, induce the benign prompts' mean score with it added, and KL how far ablation moves the benign prompts' next-token distribution. Candidates are ruled out if adding them does not induce refusal (induce ≤ 0), if ablating them disturbs benign prompts too much (KL ≥ 0.2), or if they lie past 80 % of the depth; the lowest bypass among the rest wins. The paper's cut-off is KL < 0.1, which no candidate meets on this model, so the page uses a looser one and says so.
The winner is layer 12 at the newline after <|im_end|>, with norm 1.91: ablating it drives the harmful prompts' score to −2.69, adding it lifts the benign prompts' to +0.90, and its KL is 0.18. The One direction or many? chart compares it with the same token's candidates at other layers: neighbouring layers find nearly the same direction, and it drifts away over a few layers on either side.
Ablating and adding
With the unit direction , directional ablation removes the component along from every layer's stream at every position, so no block can read or write it:
The same edit can be made permanent in the weights by projecting out of every matrix that writes to the stream, , which Arditi et al. present as a white-box jailbreak. Activation addition goes the other way and adds to the stream at layer 12 at every position, .
The Intervening card shows a benign prompt's greedy answer as is, with the direction ablated and with it added, and the First answer token bars show where the refusal begins. On the 30 harmful test prompts the model refuses 22 as is and none once the direction is ablated. On the 30 benign test prompts it refuses 6 as is, 3 with the direction ablated, and 27 with it added. Refusals are counted with the paper's list of refusal phrases, a crude rule the page points out.
What the direction is
The test prompts scatter projects never-seen harmful and benign prompts onto at the chosen point, and the strip's projection chart follows the two classes' means through the layers. Harmful and benign prompts separate along this one direction: 28 of the 30 harmful and 28 of the 30 benign test prompts fall on their own side of the line halfway between the training means, much as the Probes tab found for sentiment.
Projection alone would only make a probe; the interventions make it causal. Erasing one of 896 dimensions removes every refusal of the harmful test prompts while moving the benign selection prompts' next-token distribution by a KL of only 0.18 nats, which is what “mediated by a single direction” means. It also shows how thin a safety fine-tune can be: the behaviour it trains is a direction that an edit to the weights can remove.
Where it came from
Steering by adding vectors to activations was shown by Turner et al. (activation addition, from a single pair of prompts such as “Love” and “Hate”) and refined by contrastive activation addition, which averages the difference over many pairs. Li et al. shifted chosen attention heads along truthful directions at inference time, and Zou et al. framed reading and controlling such directions as representation engineering. Arditi et al. (2024) applied the difference-of-means recipe to refusal, the experiment this page repeats on a small model.
Papers
- Refusal in Language Models Is Mediated by a Single Direction The method this page follows: a difference-of-means refusal direction chosen by bypass, induce and KL scores, then ablated or added, across 13 chat models.
- Steering Language Models With Activation Engineering Activation addition: a steering vector from the activations of a contrasting pair of prompts, added during the forward pass.
- Steering Llama 2 via Contrastive Activation Addition Averages the residual difference over many contrasting pairs into a steering vector added at every position after the prompt.
- Inference-Time Intervention: Eliciting Truthful Answers from a Language Model Shifts a few attention heads' activations along truthful directions found by probing, trading truthfulness against helpfulness.
- Representation Engineering: A Top-Down Approach to AI Transparency Reading and controlling concepts such as honesty through directions in a model's representations.
- JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Models The 100 harmful and 100 benign behaviours this page splits into training, selection and test prompts.
- Qwen2.5 Technical Report Qwen2.5, whose 0.5B instruction-tuned model this page steers.