通过输入优化创建引导向量

arXiv cs.CL 论文

摘要

一篇学士学位论文,介绍了 ActGCG,这是一种贪心坐标梯度(GCG)算法的变体,通过优化输入后缀,在生成时无需白盒访问即可复现引导向量的行为。该方法在德语语言引导和反拒绝越狱任务上进行了评估,在更严格的指标下结果好坏参半。

arXiv:2611.17481v1 Announce Type: new Abstract: Activation steering influences a language model's behaviour by adding a steering vector to its residual stream during generation, but it requires white-box access to modify the hidden states at every generation step. We introduce ActGCG, a modification of Greedy Coordinate Gradient which optimises a suffix to match the target activations obtained by adding a steering vector to the residual stream. We further introduce universal suffixes trained across many prompts at once, a model-translation step that rewrites the suffix into human-readable text midway through optimisation, and a soft-suffix variant to remove the discrete token space constraint. We study two behaviours: steering a model to answer in German, and anti-refusal steering for jailbreaking. For German, a discrete suffix reproduces the steering vector's behaviour almost perfectly and transfers well across prompts and models. For anti-refusal, the equivalence is weaker, succeeding under a phrase-avoidance metric but only partially under the stricter HarmBench classifier. Our results show that a steering vector's behaviour is reachable from the input, with no access to model internals at generation time, up to a loss that depends on the concept being steered.
查看原文
查看缓存全文

缓存时间: 2026/11/16 08:18

# Creating Steering Vectors via Input Optimisation
Source: [https://arxiv.org/html/2611.17481](https://arxiv.org/html/2611.17481)
\\thesistype

Bachelor’s Thesis\\supervisorsLukas Fluri, Prof\. Dr\. Florian Tramèr

August 25, 2026

###### Abstract

Activation steering influences a language model’s behaviour by adding a steering vector to its residual stream during generation, but it requires white\-box access to modify the hidden states at every generation step\. We introduceActGCG, a modification of Greedy Coordinate Gradient which optimises a suffix to match the target activations obtained by adding a steering vector to the residual stream\. We further introduce universal suffixes trained across many prompts at once, a model\-translation step that rewrites the suffix into human\-readable text midway through optimisation, and a soft\-suffix variant to remove the discrete token space constraint\. We study two behaviours: steering a model to answer in German, and anti\-refusal steering for jailbreaking\. For German, a discrete suffix reproduces the steering vector’s behaviour almost perfectly and transfers well across prompts and models\. For anti\-refusal, the equivalence is weaker, succeeding under a phrase\-avoidance metric but only partially under the stricter HarmBench classifier\. Our results show that a steering vector’s behaviour is reachable from the input, with no access to model internals at generation time, up to a loss that depends on the concept being steered\.

To Dennis

###### Acknowledgements\.

I’m grateful to Lukas Fluri, my supervisor, for guiding me throughout this thesis\. Without his support, this project would not have been possible\. I’m also grateful to the whole SPY Lab team, as their amazing environment has helped me stay strongly motivated throughout the semester\. Last but not least, I am thankful to my friends and family, especially my brother Dennis, and my parents Tolga and Banu, for always being there for me\. Thank you\.

###### Contents

1. [0Introduction](https://arxiv.org/html/2611.17481#1)
2. [1Background](https://arxiv.org/html/2611.17481#Ch1)1. [1Layers and Tokens](https://arxiv.org/html/2611.17481#Ch1.S1) 2. [2Activations](https://arxiv.org/html/2611.17481#Ch1.S2) 3. [3Prompt structures with chat templates](https://arxiv.org/html/2611.17481#Ch1.S3) 4. [4Steering Vectors](https://arxiv.org/html/2611.17481#Ch1.S4) 5. [5Steering Vector Algorithms](https://arxiv.org/html/2611.17481#Ch1.S5) 6. [6GCG mechanism](https://arxiv.org/html/2611.17481#Ch1.S6) 7. [7GCG modifications and alternatives](https://arxiv.org/html/2611.17481#Ch1.S7)
3. [2Methodology](https://arxiv.org/html/2611.17481#Ch2)1. [1Constructing Steering Vectors](https://arxiv.org/html/2611.17481#Ch2.S1) 2. [2The ActGCG Objective](https://arxiv.org/html/2611.17481#Ch2.S2) 3. [3Universal Suffixes and Model Translation](https://arxiv.org/html/2611.17481#Ch2.S3) 4. [4Experimental Setup](https://arxiv.org/html/2611.17481#Ch2.S4)
4. [3Experiments](https://arxiv.org/html/2611.17481#Ch3)1. [1Different values ofα\\alphafor German](https://arxiv.org/html/2611.17481#Ch3.S1) 2. [2Different seeds for different values of alpha](https://arxiv.org/html/2611.17481#Ch3.S2) 3. [3Suffix lengths](https://arxiv.org/html/2611.17481#Ch3.S3) 4. [4Checking target on German](https://arxiv.org/html/2611.17481#Ch3.S4) 5. [5Comparing results to the original GCG method and SSR for German](https://arxiv.org/html/2611.17481#Ch3.S5) 6. [6Universal suffixes on German](https://arxiv.org/html/2611.17481#Ch3.S6) 7. [7Model translation for universal suffixes on German](https://arxiv.org/html/2611.17481#Ch3.S7) 8. [8Tracking the change of loss for German](https://arxiv.org/html/2611.17481#Ch3.S8) 9. [9Refusal](https://arxiv.org/html/2611.17481#Ch3.S9) 10. [10Checking our target for refusal](https://arxiv.org/html/2611.17481#Ch3.S10) 11. [11Comparing results to the original GCG method and SSR for refusal](https://arxiv.org/html/2611.17481#Ch3.S11) 12. [12Universal suffixes on refusal](https://arxiv.org/html/2611.17481#Ch3.S12) 13. [13Model translation for universal suffixes on refusal](https://arxiv.org/html/2611.17481#Ch3.S13) 14. [14Tracking the change of loss for refusal](https://arxiv.org/html/2611.17481#Ch3.S14) 15. [15Soft suffixes](https://arxiv.org/html/2611.17481#Ch3.S15) 16. [16Decoding soft tokens](https://arxiv.org/html/2611.17481#Ch3.S16) 17. [17Different dataset extraction for German](https://arxiv.org/html/2611.17481#Ch3.S17) 18. [18More steps](https://arxiv.org/html/2611.17481#Ch3.S18) 19. [19Weight precision](https://arxiv.org/html/2611.17481#Ch3.S19) 20. [20Suffix to steering vectors](https://arxiv.org/html/2611.17481#Ch3.S20) 21. [21Prefix instead of suffix](https://arxiv.org/html/2611.17481#Ch3.S21) 22. [22Starting from a readable German instruction](https://arxiv.org/html/2611.17481#Ch3.S22)
5. [4Discussion](https://arxiv.org/html/2611.17481#Ch4)1. [1Limitations](https://arxiv.org/html/2611.17481#Ch4.S1) 2. [2Ethical Considerations](https://arxiv.org/html/2611.17481#Ch4.S2) 3. [3Future Work](https://arxiv.org/html/2611.17481#Ch4.S3)
6. [5Conclusion](https://arxiv.org/html/2611.17481#Ch5)
7. [References](https://arxiv.org/html/2611.17481#bib)
8. [6Additional Figures](https://arxiv.org/html/2611.17481#Ch6)1. [6\.APer\-layer cosine trajectories](https://arxiv.org/html/2611.17481#Ch6.A1) 2. [6\.BPer\-prompt loss trajectories](https://arxiv.org/html/2611.17481#Ch6.A2)

## Chapter 0Introduction

The behaviour of large language models can be influenced by directly editing their internal activations\. A common method of achieving this is to use*activation steering*, where one computes a*steering vector*to induce a target behaviour and adds the vector to the residual stream during generation to push the model towards it\. One can build such a vector by averaging the difference in activations between two datasets with prompts that do and do not exhibit the behaviour\[[21](https://arxiv.org/html/2611.17481#bib.bib8)\]\. Steering vectors are useful as they’re cheap to produce and interpretable\. However, since they are an intervention in the activation space, one requires full access to the model’s weights as well as the ability to modify hidden states at every generation step\. This is not feasible when a model can only be reached through a chat interface\.

At the same time, model behaviour can be changed automatically from the input alone\. Greedy Coordinate Gradient \(GCG\)\[[30](https://arxiv.org/html/2611.17481#bib.bib7)\]is a suffix finding method to cause a model to yield an affirmative string such as “Sure, here is how to…”, also called the target string\. The adversarial suffix is optimised by only changing the suffix tokens themselves to maximise the chance of obtaining the target as output, without directly modifying internal activations\.

We look for an equivalence relationship between suffixes and steering vectors by combining these two methods, and investigating whether the effect of a steering vector can be reproduced by an input suffix\. To this end, we modify the loss function of GCG to reach a new algorithm, which we callActGCG\. Instead of targeting an output string, ActGCG targets the*activations*that a steering vector would have induced\. The vector is first given on a set of filler tokens to obtain the target activations\. The algorithm then searches for a discrete suffix whose activations are on those same tokens to match the target, minimising the squared difference summed over positions and over several layers\. If such a suffix exists, it means that the steering vector’s behaviour was reachable from the input, with no access to the model’s internals at generation time\.

We study two behaviours\. The first task is to steer a model to answer inGerman, using a contrastive German/English steering vector built from the Dolly instruction dataset\[[4](https://arxiv.org/html/2611.17481#bib.bib10)\]\. The second isanti\-refusalsteering, where the vector is negated so that matching the target pushes the model*away*from refusing a harmful request, and we measure success with the HarmBench jailbreak classifier\[[15](https://arxiv.org/html/2611.17481#bib.bib9)\]as well as checking if a model avoids a set of refusal phrases\. For German, the discrete suffix reproduces the steering vector’s behaviour almost perfectly\. For the anti\-refusal direction, we achieve a high success rate for phrase avoidance, but lower success rate for jailbreaking\.

Beyond the core method, we make three further contributions\. First, we introduce a*soft\-suffix*variant that replaces the discrete tokens with continuous embeddings optimised directly by gradient descent\. We use this as an upper bound on how well the activation\-matching objective can be met, as it is unconstrained by the discrete token space\. Second, we move from single prompts to*universal*suffixes: a single string trained across multiple prompts at once, which we then use to study transfer across new prompts of the same model, and across different models\. Third, we add a*model\-translation*step to the universal setting, where in the middle of the optimisation steps the unreadable suffix is rewritten into fluent, human\-readable text using another model\. We then continue the optimisation as before\.

The rest of the thesis is organised as follows\. Chapter[1](https://arxiv.org/html/2611.17481#Ch1)reviews the linear representation hypothesis, steering vectors, and the GCG algorithm\. Chapter[2](https://arxiv.org/html/2611.17481#Ch2)introduces the ActGCG method and the experimental setup\. Chapter[3](https://arxiv.org/html/2611.17481#Ch3)presents our experiments on the German and anti\-refusal directions, covering per\-prompt, universal, model\-translation, and soft suffixes, as well as transferring across models\. Chapters[4](https://arxiv.org/html/2611.17481#Ch4)and[5](https://arxiv.org/html/2611.17481#Ch5)discuss the findings and conclude\.

## Chapter 1Background

We first discuss the internal mechanisms of a Large Language Model, explain the role of steering vectors in this context, and elaborate on the GCG algorithm\.

### 1Layers and Tokens

Large Language Models are built up of stacks of layers between an input and an output\. These layers allow the model to represent increasingly complex functions\. Each layer consists of a Multi\-Layer Perceptron \(MLP\) and multiple attention heads\. The MLP processes information in each token position, whereas attention moves information between token positions\.

A token is a unit of text that the model can process, represented by a vector of numbers\. We have two notions of a token\. A*discrete*token corresponds to a word of the model’s fixed vocabulary\. In contrast, a*soft*token is an arbitrary vector in embedding space that does not necessarily correspond to a word in a vocabulary\. Hence, allowing soft tokens gives an optimiser access to the entire continuous embedding space rather than the discrete vocabulary\.

### 2Activations

For each layer and each token position, the transformer\[[24](https://arxiv.org/html/2611.17481#bib.bib11)\]of a Large Language Model maintains a vector that is updated by the attention and MLP sublayers\. Attention combines vectors from earlier positions, and the MLP applies a non\-linear transformation per position\. The transformer adds each sublayer’s output back onto its input through a*residual connection*\[[24](https://arxiv.org/html/2611.17481#bib.bib11)\]\. More formally, following the residual\-stream view of[Elhage et al\. \[6\]](https://arxiv.org/html/2611.17481#bib.bib12)and ignoring layer normalisation for clarity, we lethi\(ℓ\)h\_\{i\}^\{\(\\ell\)\}be the vector at token positioniiafter layerℓ\\ell\. We first have attention write into the stream:

h~i\(ℓ\)=hi\(ℓ\)\+attn\(ℓ\)​\(h≤i\(ℓ\)\),\\tilde\{h\}\_\{i\}^\{\(\\ell\)\}=h\_\{i\}^\{\(\\ell\)\}\+\\mathrm\{attn\}^\{\(\\ell\)\}\\\!\\big\(h\_\{\\leq i\}^\{\(\\ell\)\}\\big\),\(1\)Then, we let the MLP read that post\-attention value and write into it:

hi\(ℓ\+1\)=h~i\(ℓ\)\+mlp\(ℓ\)​\(h~i\(ℓ\)\),h\_\{i\}^\{\(\\ell\+1\)\}=\\tilde\{h\}\_\{i\}^\{\(\\ell\)\}\+\\mathrm\{mlp\}^\{\(\\ell\)\}\\\!\\big\(\\tilde\{h\}\_\{i\}^\{\(\\ell\)\}\\big\),\(2\)Therefore, each sublayer writes into a running sum\. This vector is variously called the hidden state, the activation vector, or the residual stream, and it lives in a high\-dimensional*activation space*\. The residual form of Equation[2](https://arxiv.org/html/2611.17481#Ch1.E2)is what makes activation steering possible, as an intervention added tohi\(ℓ\)h\_\{i\}^\{\(\\ell\)\}is carried forward to every subsequent layer\.

The*linear representation hypothesis*claims that human\-interpretable concepts are represented along linear subspaces\[[16](https://arxiv.org/html/2611.17481#bib.bib1),[19](https://arxiv.org/html/2611.17481#bib.bib2),[2](https://arxiv.org/html/2611.17481#bib.bib3),[5](https://arxiv.org/html/2611.17481#bib.bib4),[18](https://arxiv.org/html/2611.17481#bib.bib5),[17](https://arxiv.org/html/2611.17481#bib.bib6)\], i\.e\. as directions in the activation space\. We adopt this assumption in our work\. For example, if a concept corresponds to a directionvv, we assume that moving an activation alongvvstrengthens the concept\. The difference between the mean activations of examples that do and do not exhibit the concept is an estimate ofvv, which we explore as steering vectors\.

### 3Prompt structures with chat templates

Instruction\-tuned models wrap user text in a*chat template*\. A template uses additional tokens to determine where the user begins and ends, and where the assistant turn starts\. The number of chat template tokens differs from model to model, which can change the optimal token position to extract steering vectors\. For our method, since we read the activations at fixed positions between the user prompt and the response, the chat template determines the token positions to be extracted\. We refer to this as*filler*positions as given in Chapter[2](https://arxiv.org/html/2611.17481#Ch2)\.

### 4Steering Vectors

Under the linear representation hypothesis, we can influence a model’s output by adding a vector to the residual stream at a chosen layer and token position\. Concretely, given a steering vectorvvfor a target concept and a strengthα\\alpha, we replace the activation during generation by

hi\(ℓ\)←hi\(ℓ\)\+α​v,h\_\{i\}^\{\(\\ell\)\}\\;\\leftarrow\\;h\_\{i\}^\{\(\\ell\)\}\+\\alpha\\,v,\(3\)which pushes the model towards the concept forα\>0\\alpha\>0and away from it forα<0\\alpha<0\. Steering vectors can nudge models along behaviours of varying complexity: the output language, refusal, sycophancy \(telling the user what they want to hear\), and so on\. They are computationally easy to build and interpretable by humans\.

The underlying intuition predates language models\. In classical word embeddings, semantic relationships appear as consistent directions, so that vector arithmetic such asking−man\+woman≈queen\\text\{king\}\-\\text\{man\}\+\\text\{woman\}\\approx\\text\{queen\}recovers analogies \(Figure[2](https://arxiv.org/html/2611.17481#Ch1.footnote2)\)\. Steering vectors carry this intuition into the residual stream of a transformer\.

![Refer to caption](https://arxiv.org/html/2611.17481v1/Figures/Word_vector_illustration.jpg)Figure 1:Semantic relationships as directions in an embedding space\.222[https://commons\.wikimedia\.org/wiki/File:Word\_vector\_illustration\.jpg](https://commons.wikimedia.org/wiki/File:Word_vector_illustration.jpg)
### 5Steering Vector Algorithms

Several methods exist for constructing the directionvv; they differ mainly in how many contrast examples they use, at which layer and position they read activations, and whether they apply a further linear transformation\. We summarise the most common ones\.

*Activation Addition \(ActAdd\)*\[[23](https://arxiv.org/html/2611.17481#bib.bib19)\]takes a single contrast pair, runs both prompts through the model, records the activations at one layer, and subtracts them to obtain the steering vector, which is then added at one token position during generation\.

*Contrastive Activation Addition \(CAA\)*\[[21](https://arxiv.org/html/2611.17481#bib.bib8)\]generalises to many contrast pairs\. For each pair it computes the positive and negative activations at a single layer and last token position and takes the mean of their differences across all pairs, adding the resulting vector at every token position during generation\. CAA is evaluated on both multiple\-choice and open\-ended prompts\. Our own steering vectors follow this difference\-of\-means recipe \(Chapter[2](https://arxiv.org/html/2611.17481#Ch2)\)\.

*Inference\-Time Intervention \(ITI\)*\[[13](https://arxiv.org/html/2611.17481#bib.bib20)\]considers the attention\-head space rather than the full residual stream\. Given a dataset of true/false question–answer pairs, it records the activation of each attention head, trains a linear probe per head to separate true from false, and keeps the top\-KKmost predictive heads\. For each such head it takes the mean\-difference direction between true and false examples and shifts activations along the direction, targeting truthfulness specifically\.

*Representation Engineering \(RepE\)*\[[29](https://arxiv.org/html/2611.17481#bib.bib21)\]collects contrast pairs where the contrast is only in the target concept, and reads activations \(by default at the last token\) for both\. For each layer it forms the difference vectors and runs principal component analysis over them; the first principal component is taken as the reading direction for that concept at that layer, which can then be used either as a classifier \(by projection\) or for control \(by addition or subtraction\)\.

We adopt the simpler and well\-supported difference\-of\-means \(CAA\-style\) construction\.

### 6GCG mechanism

Greedy Coordinate Gradient \(GCG\)\[[30](https://arxiv.org/html/2611.17481#bib.bib7)\]optimises a suffix appended to a prompt such that the model begins its answer with a chosen affirmative*target string*\. For example, this can be a result starting with “Sure, here is how to…”\. To obtain such a suffix, the algorithm works in the following manner:

For a given prompt, our loss function is the cross entropy \(i\.e\. the “surprise”\) of the target tokens given the prompt and the suffix, which we minimise\. For a current suffix, we first take the embeddings of the tokens and find the gradients of the loss with respect to these embeddings\. We compute the top\-k promising tokens per position for a replacement\. Then, for each batch, we choose a random token position in the suffix, and replace it with a uniformly sampled token from the top\-k options\. We receive a number of candidate suffixes, and choose the suffix of the batch that minimises the loss \(and hence maximises the chance of reaching our target string\)\. We repeat this T times\.

Crucially, GCG searches over*discrete*tokens\. Figure[2](https://arxiv.org/html/2611.17481#Ch1.F2)states the algorithm formally\.

![Refer to caption](https://arxiv.org/html/2611.17481v1/Figures/GCG.png)Figure 2:The Greedy Coordinate Gradient \(GCG\) algorithm, reproduced from[Zou et al\. \[30\]](https://arxiv.org/html/2611.17481#bib.bib7)\.
### 7GCG modifications and alternatives

There are numerous ways of modifying GCG, as well as alternatives to the GCG algorithm\. We explore three such methods\.

*Steering\-SSR*\[[26](https://arxiv.org/html/2611.17481#bib.bib22)\]is the most similar prior method\. It optimises a suffix so that the model’s activations match a target where a steering vector is added, but using a cosine\-similarity loss rather than a squared distance\.444Eq\.[4](https://arxiv.org/html/2611.17481#Ch1.E4)fromSteeringSSRin[https://github\.com/Sckathach/subspace\-rerouting](https://github.com/Sckathach/subspace-rerouting)\.Writinghℓh\_\{\\ell\}for the suffix’s readout activation andvℓv\_\{\\ell\}for the unit steering direction at layerℓ\\ell, its loss sums a per\-layer squared cosine term over the chosen layers,

ℒSSR​\(s\)=∑ℓ∈ℒ\(−αℓ−cos⁡\(hℓ,vℓ\)\)2,\\mathcal\{L\}\_\{\\text\{SSR\}\}\(s\)\\;=\\;\\sum\_\{\\ell\\in\\mathcal\{L\}\}\\big\(\\,\{\-\}\\alpha\_\{\\ell\}\\;\-\\;\\cos\\\!\\big\(h\_\{\\ell\},\\,v\_\{\\ell\}\\big\)\\big\)^\{2\},\(4\)where the per\-layer targetαℓ\\alpha\_\{\\ell\}sets the desired cosine\. We were unable to reproduce the reported jailbreak success rates, since re\-judging the paper’s outputs with our own classifier \(see Chapter[2](https://arxiv.org/html/2611.17481#Ch2)\) gave substantially lower rates than reported, which we attribute to the choice of jailbreak judge\.

*PEZ \(Hard Prompts Made Easy\)*\[[25](https://arxiv.org/html/2611.17481#bib.bib23)\]performs gradient\-based discrete optimisation by combining soft and discrete updates\. In each iteration it projects the current continuous embeddings onto their nearest discrete vocabulary tokens, computes the gradient at the projected point, and applies that gradient to update the continuous iterate\. A final projection yields the discrete output\. Figure[3](https://arxiv.org/html/2611.17481#Ch1.F3)states the algorithm formally\.

![Refer to caption](https://arxiv.org/html/2611.17481v1/Figures/PEZ.png)Figure 3:The PEZ gradient\-based discrete optimisation scheme, reproduced from[Wen et al\. \[25\]](https://arxiv.org/html/2611.17481#bib.bib23)Finally, we can remove the discrete token constraint altogether by considering*soft suffixes*\. We use this as a comparison method in Section[15](https://arxiv.org/html/2611.17481#Ch3.S15)\.

## Chapter 2Methodology

We now introduce our method\. We first describe how we construct the steering vectors that define each target behaviour, and the ActGCG objective that searches for a suffix reproducing the activations when a steering vector was added\. Then, we follow with the universal and model\-translation versions of the objective, our tasks and datasets, as well as the models, judges that were used together with the comparisons to other methods\.

### 1Constructing Steering Vectors

We build a steering vector for each behaviour with a difference\-of\-means construction inspired by Contrastive Activation Addition\[[21](https://arxiv.org/html/2611.17481#bib.bib8)\]\. For a set of contrast pairs \(such as German against English\), we run both prompts through the model, and read the residual\-stream activation at a chosen layer and token position\. We average the difference across all pairs\. Since our loss matches activations at several layers at once \(Section[2](https://arxiv.org/html/2611.17481#Ch2.S2)\), we build one such vector per target layer and stack them together\. For every model, we use four layers, with a preference towards the middle and later layers where steering vectors are commonly applied, as listed in Table[1](https://arxiv.org/html/2611.17481#Ch2.T1)\.

Table 1:The four layers at which each model’s steering vectors are built and at which the ActGCG objective matches activations\.We choose a CAA style method because it is both simple to implement and effective relative to its alternatives\. The best method to obtain steering vectors overall is not yet fully clear; for instance,[Im and Li \[11\]](https://arxiv.org/html/2611.17481#bib.bib13)reports that mean\-difference vectors outperform other steering constructions, whereas[Pres et al\. \[20\]](https://arxiv.org/html/2611.17481#bib.bib14)argues that CAA is less optimal than what earlier work suggested\. We proceed with it regardless, as we found no alternative that gives a clear improvement for our purposes\.

For the language task, we first tried Turkish\. However, we noticed that the level of knowledge for the language was quite limited\. For example, Figure[1](https://arxiv.org/html/2611.17481#Ch2.F1)illustrates that Llama\-2\-7B has German as the second largest recognised language\[[22](https://arxiv.org/html/2611.17481#bib.bib17)\]\. As a result, we believed German might be the more optimal language choice\. For theGermanvector, we use the Dolly instruction dataset\[[4](https://arxiv.org/html/2611.17481#bib.bib10)\]\. We pair each German \(both question and response\) prompt \(positive\) with its English counterpart \(negative\)\. We read the activations near the end of the response \(position−2\-2, or second to last token\)\. The difference of means gives our “answer in German” direction\.

![Refer to caption](https://arxiv.org/html/2611.17481v1/Figures/llama_languages.png)Figure 1:Language distribution in pretraining data with percentage \>= 0\.005%\. Most data is in English, meaning that Llama 2 will perform best for English\-language use cases\. The large unknown category is partially made up of programming code data\. Reproduced from[Touvron et al\. \[22\]](https://arxiv.org/html/2611.17481#bib.bib17)\.For therefusalvector we use the harmful and harmless instruction datasets of[Arditi et al\. \[1\]](https://arxiv.org/html/2611.17481#bib.bib18), taking the harmful set as positive and the harmless set as negative\. Here, unlike the German vector, there is no answer appended after the instruction, so we consider the last tokens before the response\. The exact position changes depending on the model\. We read at position−1\-1\(last token of the prompt\) for Gemma, Llama, and Qwen2\.5\[[27](https://arxiv.org/html/2611.17481#bib.bib26)\]; but−5\-5for Qwen3, since its chat template also inserts an empty reasoning scaffold \(<think\></think\>\)\. Since the resulting vector points*towards*refusal, to steer against refusal \(the jailbreak direction\) we negate it, which corresponds to using a negative strengthα\\alpha\.

Our vector extraction was implemented with the NNSight library\[[7](https://arxiv.org/html/2611.17481#bib.bib16)\], which made our efforts simpler in tracing activations at specific layers and token positions\. We do not claim our chosen layers and token extraction positions to be optimal \(due to the amount of computational resources it would require\)\. However, we chose our token and layer extraction positions after checking the success rates of multiple different combinations\.

### 2The ActGCG Objective

Our method, which we callActGCG, modifies the loss of a GCG implementation \(from the NanoGCG library\[[10](https://arxiv.org/html/2611.17481#bib.bib29)\]\) while keeping its discrete search unchanged\. Instead of a cross\-entropy towards a target string, we match the activations that a steering vector would have produced\.

Concretely, letxxbe a prompt and let the suffix be the tokens that follow it\. We call the chat\-template tokens that sit*after*the user prompt and*before*the generated response the*filler*tokens, and read activations at those positions\. We first build our target\. For each target layerℓ\\ellwe run the plain prompt through the model, addα​vℓ\\alpha\\,v\_\{\\ell\}to the residual stream at every filler position, and read the resulting activationstℓ,pt\_\{\\ell,p\}at filler positionpp\. We then search for a suffix whose own forward pass reproduces those activations\. Writingaℓ,p​\(x∥s\)a\_\{\\ell,p\}\(x\\mathbin\{\\\|\}s\)for the activation at layerℓ\\ell, filler positionpp, of the prompt with suffixssappended, the loss is the squared error summed over filler positions and over four layers:

ℒ⁡\(s\)=∑ℓ∈ℒ∑p∈ℱ∥aℓ,p​\(x∥s\)−tℓ,p∥22,\\mathcal\{L\}\(s\)\\;=\\;\\sum\_\{\\ell\\in\\mathcal\{L\}\}\\;\\sum\_\{p\\in\\mathcal\{F\}\}\\big\\lVert\\,a\_\{\\ell,p\}\(x\\mathbin\{\\\|\}s\)\\;\-\\;t\_\{\\ell,p\}\\,\\big\\rVert\_\{2\}^\{\\,2\},\(1\)whereℒ\\mathcal\{L\}is the set of four layers andℱ\\mathcal\{F\}the filler positions\. Minimising Equation[1](https://arxiv.org/html/2611.17481#Ch2.E1)with the ordinary GCG search lets us reproduce the steering vector’s effect using a discrete suffix, without activation edits during generation\.

We match at the filler positions rather than at the generated response since the response tokens change from run to run and differ across prompts, so the variance is quite high\. The filler tokens, by contrast, are a*fixed*set of chat\-template tokens that is present for every prompt and directly before generation\. Reading the filler tokens provides a prompt\-independent set of positions, and since there are several of them the steering vector signal is stronger from multiple positions at once rather than from a single token\.

The variableα\\alphascales the strength of the steering vector\. We sweep across differentα\\alphafor both the German and the anti\-refusal directions\. Unless noted otherwise, we optimise a suffix of2020tokens initialised to “x x … x”, for250250steps with search width512512, top\-k=256k=256, replacing a single token per candidate, and a fixed seed for reproducibility\.

### 3Universal Suffixes and Model Translation

Our original objective is optimised on a single suffix for a single prompt\. We extend our method in two ways to create suffixes that generalise across different prompts and models\.

First, we consider auniversal suffix\. To obtain a single suffix that steers multiple prompts at once, we optimise one shared token string whose loss and gradient are*summed*over a training set of prompts\. At each step, a token swap depends on the sum of the per\-prompt gradients\. We train onNNprompts, and evaluate on the training set as well as a set of new prompts to measure generalisation\. To check model transfer, we evaluate the universal suffix on the same training prompt set across different models\.

Second, a GCG suffix is typically unreadable to humans\. To make it interpretable without losing its effect, we adopt the prompt translation idea from[Li et al\. \[14\]](https://arxiv.org/html/2611.17481#bib.bib15)and insert amodel\-translationstep into the middle of the optimisation steps\. We run the universal search for the first half of the steps, and then make a single call to a larger*proposer*model asking it to rewrite the current suffix into a coherent version of the same length\. Afterwards, we resume the search from the rewritten suffix for the remaining steps\. We also compare the mid\-optimisation step against a variant that translates only once at the very end\.

### 4Experimental Setup

We test ActGCG across two concepts, German and refusal\.111Code available at[https://github\.com/ethz\-spylab/s26\-gcg\-steering](https://github.com/ethz-spylab/s26-gcg-steering)\.We first optimise one suffix for each prompt to match the steering vector target activations at the filler tokens \(Equation[1](https://arxiv.org/html/2611.17481#Ch2.E1)\)\. We then test our method on universal suffixes that work across multiple prompts, as well as across multiple models\. Finally, we apply*model translation*to the universal suffix, having a larger model rewrite the optimised suffix into readable text midway through the optimisation \(Section[3](https://arxiv.org/html/2611.17481#Ch2.S3)\)\.

#### Models\.

Our primary models are Gemma\-2\-2B\-it\[[8](https://arxiv.org/html/2611.17481#bib.bib24)\], Qwen3\-1\.7B\[[28](https://arxiv.org/html/2611.17481#bib.bib25)\], Llama3\.2\-3B\[[9](https://arxiv.org/html/2611.17481#bib.bib27)\]and Qwen3\-4B\[[28](https://arxiv.org/html/2611.17481#bib.bib25)\]\.

#### Test data\.

ForGermanthe per\-prompt experiments use3030test English prompts from the Dolly dataset\[[4](https://arxiv.org/html/2611.17481#bib.bib10)\], which are disjoint from the contrast pairs used to build the steering vector \(Section[1](https://arxiv.org/html/2611.17481#Ch2.S1)\)\. The universal experiments train a single suffix on2020prompts and test the suffix on3030further prompts\. Forrefusal, we utilise the harmful test set of[Arditi et al\. \[1\]](https://arxiv.org/html/2611.17481#bib.bib18)in two ways\. The*breadth*split takes one prompt from each of the2222categories in the dataset, resulting in2222total prompts\. The*depth*split instead takes55prompts from each of44training categories, with a disjoint set of55other prompts from the same44categories as test, as well as an additional set of55prompts from44categories that are distinct from the training ones \(6060prompts in total\)\.

#### Judging\.

We judgeGermansuccess rates with thelangdetectlibrary\[[3](https://arxiv.org/html/2611.17481#bib.bib30)\], additionally checking whether the response consists of degenerate repetitive phrases\. We note that a short response that is genuinely German can still be misclassified when it contains English names or titles\. A result is German if and only if the text is non\-repetitive and the library gives “de” as output\. To judgerefusalsuccess rates, following[Arditi et al\. \[1\]](https://arxiv.org/html/2611.17481#bib.bib18), we first check the model responses across a set of phrases, i\.e\. whether a part of the output and a phrase match together \(e\.g\. “I cannot help with that”\)\. We then also check for safety, where we use the HarmBench\-Llama\-2\-13b classifier\[[15](https://arxiv.org/html/2611.17481#bib.bib9)\]as the model judge\. We acknowledge the difficulty in objective scoring for safety, and settled on this judge after comparing it against alternatives such asgpt\-5\.5,claude\-opus\-4\.8, andHarmBench\-Mistral\-7b\-val\-cls\. For Claude and GPT, we found issues in obtaining a score from the models due to safety classifiers, and we preferred the Llama classifier over Mistral as it is more widely used in the literature\. We treat the HarmBench judge as our main refusal score, as otherwise the phrase based metric scores roughly twice as high as Harmbench \(page[10](https://arxiv.org/html/2611.17481#Ch3.S10)\)\.

#### Comparisons\.

We compare ActGCG against three alternatives\.*Soft suffixes*optimise directly over continuous embeddings that do not necessarily correspond to words, where we use gradient descent with Adam\[[12](https://arxiv.org/html/2611.17481#bib.bib28)\]to bring the activations as close as possible to the same activation matching loss of Equation[1](https://arxiv.org/html/2611.17481#Ch2.E1)\. Since the optimiser explores a continuous space rather than the discrete vocabulary, a soft suffix can reach the target more easily than a discrete one\. The original*GCG*method\[[30](https://arxiv.org/html/2611.17481#bib.bib7)\]minimises the cross entropy towards a fixed string \(an affirmative string for refusal, a German string for the language task\), determining what a discrete suffix can do*without*any steering vector\.*SSR*steering \(Equation[4](https://arxiv.org/html/2611.17481#Ch1.E4)\) is the closest prior method, matching the steering direction with a cosine loss rather than the full target activation\.

#### Default settings\.

Unless a subsection states otherwise, every suffix is2020tokens initialised tox x …xand optimised for250250steps, with search width512512, top\-k=256k=256, and a single token replaced per step \(as in Section[2](https://arxiv.org/html/2611.17481#Ch2)\)\. The target activations are built at the four layers of Table[1](https://arxiv.org/html/2611.17481#Ch2.T1)with steering strengthα=2\.0\\alpha=2\.0for German andα=1\.0\\alpha=1\.0for refusal\. The per\-prompt, universal and model translation ActGCG runs use a fixed seed of00\(except for the seed sweep in Section[2](https://arxiv.org/html/2611.17481#Ch3.S2)\)\. Each subsection below reports only its deviations from these defaults\.

## Chapter 3Experiments

### 1Different values ofα\\alphafor German

We test different values ofα\\alphato change the strength of steering vectors added in the four chosen layers for a given model\. We use ActGCG to optimise a suffix towards the target activations for each of the 30 German test prompts\. We sweepα∈\{0\.4,0\.7,1\.0,1\.3,1\.6,2\.0,3\.0,4\.0,5\.0\}\\alpha\\in\\\{0\.4,0\.7,1\.0,1\.3,1\.6,2\.0,3\.0,4\.0,5\.0\\\}on Gemma\-2\-2B and Qwen3\-1\.7B, and run Llama\-3\.2\-3B and Qwen3\-4B atα=2\.0\\alpha=2\.0only\.

Figure 1:Per\-prompt German success rate \(langdetect\) versus the steering strengthα\\alpha, for each of the four main models on3030prompts\. Eachα\\alphascales the steering vector that defines the activation target\.We find thatα=2\\alpha=2is a good value for the German steering vector across the four chosen layers, as it gives the highest success rate\. The suffix optimised on the German steering vector reliably induces the same behaviour\.

### 2Different seeds for different values of alpha

We found some variance in results when running an experiment more than once since the original GCG method is stochastic\. To minimise the effect of randomness in our results, we repeat ourα\\alphasweep atα∈\{1\.0,1\.3,2\.0,3\.0\}\\alpha\\in\\\{1\.0,1\.3,2\.0,3\.0\\\}for five different seeds \(00–44\) on Gemma\-2\-2B\. We also fix the default seed to00in our ActGCG experiments\.

Figure 2:Per\-prompt German success rate on3030prompts acrossα\\alpha, with five different seeds on Gemma\-2\-2B\.Despite the variance from GCG’s randomness,α=2\\alpha=2remains the strongest choice overall\.

### 3Suffix lengths

We now vary the number of optimised tokens in the suffix, which we otherwise fix at2020\. On Gemma\-2\-2B we sweep the suffix length over\{5,10,15,20,25,50\}\\\{5,10,15,20,25,50\\\}tokens, repeating each length for five seeds \(00–44\)\. We test onn=30n=30German prompts\.

Figure 3:Per\-prompt German success rate on 30 prompts for different suffix lengths, with one point per seed and the mean\.We find that changing the suffix length can increase the success rate\. At the same time, variance is low at suffix token length 20, while increasing suffix length costs more optimisation time but minimal gain\. Hence, we kept our experiments to have the same suffix length of 20\.

### 4Checking target on German

We check whether the activation target itself yields German answers\. We do this by adding the German steering vector \(α=2\.0\\alpha=2\.0\) directly to the residual stream at the filler positions of the four target layers \(Table[1](https://arxiv.org/html/2611.17481#Ch2.T1)\)*before generation*\(with no suffix involved\) using Gemma\-2\-2B, and measuring the German rate on the same3030prompts\.

Table 1:Steering vector added at the filler positions, the target which ActGCG optimises towards \(Gemma\-2\-2B,α=2\.0\\alpha=2\.0,3030prompts\)\.Our target is worth striving towards; however, the result itself is not 100%\. Therefore, the success of our method is capped by the success of the target\.

### 5Comparing results to the original GCG method and SSR for German

We compare our method to the original GCG algorithm using the same per\-prompt setup\. Instead of matching the target activations with a steering vector, the original GCG minimises the cross\-entropy loss towards a fixed target string\. We determine the target string to be “Hier ist meine Antwort auf Deutsch:” \(“Here is my answer in German:”\)\. Otherwise, we use the samen=30n=30German Dolly prompts, same initialisation, and the same250250steps\.

Table 2:Comparing ActGCG to the original GCG method with the same per\-prompt setup apart from the loss\.We notice that ActGCG performs better for the German concept on both models\. We note that this experiment could be further improved by sweeping a set of German phrases for the target string\.

Besides GCG, we also compare our method to SSR\[[26](https://arxiv.org/html/2611.17481#bib.bib22)\]due to the similarity in goals\. Instead of minimising the squared distance to the target activations, SSR drives the cosine similarity between the steering vector and the activations towards a target value \(Equation[4](https://arxiv.org/html/2611.17481#Ch1.E4)\)\. The original implementation reads the last prompt token, which differs from our method\. Therefore, we run SSR twice; first by faithfully following its single token position, and second by reading the filler positions the same way our method does\. We run it on Gemma\-2\-2B, and the rest of the setup is the same\.

Table 3:Comparing ActGCG to the SSR method with the same per\-prompt setup andα=2\.0\\alpha=2\.0For Gemma\-2\-2B, our method outperforms both variants\. This indicates that the cosine objective is weaker than ourL2L\_\{2\}loss\. We also see that reading at the filler positions performs better than the single token\.

### 6Universal suffixes on German

We now optimise a single*universal*suffix that steers many prompts at once, rather than having one suffix per prompt\. Following Section[3](https://arxiv.org/html/2611.17481#Ch2.S3), a suffix is trained jointly on2020German prompts, and then evaluated on the same2020training prompts as well as a set of3030test prompts\. We also transfer the finished suffix from the source model to a different model, evaluated on the2020training prompts\. Where available, we transfer to a similarly sized \(or smaller\) and a slightly larger model of the same family\.

Table 4:Universal German suffix, withα=2\.0\\alpha=2\.0and2020train prompts\. Training and test are for the source model; transfer applies the same suffix to another model, evaluated on the training prompts\.Source modelEvaluationGerman \(%\)Gemma\-2\-2Btraining \(20\)90\.0test \(30\)73\.3Gemma\-1\.1\-2B65\.0Gemma\-2\-9B5\.0Qwen3\-1\.7Btraining \(20\)95\.0test \(30\)80\.0Qwen2\.5\-1\.5B95\.0Qwen3\-4B60\.0Llama\-3\.2\-3Btraining \(20\)95\.0test \(30\)96\.7Llama\-3\.2\-1B95\.0We find that the test set generally performs similarly to or worse than the training set\. For Llama\-3\.2\-3B, both sets only had one failed prompt, but the test set showed a slight increase, likely due to larger number of prompts tested\. Transferring the suffix to a similarly sized or smaller model performed better than transferring it to a larger model\.

### 7Model translation for universal suffixes on German

The universal suffix is mostly not interpretable, so we check if a model translation preserves the meaning of the concept better\. We run the universal steps as usual for the first half, and then insert a*model\-translation*step in the middle of the steps \(at step125125\) where we make one call to a*proposer*model that rewrites the suffix into fluent text\. We try two proposers, GPT\-5\.5 and Llama\-3\.1\-8B\. For the remaining steps, we continue as usual\. We use the same2020training and3030test prompts\. We also check a variantend\_askwhere we ask at the end instead of the middle\. Suffixes transferred to other models are evaluated on the3030test prompts \(in comparison, cross\-model transfers in Section[6](https://arxiv.org/html/2611.17481#Ch3.S6)were checked on the easier training prompts\)\.

Table 5:Universal modified GCG with model translation, German \(α=2\.0\\alpha=2\.0,2020train,3030test prompts\)\. The proposer rewrites the suffix in the middle of the steps \(step125125\);end\_askrewrites only after the final step instead\. Transferred suffixes are evaluated on the3030test prompts\.We find that translating the suffix with a model in the middle of the steps performs better in inducing German behaviour than using no translation step, as well as in generalising to new prompts and transferring to other models\.

### 8Tracking the change of loss for German

We log the cosine similarity \(between the suffix’s filler token activations and the target activations\) and theL2L\_\{2\}distance to the target every2525steps at each of the four target layers, for both the universal suffix and the model\-translation run\.

#### Universal suffix\.

We check how the cosine similarity and theL2L\_\{2\}distance loss changes throughout the ActGCG steps\. We log both every2525steps at each of the four target layers, for universal suffix experiments \(Figure[4](https://arxiv.org/html/2611.17481#Ch3.F4)\)\. Figure[4](https://arxiv.org/html/2611.17481#Ch3.F4)sums both losses over the layers and Appendix[6\.A](https://arxiv.org/html/2611.17481#Ch6.A1)considers the cosine loss for each of the chosen layers \(with one target per layer\)\. Figure[5](https://arxiv.org/html/2611.17481#Ch3.F5)shows the contribution of each chosen layer to theL2L\_\{2\}loss\. Figure[6](https://arxiv.org/html/2611.17481#Ch3.F6)considers the change in German rate for the given suffix every2525steps\. We notice overall that the loss decreases and the results get closer to the target\. However, we also see that we get a roughly logarithmic curve, and increasing the number of steps for longer than 100 steps doesn’t significantly change the loss\. The same descent holds for the individual per\-prompt runs \(Appendix[6\.B](https://arxiv.org/html/2611.17481#Ch6.A2)\)\.

Figure 4:L2L\_\{2\}distance to the target activations \(normalised to its step\-0 value\) and cosine similarity between the filler\-token activations and the target, every2525steps and averaged across the four target layers, for the universal German run withα=2\.0\\alpha=2\.0and2020training prompts\.Figure 5:Per\-layer activation matching for the universal German suffix \(α=2\.0\\alpha=2\.0\)\. The four target layers’L2L\_\{2\}distances to the target, stacked\.Figure 6:Fraction of train prompts answered in German every2525steps, for the universal German suffix\.
#### Model translation\.

We repeat the same procedure for the model\-translation run\. Figure[7](https://arxiv.org/html/2611.17481#Ch3.F7)sums theL2L\_\{2\}distance and averages the cosine over the layers, and Figure[8](https://arxiv.org/html/2611.17481#Ch3.F8)breaks theL2L\_\{2\}down per layer\. Figure[9](https://arxiv.org/html/2611.17481#Ch3.F9)tracks the German rate over the run\. We observe a sharp change in loss when the suffix is translated by the proposer model\. Despite the fact that model translation experiments produce higher success results, we do not observe a significant change in loss at the end of the steps\. Nevertheless, we believe the re\-initialisation in the middle of the steps might drive the model to explore new suffixes better\.

Figure 7:Model\-translation German run:L2L\_\{2\}\(normalised to step 0\) and cosine to the target over steps, averaged across layers\. The dashed line marks the mid\-run proposer rewrite\.Figure 8:Per\-layer activation matching for the*model\-translation*German run forα=2\.0\\alpha=2\.0\. Stacked per\-layerL2L\_\{2\}distances; the dashed line is the step\-125 proposer rewrite\.Figure 9:Fraction of train prompts answered in German every2525steps for the model\-translation run\.

### 9Refusal

We now apply ActGCG to the anti\-refusal direction rather than German, on2222harmful prompts \(using the breadth split, one prompt from each category\)\. For every prompt, we optimise a single suffix\. We sweep forα∈\{0\.5,1\.0,1\.5,2\.0\}\\alpha\\in\\\{0\.5,1\.0,1\.5,2\.0\\\}, and compare against a “None” baseline where we don’t optimise for any suffix\. The jailbreak rates are judged with HarmBench\-Llama\-2\-13b\. We note thatα\\alphavalues are negated in the code for the anti direction\.

Figure 10:Anti\-refusal direction, breadth split,2222prompts, judged with HarmBench\. The grey band marks the unsteered baseline \(None\) range across the four models \(4\.54\.5–13\.613\.6%\)\.The suffix induces jailbreaking more often than the unsteered baseline, which indicates that our optimisation induces the anti\-refusal behaviour\. At the same time, the steering strength is much weaker than for German \(Figure[1](https://arxiv.org/html/2611.17481#Ch3.F1)\)\.

On the suffix itself, Gemma\-2\-2B and Qwen3\-1\.7B together do slightly better atα=0\.5\\alpha=0\.5than atα=1\.0\\alpha=1\.0, and the rate then falls asα\\alphagrows further\. We nonetheless adoptα=1\.0\\alpha=1\.0as the default, since the reachable target itself peaks atα∈\[1\.0,1\.5\]\\alpha\\in\[1\.0,1\.5\]whileα=0\.5\\alpha=0\.5is too weak \(Section[10](https://arxiv.org/html/2611.17481#Ch3.S10)\)\. The suffix still matches the target well atα=1\.0\\alpha=1\.0but degrades beyond it\.

### 10Checking our target for refusal

We check whether the activation target itself yields jailbreaking answers, as we did for the German direction\. We add the refusal steering vector forα∈\{0\.5,1\.0,1\.5,2\.0\}\\alpha\\in\\\{0\.5,1\.0,1\.5,2\.0\\\}directly into the residual stream at the filler positions of the four target layers \(Table[1](https://arxiv.org/html/2611.17481#Ch2.T1)\)*before generation*on Gemma\-2\-2B, with no suffix involved, and measure both metrics on the same2222breadth\-split prompts \(one per category\)\.

Table 6:Refusal steering vector applied at the filler positions, the target ActGCG optimises towards \(Gemma\-2\-2B, breadth split,n=22n=22\)\. HarmBench jailbreak rate and phrase\-based anti\-refusal rate \(%\)\.The HarmBench target peaks atα∈\[1\.0,1\.5\]\\alpha\\in\[1\.0,1\.5\], while the phrase\-based rate is roughly twice as high\. The target never reaches100%100\\%, hence the success of our ActGCG method is capped by it\. It is also far weaker than its German counterpart \(90\.00%90\.00\\%, Section[4](https://arxiv.org/html/2611.17481#Ch3.S4)\), which may be the reason for the lower refusal success rates throughout our experiments\.

### 11Comparing results to the original GCG method and SSR for refusal

Similar to Section[5](https://arxiv.org/html/2611.17481#Ch3.S5), we now compare our method to the original GCG algorithm with the same per\-prompt setup for refusal\. We use the samen=22n=22prompts with the same suffix initialisation, as well as the same number of250250steps\. We compare for both the phrase based metric and the safety metric for jailbreaking\.

Table 7:Per\-prompt refusal, breadth split \(2222prompts\), comparing the original GCG against ActGCG withα=1\.0\\alpha=1\.0\. HarmBench jailbreak rate and the phrase\-based anti\-refusal rate, both in %\.Considering both the safety and the phrase metric, our ActGCG performs stronger than the original GCG for Gemma\-2\-2B, but worse for Qwen3\-1\.7B\. Overall, our activation target matches the fixed string target of GCG, but does not show a major improvement\.

We compare our method to SSR\[[26](https://arxiv.org/html/2611.17481#bib.bib22)\]again, using the same last token and filler token variants as before\. Apart from the change in loss, we use the same per\-prompt setup as before\.

Table 8:Per\-prompt anti\-refusal results on Gemma\-2\-2B, breadth split with2222prompts\. Comparing both SSR variants against ActGCG\. HarmBench jailbreak rate and the phrase\-based anti\-refusal rate, both in %\.We observe that ActGCG performs better than both SSR variants on the safety metric\. At the same time, for the phrase based metric, ActGCG nevertheless performs slightly worse\.

### 12Universal suffixes on refusal

We now optimise a single*universal*suffix that steers many prompts at once, rather than having one suffix per prompt\. We evaluate in two ways\. First, we do a “breadth split”, where we train on2222prompts each from a different category, and then test on2222new prompts from all different categories again\. Then, we do a “depth split” \(five prompts from each of four training categories, then five prompts from the same categories for test, and finally five prompts from four new categories\)\. We also transfer to a similarly sized \(or smaller\) and a slightly larger model of the same family, evaluated on training prompts for both split variants\.

Table 9:Universal suffix on refusal, breadth split \(2222prompts, one prompt per category\)\. HarmBench jailbreak rate and phrase\-based anti\-refusal rate, both in %\.Table 10:Universal suffix on refusal, depth split\. HarmBench jailbreak rate and phrase\-based anti\-refusal rate, both in %\.We notice that the phrase based metric scores significantly higher than the safety metric\. The training prompts generally score higher than the test prompts \(except for slight increase in Qwen3\-1\.7B\), and transfers to smaller or similarly sized models perform better than larger models, similar to the German transfers \(Section[6](https://arxiv.org/html/2611.17481#Ch3.S6)\)\. We also observe that the suffix does generalise to unseen categories\.

### 13Model translation for universal suffixes on refusal

We now evaluate a variant of the universal suffix again, where we insert a model\-translation in the middle of the steps\. We namely call a proposer model that rewrites the suffix into coherent text as in Section[7](https://arxiv.org/html/2611.17481#Ch3.S7)\. As proposers, we utilise GPT\-5\.5 and Llama\-3\.1\-8B again\. We compare for both the depth and breadth split variants\. The transfer models are evaluated on the test prompts \(same as in Section[7](https://arxiv.org/html/2611.17481#Ch3.S7)\)\.

Table 11:Breadth split \(n=22n=22, one prompt per category\)\. Model\-translation universal suffix on refusal with HarmBench jailbreak rate and phrase\-based anti\-refusal rate, both in %\.Source modelProposerEvaluationHarmBenchPhraseGemma\-2\-2BGPT\-5\.5training45\.586\.4test31\.868\.2Gemma\-1\.1\-2B4\.54\.5Gemma\-2\-9B4\.513\.6Llama\-3\.1\-8Btraining40\.990\.9test22\.772\.7Gemma\-1\.1\-2B0\.09\.1Gemma\-2\-9B0\.00\.0Llama\-3\.2\-3BGPT\-5\.5training36\.481\.8test31\.872\.7Llama\-3\.2\-1B4\.54\.5Table 12:Depth split \(2020prompts each for training, test, new categories\), model\-translation universal suffix on refusal\. HarmBench jailbreak rate and phrase\-based anti\-refusal rate, both in %\.Source modelProposerEvaluationHarmBenchPhraseGemma\-2\-2BGPT\-5\.5training10\.085\.0test15\.090\.0new categories5\.060\.0Gemma\-1\.1\-2B10\.015\.0Gemma\-2\-9B5\.05\.0Llama\-3\.1\-8Btraining55\.095\.0test20\.085\.0new categories15\.085\.0Gemma\-1\.1\-2B10\.010\.0Gemma\-2\-9B10\.035\.0Llama\-3\.2\-3BGPT\-5\.5training45\.080\.0test45\.090\.0new categories40\.080\.0Llama\-3\.2\-1B0\.00\.0We find that in the case of refusal, a model translation in the middle of the steps generally performs worse than the universal ActGCG with no translation\. This is in contrast to our results for German, and shows that the German language may be easier to translate to a coherent meaning than the more complex refusal concept\.

### 14Tracking the change of loss for refusal

We repeat the loss\-tracking analysis of Section[8](https://arxiv.org/html/2611.17481#Ch3.S8)for refusal, on the breadth split\.

#### Universal suffix\.

We first check the change of loss in our universal experiments every2525steps\. Figure[11](https://arxiv.org/html/2611.17481#Ch3.F11)sums theL2L\_\{2\}distance and averages the cosine over the layers, Figure[12](https://arxiv.org/html/2611.17481#Ch3.F12)shows the per\-layer contribution to theL2L\_\{2\}loss \(per\-layer cosine in Appendix[6\.A](https://arxiv.org/html/2611.17481#Ch6.A1)\), and Figure[13](https://arxiv.org/html/2611.17481#Ch3.F13)tracks the change in refusal rate for the phrase metric\. The per\-prompt runs show the same descent \(Appendix[6\.B](https://arxiv.org/html/2611.17481#Ch6.A2)\)\.

Figure 11:L2L\_\{2\}distance to the target activations \(normalised to its step\-0 value\) and cosine similarity between the filler\-token activations and the target, over optimisation steps and averaged across the four target layers, for the universal refusal run \(α=1\.0\\alpha=1\.0,Ntrain=22N\_\{\\mathrm\{train\}\}=22\)\.Figure 12:Stacked per\-layerL2L\_\{2\}distance to the target for the universal anti\-refusal suffix \(Ntrain=22N\_\{\\mathrm\{train\}\}=22\)\.Figure 13:Fraction of train prompts whose output is*not*a phrase\-based refusal every2525steps, for the universal anti\-refusal suffix\.
#### Model translation\.

We then track the change of loss for our model\-translation experiments\. Figure[14](https://arxiv.org/html/2611.17481#Ch3.F14)sums theL2L\_\{2\}distance and averages the cosine over the layers, Figure[15](https://arxiv.org/html/2611.17481#Ch3.F15)breaks theL2L\_\{2\}down per layer, and Figure[16](https://arxiv.org/html/2611.17481#Ch3.F16)tracks the change in refusal rate\. The change of suffix in the middle of the steps by the proposer sharply increases the loss\. Despite the fact that the safety metric performs significantly worse than its German counterpart, we do not notice a strong difference between the losses for German and for refusal\. This may be an indication that the steering vector for refusal is more related to avoiding the phrase substrings than pure jailbreaking\.

Figure 14:Model\-translation refusal run\.L2L\_\{2\}\(normalised to step 0\) and cosine to the target every2525steps, averaged across layers\. The dashed line marks the mid\-run proposer rewrite\.Figure 15:Stacked per\-layerL2L\_\{2\}distance to the target for the*model\-translation*anti\-refusal run\.Figure 16:Fraction of train prompts whose output is not a phrase\-based refusal every2525steps for the model\-translation run\.

### 15Soft suffixes

To check how removing the discrete token constraint performs, we replace the2020discrete suffix tokens with2020*soft*tokens, and optimise them directly with Adam \(with learning rate0\.050\.05and150150steps\) against the same activation target as ActGCG \(Equation[1](https://arxiv.org/html/2611.17481#Ch2.E1)\)\. We see this as an indication on how well the objective can be met, since the optimiser explores the full continuous embedding space\. We run this on Gemma\-2\-2B and Qwen3\-1\.7B, and the same3030German prompts, at bothα=1\.0\\alpha=1\.0and theα=2\.0\\alpha=2\.0\.

Table 13:Soft suffix German success rate at two steering strengths \(3030prompts\)\.Atα=1\.0\\alpha=1\.0, the soft suffix reaches near perfect German rates compared to its discrete version with ActGCG\. This shows that the discrete search over tokens is a limitation\. Forα=2\.0\\alpha=2\.0, we note a peculiarity where the success rate of Qwen3\-1\.7B decreases strongly due to empty outputs, likely due to the vector being too strong, driving the activations to extreme values which the model cannot decode\.

### 16Decoding soft tokens

We tried to convert the optimised soft embeddings back into discrete tokens by projecting each soft token to its nearest vocabulary embedding \(using cosine similarity\) and evaluating the resulting discrete string as a suffix\. This attempt failed completely, as the suffix produced zero German responses\. Hence, a soft suffix cannot be easily converted into a discrete one, which justifies why a discrete search is useful to obtain a hard suffix\.

### 17Different dataset extraction for German

We change how the German steering vector is extracted\. The default construction \(the*German only*column\) contrasts a German prompt with a German answer against an English prompt with an English answer\. We change the way we extract the dataset such that we hold the prompt fixed in English and contrast only the answer language \(the*English \+ German*column\), with the positive example being an English prompt followed by its German answer, and the negative example being the same English prompt followed by its original English answer \(en\_prompt \+ de\_answeragainsten\_prompt \+ en\_answer\)\. The vector is built from the same Dolly dataset and at the same four layers as before, and we then run per\-prompt ActGCG on Gemma\-2\-2B and Qwen3\-1\.7B for3030prompts\. We useα=1\.0\\alpha=1\.0rather than the German default of2\.02\.0\.

Table 14:Per\-prompt German success rate withα=1\.0\\alpha=1\.0and3030prompts, comparing two different Dolly dataset extraction methods\.The new dataset variant shows no consistent or clear improvement\. Since we started with the German only method, we simply stay with the original way we extract the Dolly dataset\.

### 18More steps

We test whether the default250250optimisation steps are enough for refusal, or whether the discrete search continues to improve, by re\-running the per\-prompt anti\-refusal experiment at500500steps withα=1\.0\\alpha=1\.0, and breadth split using2222prompts\.

Table 15:Per\-prompt anti\-refusal, breadth split\. HarmBench jailbreak rate \(%\) at250250against500500optimisation steps\.More steps do increase the success rate\. Nevertheless, computation time increases significantly as well\. Hence, we continue to use250250steps throughout our experiments\.

### 19Weight precision

We test whether the model’s weight precision, the number of bits per weight, affects our method’s search\. We run the per\-prompt German experiment on Gemma\-2\-2B in fullfp32precision instead of the defaultbf16, keeping everything else fixed while using3030prompts\. Note that this run usesα=1\.0\\alpha=1\.0rather than theα=2\.0\\alpha=2\.0of the main German results, but we mainly consider the difference between the two precisions at the sameα\\alpha\.

Table 16:Effect of weight precision atα=1\.0\\alpha=1\.0\(Gemma\-2\-2B\)\.We notice thatfp32precision does perform better\. However, since it takes a significantly longer amount of computation time, and the gap is within the seed\-to\-seed variance seen earlier, we continue to usebf16throughout our experiments\.

### 20Suffix to steering vectors

To complete the equivalence relationship in the reverse direction, we ask whether a suffix’s effect can itself be distilled back into a steering vector\. For each of the3030Gemma\-2\-2B German prompts, we take its optimised per\-prompt ActGCG suffix and measure the activation difference it induces at the filler positions of the four target layers, where we take the activations with the suffix appended minus those without\. We obtain a*recovered*steering vector, and add it at the filler positions during generation exactly as we would a normal steering vector, and measure the success rate\. Here, we compare two variants: a*per\-prompt*recovered vector \(each prompt steered by the vector recovered from its own suffix\) and the*mean*recovered vector \(a single vector averaged over all3030prompts, applied to every prompt\), each forα=1\.0\\alpha=1\.0andα=2\.0\\alpha=2\.0\.

Table 17:Success rate of steering vectors recovered from a suffix \(Gemma\-2\-2B, German,3030prompts\)\.A steering vector recovered from the suffix does reproduce the behaviour, and the mean vector recovers it better than the per\-prompt vector\. Although we do observe a slight decrease in effectiveness, this supports the equivalence between the suffix and the steering vector\.

### 21Prefix instead of suffix

We check whether optimising a*prefix*placed before a prompt performs better than a*suffix*placed after the prompt\. Unlike a suffix, a prefix can, in principle, match an activation target that also covers the prompt positions\. Therefore, we compare two targets for the prefix: the steering vector added only at the filler positions, and the steering vector added at both the prompt and filler positions\. We evaluate on German with Gemma\-2\-2B for3030prompts withα∈\{1\.0,2\.0,3\.0\}\\alpha\\in\\\{1\.0,2\.0,3\.0\\\}

Table 18:Prefix optimisation on German with Gemma\-2\-2B for a filler only target against a prompt and filler target\.Even though a prefix can reach the prompt positions, matching the prompt and filler target is generally worse than matching the filler positions alone\. Moreover, the best prefix result is still behind its suffix counterpart\. Therefore, the suffix remains the stronger choice\.

### 22Starting from a readable German instruction

Until now, we have initialised the optimised suffix from the stringx x …x\. We check whether starting from a*readable*instruction that already asks for the target behaviour gives ActGCG an easier starting point and a higher final success rate\. We run the per\-prompt German experiment for the four main models with only the initial suffix changed, keeping everything else fixed \(3030Dolly prompts,α=2\.0\\alpha=2\.0, seed 0\)\. The initial suffix is “Please answer in German”\.

Table 19:Per\-prompt German success rate \(%\) when the suffix is initialised fromx x …xagainst a readable instruction\.A target\-oriented initialisation makes essentially no difference\. This shows that GCG, as well as our ActGCG method, does not preserve coherence between suffix tokens, as it only optimises them independently\.

## Chapter 4Discussion

### 1Limitations

Our results come with several limitations\. The most fundamental is that the success rate depends heavily on the*concept*being steered, and we test only two of them here: the German language and refusal\. These two already behave very differently: German is reproduced almost perfectly by a suffix and transfers well across prompts and models, whereas refusal is weaker\. From here, it is not possible to infer how other concepts would perform\.

The evaluations are also run at a relatively small scale\. The per\-prompt and universal experiments were tested on3030prompts for German, and between2222and6060for refusal\. Most runs use a single fixed seed\. As a result, our scores may vary with different prompts or seeds\.

By construction, ActGCG searches over discrete tokens, which limits how closely it can match the target activations\. Our soft suffix experiments, which optimise continuous embeddings directly, reach lower losses than any discrete suffix and act as an upper bound on what the objective can achieve\. The gap between them reflects the reduction in success rate due to the discrete token space\.

The method is also bounded by the steering vector it imitates\. The suffix can only reproduce a behaviour that the steering vector itself induces\. If the vector is weak, the suffix inherits that ceiling as well\. Moreover, reaching the activation target is not sufficient to guarantee the behaviour\. For instance, a suffix can match the target activations closely and still fail to jailbreak\. Matching the activations is thus a useful proxy for the behaviour, but not a guarantee of it\. Furthermore, the best way to construct a steering vector in the first place is still an open question\. A more optimal steering vector could further improve our method\.

Finally, judging the responses is not perfect\. Especially for refusal, the measured safety rate depends heavily on the judge\. We standardise on a single classifier throughout our experiments to keep the runs comparable\. The phrase based metric is not a good proxy for safety either, as a response can often avoid refusal phrases without delivering harmful content\. For German, thelangdetectjudge occasionally mislabels short responses that are German overall but contain English titles or names\. In addition, the definition of the concept itself matters, and results can vary drastically across the literature due to the difficulty of rigorously defining behaviours\.

### 2Ethical Considerations

Our work considers the anti\-refusal direction, which can sometimes result in bypassing safety guardrails\. We conduct all of our jailbreak experiments on small, open\-weight models that are already publicly available, and we do not present any harmful model outputs in this thesis\. The practical offensive value of the resulting suffixes is limited\. They jailbreak only at modest rates and, crucially, transfer poorly across models\. Therefore, a suffix optimised on one model is of little use against another\.

Our aim in understanding an equivalence relationship between suffixes and steering vectors is defensive\. Showing that a suffix can imitate a steering vector is a step towards building measures against inputs that reproduce vectors of malicious concepts\.

### 3Future Work

Our findings suggest a number of directions worth pursuing\. The most direct option would be to test more concepts, and to check how well our approach generalises\. German reaches a high success rate while refusal shows highly mixed results; hence, it would be informative to see how other concepts fall on this scale\.

The matching objective could also be further improved\. We use a squared\-L2L\_\{2\}loss, but there may be other losses that can approximate the target activation more closely\. Since squaring amplifies large deviations, a more robust objective could reduce their influence\.

Furthermore, the steering vector itself could be strengthened by searching for better construction methods than the difference\-of\-means vectors\. More broadly, steering vectors themselves may not be the best proxy for a given behaviour\. Our method draws its target activation from a steering vector, but for instance, we could also choose activations from another model that already exhibits the desired behaviour\. Investigating such alternative targets with input suffixes would test whether there are equivalence relationships for behaviours that a steering vector does not fully capture\.

## Chapter 5Conclusion

In this thesis, we investigate whether there is an equivalence between input suffixes and steering vectors\. We introduce ActGCG, a modification of GCG that, rather than optimising a suffix towards a fixed output string, optimises it such that its activations match the target obtained by adding a steering vector to the residual stream\. We test this hypothesis on two concepts, namely the German language and refusal\. For German, we largely retain the behaviour of the steering vector with a discrete suffix using our method\. For refusal, the equivalence is weaker\. Our method largely suppresses the model’s refusal, such that it succeeds under a substring\-based metric that only checks whether the response avoids a set of refusal phrases\. However, when measured with the stricter HarmBench classifier, the suffix that reproduces the steering vector does not directly produce a jailbreak\. The substring metric roughly doubles the true HarmBench rate\.

We find the same asymmetry between the two concepts throughout the rest of our results\. We extend the method to universal suffixes that steer many prompts at once, and to a single suffix shared across models, and find that our behaviour is still retained\. The German suffix transfers well both to test prompts and to other models, whereas the anti\-refusal suffix generalises across prompts but transfers poorly across models\. The same pattern appears when we ask a larger model to rewrite the unreadable suffix into coherent text midway through optimisation\. The model translation improves success for German, most significantly for transferring to different models, but gives only mixed results for refusal\. All in all, our results show that a steering vector’s behaviour is reachable from the input, with no access to the model’s internals at generation time, but with a certain loss depending on the concept\. Establishing how far this equivalence extends to further concepts beyond the two studied here, to better steering vector constructions, as well as to alternative losses, remains a promising direction for the future\.

## References

- \[1\]A\. Arditi, O\. Obeso, A\. Syed, D\. Paleka, N\. Panickssery, W\. Gurnee, and N\. Nanda\(2024\)Refusal in language models is mediated by a single direction\.InAdvances in Neural Information Processing Systems 37 \(NeurIPS\),Cited by:[§1](https://arxiv.org/html/2611.17481#Ch2.S1.p4.1),[§4](https://arxiv.org/html/2611.17481#Ch2.S4.SS0.SSS0.Px2.p1.1),[§4](https://arxiv.org/html/2611.17481#Ch2.S4.SS0.SSS0.Px3.p1.1)\.
- \[2\]T\. Bolukbasi, K\. Chang, J\. Zou, V\. Saligrama, and A\. Kalai\(2016\)Man is to computer programmer as woman is to homemaker? debiasing word embeddings\.InAdvances in Neural Information Processing Systems 29 \(NeurIPS\),pp\. 4349–4357\.Cited by:[§2](https://arxiv.org/html/2611.17481#Ch1.S2.p2.1)\.
- \[3\]M\. Danilak\(2014\)Langdetect: port of google’s language\-detection library to Python\.Note:[https://github\.com/Mimino666/langdetect](https://github.com/Mimino666/langdetect)Accessed: 2026\-08\-25Cited by:[§4](https://arxiv.org/html/2611.17481#Ch2.S4.SS0.SSS0.Px3.p1.1)\.
- \[4\]Databricks\(2023\)Free dolly: introducing the world’s first truly open instruction\-tuned llm\.Note:[https://www\.databricks\.com/blog/2023/04/12/dolly\-first\-open\-commercially\-viable\-instruction\-tuned\-llm](https://www.databricks.com/blog/2023/04/12/dolly-first-open-commercially-viable-instruction-tuned-llm)Cited by:[§1](https://arxiv.org/html/2611.17481#Ch2.S1.p3.1),[§4](https://arxiv.org/html/2611.17481#Ch2.S4.SS0.SSS0.Px2.p1.1),[Chapter 0](https://arxiv.org/html/2611.17481#p6.1)\.
- \[5\]N\. Elhage, T\. Hume, C\. Olsson, N\. Schiefer, T\. Henighan,et al\.\(2022\)Toy models of superposition\.Transformer Circuits Thread\.Cited by:[§2](https://arxiv.org/html/2611.17481#Ch1.S2.p2.1)\.
- \[6\]N\. Elhage, N\. Nanda, C\. Olsson, T\. Henighan, N\. Joseph, B\. Mann, A\. Askell, Y\. Bai, A\. Chen, T\. Conerly, N\. DasSarma, D\. Drain, D\. Ganguli, Z\. Hatfield\-Dodds, D\. Hernandez, A\. Jones, J\. Kernion, L\. Lovitt, K\. Ndousse, D\. Amodei, T\. Brown, J\. Clark, J\. Kaplan, S\. McCandlish, and C\. Olah\(2021\)A mathematical framework for transformer circuits\.Transformer Circuits Thread\.Cited by:[§2](https://arxiv.org/html/2611.17481#Ch1.S2.p1.1)\.
- \[7\]J\. Fiotto\-Kaufman, A\. R\. Loftus, E\. Todd, J\. Brinkmann, K\. Pal, D\. Troitskii, M\. Ripa,et al\.\(2024\)NNsight and ndif: democratizing access to open\-weight foundation model internals\.arXiv preprint arXiv:2407\.14561\.Cited by:[§1](https://arxiv.org/html/2611.17481#Ch2.S1.p5.1)\.
- \[8\]Gemma Team\(2024\)Gemma 2: improving open language models at a practical size\.arXiv preprint arXiv:2408\.00118\.Cited by:[§4](https://arxiv.org/html/2611.17481#Ch2.S4.SS0.SSS0.Px1.p1.1)\.
- \[9\]A\. Grattafioriet al\.\(2024\)The llama 3 herd of models\.arXiv preprint arXiv:2407\.21783\.Cited by:[§4](https://arxiv.org/html/2611.17481#Ch2.S4.SS0.SSS0.Px1.p1.1)\.
- \[10\]Gray Swan AI\(2024\)nanoGCG: a fast and lightweight implementation of the GCG algorithm in PyTorch\.Note:[https://github\.com/GraySwanAI/nanoGCG](https://github.com/GraySwanAI/nanoGCG)Accessed: 2026\-08\-25Cited by:[§2](https://arxiv.org/html/2611.17481#Ch2.S2.p1.1)\.
- \[11\]S\. Im and S\. Li\(2025\)A unified understanding and evaluation of steering methods\.arXiv preprint arXiv:2502\.02716\.Cited by:[§1](https://arxiv.org/html/2611.17481#Ch2.S1.p2.1)\.
- \[12\]D\. P\. Kingma and J\. Ba\(2015\)Adam: a method for stochastic optimization\.InInternational Conference on Learning Representations \(ICLR\),Cited by:[§4](https://arxiv.org/html/2611.17481#Ch2.S4.SS0.SSS0.Px4.p1.1)\.
- \[13\]K\. Li, O\. Patel, F\. Viégas, H\. Pfister, and M\. Wattenberg\(2023\)Inference\-time intervention: eliciting truthful answers from a language model\.InAdvances in Neural Information Processing Systems 36 \(NeurIPS\),Cited by:[§5](https://arxiv.org/html/2611.17481#Ch1.S5.p4.1)\.
- \[14\]Q\. Li, X\. Yang, W\. Zuo, and Y\. Guo\(2024\)Deciphering the chaos: enhancing jailbreak attacks via adversarial prompt translation\.arXiv preprint arXiv:2410\.11317\.Cited by:[§3](https://arxiv.org/html/2611.17481#Ch2.S3.p3.1)\.
- \[15\]M\. Mazeika, L\. Phan, X\. Yin, A\. Zou, Z\. Wang, N\. Mu, E\. Sakhaee, N\. Li, S\. Basart, B\. Li, D\. Forsyth, and D\. Hendrycks\(2024\)HarmBench: a standardized evaluation framework for automated red teaming and robust refusal\.Proceedings of the 41st International Conference on Machine Learning \(ICML\)\.Cited by:[§4](https://arxiv.org/html/2611.17481#Ch2.S4.SS0.SSS0.Px3.p1.1),[Chapter 0](https://arxiv.org/html/2611.17481#p6.1)\.
- \[16\]T\. Mikolov, I\. Sutskever, K\. Chen, G\. S\. Corrado, and J\. Dean\(2013\)Distributed representations of words and phrases and their compositionality\.InAdvances in Neural Information Processing Systems 26 \(NeurIPS\),pp\. 3111–3119\.Cited by:[§2](https://arxiv.org/html/2611.17481#Ch1.S2.p2.1)\.
- \[17\]N\. Nanda, A\. Lee, and M\. Wattenberg\(2023\)Emergent linear representations in world models of self\-supervised sequence models\.InProceedings of the 6th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP,Singapore,pp\. 16–30\.Cited by:[§2](https://arxiv.org/html/2611.17481#Ch1.S2.p2.1)\.
- \[18\]K\. Park, Y\. J\. Choe, and V\. Veitch\(2024\)The linear representation hypothesis and the geometry of large language models\.InProceedings of the 41st International Conference on Machine Learning \(ICML\),Cited by:[§2](https://arxiv.org/html/2611.17481#Ch1.S2.p2.1)\.
- \[19\]J\. Pennington, R\. Socher, and C\. D\. Manning\(2014\)GloVe: global vectors for word representation\.InProceedings of the 2014 Conference on Empirical Methods in Natural Language Processing \(EMNLP\),Doha, Qatar,pp\. 1532–1543\.Cited by:[§2](https://arxiv.org/html/2611.17481#Ch1.S2.p2.1)\.
- \[20\]I\. Pres, L\. Ruis, E\. S\. Lubana, and D\. Krueger\(2024\)Towards reliable evaluation of behavior steering interventions in llms\.arXiv preprint arXiv:2410\.17245\.Cited by:[§1](https://arxiv.org/html/2611.17481#Ch2.S1.p2.1)\.
- \[21\]N\. Rimsky, N\. Gabrieli, J\. Schulz, M\. Tong, E\. Hubinger, and A\. M\. Turner\(2024\)Steering llama 2 via contrastive activation addition\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(ACL\),Cited by:[§5](https://arxiv.org/html/2611.17481#Ch1.S5.p3.1),[§1](https://arxiv.org/html/2611.17481#Ch2.S1.p1.1),[Chapter 0](https://arxiv.org/html/2611.17481#p3.1)\.
- \[22\]H\. Touvron, L\. Martin, K\. Stone, P\. Albert, A\. Almahairi, Y\. Babaei, N\. Bashlykov, S\. Batra, P\. Bhargava, S\. Bhosale,et al\.\(2023\)Llama 2: open foundation and fine\-tuned chat models\.arXiv preprint arXiv:2307\.09288\.Cited by:[Figure 1](https://arxiv.org/html/2611.17481#Ch2.F1),[Figure 1](https://arxiv.org/html/2611.17481#Ch2.F1.4),[§1](https://arxiv.org/html/2611.17481#Ch2.S1.p3.1)\.
- \[23\]A\. M\. Turner, L\. Thiergart, G\. Leech, D\. Udell, J\. J\. Vazquez, U\. Mini, and M\. MacDiarmid\(2023\)Steering language models with activation engineering\.arXiv preprint arXiv:2308\.10248\.Cited by:[§5](https://arxiv.org/html/2611.17481#Ch1.S5.p2.1)\.
- \[24\]A\. Vaswani, N\. Shazeer, N\. Parmar, J\. Uszkoreit, L\. Jones, A\. N\. Gomez, Ł\. Kaiser, and I\. Polosukhin\(2017\)Attention is all you need\.InAdvances in Neural Information Processing Systems 30 \(NeurIPS\),pp\. 5998–6008\.Cited by:[§2](https://arxiv.org/html/2611.17481#Ch1.S2.p1.1)\.
- \[25\]Y\. Wen, N\. Jain, J\. Kirchenbauer, M\. Goldblum, J\. Geiping, and T\. Goldstein\(2023\)Hard prompts made easy: gradient\-based discrete optimization for prompt tuning and discovery\.InAdvances in Neural Information Processing Systems 36 \(NeurIPS\),Cited by:[Figure 3](https://arxiv.org/html/2611.17481#Ch1.F3),[Figure 3](https://arxiv.org/html/2611.17481#Ch1.F3.4),[§7](https://arxiv.org/html/2611.17481#Ch1.S7.p3.1)\.
- \[26\]T\. Winninger, B\. Addad, and K\. Kapusta\(2025\)Using mechanistic interpretability to craft adversarial attacks against large language models\.arXiv preprint arXiv:2503\.06269\.Cited by:[§7](https://arxiv.org/html/2611.17481#Ch1.S7.p2.1),[§11](https://arxiv.org/html/2611.17481#Ch3.S11.p3.1),[§5](https://arxiv.org/html/2611.17481#Ch3.S5.p3.1)\.
- \[27\]A\. Yanget al\.\(2024\)Qwen2\.5 technical report\.arXiv preprint arXiv:2412\.15115\.Cited by:[§1](https://arxiv.org/html/2611.17481#Ch2.S1.p4.1)\.
- \[28\]A\. Yanget al\.\(2025\)Qwen3 technical report\.arXiv preprint arXiv:2505\.09388\.Cited by:[§4](https://arxiv.org/html/2611.17481#Ch2.S4.SS0.SSS0.Px1.p1.1)\.
- \[29\]A\. Zou, L\. Phan, S\. Chen, J\. Campbell, P\. Guo, R\. Ren, A\. Pan, X\. Yin, M\. Mazeika,et al\.\(2023\)Representation engineering: a top\-down approach to ai transparency\.arXiv preprint arXiv:2310\.01405\.Cited by:[§5](https://arxiv.org/html/2611.17481#Ch1.S5.p5.1)\.
- \[30\]A\. Zou, Z\. Wang, N\. Carlini, M\. Nasr, J\. Z\. Kolter, and M\. Fredrikson\(2023\)Universal and transferable adversarial attacks on aligned language models\.arXiv preprint arXiv:2307\.15043\.Cited by:[Figure 2](https://arxiv.org/html/2611.17481#Ch1.F2),[Figure 2](https://arxiv.org/html/2611.17481#Ch1.F2.4),[§6](https://arxiv.org/html/2611.17481#Ch1.S6.p1.1),[§4](https://arxiv.org/html/2611.17481#Ch2.S4.SS0.SSS0.Px4.p1.1),[Chapter 0](https://arxiv.org/html/2611.17481#p4.1)\.

## Chapter 6Additional Figures

## Appendix 6\.APer\-layer cosine trajectories

Figure 1:Per\-layer cosine to the target activations over optimisation steps for the universal German run\.Figure 2:Per\-layer cosine to the target activations over optimisation steps for the universal anti\-refusal run\.
## Appendix 6\.BPer\-prompt loss trajectories

Figure 3:Per\-prompt multilayer loss for German runs \(Gemma\-2\-2B,α=2\.0\\alpha=2\.0,3030prompts\), with normalisedL2L\_\{2\}and cosine to the target over optimisation steps\. Panel titles are green where the answer is German, red otherwise\.Figure 4:Per\-prompt multilayer loss for the anti\-refusal runs \(Gemma\-2\-2B,α=1\.0\\alpha=1\.0,2222prompts\), with normalisedL2L\_\{2\}and cosine to the target over optimisation steps\. Panel titles are green where the prompt is a jailbreak judged by HarmBench, red otherwise\.

相似文章

基于稀疏查询特征梯度优化的导向生成

arXiv cs.LG

本文介绍了Prototype-Based Sparse Steering方法,该方法将稀疏自编码器应用于大语言模型的注意力查询激活,然后在推理过程中使用梯度优化来引导生成朝向目标行为。该方法在一个逻辑规划任务和一个风格化教育领域中得到了验证,展示了可解释且解耦的控制能力。

Genesis 引导:通过训练数据实现更好的激活引导

arXiv cs.LG

该论文提出了“创世引导”(genesis steering),一种从模型自身微调数据中的对比样本(或在无法获取此类数据时,使用基于成员推断的替代数据)中提取激活引导向量的方法。在 Tülu-3-8B 和 Llama-3.1-8B-Instruct 上,该方法展现出比使用外部数据集更强的安全引导效果。

从 J 空间提取控制向量

Hacker News Top

本文研究探讨利用 Jacobian 空间从概念标记提取控制向量以调控大语言模型行为,基于 Qwen3-1.7B 的实验表明,该方法在简单任务中展现潜力,但在复杂场景中存在局限。

策略梯度引导:来自行为目标的干预

arXiv cs.LG

介绍了策略梯度引导(PGS),一种将激活引导形式化为强化学习问题的方法,利用策略梯度从行为目标中构建可移除、可组合的引导向量。在网格世界、国际象棋谜题和足球环境中进行了验证。