Paper deep dive
Tradeoffs Between Alignment and Helpfulness in Language Models
Yotam Wolf, Noam Wies, Dorin Shteyman, Binyamin Rothberg, Yoav Levine, Amnon Shashua
Models: Llama 2 13B Base, Llama 2 13B Chat
Intelligence
Status: succeeded | Model: google/gemini-3.1-flash-lite-preview | Prompt: intel-v1 | Confidence: 94%
Last extracted: 3/12/2026, 7:43:46 PM
Summary
This paper investigates the inherent tradeoff between alignment and helpfulness in Large Language Models (LLMs) when using steering methods like representation engineering. The authors propose a theoretical framework demonstrating that while alignment increases linearly with the norm of the injected steering vector, helpfulness decreases quadratically. They identify a regime where steering is efficient for alignment without severely compromising model performance and validate these findings empirically.
Entities (5)
Relation Signals (3)
Representation Engineering ā improves ā Alignment
confidence 95% Ā· Representation engineering yields gains in alignment oriented tasks such as resistance to adversarial attacks and reduction of social biases
Representation Engineering ā reduces ā Helpfulness
confidence 95% Ā· was also shown to cause a decrease in the ability of the model to perform basic tasks.
Steering Methods ā appliedto ā Claude 3 Sonnet
confidence 90% Ā· demonstrate SOTA models such as Claude 3 Sonnet can be effectively steered by this method.
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Language model alignment has become an important component of AI safety, allowing safe interactions between humans and language models, by enhancing desired behaviors and inhibiting undesired ones. It is often done by tuning the model or inserting preset aligning prompts. Recently, representation engineering, a method which alters the model's behavior via changing its representations post-training, was shown to be effective in aligning LLMs (Zou et al., 2023a). Representation engineering yields gains in alignment oriented tasks such as resistance to adversarial attacks and reduction of social biases, but was also shown to cause a decrease in the ability of the model to perform basic tasks. In this paper we study the tradeoff between the increase in alignment and decrease in helpfulness of the model. We propose a theoretical framework which provides bounds for these two quantities, and demonstrate their relevance empirically. First, we find that under the conditions of our framework, alignment can be guaranteed with representation engineering, and at the same time that helpfulness is harmed in the process. Second, we show that helpfulness is harmed quadratically with the norm of the representation engineering vector, while the alignment increases linearly with it, indicating a regime in which it is efficient to use representation engineering. We validate our findings empirically, and chart the boundaries to the usefulness of representation engineering for alignment.
Tags
Links
- Source: https://arxiv.org/abs/2401.16332
- Canonical: https://arxiv.org/abs/2401.16332
Trouble viewing inline? Open PDF directly ā
Full Text
242,248 characters extracted from source content.
Expand or collapse full text
Tradeoffs Between Alignment and Helpfulness in Language Models with Steering Methods Yotam Wolf, Noam Wies, Dorin Shteyman, Binyamin Rothberg, Yoav Levine, and Amnon Shashua The Hebrew University yotamwolf,noam.wies,dorin.shteyman,binyamin.rothberg yoav.levine,shashua@cs.huji.ac.il (October 2023) Abstract Language model alignment has become an important component of AI safety, allowing safe interactions between humans and language models, by enhancing desired behaviors and inhibiting undesired ones. It is often done by tuning the model or inserting preset aligning prompts. Recently, steering methods, such as representation engineering and feature steering and activation steering, methods which alters the modelās behavior via changing its representations post-training, were shown to be effective in aligning LLMs. Steering methods yield gains in alignment oriented tasks such as resistance to adversarial attacks and reduction of social biases, but were also shown to cause a decrease in the ability of the model to perform basic tasks. In this paper we study the tradeoff between the increase in alignment and decrease in helpfulness of the model. We propose a theoretical framework which provides bounds for these two quantities, and demonstrate their relevance empirically. First, we find that under the conditions of our framework, alignment can be guaranteed with steering methods, and at the same time that helpfulness is harmed in the process. Second, we show that helpfulness is harmed quadratically with the norm of the injected steering vectors, while the alignment increases linearly with it, indicating a regime in which it is efficient to use representation engineering. We validate our findings empirically, and chart the boundaries to the usefulness of these methods for alignment. Our code is available at https://github.com/dorin133/REPE_alignment_helpfulness_tradeoff. 1 Introduction Advancements in large language model (LLM) development over the last few years have given LLMs a variety of abilities that allow them to serve as general purpose assistants in a wide range of tasks, such as broad-scoped question answering, writing assistance, teaching, and more (Radford et al., 2019; Devlin et al., 2019; Brown et al., 2020; Schulman et al., 2023; OpenAI, 2023; Bubeck et al., 2023; Nori et al., 2023; West, 2023; Park et al., 2023). The vast use of LLMs for such purposes has raised concerns due to the harm they can cause their users, such as serving fake information (Lin et al., 2022; Weidinger et al., 2022), behaving offensively, feeding social biases (Hutchinson et al., 2020; Venkit et al., 2022; Weidinger et al., 2022), or encouraging problematic behaviors by users Roose (2023); Atillah (2023). Alignment is often the term given for the process of removing these undesired behaviors (Yudkowsky, 2001; Taylor et al., 2016; Amodei et al., 2016; Shalev-Shwartz et al., 2020; Hendrycks et al., 2021; Pan et al., 2022; Ngo, 2022). There are several different approaches to performing alignment in LLMs, such as including aligning prompts (Askell et al., 2021; Rae et al., 2021) which was shown to improve alignment and decrease toxicity in LLMs, and the procedure of reinforcement learning from human feedback (RLHF) which trains language models to be helpful and harmless (Bai et al., 2022). Though effective to an extent, these approaches are still dangerously frail, as several works have shown that adversarial prompts can trigger negative behaviors in LLMs Wallace et al. (2019); Yu & Sagae (2021); Xu et al. (2021); Subhash (2023); Zou et al. (2023b). The work of Wolf et al. (2023) provides a theoretical framework which shows that frozen LLMs can be misaligned with sufficiently long prompts. Recently, new alignment methods were proposed, revolving around altering model weights at inference time, which control the model at the internal representations level by adding tailored vectors to the hidden layerās representations. The appeal of such methods is that enhancing concepts through finetuning is expensive and not always efficient for small changes, while inference time steering requires only inference compute and allows to specialize the model to the userās needs. Prominent methods include representation engineering (Zou et al., 2023a) and activation steering (Turner et al., 2023), in which directions in the modelās latent space controlling certain behaviors are extracted by contrasting hidden representations in which opposing behaviors are exhibited, as well as feature steering, by Anthropic (Templeton, 2024), in which steering vectors are obtained via the use of variational auto-encoders (VAEs), and demonstrate SOTA models such as Claude 3 Sonnet can be effectively steered by this method. While the methods differ in their approach for obtaining the steering vectors, the underlying principle of injecting the vectors into the model is simlar. Since then, there has been an increasing body of work using these methods. Zou et al. (2023a) demonstrated experimentally that the procedure can significantly improve alignment, e.g., in resistance to adversarial attacks, with reduction from 50% success of adversarial attacks to less than 15%, and truthfulness enhancement, with a relative increase of over 50%, though at the cost of somewhat reducing the helpfulness of the model. Wang et al. (2024b) use extracted safety vectors for inference time alignment for harmlessness, reducing jailbreaking success rate from over 30% with prompting and over 10% in supervised fine tuning to below one percent. Similar methods have also been used by Jorgensen et al. (2023); Leong et al. (2023); Liu et al. (2023); Turner et al. (2023) to improve alignment and reduce toxicity. Wang et al. (2024a) uses a method of editing model parameters that maximize the difference between toxic and untoxic responses to detoxify it. Wei et al. (2024) find sparse regions in parameter space that affect alignment brittleness, to be removed for better alignment. Marks et al. (2024) interpret causal graphs in language models and edit them to improve behaviors. van der Weij et al. (2024) extend activation steering to multiple behaviors. To improve low rank finetuning, Wu et al. (2024) utilize a procedure of tuning representations directly to substantially reduce the trainable parameters of finetuning compared to LoRA. Xu et al. (2024); Li et al. (2024) use concept activation vectors to jailbreak, they also observe that concepts that activate different behaviors are linearly separable. Zhang et al. (2024) remove hallucinations by editing truthfulness concepts. Additionally, the method scales to SOTA models, such as Claude 3 Sonnet (Templeton, 2024), using a similar method of sparse auto encoders, which extracts interpretable features from the model that can be used to manipulate the model through steering. There are also known limitations to editing representations - Yan et al. (2024) study limitations of model editing methods for social debiasing, and Elazar et al. (2021) empirically demonstrate how projecting out supervised linear probe directions can reduce performance on selected tasks. Understanding the tradeoff between model helpfulness and alignment is important for designing safe yet useful LLM systems. Previous empirical works have shown tradeoffs between quality and diversity and between helpfulness and safety in LLMs due to instruct finetuning (Florian et al., 2024; Bianchi et al., 2023; Rƶttger et al., 2023), and reduction in performance due to watermarking (Ajith et al., 2023). In this work we aim to shed light on the benefits and limitations of steering for LLM alignment, i.e., how much does alignment improve with this method and what is the cost in terms of the modelās abilities. We approach this question theoretically at first, and then provide empirical evidence for the validity of our theory. Figure 1: Effect of steering on helpfulness and alignment. Our main results show that alignment can improve at the cost of helpfulness. Moreover, we show that for small representation engineering norms the helpfulness decreases quadratically while the alignment increase is linear, so there is a regime in which representation engineering can be cost-effective. In sections 2 and 3, we set up our theoretical framework and present our theoretical results respectively. We find that steering increases alignment linearly with the steering vector norm (theorem 1), while the helpfulness of the model, defined as the probability of answering general queries correctly, decreases quadratically with the vector norm (theorem 2). Consequently, alignment can be guaranteed with large enough vector injections, though at the cost of reducing the modelās helpfulness. Conversely, when injecting vectors of small norms, the improvement of alignment is initially faster than the decrease in helpfulness, indicating a regime where steering is effective, allowing for inference time alignment while maintaining the modelās helpful capabilities. See figure 1 for an illustration of this intuition. In section 4 we explore the validity of our assumptions and results in an experimental setting with representation engineering: We calculate alignment, as defined by the theoretical framework, as a function of representation engineered vector norms corresponding to the desired behaviors and find that it increases as predicted by theorem 1. This is done by aligning with representation engineering an unaligned (pretrained) model with respect to desired behaviors (āharmless", ānot-racist"), and misaligning an aligned (RLHF) model to undesired behaviors (āharmful", āracist"). Then, we calculate the helpfulness of the model, quantified by its question answering abilities over different knowledge domains and coding capabilities, with the same aligning vectors, and find that the decay with increased vector norm described in theorem 2 is manifested. Together, the results correspond to the intuitive illustration in fig. 1. Complementary experimental results by Anthropic showed similar empirical trends for alignment and helpfulness in the use of feature steering with vectors extracted from VAEs on Claude 3 Sonnet (Durmus et al., ). 2 Preliminaries We denote PĪø(ā |s)P_Īø(Ā·|s)Pitalic_Īø ( ā | s ) as the next token probability distribution of a model with parameters Īø, when conditioned on the prompt s. The model is composed of L layers, rĪølsuperscriptsubscriptr_Īø^lritalic_Īøitalic_l is the lāth hidden state representation of the model. The next token prediction of a model is parametrized as: PĪøā¢(tn+1|t1ā¢ā¦ā¢tn)=sā¢oā¢fā¢tā¢mā¢aā¢xā¢(Uā¢rĪø(L)ā¢(t1ā¢ā¦ā¢tn))tn+1subscriptconditionalsubscript1subscript1ā¦subscriptsubscriptsubscriptsuperscriptsubscript1ā¦subscriptsubscript1P_Īø(t_n+1|t_1...t_n)=softmax(Ur^(L)_Īø(t_1...t_n))_t% _n+1Pitalic_Īø ( titalic_n + 1 | t1 ⦠titalic_n ) = s o f t m a x ( U r( L )Īø ( t1 ⦠titalic_n ) )t start_POSTSUBSCRIPT n + 1 end_POSTSUBSCRIPT (1) Where rĪø(L)ā¢(s)subscriptsuperscriptr^(L)_Īø(s)r( L )Īø ( s ) is the final hidden layerās representation of the prompt s and U is an unembedding matrix from the hidden state to a vocabulary of tokens, a standard parametrization for SOTA LLMs. Denote a steered model by vectors, Re=(re(l=1),ā¦,re(l=L))subscriptsuperscriptsubscript1ā¦superscriptsubscriptR_e=(r_e^(l=1),...,r_e^(l=L))Ritalic_e = ( ritalic_e( l = 1 ) , ⦠, ritalic_e( l = L ) ), as PĪø,resubscriptsubscriptP_Īø,r_ePitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT. Steering is performed at each layer by adding the corresponding vector to the hidden layer: rĪø(l)ārĪø(l)+re(l)āsuperscriptsubscriptsuperscriptsubscriptsuperscriptsubscriptr_Īø^(l)ā r_Īø^(l)+r_e^(l)ritalic_Īø( l ) ā ritalic_Īø( l ) + ritalic_e( l ) (2) Additionally, we follow existing methods for steering and provide a uniform norm for all the injected vectors |re(l)|=|re|superscriptsubscriptsubscript|r_e^(l)|=|r_e|| ritalic_e( l ) | = | ritalic_e |, which are initially prepared with norm 1111, and when injected to the model, are multiplied by the coefficient resubscriptr_eritalic_e which can be positive or negative, to tune the steering strength and direction. For layers that are not injected, |re(l)|=0superscriptsubscript0|r_e^(l)|=0| ritalic_e( l ) | = 0. To quantify alignment, we use the behavior expectation definition of alignment as in Wolf et al. (2023), based on the expected score of model responses to a behavior scoring function. The behavior scoring function can measure honesty, safety or any other concept for which responses can be scored as positively or negatively aligned with respect to. We will use a binary scoring function, with labels ±1plus-or-minus1± 1± 1 for aligned/misaligned answers. The results can be extended to more complex behavior scoring function over [ā1,+1]11[-1,+1][ - 1 , + 1 ], to yield qualitatively similar results, as discussed appendix J: Definition 1. Let B:Ī£āāā1,+1:āsuperscriptĪ£11B: ^*ā\-1,+1\B : Ī£ā ā - 1 , + 1 be a binary behavior scoring function, the behavior of a prompted model P(ā |q)P(Ā·|q)P ( ā | q ) is defined as: B[PĪø(ā |q)]=aā¼PĪø(ā |q)[B(a)]=āa+āaā¢lā¢iā¢gā¢nā¢eā¢dPĪø(a+|q)āāaāāmā¢iā¢sā¢aā¢lā¢iā¢gā¢nā¢eā¢dPĪø(aā|q)B[P_Īø(Ā·|q)]=E_a P_Īø(Ā·|q)[B(a)]= _a_+% ā alignedP_Īø(a_+|q)- _a_-ā misalignedP_Īø(a_-|q)B [ Pitalic_Īø ( ā | q ) ] = blackboard_Ea ā¼ P start_POSTSUBSCRIPT Īø ( ā | q ) end_POSTSUBSCRIPT [ B ( a ) ] = āa start_POSTSUBSCRIPT + ā a l i g n e d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) - āa start_POSTSUBSCRIPT - ā m i s a l i g n e d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) (3) While B is a binary function, the behavior expectation is in the range [ā1,+1]11[-1,+1][ - 1 , + 1 ], reflecting cases where a model has probability for both aligned and misaligned responses. In theorem 1 we will prove that steering is an effective alignment method by lower bounding the behavior expectation. Notice that high probability of outputting a positive/negative response gives a positive/negative contribution to the behavior expectation, thus the sign and absolute value of behavior expectation measures the alignment of a model w.r.t. the given behavior. The modelās helpfulness can be quantified as its ability to produce useful answers to userās queries (knowledge questions, code generation, summarization, etc.). In order to theoretically analyze helpfulness, we focus on queries where correctness can be defined, such as knowledge based question answering (see figure 1 for an example) and code generation. This can be measured as the likelihood of outputting a correct answer to a query: hā¢eā¢lā¢pā¢fā¢uā¢lā¢nā¢eā¢sā¢sā¢(mā¢oā¢dā¢eā¢l,q)=PĪøā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)āsubscriptconditionalsubscripthelpfulness(model,q)=P_Īø(a_correct|q)h e l p f u l n e s s ( m o d e l , q ) = Pitalic_Īø ( aitalic_c o r r e c t | q ) (4) Where PĪøā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)subscriptconditionalsubscriptP_Īø(a_correct|q)Pitalic_Īø ( aitalic_c o r r e c t | q ) is the modelās probability of outputting the correct answer a to the query q. By this definition, the helpfulness is in the range [0,1]01[0,1][ 0 , 1 ], in order to quantify the general capabilities of the model when steering vectors are injected into it. For queries where correctness is not defined, the bounds we derive are expected to still be meaningful as they also describe the rate of the modelās deviation from its original distribution due to steering. The rational behind this quantification of alignment and helpfulness is to measure how aligning the model w.r.t. a concept through steering affects its ability to perform other tasks. Ideally, a model that interacts with a user should be both aligned and helpful, meaning its response is appropriate w.r.t. a desired behavior (quantified by a positive behavior expectation) and also useful (high probability of giving a correct answer to general purpose queries). In the next section, we will provide results on alignment and helpfulness under the use of steering, based on the modelās next token prediction, which provides simple analytical forms for alignment and helpfulness. In appendix K, we extend the results for multi-token answers, which yields qualitatively similar results, with somewhat more complex form. 3 Main Results We will show that steering improves alignment and harms helpfulness, yet a "moderate" use of steering can yield a model that is good for both. Theorem 1 shows that behavior expectation is bounded from below by a hyperbolic tangent function, such that it approaches +11+1+ 1 for increasing size of injected vectors and increases linearly within a bounded range. This in principle allows to sample an aligned response for any adversarial attack (corollary 1), demonstrating the power of representation engineering as an alignment technique. Theorem 2 shows that the helpfulness is maximized in the vicinity of norm zero injected vectors (i.e., no representation engineering) and that as the norm is increased, helpfulness decays. The assumptions used to prove the theorems are presented formally in appendix A. The following statement quantifies how alignment is improved by steering. It assumes the injected vectors in all layers accumulate to a change in the last hidden layer representation that classifies positive and negative behavior answers to the query, as depicted in figure 2a. This is assumed due to the popular choice in representation engineering to use steering vectors re(l)superscriptsubscript\r_e^(l)\ ritalic_e( l ) , that are themselves classifiers for positive and negative representations on the intermediate layers, due to being learned from contrasting positive and negative behavior representations for different queries. For example, mean centering, re(l)=gā¢oā¢oā¢d,bā¢aā¢dā¢[rgā¢oā¢oā¢d(l)ārbā¢aā¢d(l)]superscriptsubscriptsubscriptdelimited-[]superscriptsubscriptsuperscriptsubscriptr_e^(l)=E_good,bad[r_good^(l)-r_bad^(l)]ritalic_e( l ) = blackboard_Eg o o d , b a d [ ritalic_g o o d( l ) - ritalic_b a d( l ) ] (Jorgensen et al. (2023)), or PCA, re(l)=argmaxv:āvā=1ā¢[gā¢oā¢oā¢d,bā¢aā¢dā¢|āØv,rgā¢oā¢oā¢d(l)ārbā¢aā¢d(l)ā©|2]superscriptsubscriptsubscriptargmax:norm1delimited-[]subscriptsuperscriptsuperscriptsubscriptsuperscriptsubscript2r_e^(l)=argmax_v:||v||=1[E_good,bad| v,r_good% ^(l)-r_bad^(l) |^2]ritalic_e( l ) = argmaxv : | | v | | = 1 [ blackboard_Eg o o d , b a d | ⨠v , ritalic_g o o d( l ) - ritalic_b a d( l ) ā© |2 ] (Zou et al. (2023a)), such that they form linear classifiers for the intermediate layers due to the positive/negative inner product with positive/negative answer representations. Notably, in Xu et al. (2024) it is shown empirically that such concept classes in latent space are linearly separable. We discuss this assumption further in A and provide empirical evidence. Furthermore, the classification condition can be softened to an imperfect classifier, as discussed in appendix A and shown in appendix in H, to yield similar results. Theorem 1. Let PĪø,re(ā |q)P_Īø,r_e(Ā·|q)Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) be a model prompted with query q and injected with representations of coefficient resubscriptr_eritalic_e. Let B:Ī£āāā1,+1:āsuperscriptĪ£11B: ^*ā\-1,+1\B : Ī£ā ā - 1 , + 1 be a behavior scoring function. The injections to all layers amounts to a change in the final hidden layer representation that is q dependent, denoted by the vector Ī“ā¢re(L)ā¢(q)subscriptsuperscriptĪ“ r^(L)_e(q)Ī“ r( L )e ( q ). Assume the representations of aligned and misaligned answers w.r.t. B are linearly separable, and Ī“ā¢re(L)ā¢(q)subscriptsuperscriptĪ“ r^(L)_e(q)Ī“ r( L )e ( q ) linearly classifies them with margin Ī Ī. Then, the behavior expectation of the model conditioned on the query q satisfies: B[PĪø,re(ā |q)]ā„tanh(ĪĪ»ā re+arctanh(B0))B[P_Īø,r_e(Ā·|q)]ā„ tanh( λ· r_e+arctanh(B_0))B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] ā„ t a n h ( Ī Ī» ā ritalic_e + a r c t a n h ( B0 ) ) (5) Where B0=B[PĪø(ā |q)]B_0=B[P_Īø(Ā·|q)]B0 = B [ Pitalic_Īø ( ā | q ) ] is the behavior expectation without steering and Ī» is a model dependent coefficient relating between resubscriptr_eritalic_e and the corresponding final hidden state norm. As can be seen in the mathematical expression and in figure 2b for B0=ā0.5subscript00.5B_0=-0.5B0 = - 0.5, this lower bound is a shifted hyperbolic tangent function w.r.t resubscriptr_eritalic_e. At re=0subscript0r_e=0ritalic_e = 0 the bound gives B0subscript0B_0B0, which is the unaltered modelās behavior. As resubscriptr_eritalic_e is increased, the bound approaches +11+1+ 1, meaning the behavior asymptotically approaches +11+1+ 1. We see that for B0subscript0B_0B0 that is not too close to ā11-1- 1, the increase in behavior expectation is linear due to the hyperbolic tangentās nature, while if it is very close to ā11-1- 1, resubscriptr_eritalic_e is to be increased before seeing the linear effect. Thus for behaviors on which the model is negative but has a small tendency for positive answers, the linear effect should be felt near re=0subscript0r_e=0ritalic_e = 0. In section 4, we present our numerical estimation Īā¢Ī»Ī λΠλ in the range 0.1ā30.130.1-30.1 - 3, both based on the linear classifier condition and direct alignment measurement. For proof see appendix section B. Figure 2: (a) The change to the last hidden layer due to vector injections from previous layers classifies positive and negative answer representations. (b) Plot of the upper bound on behavior expectation in theorem 1. This can be extended to multi-token answers, by enforcing the above result on each decoding step of the generated answer, as explained in appendix K. The binary behavior score can also be extended beyond binary, as explained in appendix J. In contrast to Wolf et al. (2023), whose framework is centralized on using prompts to misalign frozen models, i.e. whose weights and representations are not changed after training, here the model is not frozen due to steering, and accordingly a different result is obtained on guaranteeing an aligned response ā for any adversarial attack, using steering with large enough norms produces an aligned response if the learned steering vectors accumulate to a good classifier of positive and negative answer representations in the final layer. We formalize this in appendix D. Now, we shall bound from above the helpfulness of the model as a function of steering. We formally bound the probability of producing correct answers to queries where correctness is well defined. Yet, even when this is not the case, the bound can still be relevant, as it quantifies the modelās deviation from its original distribution due to steering. Hence if the model was initially helpful on a task, a random deviation to its probability distribution is expected to decrease model performance proportionally to the size of the deviation. Intuitively, editing the modelās representation in a specific direction adds random noise to other latent concepts of the model, causing a degradation in its other capabilities. This is introduced in our framework through the resulting change to the final hidden layer Ī“ā¢reā¢(q)=rĪø,re(L)ārĪø(L)subscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptĪ“ r_e(q)=r_Īø,r_e^(L)-r_Īø^(L)Ī“ ritalic_e ( q ) = ritalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT( L ) - ritalic_Īø( L ), we will assume its direction Ī“ā¢reā¢(q)|Ī“ā¢reā¢(q)|subscriptsubscript Ī“ r_e(q)|Ī“ r_e(q)|divide start_ARG Ī“ ritalic_e ( q ) end_ARG start_ARG | Ī“ ritalic_e ( q ) | end_ARG contains random projections w.r.t. latent representations of correct and incorrect answers, which creates noise in the modelās distribution. The noise is expected to be random on the highest probability tokens, when answering a query that is unrelated to the behavior being enhanced (intuitively depicted in figure 3a). We verify this empirically in appendix A.3. Thus, we assume random noise on the top T tokens making up a large probability mass of the answer distribution, 1āϵ1italic-ϵ1- 1 - ϵ, (e.g. Tā¼10similar-to10T 10T ā¼ 10 typically makes ϵā¼0.1similar-toitalic-ϵ0.1ε 0.1ϵ ā¼ 0.1), and do not make assumptions on the rest of the vocabulary. The following theorem formally states this. Theorem 2. Let PĪø,re(ā |q)P_Īø,r_e(Ā·|q)Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) be a model prompted with query q and injected with representations of coefficient resubscriptr_eritalic_e. If the resulting change to the directionality of the last hidden layer representation due to the injections in all layers, distributes randomly with variance Ļ2>0superscript20Ļ^2>0Ļ2 > 0 w.r.t. the representations of correct and incorrect answers making up 1āϵ1italic-ϵ1- 1 - ϵ of the probability mass, the helpfulness of the model on the query is bounded with probability 1ā2T121- 2T1 - divide start_ARG 2 end_ARG start_ARG T end_ARG by: PĪø,reā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)ā¤P0P0+(1āP0)ā αā¢(1āϵ)ā¢(1+Ī»2ā¢Ļ2ā¢Ī²22ā¢re2)subscriptsubscriptconditionalsubscriptsubscript0subscript0ā 1subscript01italic-ϵ1superscript2superscript2superscript22superscriptsubscript2P_Īø,r_e(a_correct|q)⤠P_0P_0+(1-P_0)·α(1-% ε)(1+ Ī»^2Ļ^2β^22r_e^2)Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( aitalic_c o r r e c t | q ) ⤠divide start_ARG P0 end_ARG start_ARG P0 + ( 1 - P0 ) ā α ( 1 - ϵ ) ( 1 + divide start_ARG Ī»2 Ļ2 β2 end_ARG start_ARG 2 end_ARG ritalic_e2 ) end_ARG (6) Where P0=PĪø,re=0(ā |q)P_0=P_Īø,r_e=0(Ā·|q)P0 = Pitalic_Īø , r start_POSTSUBSCRIPT e = 0 end_POSTSUBSCRIPT ( ā | q ) is the probability of answering correctly without steering, T is the number of tokens making 1āϵ1italic-ϵ1- 1 - ϵ of the probability mass and α,β>00α,β>0α , β > 0 that depend on the query. Ī» is a model dependent coefficient relating between resubscriptr_eritalic_e and the corresponding final hidden state norm. The proof is presented in appendix C and the assumption formally defined in appendix A. The above bound is illustrated in figure 3b for different values of β. As can be seen, around re=0subscript0r_e=0ritalic_e = 0, the bound is parabolic, i.e. the decrease is proportional to āre2superscriptsubscript2-r_e^2- ritalic_e2, obtained by expanding the bound near re=0subscript0r_e=0ritalic_e = 0. On the other hand, for large resubscriptr_eritalic_e, we see a decay to zero at a rate proportional to reā2superscriptsubscript2r_e^-2ritalic_e- 2, obtained by expanding the bound for large resubscriptr_eritalic_e. This result can be extended to multi-token answers, by enforcing the above result on each decoding step of the generated answer, as explained in appendix K. Importantly, this demonstrates that while large vector injections harm the modelās overall performance, for small injections, the modelās performance is relatively unharmed due to the slow (parabolic) decrease with norm around re=0subscript0r_e=0ritalic_e = 0. For the second statement to be feasible, the true helpfulness and the bound need to be close when no steering is performed. Indeed, the difference between the two at re=0subscript0r_e=0ritalic_e = 0 is bounded by 1āP01subscript01-P_01 - P0, such that for queries with high probability of being answered correctly without steering, i.e. P0ā1subscript01P_0ā 1P0 ā 1, the true helpfulness and the bound will be close, guaranteeing the parabolic bound to be meaningful. The parameter αā[0,1]01αā[0,1]α ā [ 0 , 1 ] measures the tightness of the bound at re=0subscript0r_e=0ritalic_e = 0, since the true helpfulness at re=0subscript0r_e=0ritalic_e = 0 is P0subscript0P_0P0, while our helpfulness bound is P0P0+αā¢(1āP0)subscript0subscript01subscript0 P_0P_0+α(1-P_0)divide start_ARG P0 end_ARG start_ARG P0 + α ( 1 - P0 ) end_ARG. Thus α=11α=1α = 1 (and ϵ=0italic-ϵ0ε=0ϵ = 0) means the bound at re=0subscript0r_e=0ritalic_e = 0 coincides with the true helpfulness, while smaller α means the bound overshoots it. In our results, we obtain αā¤0.50.5α⤠0.5α ⤠0.5. Figure 3 depicts this overshooting for α=0.250.25α=0.25α = 0.25. Even so, as explained above, the tightness is at least 1āP01subscript01-P_01 - P0 regardless of α, so it is always meaningful for queries the model is initially helpful on. The product of parameters Ī»ā¢Ļā¢Ī²Ī»Ļβλ Ļ Ī² measures the rate/curvature of the quadratic decay, as they are the coefficient multiplying re2superscriptsubscript2r_e^2ritalic_e2. Ī» is the same scaling parameter from theorem 1, Ļ is the standard deviation of random noise added to the logits due to representation engineering (depicted in figure 3a and formally defined in A). β is the minimum between two weighted sums of positive variables with parameter Ļā²=1superscriptā²1Ļ =1Ļā² = 1. In section 4, we present an empirical estimation for Ī»ā¢Ļā¢Ī²Ī»Ļβλ Ļ Ī² in the range 0.1ā0.660.10.660.1-0.660.1 - 0.66, based on the logit noise condition and direct helpfulness measurement. Hence the decay becomes strong at coefficients resubscriptr_eritalic_e of size 1ā101101-101 - 10. Figure 3: (a) Directionality of change to last hidden layer due to representation engineering distributes randomly with variance Ļ2superscript2Ļ^2Ļ2 w.r.t. correct and incorrect answer representations. (b) Plot of helpfulness bound with given parameters of P0subscript0P_0P0, α and Ī»ā¢Ļā¢Ī²Ī»Ļβλ Ļ Ī². A tradeoff between alignment and usefulness: The combination of the two results shows alignment improves linearly with the norm of the steering vectors while helpfulness is decreased quadratically. This means that when injecting vectors of small norms, the improvement of alignment is initially faster than the decrease in helpfulness, indicating a regime where steering is more effective. See figure 1 for an illustration of this intuition. 4 Empirical results Here we will calculate alignment and helpfulness as defined above and observe how they are affected by increasing norms of steering vectors. Theorem 1 shows how alignment can increase/decrease due to steering, thus to demonstrate it, we increase the alignment of an unaligned pretrained model w.r.t. āharmless" and ānot-racist" behaviors (specifically we use Llama 2 13B (Touvron et al., 2023)), and conversely, misalign an aligned RLHF model w.r.t. āharmful" and āracist" behaviors (Llama 2 13B chat (Touvron et al., 2023)). Then, we calculate helpfulness as the probability of answering queries correctly when the model is injected with the same behavior altering vectors. The experiments show an effect on alignment matching theorem 1 and on helpfulenss matching theorem 2. Additional experimental details can be found in appendix F as well as results for Llama 3.1 8B (Dubey et al., 2024). We note the goal of the experiments is to demonstrate the theoretical bounds showing an enhancement of alignment with a concept and a helpfulness decrease due to steering, and that a complementary experimental demonstration of these with more behaviors is shown on Claude 3 Sonnet with social biases when using feature steering (Durmus et al., ). We follow the work of Zou et al. (2023a) to extract the vectors used in representation engineering: Pairs of positive and negative statements w.r.t. a behavior, are forward passed through the model, and the differences between representations of the pairs are used to find latent space directions that steer the modelās responses from negative to positive behaviors or vice versa. For the āharmful" behavior on the aligned model, we extracted harmful and unharmful instructions from AdvBench (Robey et al., 2021; 2022) and shareGPT respectively. For āharmless" behavior on the unaligned model, the approach of contrasting positive and negative requests does not work, as the model agrees to answer both types of requests, so contrasting them does not steer the model towards not answering a request. Instead, inspired by the method of preference learning, we contrast aligned and misaligned responses to harmful instructions from AdvBench. For āracism" on the aligned model, we used biased and unbiased statements from the StereoSet dataset (Nadeem et al., 2020). For ānot-racist" on the unaligned model, we used the racist statements from above, followed by aligned and misaligned responses. The obtained vectors were used to calculate behavior expectation and helpfulness of the model as the norm of the vectors increased. Alignment Measurement: To calculate harmful behavior expectation, we sampled full responses to harmful instructions and used the behavior scoring function that assigns an answer Bā¢(aā¢nā¢sā¢wā¢eā¢r)=±1plus-or-minus1B(answer)=± 1B ( a n s w e r ) = ± 1 if the model answers a harmful instruction or refuses to and calculated its expectation value, which is the difference between probabilities of fulfilling and not fulfilling the instruction. To calculate the racism behavior expectation, sampled full responses to racist statements and used a behavior scoring function that assigns an answer Bā¢(aā¢nā¢sā¢wā¢eā¢r)=±1plus-or-minus1B(answer)=± 1B ( a n s w e r ) = ± 1 to agreeing/disagreeing with a racist statement, and calculated the expectation value of this function w.r.t. the model distribution, which is the difference in probabilities of agreeing and disagreeing with a racist statement. Figure 4: Plots of behavior expectation as a function of the coefficients of representation engineering vectors injected to the model. The blue line is the direct measurement, the orange line is a plot of the bound from theorem 1. (a) Harmless behavior expectation of Llama 2 13B as a function of coefficient of injected harmful PCA vectors. (b) Racism behavior expectation of Llama 2 13B as a function of coefficient of injected bias PCA vectors.(c) Harmful behavior expectation of Llama 2 13B as a function of coefficient of injected harmful PCA vectors. (d) Racism behavior expectation of Llama 2 13B chat as a function of coefficient of injected bias PCA vectors. Figure 4 shows behavior expectation as a function of corresponding PCA vector coefficients injected into the models. Overall we see that on both behaviors and both models, the behavior expectation changes like a hyperbolic tangent, as expected of theorem 1, which can be seen by the fitted curve of the data to a bound of the form of theorem 1 when using Īā¢Ī»Ī λΠλ as a free parameter that fits the measurements. The value of Īā¢Ī»Ī λΠλ corresponding to the curve is 0.5ā30.530.5-30.5 - 3 while our empirically estimated value of Īā¢Ī»Ī λΠλ from the data based on the linear classification condition of the last hidden layer change is 0.1ā0.40.10.40.1-0.40.1 - 0.4 (for details and explanation for these differences see appendix A.3). We note that for all behaviors, re=2.5subscript2.5r_e=2.5ritalic_e = 2.5 suffices for a significant change in behavior expectation, taking it from negative to positive. It is left to observe the decrease in helpfulness and verify that it is not too big. Helpfulness Measurement: To calculate helpfulness, we tested the model on two tasks. The first is knowledge based question answering, for a clean test of the single token theoretical results (theorem 2). The second is code generation, to verify the single token results persist for tasks with multiple-token answers. Importantly, we injected the model with the same vectors used to alter the modelās behavior in the alignment measurement. For the first task, we queried the model with multiple choice questions from the MMLU dataset (Hendrycks et al., 2020) over a variety of domains (e.g. international law, medical genetics) and calculated the probability that the model assigns the correct answer. This was done both by calculating the probabilities of the multiple choice answers, A,B,C,D, and in appendix F by sampling full responses to the questions and measuring the accuracy, yielding similar results. This was measured as a function of injected vector coefficients inserted to the model for the behaviors above. Figure 5 shows the results for the different behaviors and models. We plot a bound of the form of theorem 2 to demonstrate the predicted parabolic behavior. We do so with free parameter Ī»ā¢Ļā¢Ī²Ī»Ļβλ Ļ Ī² from which we find Ī»ā¢Ļā¢Ī²Ī»Ļβλ Ļ Ī² in the range of 0.330.330.330.33 to 0.660.660.660.66 (see appendix F.4). This is in accordance with our empirically estimated values of 0.10.10.10.1 to 0.40.40.40.4 for Ī»ā¢Ļā¢Ī²Ī»Ļβλ Ļ Ī² from direct measurement of the noise injected to the model due to representation engineering in appendix A.3. Notably, for re=2.5subscript2.5r_e=2.5ritalic_e = 2.5, the decrease in helpfulness is still not too great, while as mentioned previously, alignment is significantly increased. Figure 5: Helpfulness measurement: the probability assigned to the correct answer to questions from different MMLU tests (international law, medical genetics, high school computer science), as a function of representation engineering vector coefficients injected to the model. Here the probability of the correct answer was measured relative to the answers A, B, C, D. The red line plots the bound of theorem 2 for free parameters on āinternational law". (a) Helpfulness of Llama 2 13B with harmful PCA vectors. (b) Helpfulness of Llama 2 13B with bias PCA vectors. (c) Helpfulness of Llama 2 13B chat with harmful PCA vectors. (d) Helpfulness of Llama 2 13B chat with bias PCA vectors. For the second task, we tested the modelās coding skills with the humaneval dataset (Chen et al., 2021). We present the results in appendix G. The modelās performance is peaked around re=0subscript0r_e=0ritalic_e = 0, and it decays parabolically ar resubscriptr_eritalic_e increases, as predicted in theorem 2. 5 Discussion In this work, we study the benefits of steering methods for LLM alignment from a theoretical perspective. We find that increasing the magnitude of the vectors injected to the model leads to improved alignment; we theoretically quantify this improvement as linear in the vectorsā magnitude, and validate our result empirically. A practical outcome of our result is a guarantee of alignment when using the representation engineering method. Such theoretical guarantees cannot be made without altering the model at inference time ā Wolf et al. (2023) show that prompt based alignment methods can always be undone. Our result thus crystallizes an inherent advantage of steering over competing alignment methods. On the other hand, our framework indicates a degradation of the modelās general capabilities when steering is applied. We theoretically quantify this degradation to be parabolic in the injected vectorsā magnitude, which puts a bound on the strength with which steering should be performed to keep the model reliable for different uses. While our theoretical bound is an upper bound on the helpfulness, we observe this parabolic behavior empirically as well. While steering is an emerging field, editing interpretable features of models on the representation level in order to control them scales to SOTA models such as Anthropicās Claude 3 Sonnet (Templeton, 2024; Durmus et al., ). In principle, our framework may be generalized for theoretically analyzing the effects of normal finetuneing on alignment and helpfulness, as it too amounts to a change in the LLM representations to maximize the likelihood of desired outputs. In particular, each step in preference learning is equivalent to steering with coefficient that equals to the learning rate (see appendix I), and indeed similar tradeoffs have been observed for finetuning (Tan et al., 2024). However, we leave this for future work, as finetuning creates small changes to the modelās representation at each training step on several behaviors, that sums to a large overall change, while steering takes a large step in one direction. As a result, the change to the representations in a steering process on one behavior creates random noise on the others (assumption 3), unlike a finetuning process where this does not necessarily happen. Hence in regards of maintaining helpfulness, finetuning has an advantage, however, steering does enjoy the benefit of an online controllable step size in the desired behavior for effective manipulation at inference time. Overall, we hope that our theoretical work will shed light on the mechanism of steering, which constitutes a new interesting direction for language model alignment. Acknowledgments This research was supported by the ERC (European Research Council) and the ISF (Israel Science Foundation). References Ajith et al. (2023) Anirudh Ajith, Sameer Singh, and Danish Pruthi. Performance trade-offs of watermarking large language models. arXiv preprint arXiv:2311.09816, 2023. Amodei et al. (2016) Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan ManĆ©. Concrete problems in ai safety. arXiv preprint arXiv:1606.06565, 2016. Askell et al. (2021) Amanda Askell, Yuntao Bai, Anna Chen, Dawn Drain, Deep Ganguli, Tom Henighan, Andy Jones, Nicholas Joseph, Ben Mann, Nova DasSarma, et al. A general language assistant as a laboratory for alignment. arXiv preprint arXiv:2112.00861, 2021. Atillah (2023) Imane El Atillah. Man ends his life after an ai chatbot āencouragedā him to sacrifice himself to stop climate change. Euronews, 2023. Bai et al. (2022) Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova DasSarma, Dawn Drain, Stanislav Fort, Deep Ganguli, Tom Henighan, et al. Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862, 2022. Bianchi et al. (2023) Federico Bianchi, Mirac Suzgun, Giuseppe Attanasio, Paul Rƶttger, Dan Jurafsky, Tatsunori Hashimoto, and James Zou. Safety-tuned llamas: Lessons from improving the safety of large language models that follow instructions. arXiv preprint arXiv:2309.07875, 2023. Brown et al. (2020) Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877ā1901, 2020. Bubeck et al. (2023) SĆ©bastien Bubeck, Varun Chandrasekaran, Ronen Eldan, Johannes Gehrke, Eric Horvitz, Ece Kamar, Peter Lee, Yin Tat Lee, Yuanzhi Li, Scott Lundberg, et al. Sparks of artificial general intelligence: Early experiments with gpt-4. arXiv preprint arXiv:2303.12712, 2023. Chen et al. (2021) Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. Evaluating large language models trained on code. 2021. Devlin et al. (2019) Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), p. 4171ā4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL https://aclanthology.org/N19-1423. Dubey et al. (2024) Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024. (12) Esin Durmus, Alex Tamkin, Jack Clark, Jerry Wei, Jonathan Marcus, Joshua Batson, Kunal Handa, Liane Lovitt, Meg Tong, Miles McCain, et al. Evaluating feature steering: A case study in mitigating social biases, 2024. URL https://anthropic. com/research/evaluating-feature-steering. Elazar et al. (2021) Yanai Elazar, Shauli Ravfogel, Alon Jacovi, and Yoav Goldberg. Amnesic probing: Behavioral explanation with amnesic counterfactuals. Transactions of the Association for Computational Linguistics, 9:160ā175, 2021. Florian et al. (2024) Le Bronnec Florian, Verine Alexandre, Negrevergne Benjamin, Chevaleyre Yann, and Allauzen Alexandre. Exploring precision and recall to assess the quality and diversity of llms. arXiv preprint arXiv:2402.10693, 2024. Hendrycks et al. (2020) Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300, 2020. Hendrycks et al. (2021) Dan Hendrycks, Nicholas Carlini, John Schulman, and Jacob Steinhardt. Unsolved problems in ml safety. arXiv preprint arXiv:2109.13916, 2021. Hutchinson et al. (2020) Ben Hutchinson, Vinodkumar Prabhakaran, Emily Denton, Kellie Webster, Yu Zhong, and Stephen Denuyl. Social biases in NLP models as barriers for persons with disabilities. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, p. 5491ā5501, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.487. URL https://aclanthology.org/2020.acl-main.487. Jorgensen et al. (2023) Ole Jorgensen, Dylan Cope, Nandi Schoots, and Murray Shanahan. Improving activation steering in language models with mean-centring. arXiv preprint arXiv:2312.03813, 2023. Leong et al. (2023) Chak Tou Leong, Yi Cheng, Jiashuo Wang, Jian Wang, and Wenjie Li. Self-detoxifying language models via toxification reversal. arXiv preprint arXiv:2310.09573, 2023. Li et al. (2024) Tianlong Li, Xiaoqing Zheng, and Xuanjing Huang. Open the pandoraās box of llms: Jailbreaking llms through representation engineering. arXiv preprint arXiv:2401.06824, 2024. Lin et al. (2022) Stephanie Lin, Jacob Hilton, and Owain Evans. TruthfulQA: Measuring how models mimic human falsehoods. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), p. 3214ā3252, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.229. URL https://aclanthology.org/2022.acl-long.229. Liu et al. (2023) Wenhao Liu, Xiaohua Wang, Muling Wu, Tianlong Li, Changze Lv, Zixuan Ling, Jianhao Zhu, Cenyuan Zhang, Xiaoqing Zheng, and Xuanjing Huang. Aligning large language models with human preferences through representation engineering. arXiv preprint arXiv:2312.15997, 2023. Marks et al. (2024) Samuel Marks, Can Rager, Eric J Michaud, Yonatan Belinkov, David Bau, and Aaron Mueller. Sparse feature circuits: Discovering and editing interpretable causal graphs in language models. arXiv preprint arXiv:2403.19647, 2024. Nadeem et al. (2020) Moin Nadeem, Anna Bethke, and Siva Reddy. Stereoset: Measuring stereotypical bias in pretrained language models, 2020. Ngo (2022) Richard Ngo. The alignment problem from a deep learning perspective. arXiv preprint arXiv:2209.00626, 2022. Nori et al. (2023) Harsha Nori, Nicholas King, Scott Mayer McKinney, Dean Carignan, and Eric Horvitz. Capabilities of gpt-4 on medical challenge problems. arXiv preprint arXiv:2303.13375, 2023. OpenAI (2023) OpenAI. Gpt-4 technical report, 2023. Pan et al. (2022) Alexander Pan, Kush Bhatia, and Jacob Steinhardt. The effects of reward misspecification: Mapping and mitigating misaligned models. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=JYtwGwIL7ye. Park et al. (2023) Joon Sung Park, Joseph C OāBrien, Carrie J Cai, Meredith Ringel Morris, Percy Liang, and Michael S Bernstein. Generative agents: Interactive simulacra of human behavior. arXiv preprint arXiv:2304.03442, 2023. Radford et al. (2019) Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019. Rae et al. (2021) Jack W Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song, John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, et al. Scaling language models: Methods, analysis & insights from training gopher. arXiv preprint arXiv:2112.11446, 2021. Robey et al. (2021) Alexander Robey, Luiz Chamon, George J Pappas, Hamed Hassani, and Alejandro Ribeiro. Adversarial robustness with semi-infinite constrained learning. Advances in Neural Information Processing Systems, 34:6198ā6215, 2021. Robey et al. (2022) Alexander Robey, Luiz Chamon, George J Pappas, and Hamed Hassani. Probabilistically robust learning: Balancing average and worst-case performance. In International Conference on Machine Learning, p. 18667ā18686. PMLR, 2022. Roose (2023) Kevin Roose. A conversation with bingās chatbot left me deeply unsettled. New York Times, 2023. Rƶttger et al. (2023) Paul Rƶttger, Hannah Rose Kirk, Bertie Vidgen, Giuseppe Attanasio, Federico Bianchi, and Dirk Hovy. Xstest: A test suite for identifying exaggerated safety behaviours in large language models. arXiv preprint arXiv:2308.01263, 2023. Schulman et al. (2023) John Schulman, Barret Zoph, Christina Kim, Jacob Hilton, Jacob Menick, Jiayi Weng, Juan Felipe, Ceron Uribe, Liam Fedus, Luke Metz, Michael Pokorny, Rapha Gontijo Lopes, Shengjia Zhao, Arun Vijayvergiya, Eric Sigler, Adam Perelman, Chelsea Voss, Mike Heaton, Joel Parish, Dave Cummings, Rajeev Nayak, Valerie Balcom, David Schnurr, Tomer Kaftan, Chris Hallacy, Nicholas Turley, Noah Deutsch, Vik Goel, Jonathan Ward, Aris Konstantinidis, Wojciech Zaremba, Long Ouyang, Leonard Bogdonoff, Joshua Gross, David Medina, Sarah Yoo, Teddy Lee, Ryan Lowe, Dan Mossing, Joost Huizinga, Roger Jiang, Carroll Wainwright, Diogo Almeida, Steph Lin, Marvin Zhang, Kai Xiao, Katarina Slama, Steven Bills, Alex Gray, Jan Leike, Jakub Pachocki, Phil Tillet, Shantanu Jain, Greg Brockman, Nick Ryder, Alex Paino, Qiming Yuan, Clemens Winter, Ben Wang, Mo Bavarian, Igor Babuschkin, Szymon Sidor, Ingmar Kanitscheider, Mikhail Pavlov, Matthias Plappert, Nik Tezak, Heewoo Jun, William Zhuk, Vitchyr Pong, Lukasz Kaiser, Jerry Tworek, Andrew Carr, Lilian Weng, Sandhini Agarwal, Karl Cobbe, Vineet Kosaraju, Alethea Power, Stanislas Polu, Jesse Han, Raul Puri, Shawn Jain, Benjamin Chess, Christian Gibson, Oleg Boiko, Emy Parparita, Amin Tootoonchian, Kyle Kosic, and Christopher Hesse. Introducing chatgpt. OpenAI blog, 2023. Shalev-Shwartz et al. (2020) Shai Shalev-Shwartz, Shaked Shammah, and Amnon Shashua. On the ethics of building ai in a responsible manner. arXiv preprint arXiv:2004.04644, 2020. Subhash (2023) Varshini Subhash. Can large language models change user preference adversarially? arXiv preprint arXiv:2302.10291, 2023. Tan et al. (2024) Yingshui Tan, Yanshi li, Xiaoyong Zhu, Xingyuan Bu, Wenbo Su, Xiangyu Yue, and Zheng Bo. Truly safe & truly helpful: Achieving harmonious balance for large language model. Openreview, 2024. Taylor et al. (2016) Jessica Taylor, Eliezer Yudkowsky, Patrick LaVictoire, and Andrew Critch. Alignment for advanced machine learning systems. Ethics of Artificial Intelligence, p. 342ā382, 2016. Templeton (2024) Adly Templeton. Scaling monosemanticity: Extracting interpretable features from claude 3 sonnet. Anthropic, 2024. Touvron et al. (2023) Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023. Turner et al. (2023) Alex Turner, Lisa Thiergart, David Udell, Gavin Leech, Ulisse Mini, and Monte MacDiarmid. Activation addition: Steering language models without optimization. arXiv preprint arXiv:2308.10248, 2023. van der Weij et al. (2024) Teun van der Weij, Massimo Poesio, and Nandi Schoots. Extending activation steering to broad skills and multiple behaviours. arXiv preprint arXiv:2403.05767, 2024. Venkit et al. (2022) Pranav Narayanan Venkit, Mukund Srinath, and Shomir Wilson. A study of implicit bias in pretrained language models against people with disabilities. In Proceedings of the 29th International Conference on Computational Linguistics, p. 1324ā1332, Gyeongju, Republic of Korea, October 2022. International Committee on Computational Linguistics. URL https://aclanthology.org/2022.coling-1.113. Wallace et al. (2019) Eric Wallace, Shi Feng, Nikhil Kandpal, Matt Gardner, and Sameer Singh. Universal adversarial triggers for attacking and analyzing NLP. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), p. 2153ā2162, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1221. URL https://aclanthology.org/D19-1221. Wang et al. (2024a) Mengru Wang, Ningyu Zhang, Ziwen Xu, Zekun Xi, Shumin Deng, Yunzhi Yao, Qishen Zhang, Linyi Yang, Jindong Wang, and Huajun Chen. Detoxifying large language models via knowledge editing. arXiv preprint arXiv:2403.14472, 2024a. Wang et al. (2024b) Pengyu Wang, Dong Zhang, Linyang Li, Chenkun Tan, Xinghao Wang, Ke Ren, Botian Jiang, and Xipeng Qiu. Inferaligner: Inference-time alignment for harmlessness through cross-model guidance. arXiv preprint arXiv:2401.11206, 2024b. Wei et al. (2024) Boyi Wei, Kaixuan Huang, Yangsibo Huang, Tinghao Xie, Xiangyu Qi, Mengzhou Xia, Prateek Mittal, Mengdi Wang, and Peter Henderson. Assessing the brittleness of safety alignment via pruning and low-rank modifications. arXiv preprint arXiv:2402.05162, 2024. Weidinger et al. (2022) Laura Weidinger, Jonathan Uesato, Maribeth Rauh, Conor Griffin, Po-Sen Huang, John Mellor, Amelia Glaese, Myra Cheng, Borja Balle, Atoosa Kasirzadeh, Courtney Biles, Sasha Brown, Zac Kenton, Will Hawkins, Tom Stepleton, Abeba Birhane, Lisa Anne Hendricks, Laura Rimell, William Isaac, Julia Haas, Sean Legassick, Geoffrey Irving, and Iason Gabriel. Taxonomy of risks posed by language models. In 2022 ACM Conference on Fairness, Accountability, and Transparency, FAccT ā22, p. 214ā229, New York, NY, USA, 2022. Association for Computing Machinery. ISBN 9781450393522. doi: 10.1145/3531146.3533088. URL https://doi.org/10.1145/3531146.3533088. West (2023) Colin G West. Advances in apparent conceptual physics reasoning in gpt-4. arXiv e-prints, p. arXivā2303, 2023. Wolf et al. (2023) Yotam Wolf, Noam Wies, Yoav Levine, and Amnon Shashua. Fundamental limitations of alignment in large language models. arXiv preprint arXiv:2304.11082, 2023. Wu et al. (2024) Muling Wu, Wenhao Liu, Xiaohua Wang, Tianlong Li, Changze Lv, Zixuan Ling, Jianhao Zhu, Cenyuan Zhang, Xiaoqing Zheng, and Xuanjing Huang. Advancing parameter efficiency in fine-tuning via representation editing. arXiv preprint arXiv:2402.15179, 2024. Xu et al. (2021) Jing Xu, Da Ju, Margaret Li, Y-Lan Boureau, Jason Weston, and Emily Dinan. Bot-adversarial dialogue for safe conversational agents. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, p. 2950ā2968, Online, June 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.naacl-main.235. URL https://aclanthology.org/2021.naacl-main.235. Xu et al. (2024) Zhihao Xu, Ruixuan Huang, Xiting Wang, Fangzhao Wu, Jing Yao, and Xing Xie. Uncovering safety risks in open-source llms through concept activation vector. arXiv preprint arXiv:2404.12038, 2024. Yan et al. (2024) Jianhao Yan, Futing Wang, Yafu Li, and Yue Zhang. Potential and challenges of model editing for social debiasing. arXiv preprint arXiv:2402.13462, 2024. Yu & Sagae (2021) Dian Yu and Kenji Sagae. Automatically exposing problems with neural dialog models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, p. 456ā470, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.37. URL https://aclanthology.org/2021.emnlp-main.37. Yudkowsky (2001) Eliezer Yudkowsky. Creating friendly ai 1.0: The analysis and design of benevolent goal architectures. The Singularity Institute, San Francisco, USA, 2001. Zhang et al. (2024) Shaolei Zhang, Tian Yu, and Yang Feng. Truthx: Alleviating hallucinations by editing large language models in truthful space. arXiv preprint arXiv:2402.17811, 2024. Zou et al. (2023a) Andy Zou, Long Phan, Sarah Chen, James Campbell, Phillip Guo, Richard Ren, Alexander Pan, Xuwang Yin, Mantas Mazeika, Ann-Kathrin Dombrowski, et al. Representation engineering: A top-down approach to ai transparency. arXiv preprint arXiv:2310.01405, 2023a. Zou et al. (2023b) Andy Zou, Zifan Wang, J Zico Kolter, and Matt Fredrikson. Universal and transferable adversarial attacks on aligned language models. arXiv preprint arXiv:2307.15043, 2023b. Appendix A Assumptions In A.1 we introduce our assumptions used in proving theorems 1 and 2. We discuss them in A.2 and provide experiments to check their validity in A.3 A.1 Introduction of assumptions We assume that for small coefficients of representation steering resubscriptr_eritalic_e, the norm of the change to the last hidden layer representation is linear in resubscriptr_eritalic_e: Assumption 1. Let PĪø,re(ā |q)P_Īø,r_e(Ā·|q)Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) be a language model prompted with query q. The change to the last hidden layer representation due to steering with coefficient resubscriptr_eritalic_e, denoted by Ī“ā¢reā¢(q)=r(L)ā¢(q,re)ār(L)ā¢(q,0)subscriptsuperscriptsubscriptsuperscript0Ī“ r_e(q)=r^(L)(q,r_e)-r^(L)(q,0)Ī“ ritalic_e ( q ) = r( L ) ( q , ritalic_e ) - r( L ) ( q , 0 ) satisfies: |Ī“ā¢reā¢(q)|=Ī»ā¢|re|subscriptsubscript|Ī“ r_e(q)|=Ī»|r_e|| Ī“ ritalic_e ( q ) | = Ī» | ritalic_e | (7) For a constant Ī»>00Ī»>0Ī» > 0 that is query dependent. It is used in theorems 1 and 2, to relate the change to the last hidden layer to the coefficients of injected representations. A representation of an answer to a query is defined as the latent space embedding of the answerās token, UTā¢etā¢oā¢kā¢eā¢nsuperscriptsubscriptU^Te_tokenUitalic_T eitalic_t o k e n, where eisubscripte_ieitalic_i is the one-hot vector of the token i and U is the matrix from the last layerās hidden dimension to the vocabulary. We assume that the representations of positive and negative answers to a query are linearly separable, and that the change to the last hidden layer of the model due to representation engineering linearly classifies them with margin Ī Ī: Assumption 2. Given a query q, the change to the last hidden layer of a model due to steering, Ī“ā¢reā¢(q)=r(L)ā¢(q,re)ār(L)ā¢(q,0)subscriptsuperscriptsubscriptsuperscript0Ī“ r_e(q)=r^(L)(q,r_e)-r^(L)(q,0)Ī“ ritalic_e ( q ) = r( L ) ( q , ritalic_e ) - r( L ) ( q , 0 ) , linearly classifies the representations of positive and negative answers to a query q with margin Ī Ī, where the positive and negative answers are defined with respect to a behavior scoring function B:Ī£āā1,+1:āĪ£11B: ā\-1,+1\B : Ī£ ā - 1 , + 1 : mā¢iā¢ni:Bā¢(i)>0,j:Bā¢(j)<0ā¢āØĪ“ā¢reā¢(q)|Ī“ā¢reā¢(q)|,UTā¢eiāUTā¢ejā©>Īsubscript:0:0subscriptsubscriptsuperscriptsubscriptsuperscriptsubscriptĪmin_i:B(i)>0,j:B(j)<0 \ Ī“ r_e(q)|Ī“ r_% e(q)|,U^Te_i-U^Te_j \> i nitalic_i : B ( i ) > 0 , j : B ( j ) < 0 ⨠divide start_ARG Ī“ ritalic_e ( q ) end_ARG start_ARG | Ī“ ritalic_e ( q ) | end_ARG , Uitalic_T eitalic_i - Uitalic_T eitalic_j ā© > Ī (8) That is to say, that on the axis defined by Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ), positive and negative representations can be separated, and the minimal distance between representations of positive and negative answers on it is Ī Ī. It is used in theorm 1, to obtain that the probability of the aligned answers increases w.r.t.the misaligned answers as the coefficients of the injected representations increases. Note that the above assumption can be relaxed from a hard margin to a soft margin assumption, where Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ) classifies the representations of positive and negative answers, but part of the misaligned/aligned answersā representations are misclassified as aligned/misaligned. This yields similar results to theorem 1 that are shown in appendix H. For queries whose topic is unrelated to the behavior with respect to which steering is performed, we expect the change to the last layer representation to be somewhat random on the highest probability tokens as they answer a question that is unrelated to the behavior whose vectors are injected to the model. Intuitively, the change to the final layer representation has no preference for a correct token over an incorrect token, so an incorrect answer is just as likely to be on one side or the other of the plane defined by the vertical Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ) that passes through the correct answer representation. Assumption 3. When sampling an answer to a query q that is unrelated to the behavior of steering, the vector Ī“ā¢reā¢(q)=r(L)ā¢(q,re)ār(L)ā¢(q,0)subscriptsuperscriptsubscriptsuperscript0Ī“ r_e(q)=r^(L)(q,r_e)-r^(L)(q,0)Ī“ ritalic_e ( q ) = r( L ) ( q , ritalic_e ) - r( L ) ( q , 0 ), i.e., the resulting change to the last hidden layer representation due to the steering vectors from all layers, is random with the following coordinate-wise distribution on the T highest probability tokens making 1āϵ1italic-ϵ1- 1 - ϵ of the probability mass: āØĪ“ā¢reā¢(q)|Ī“ā¢reā¢(q)|,UTā¢eiā©ā¼Dsimilar-tosubscriptsubscriptsuperscriptsubscript Ī“ r_e(q)|Ī“ r_e(q)|,U^Te_i D⨠divide start_ARG Ī“ ritalic_e ( q ) end_ARG start_ARG | Ī“ ritalic_e ( q ) | end_ARG , Uitalic_T eitalic_i ā© ā¼ D (9) Where D is some continuous distribution with variance Ļ2>0superscript20Ļ^2>0Ļ2 > 0. This defines a random directionality of Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ) w.r.t. the representations of answers. It is used in theorem 2 to formalize that steering is a āperpendicular" direction to the queryās relevant answer representations. A.2 Discussion of assumptions Linear last hidden layer change (assumption 1): Intuitively, when adding vectors of relatively small norms to each layer, the first order Taylor expansion with respect to the vectors is good, and it scales linearly with the coefficients of the vectors. We observe experimentally in subsection A.3 that for small coefficients, the change is indeed approximately linear. Note that it suffices to assume |Ī“ā¢reā¢(q)|subscript|Ī“ r_e(q)|| Ī“ ritalic_e ( q ) | grows monotonically with |re|subscript|r_e|| ritalic_e |, but for simplicity and due to experimental observations we assume the linear dependence. Linear classification with margin Ī Ī (assumption 2): We expect the representation engineered vectors resubscriptr_eritalic_e to be good classifiers because they are obtained by methods of finding directions in the latent space that maximize the distance between representations of positive and negative textual statements. For example, in Zou et al. (2023a) the first principle component is used as a steering vector, obtained via pā¢cā¢a1=aā¢rā¢gā¢mā¢aā¢xvā¢gā¢oā¢oā¢d,bā¢aā¢dā¢[|āØv,rgā¢oā¢oā¢dārbā¢aā¢dā©|2]subscript1subscriptsubscriptdelimited-[]superscriptsubscriptsubscript2pca_1=argmax_v\E_good,bad[| v,r_good-r_bad |^% 2]\p c a1 = a r g m a xitalic_v blackboard_Eg o o d , b a d [ | ⨠v , ritalic_g o o d - ritalic_b a d ā© |2 ] and in Jorgensen et al. (2023) the steering vector is obtained as the average of difference between positive and negative statements 1Nā¢āi=1N(rgā¢oā¢oā¢diārbā¢aā¢di)1superscriptsubscript1subscriptsuperscriptsubscriptsuperscript 1N _i=1^N(r^i_good-r^i_bad)divide start_ARG 1 end_ARG start_ARG N end_ARG āi = 1N ( ritalic_iitalic_g o o d - ritalic_iitalic_b a d ). In these examples, rgā¢oā¢oā¢dsubscriptr_goodritalic_g o o d and rbā¢aā¢dsubscriptr_badritalic_b a d are representations of queries and not the latent space embedding of the answers, as in the definition of Ī Ī-representation-separability, but we expect the steering vectors to behave similarly on them. In subsection A.3, we show that indeed Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ) clusters positive and negative responses to harmful queries in the modelās latent space. In appendix H we also formulate a theorem equivalent to theorem 1, but with an imperfect classifier. Random directionality of last hidden layer change (assumption 3): When answering queries that are unrelated to the behavior being enhanced by steering, the directionality of the injected vectors are expected to be random w.r.t. the representations of the answers to the query. Therefore, the highest probability tokens are expected to be injected with random noise. We validate this in the next subsection, by looking at the noise injected into the top 10 highest probability tokens in knowledge queries (which typically make over 90% of the probability mass). A.3 Experiments for assumptions Here we empirically check the validity of our assumptions and empirically estimate the values of the parameters in the bounds. The experiments were performed on Llama 2 13B and Llama 2 13B chat. We first verify a linear relation between the steering vector coefficient resubscriptr_eritalic_e to the last hidden layer change of assumption 1, which yields Ī». Then, we verify the normal distribution assumption 3 and the linear classification of assumption 2. Norm of final hidden layer change is linear in injected vectors For a query q we define Ī“ā¢reā¢(q)=r(L)ā¢(q,re)ār(L)ā¢(q,0)subscriptsuperscriptsubscriptsuperscript0Ī“ r_e(q)=r^(L)(q,r_e)-r^(L)(q,0)Ī“ ritalic_e ( q ) = r( L ) ( q , ritalic_e ) - r( L ) ( q , 0 ) as the change of the representation of the query in the final layer. where r(L)ā¢(q,0)superscript0r^(L)(q,0)r( L ) ( q , 0 ) is the representation if we injected no vector (the default model representation) and r(L)ā¢(q,re)superscriptsubscriptr^(L)(q,r_e)r( L ) ( q , ritalic_e ) is the representation given that we inject a vector of norm resubscriptr_eritalic_e at a range of layers. We show that the norm of Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ) increases linearly with resubscriptr_eritalic_e when resubscriptr_eritalic_e is not too large (figure 6). Here we use the above mentioned fairness PCA vectors. We average on different queries from a few datasets taken from MMLU. In practice we look at Uā¢Ī“ā¢reā¢(q)subscriptUĪ“ r_e(q)U Ī“ ritalic_e ( q ), where U is the transformation taking from the final layer representation to the logits vector. Since this is a linear transformation, showing a linear relationship between resubscriptr_eritalic_e and |Uā¢Ī“ā¢reā¢(q)|subscript|UĪ“ r_e(q)|| U Ī“ ritalic_e ( q ) | implies a linear relationship between resubscriptr_eritalic_e and |Ī“ā¢reā¢(q)|subscript|Ī“ r_e(q)|| Ī“ ritalic_e ( q ) |. Figure 6: Linear increase in the norm of Uā¢Ī“ā¢reā¢(q)subscriptUĪ“ r_e(q)U Ī“ ritalic_e ( q ) for small coefficients, when injected with āracist" vectors. In figures 7 and 8 we plot the change in norm for Llama 2 13B chat (injected with racist vectors) and Llama 2 13B (injected with not racist vectors) respectively, on the datasets āinternational law", āmedical genetics" and āhigh school computer science". We add fitted curves to estimate Ī». We find that it is in the range 40ā60406040-6040 - 60. Figure 7: Norm of the final hidden layer representation change as a function of representation engineering coefficient, for Llama 2 13B chat, on different MMLU datasets. The fitted linear curves estimate Ī». Figure 8: Norm of the final hidden layer representation change as a function of representation engineering coefficient, for Llama 2 13B, on different MMLU datasets. The fitted linear curves estimate Ī». Random logit noise assumption As proposed in assumption 3, we show here that the projection of a given answer on the representation change Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ) is random. (Assuming the question asked is not connected to the property we are changing with the representation engineering). In assumption 3 we looked at the normalized change: āØĪ“ā¢reā¢(q)||Ī“ā¢reā¢(q)||,UTā¢eiā©subscriptsubscriptsuperscriptsubscript Ī“ r_e(q) Ī“ r_e(q) ,U^Te_% i ⨠divide start_ARG Ī“ ritalic_e ( q ) end_ARG start_ARG | | Ī“ ritalic_e ( q ) | | end_ARG , Uitalic_T eitalic_i ā©. Here we will look at āØĪ“ā¢reā¢(q),UTā¢eiā©subscriptsuperscriptsubscript Ī“ r_e(q),U^Te_i ⨠Γ ritalic_e ( q ) , Uitalic_T eitalic_i ā©, so we expect the distribution to be: āØĪ“ā¢reā¢(q),UTā¢eiā©ā¼||Ī“ā¢reā¢(q)||ā Dsimilar-tosubscriptsuperscriptsubscriptā subscript Ī“ r_e(q),U^Te_i Ī“ r_e(q) % Ā· D⨠Γ ritalic_e ( q ) , Uitalic_T eitalic_i ā© ā¼ | | Ī“ ritalic_e ( q ) | | ā D Meaning the standard deviation scales linearly with the norm of Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ). Since resubscriptr_eritalic_e scales linearly with Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ), we expect the standard deviation to also scale linearly with resubscriptr_eritalic_e. To measure the effective randomness, we look at āØĪ“ā¢reā¢(q),UTā¢(eiāecā¢oā¢rā¢rā¢eā¢cā¢t)ā©subscriptsuperscriptsubscriptsubscript Ī“ r_e(q),U^T(e_i-e_correct) ⨠Γ ritalic_e ( q ) , Uitalic_T ( eitalic_i - eitalic_c o r r e c t ) ā©, which shows explicitly that the correct answer logit change is sometimes enhanced and sometimes decreased relatively to the incorrect answers. We will observe that the noise is approximately normal. To create the plot, for each question in a dataset, we look at the top 10 answers ei,iā[10]subscriptdelimited-[]10e_i,iā[10]eitalic_i , i ā [ 10 ] (with no representation engineering). We note that experimentally, the top 10 tokens make the majority of the probability mass (over 90%). Now for a given resubscriptr_eritalic_e coefficient, we calculate the projection of these answers on Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ). We then aggregate these projections for all the questions in a few dataset and look at their histogram and at their standard deviation. We repeat this for different resubscriptr_eritalic_e norms. Figure 9: (a) ((b)) Distribution of the change in token logits minus the logit of the correct answer of Llama 2 13B chat when injected with racist (harmful) vectors. As can be seen, it is approximately normal, and in (c) and (d) the standard deviation grows linearly with the coefficient size resubscriptr_eritalic_e, which is linear in |Ī“ā¢reā¢(q)|subscript|Ī“ r_e(q)|| Ī“ ritalic_e ( q ) |. Figure 10: (a) ((b)) Distribution of the change in token logits minus the logit of the correct answer of Llama 2 13B chat when injected with harmless (not-racist) vectors. As can be seen, it is approximately normal, and in (c) and (d) the standard deviation grows linearly with the coefficient size resubscriptr_eritalic_e, which is linear in |Ī“ā¢reā¢(q)|subscript|Ī“ r_e(q)|| Ī“ ritalic_e ( q ) |. The tangent of the curve of figure 9c,d is Ī»ā¢ĻĪ»ĻĪ» Ļ, as the curve is the standard deviation of āØĪ“ā¢reā¢(q)|Ī“ā¢reā¢(q)|,UTā¢eiā©ā |Ī“ā¢reā¢(q)|=āØĪ“ā¢reā¢(q)|Ī“ā¢reā¢(q)|,UTā¢eiā©ā Ī»ā¢reā subscriptsubscriptsuperscriptsubscriptsubscriptā subscriptsubscriptsuperscriptsubscriptsubscript Ī“ r_e(q)|Ī“ r_e(q)|,U^Te_i Ā·|Ī“ r% _e(q)|= Ī“ r_e(q)|Ī“ r_e(q)|,U^Te_i % Ā·Ī» r_e⨠divide start_ARG Ī“ ritalic_e ( q ) end_ARG start_ARG | Ī“ ritalic_e ( q ) | end_ARG , Uitalic_T eitalic_i ā© ā | Ī“ ritalic_e ( q ) | = ⨠divide start_ARG Ī“ ritalic_e ( q ) end_ARG start_ARG | Ī“ ritalic_e ( q ) | end_ARG , Uitalic_T eitalic_i ā© ā Ī» ritalic_e, from assumption 1, and the inner product is a random variable of standard deviation Ļ, hence the tangent is Ī»ā¢ĻĪ»ĻĪ» Ļ. We observe that the noise is approximately normal. From the linear curve, we estimate Ī»ā¢Ļ=0.50.5Ī»Ļ=0.5Ī» Ļ = 0.5, thus Ī»ā¢Ļā¢Ī²ā0.8ā 0.5ā 0.80.5Ī»Ļβā 0.8Ā· 0.5Ī» Ļ Ī² ā 0.8 ā 0.5, as it is the mean of a half-normal distribution with parameter Ī»ā¢ĻĪ»ĻĪ» Ļ, which is approximately 0.8ā¢Ī»ā¢Ļ0.80.8Ī» 0.8 Ī» Ļ. Similarly, for the pretrained model, we find that Ī»ā¢Ļ=0.20.2Ī»Ļ=0.2Ī» Ļ = 0.2 and 0.10.10.10.1 for fairness and harmlessness respectively. Clustering of positive and negative answers to harmful queries Here we aim to estimate how well Ī Ī-representation-separability (definition 2) works in practice. The condition is equivalent to: āØĪ“ā¢reā¢(q),UTā¢(egā¢oā¢oā¢dāebā¢aā¢d)ā©ā„|Ī“ā¢reā¢(q)|ā Īsubscriptsuperscriptsubscriptsubscriptā subscriptĪ Ī“ r_e(q),U^T(e_good-e_bad) ā„|Ī“ r_e(q)|Ā· ⨠Γ ritalic_e ( q ) , Uitalic_T ( eitalic_g o o d - eitalic_b a d ) ā© ā„ | Ī“ ritalic_e ( q ) | ā Ī (10) And by assumption 1, it is equivalent to: āØĪ“ā¢reā¢(q),UTā¢(egā¢oā¢oā¢dāebā¢aā¢d)ā©ā„Īā¢Ī»ā resubscriptsuperscriptsubscriptsubscriptā Īsubscript Ī“ r_e(q),U^T(e_good-e_bad) ℠λ· r_% e⨠Γ ritalic_e ( q ) , Uitalic_T ( eitalic_g o o d - eitalic_b a d ) ā© ā„ Ī Ī» ā ritalic_e (11) In figure 11 and 12, we plot the distance between the centers of representation clusters for positive and negative answers to harmful queries as the norm of harmful vectors is increased, for Llama 2 13B chat and Llama 2 13B respectively. As can be seen, the distance between the clusters increases, which corresponds to an increase in ā¢[āØĪ“ā¢reā¢(q),UTā¢(egā¢oā¢oā¢dāebā¢aā¢d)ā©]delimited-[]subscriptsuperscriptsubscriptsubscriptE[ Ī“ r_e(q),U^T(e_good-e_bad) ]blackboard_E [ ⨠Γ ritalic_e ( q ) , Uitalic_T ( eitalic_g o o d - eitalic_b a d ) ā© ]. We can define a range of coefficients in which the increase is bounded from below by a linear curve of the form in equation 11, meaning that the change in the modelās representation separates the positive and negative answer representations, similarly to the definition of Ī Ī-representation separability, but with mean instead of min. Thus by equation 11, the tangent of the lower bounding lines of figures 11 and 12 are an estimate for Īā¢Ī»Ī λΠλ. From, this we get that Īā¢Ī»Ī λΠλ is approximately 0.1ā0.30.10.30.1-0.30.1 - 0.3. In section 4, we obtained values of Īā¢Ī»Ī λΠλ in the rage 0.5ā30.530.5-30.5 - 3 from the free parameter fit on the bound of theorem 2 to the data. The difference between these two ranges is attributed to the method of the empirical estimation of Ī Ī from the linear classification condition that looks for an upper bound on it on the entire resubscriptr_eritalic_e range, while the main change in alignment in figure 4 occurs in a more specific range, where the upper bound of Ī Ī is evidently bigger. Figure 11: Separation between representation clusters of positive and negative behavior tokens induced by Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ) on Llama 2 13B chat for three harmful instructions from the AdvBench dataset. Figure 12: Separation between representation clusters of positive and negative behavior tokens induced by Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ) on Llama 2 13B for three harmful instructions from the AdvBench dataset. In practice, the good and bad tokens were chosen beforehand as the top 40 tokens of the models when representation engineering is applied and when it is not applied (meaning in one case the model is aligned and in the other it is not). Appendix B Proof of theorem 1 The theorem utilizes assumptions 1 and 2. The behavior expectation is: B[PĪø,re(ā |q)]=āa+āgā¢oā¢oā¢dPĪø,reā¢(a+|q)āāaāābā¢aā¢dPĪø,reā¢(aā|q)āa+āgā¢oā¢oā¢dPĪø,reā¢(a+|q)+āaāābā¢aā¢dPĪø,reā¢(aā|q)=B[P_Īø,r_e(Ā·|q)]= _a_+ā goodP_Īø,r_e(a_+|% q)- _a_-ā badP_Īø,r_e(a_-|q) _a_+ā goodP_Īø% ,r_e(a_+|q)+ _a_-ā badP_Īø,r_e(a_-|q)=B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] = divide start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( a+ | q ) - āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( a- | q ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( a+ | q ) + āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( a- | q ) end_ARG = (12) =āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q)+Ī“ā¢rā¢(q),UTā¢ea+ā©)āāaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q)+Ī“ā¢rā¢(q),UTā¢eaāā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q)+Ī“ā¢rā¢(q),UTā¢ea+ā©)+āaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q)+Ī“ā¢rā¢(q),UTā¢eaāā©)=absentsubscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscriptabsent= _a_+ā goodexp( r(q)+Ī“ r(q),U^Te_a_+ )% - _a_-ā badexp( r(q)+Ī“ r(q),U^Te_a_- ) _% a_+ā goodexp( r(q)+Ī“ r(q),U^Te_a_+ )+ _a_-% ā badexp( r(q)+Ī“ r(q),U^Te_a_- )== divide start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) + Ī“ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) - āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) + Ī“ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) + Ī“ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) + āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) + Ī“ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG = (13) Where rā¢(q)r(q)r ( q ) is the final hidden layer representation and Ī“ā¢rā¢(q)Ī“ r(q)Ī“ r ( q ) is the change to the last hidden layer due to steering on the previous layers. a+āgā¢oā¢oā¢dsubscripta_+ā gooda+ ā g o o d and aāābā¢aā¢dsubscripta_-ā bada- ā b a d denote the aligned and misaligned answers respectively, i.e. Bā¢(a±)=±1subscriptplus-or-minusplus-or-minus1B(a_±)=± 1B ( a± ) = ± 1. =1āāaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q)+Ī“ā¢rā¢(q),UTā¢eaāā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q)+Ī“ā¢rā¢(q),UTā¢ea+ā©)1+āaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q)+Ī“ā¢rā¢(q),UTā¢eaāā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q)+Ī“ā¢rā¢(q),UTā¢ea+ā©)=absent1subscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscript1subscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscriptabsent= 1- _a_-ā badexp( r(q)+Ī“ r(q),U^Te_a_-% ) _a_+ā goodexp( r(q)+Ī“ r(q),U^Te_a_+% )1+ _a_-ā badexp( r(q)+Ī“ r(q),U^Te_a_% - ) _a_+ā goodexp( r(q)+Ī“ r(q),U^Te_a_+% )== divide start_ARG 1 - divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) + Ī“ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) + Ī“ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) end_ARG end_ARG start_ARG 1 + divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) + Ī“ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) + Ī“ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) end_ARG end_ARG = (14) =1āāaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢eaāā©)ā¢eā¢xā¢pā¢(āØĪ“ā¢rā¢(q),UTā¢eaāā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢ea+ā©)ā¢eā¢xā¢pā¢(āØĪ“ā¢rā¢(q),UTā¢ea+ā©)1+āaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢eaāā©)ā¢eā¢xā¢pā¢(āØĪ“ā¢rā¢(q),UTā¢eaāā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢ea+ā©)ā¢eā¢xā¢pā¢(āØĪ“ā¢rā¢(q),UTā¢ea+ā©)=absent1subscriptsubscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptsubscript1subscriptsubscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptsubscriptabsent= 1- _a_-ā badexp( r(q),U^Te_a_- )exp(% Ī“ r(q),U^Te_a_- ) _a_+ā goodexp( r(q% ),U^Te_a_+ )exp( Ī“ r(q),U^Te_a_+ )1+% _a_-ā badexp( r(q),U^Te_a_- )exp( % Ī“ r(q),U^Te_a_- ) _a_+ā goodexp( r(q),U^T% e_a_+ )exp( Ī“ r(q),U^Te_a_+ )== divide start_ARG 1 - divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) e x p ( ⨠Γ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) e x p ( ⨠Γ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) end_ARG end_ARG start_ARG 1 + divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) e x p ( ⨠Γ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) e x p ( ⨠Γ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) end_ARG end_ARG = (15) Let us look at the fraction that appears in the numerator and denominator: āaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢eaāā©)ā¢eā¢xā¢pā¢(āØĪ“ā¢rā¢(q),UTā¢eaāā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢ea+ā©)ā¢eā¢xā¢pā¢(āØĪ“ā¢rā¢(q),UTā¢ea+ā©)<subscriptsubscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptsubscriptabsent _a_-ā badexp( r(q),U^Te_a_- )exp( % Ī“ r(q),U^Te_a_- ) _a_+ā goodexp( r(q),U^T% e_a_+ )exp( Ī“ r(q),U^Te_a_+ )<divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) e x p ( ⨠Γ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) e x p ( ⨠Γ r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) end_ARG < (16) <āaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢eaāā©)ā maxaāā²ābā¢aā¢dā”eā¢xā¢pā¢(āØĪ“ā¢rā¢(q),UTā¢eaāā²ā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢ea+ā©)ā mina+ā²āgā¢oā¢oā¢dā”eā¢xā¢pā¢(āØĪ“ā¢rā¢(q),UTā¢ea+ā²ā©)=absentsubscriptsubscriptā superscriptsubscriptsubscriptsubscriptsubscriptsuperscriptā²subscriptsubscriptsuperscriptā²subscriptsubscriptā superscriptsubscriptsubscriptsubscriptsubscriptsuperscriptā²subscriptsubscriptsuperscriptā²absent< _a_-ā badexp( r(q),U^Te_a_- )Ā· _a^% _-ā bad\exp( Ī“ r(q),U^Te_a _- )\% _a_+ā goodexp( r(q),U^Te_a_+ )Ā· _a^% _+ā goodexp( Ī“ r(q),U^Te_a _+ )=< divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) ā maxitalic_aā² start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠Γ r ( q ) , Uitalic_T eitalic_aā² start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) ā minitalic_aā² start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠Γ r ( q ) , Uitalic_T eitalic_aā² start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) end_ARG = (17) Moving the maximum in the numerator to the denominator turns it into a minimum and the exponentās argument becomes negative, we obtain a product of two minimum terms, which we can jointly write as: =āaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢eaāā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢ea+ā©)ā 1mina+ā²āgā¢oā¢oā¢d,aāābā¢aā¢dā”eā¢xā¢pā¢(āØĪ“ā¢rā¢(q),UTā¢ea+ā²āUTā¢eaāā²ā©)absentā subscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscript1subscriptformulae-sequencesubscriptsuperscriptā²subscriptsuperscriptsubscriptsubscriptsuperscriptā²subscriptsubscriptsuperscriptā²= _a_-ā badexp( r(q),U^Te_a_- ) _a_+% ā goodexp( r(q),U^Te_a_+ )Ā· 1 _a % _+ā good,a_-ā badexp( Ī“ r(q),U^Te_a _+-U^T% e_a _- )= divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) end_ARG ā divide start_ARG 1 end_ARG start_ARG minitalic_aā² start_POSTSUBSCRIPT + ā g o o d , a- ā b a d end_POSTSUBSCRIPT e x p ( ⨠Γ r ( q ) , Uitalic_T eitalic_aā² start_POSTSUBSCRIPT + end_POSTSUBSCRIPT - Uitalic_T eitalic_aā² start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG (18) As the exponent is a monotonic function, we can insert the minimum into the exponent: =āaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢eaāā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢ea+ā©)ā 1eā¢xā¢pā¢(mina+ā²āgā¢oā¢oā¢d,aāābā¢aā¢dā”āØĪ“ā¢rā¢(q)|Ī“ā¢rā¢(q)|,UTā¢ea+ā²āUTā¢eaāā²ā©ā |Ī“ā¢rā¢(q)|)absentā subscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscript1ā subscriptformulae-sequencesubscriptsuperscriptā²subscriptsuperscriptsubscriptsubscriptsuperscriptā²subscriptsubscriptsuperscriptā²= _a_-ā badexp( r(q),U^Te_a_- ) _a_+% ā goodexp( r(q),U^Te_a_+ )Ā· 1exp( _a^% _+ā good,a_-ā bad Ī“ r(q)|Ī“ r(q)|,U^T% e_a _+-U^Te_a _- Ā·|Ī“ r(q)|)= divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ā© ) end_ARG ā divide start_ARG 1 end_ARG start_ARG e x p ( minitalic_aā² start_POSTSUBSCRIPT + ā g o o d , a- ā b a d end_POSTSUBSCRIPT ⨠divide start_ARG Ī“ r ( q ) end_ARG start_ARG | Ī“ r ( q ) | end_ARG , Uitalic_T eitalic_aā² start_POSTSUBSCRIPT + end_POSTSUBSCRIPT - Uitalic_T eitalic_aā² start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ā | Ī“ r ( q ) | ) end_ARG (19) From Ī Ī margin linear classification of UTā¢a+a+āgā¢oā¢oā¢dsubscriptsuperscriptsubscriptsubscript\U^Ta_+\_a_+ā good Uitalic_T a+ a start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT and UTā¢aāaāāgā¢oā¢oā¢dsubscriptsuperscriptsubscriptsubscript\U^Ta_-\_a_-ā good Uitalic_T a- a start_POSTSUBSCRIPT - ā g o o d end_POSTSUBSCRIPT by Ī“ā¢rā¢(q)|Ī“ā¢rā¢(q)| Ī“ r(q)|Ī“ r(q)|divide start_ARG Ī“ r ( q ) end_ARG start_ARG | Ī“ r ( q ) | end_ARG (assumption 2), the minimum in the denominator is larger than Ī Ī: <āaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢eaāā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢ea+āUTā¢eaāā©)ā 1eā¢xā¢pā¢(Īā¢|Ī“ā¢r|)absentā subscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptsubscript1Ī< _a_-ā badexp( r(q),U^Te_a_- ) _a_+% ā goodexp( r(q),U^Te_a_+-U^Te_a_- )Ā· 1% exp( |Ī“ r|)< divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT - Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG ā divide start_ARG 1 end_ARG start_ARG e x p ( Ī | Ī“ r | ) end_ARG (20) Plugging this back in to the behavior expectation, we obtain: B[PĪø,re(ā |q)]>1āāaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢eaāā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢ea+āUTā¢eaāā©)ā 1eā¢xā¢pā¢(Īā¢|Ī“ā¢r|)1+āaāābā¢aā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢eaāā©)āa+āgā¢oā¢oā¢deā¢xā¢pā¢(āØrā¢(q),UTā¢ea+āUTā¢eaāā©)ā 1eā¢xā¢pā¢(Īā¢|Ī“ā¢r|)=B[P_Īø,r_e(Ā·|q)]> 1- _a_-ā badexp( r(q)% ,U^Te_a_- ) _a_+ā goodexp( r(q),U^Te_a_+-U% ^Te_a_- )Ā· 1exp( |Ī“ r|)1+ _a_-% ā badexp( r(q),U^Te_a_- ) _a_+ā goodexp(% r(q),U^Te_a_+-U^Te_a_- )Ā· 1exp( |% Ī“ r|)=B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] > divide start_ARG 1 - divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT - Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG ā divide start_ARG 1 end_ARG start_ARG e x p ( Ī | Ī“ r | ) end_ARG end_ARG start_ARG 1 + divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT - Uitalic_T eitalic_a start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ā© ) end_ARG ā divide start_ARG 1 end_ARG start_ARG e x p ( Ī | Ī“ r | ) end_ARG end_ARG = (21) =1āāaāābā¢aā¢dPĪøā¢(aā|q)āa+āgā¢oā¢oā¢dPĪøā¢(a+|q)ā¢eā¢xā¢pā¢(āĪā¢|Ī“ā¢r|)1+āaāābā¢aā¢dPĪøā¢(aā|q)āa+āgā¢oā¢oā¢dPĪøā¢(a+|q)ā¢eā¢xā¢pā¢(āĪā¢|Ī“ā¢r|)absent1subscriptsubscriptsubscriptconditionalsubscriptsubscriptsubscriptsubscriptconditionalsubscriptĪ1subscriptsubscriptsubscriptconditionalsubscriptsubscriptsubscriptsubscriptconditionalsubscriptĪ= 1- _a_-ā badP_Īø(a_-|q) _a_+ā goodP_% Īø(a_+|q)exp(- |Ī“ r|)1+ _a_-ā badP_Īø% (a_-|q) _a_+ā goodP_Īø(a_+|q)exp(- |Ī“ r|)= divide start_ARG 1 - divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) end_ARG e x p ( - Ī | Ī“ r | ) end_ARG start_ARG 1 + divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) end_ARG e x p ( - Ī | Ī“ r | ) end_ARG (22) =tā¢aā¢nā¢hā¢(Īā¢|Ī“ā¢r|ālnā”(āaāābā¢aā¢dPĪøā¢(aā|q)āa+āgā¢oā¢oā¢dPĪøā¢(a+|q))2)absentāĪsubscriptsubscriptsubscriptconditionalsubscriptsubscriptsubscriptsubscriptconditionalsubscript2=tanh( |Ī“ r|- ( _a_-ā badP_Īø(a_-|q)% _a_+ā goodP_Īø(a_+|q))2)= t a n h ( divide start_ARG Ī | Ī“ r | - ln ( divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) end_ARG ) end_ARG start_ARG 2 end_ARG ) (23) Then, notice that: āaāābā¢aā¢dPĪøā¢(aā|q)āa+āgā¢oā¢oā¢dPĪøā¢(a+|q)=1āB01+B0subscriptsubscriptsubscriptconditionalsubscriptsubscriptsubscriptsubscriptconditionalsubscript1subscript01subscript0 _a_-ā badP_Īø(a_-|q) _a_+ā goodP_Īø(a% _+|q)= 1-B_01+B_0divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) end_ARG = divide start_ARG 1 - B0 end_ARG start_ARG 1 + B0 end_ARG (24) Where B0=B[PĪø(ā |q)]B_0=B[P_Īø(Ā·|q)]B0 = B [ Pitalic_Īø ( ā | q ) ], and that: aā¢rā¢cā¢tā¢aā¢nā¢hā¢(B0)=ā12ā¢lnā”1āB01+B0āsubscript0121subscript01subscript0arctanh(B_0)=- 12 1-B_01+B_0a r c t a n h ( B0 ) = - divide start_ARG 1 end_ARG start_ARG 2 end_ARG ln divide start_ARG 1 - B0 end_ARG start_ARG 1 + B0 end_ARG (25) Thus we obtain: B[PĪø,re(ā |q)]>tanh(Īā¢|Ī“ā¢rā¢(q)|2+arctanh(B0))B[P_Īø,r_e(Ā·|q)]>tanh( |Ī“ r(q)|2+arctanh(B_0))B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] > t a n h ( divide start_ARG Ī | Ī“ r ( q ) | end_ARG start_ARG 2 end_ARG + a r c t a n h ( B0 ) ) (26) Lastly, note that for coefficients that are not too large, |Ī“ā¢rā¢(q)||Ī“ r(q)|| Ī“ r ( q ) | is proportional to the injected vector coefficient resubscriptr_eritalic_e (assumption 1), hence: B[PĪø,re(ā |q)]>tanh(Īā¢Ī»2ā re+arctanh(B0))B[P_Īø,r_e(Ā·|q)]>tanh( Ī»2Ā· r_e+arctanh(B% _0))B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] > t a n h ( divide start_ARG Ī Ī» end_ARG start_ARG 2 end_ARG ā ritalic_e + a r c t a n h ( B0 ) ) (27) Where Ī» is the coefficient relating resubscriptr_eritalic_e to |Ī“ā¢rā¢(q)||Ī“ r(q)|| Ī“ r ( q ) |. Appendix C Proof of theorem 2 The theorem utilizes assumptions 1 and 3. Notice that: PĪø,reā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)=PĪø,reā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)1=PĪø,reā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)PĪø,reā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)+āiāiā¢nā¢cā¢oā¢rā¢rā¢eā¢cā¢tPĪø,reā¢(ai|q)=subscriptsubscriptconditionalsubscriptsubscriptsubscriptconditionalsubscript1subscriptsubscriptconditionalsubscriptsubscriptsubscriptconditionalsubscriptsubscriptsubscriptsubscriptconditionalsubscriptabsentP_Īø,r_e(a_correct|q)= P_Īø,r_e(a_correct|q)1=% P_Īø,r_e(a_correct|q)P_Īø,r_e(a_correct|q)+ _i% ā incorrectP_Īø,r_e(a_i|q)=Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( aitalic_c o r r e c t | q ) = divide start_ARG Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( aitalic_c o r r e c t | q ) end_ARG start_ARG 1 end_ARG = divide start_ARG Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( aitalic_c o r r e c t | q ) end_ARG start_ARG Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( aitalic_c o r r e c t | q ) + āi ā i n c o r r e c t Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( aitalic_i | q ) end_ARG = (28) =PĪøā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)PĪøā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)+āiāiā¢nā¢cā¢oā¢rā¢rā¢eā¢cā¢tPĪøā¢(ai|q)ā¢eāØĪ“ā¢reā¢(q),UTā¢(eiāecā¢oā¢rā¢rā¢eā¢cā¢tā¢(q))ā©ā¤absentsubscriptconditionalsubscriptsubscriptconditionalsubscriptsubscriptsubscriptconditionalsubscriptsuperscriptsubscriptsuperscriptsubscriptsubscriptabsent= P_Īø(a_correct|q)P_Īø(a_correct|q)+ _iā incorrect% P_Īø(a_i|q)e Ī“ r_e(q),U^T(e_i-e_correct(q))% ā¤= divide start_ARG Pitalic_Īø ( aitalic_c o r r e c t | q ) end_ARG start_ARG Pitalic_Īø ( aitalic_c o r r e c t | q ) + āi ā i n c o r r e c t Pitalic_Īø ( aitalic_i | q ) e⨠Γ ritalic_e ( q ) , U start_POSTSUPERSCRIPT T ( eitalic_i - eitalic_c o r r e c t ( q ) ) ā© end_POSTSUPERSCRIPT end_ARG ⤠(29) Denote Xi=āØĪ“ā¢reā¢(q)|Ī“ā¢reā¢(q)|,UTā¢eiā©subscriptsubscriptsubscriptsuperscriptsubscriptX_i= Ī“ r_e(q)|Ī“ r_e(q)|,U^Te_i _i = ⨠divide start_ARG Ī“ ritalic_e ( q ) end_ARG start_ARG | Ī“ ritalic_e ( q ) | end_ARG , Uitalic_T eitalic_i ā© and by Pcā¢oā¢rā¢rā¢eā¢cā¢t0superscriptsubscript0P_correct^0Pitalic_c o r r e c t0 the probability of answering correctly without steering: =Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+āiāiā¢nā¢cā¢oā¢rā¢rā¢eā¢cā¢tPĪøā¢(ai|q)ā¢e|Ī“ā¢reā¢(q)|ā¢(XiāXcā¢oā¢rā¢rā¢eā¢cā¢t)ā¤absentsubscriptsuperscript0subscriptsuperscript0subscriptsubscriptconditionalsubscriptsuperscriptsubscriptsubscriptsubscriptabsent= P^0_correctP^0_correct+ _iā incorrectP_Īø(a_i|% q)e^|Ī“ r_e(q)|(X_i-X_correct)ā¤= divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + āi ā i n c o r r e c t Pitalic_Īø ( aitalic_i | q ) e| Ī“ ritalic_e ( q ) | ( Xitalic_i - Xitalic_c o r r e c t ) end_ARG ⤠(30) Next, by considering the sum only only over highest probability tokens making up 1āϵ1italic-ϵ1- 1 - ϵ of the probability mass, for which we denote the incorrect tokens sum as iā¢nā¢cā¢oā¢rā¢rā¢eā¢cā¢tā¢(ϵ)italic-ϵincorrect(ε)i n c o r r e c t ( ϵ ): ā¤Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+āiāiā¢nā¢cā¢oā¢rā¢rā¢eā¢cā¢tā¢(ϵ)PĪøā¢(ai|q)ā¢e|Ī“ā¢reā¢(q)|ā¢(XiāXcā¢oā¢rā¢rā¢eā¢cā¢t)ā¤absentsubscriptsuperscript0subscriptsuperscript0subscriptitalic-ϵsubscriptconditionalsubscriptsuperscriptsubscriptsubscriptsubscriptabsent⤠P^0_correctP^0_correct+ _iā incorrect(ε)P_% Īø(a_i|q)e^|Ī“ r_e(q)|(X_i-X_correct)⤠divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + āi ā i n c o r r e c t ( ϵ ) Pitalic_Īø ( aitalic_i | q ) e| Ī“ ritalic_e ( q ) | ( Xitalic_i - Xitalic_c o r r e c t ) end_ARG ⤠(31) Denote by I±=iāiā¢nā¢cā¢oā¢rā¢rā¢eā¢cā¢tā¢(ϵ)|±(XiāXcā¢oā¢rā¢rā¢eā¢cā¢t)>0subscriptplus-or-minusconditional-setitalic-ϵplus-or-minussubscriptsubscript0I_±=\iā incorrect(ε)|±(X_i-X_correct)>0\I± = i ā i n c o r r e c t ( ϵ ) | ± ( Xitalic_i - Xitalic_c o r r e c t ) > 0 (i.e. XisubscriptX_iXitalic_iās that are larger/smaller than Xcā¢oā¢rā¢rā¢eā¢cā¢tsubscriptX_correctXitalic_c o r r e c t). Also denote by Pi0=PĪøā¢(ai|q)superscriptsubscript0subscriptconditionalsubscriptP_i^0=P_Īø(a_i|q)Pitalic_i0 = Pitalic_Īø ( aitalic_i | q ) and Yi=|Ī“ā¢reā¢(q)|ā¢(XiāXcā¢oā¢rā¢rā¢eā¢cā¢t)subscriptsubscriptsubscriptsubscriptY_i=|Ī“ r_e(q)|(X_i-X_correct)Yitalic_i = | Ī“ ritalic_e ( q ) | ( Xitalic_i - Xitalic_c o r r e c t ). We obtain two sums of the form āiāI±Piā¢eYisubscriptsubscriptplus-or-minussubscriptsuperscriptsubscript _iā I_±P_ie^Y_iāi ā I start_POSTSUBSCRIPT ± end_POSTSUBSCRIPT Pitalic_i eitalic_Yitalic_i. Since the exponent is a convex function, using Jensenās inequality, on the sums yields āiāIPiā¢eYiā„(āiāIPi)ā eājāIPjā¢YiājāIPjsubscriptsubscriptsuperscriptsubscriptā subscriptsubscriptsuperscriptsubscriptsubscriptsubscriptsubscriptsubscript _iā IP_ie^Y_iā„( _iā IP_i)Ā· e _jā I% P_jY_i _jā IP_jāi ā I Pitalic_i eitalic_Yitalic_i ā„ ( āi ā I Pitalic_i ) ā edivide start_ARG āj ā I Pitalic_j Yitalic_i end_ARG start_ARG āj ā I Pitalic_j end_ARG. Plugging this in: ā¤Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+(āiāI+Pi0)ā eājāI+Pj0ā¢(XjāXcā¢oā¢rā¢rā¢eā¢cā¢t)ājāI+Pj0ā¢|Ī“ā¢reā¢(q)|+(āiāIāPi0)ā eājāIāPj0ā¢(XjāXcā¢oā¢rā¢rā¢eā¢cā¢t)ājāIāPj0ā¢|Ī“ā¢reā¢(q)|absentsubscriptsuperscript0subscriptsuperscript0ā subscriptsubscriptsuperscriptsubscript0superscriptsubscriptsubscriptsuperscriptsubscript0subscriptsubscriptsubscriptsubscriptsuperscriptsubscript0subscriptā subscriptsubscriptsuperscriptsubscript0superscriptsubscriptsubscriptsuperscriptsubscript0subscriptsubscriptsubscriptsubscriptsuperscriptsubscript0subscript⤠P^0_correctP^0_correct+( _iā I_+P_i^0)Ā· e% _jā I_+P_j^0(X_j-X_correct) _jā I_+P_j^% 0|Ī“ r_e(q)|+( _iā I_-P_i^0)Ā· e _jā I% _-P_j^0(X_j-X_correct) _jā I_-P_j^0|Ī“ r_e(q)% |⤠divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + ( āi ā I start_POSTSUBSCRIPT + end_POSTSUBSCRIPT Pitalic_i0 ) ā edivide start_ARG āj ā I start_POSTSUBSCRIPT + end_POSTSUBSCRIPT Pitalic_j start_POSTSUPERSCRIPT 0 ( Xitalic_j - Xitalic_c o r r e c t ) end_ARG start_ARG āj ā I start_POSTSUBSCRIPT + end_POSTSUBSCRIPT Pitalic_j0 end_ARG | Ī“ ritalic_e ( q ) | end_POSTSUPERSCRIPT + ( āi ā I start_POSTSUBSCRIPT - end_POSTSUBSCRIPT Pitalic_i0 ) ā edivide start_ARG āj ā I start_POSTSUBSCRIPT - end_POSTSUBSCRIPT Pitalic_j start_POSTSUPERSCRIPT 0 ( Xitalic_j - Xitalic_c o r r e c t ) end_ARG start_ARG āj ā I start_POSTSUBSCRIPT - end_POSTSUBSCRIPT Pitalic_j0 end_ARG | Ī“ ritalic_e ( q ) | end_POSTSUPERSCRIPT end_ARG (32) Denote by P±=āiāI±Pi0subscriptplus-or-minussubscriptlimit-fromplus-or-minussuperscriptsubscript0P_±= _iā I±P_i^0P± = āi ā I ± Pitalic_i0 and c±=āiāI±Pi0ā¢(XiāXcā¢oā¢rā¢rā¢eā¢cā¢t)āiāI±Pi0subscriptplus-or-minussubscriptsubscriptplus-or-minussuperscriptsubscript0subscriptsubscriptsubscriptsubscriptplus-or-minussuperscriptsubscript0c_±= _iā I_±P_i^0(X_i-X_correct) _iā I_% ±P_i^0c± = divide start_ARG āi ā I start_POSTSUBSCRIPT ± end_POSTSUBSCRIPT Pitalic_i0 ( Xitalic_i - Xitalic_c o r r e c t ) end_ARG start_ARG āi ā I start_POSTSUBSCRIPT ± end_POSTSUBSCRIPT Pitalic_i0 end_ARG. We get: =Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+P+ā¢ec+ā¢|Ī“ā¢reā¢(q)|+Pāā¢ecāā¢|Ī“ā¢reā¢(q)|absentsubscriptsuperscript0subscriptsuperscript0subscriptsuperscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsubscript= P^0_correctP^0_correct+P_+e^c_+|Ī“ r_e(q)|+P_-e% ^c_-|Ī“ r_e(q)|= divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + P+ eitalic_c+ | Ī“ ritalic_e ( q ) | + P- eitalic_c- | Ī“ ritalic_e ( q ) | end_ARG (33) ā¤Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+minā”Pā,P+ā¢(ec+ā¢|Ī“ā¢reā¢(q)|+ecāā¢|Ī“ā¢reā¢(q)|)absentsubscriptsuperscript0subscriptsuperscript0subscriptsubscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptsubscript⤠P^0_correctP^0_correct+ \P_-,P_+\(e^c_+|Ī“ r% _e(q)|+e^c_-|Ī“ r_e(q)|)⤠divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + min P- , P+ ( eitalic_c+ | Ī“ ritalic_e ( q ) | + eitalic_c- | Ī“ ritalic_e ( q ) | ) end_ARG (34) ā¤Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+minPā,P+(1+12min|cā|,c+2|Ī“re(q)|2)⤠P^0_correctP^0_correct+ \P_-,P_+\(1+ 12% \|c_-|,c_+\^2|Ī“ r_e(q)|^2)⤠divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + min P- , P+ ( 1 + divide start_ARG 1 end_ARG start_ARG 2 end_ARG min | c- | , c+ 2 | Ī“ ritalic_e ( q ) |2 ) end_ARG (35) Lastly, note that for coefficients that are not too large, |Ī“ā¢rā¢(q)||Ī“ r(q)|| Ī“ r ( q ) | is proportional to the injected vector coefficient resubscriptr_eritalic_e (assumption 1), hence: ā¤Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+minPā,P+(1+12min|cā|,c+2Ī»2|re|2)⤠P^0_correctP^0_correct+ \P_-,P_+\(1+ 12% \|c_-|,c_+\^2Ī»^2|r_e|^2)⤠divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + min P- , P+ ( 1 + divide start_ARG 1 end_ARG start_ARG 2 end_ARG min | c- | , c+ 2 Ī»2 | ritalic_e |2 ) end_ARG (36) Under the assumption that XisubscriptX_iXitalic_i distribute randomly (assumption 3), c±subscriptplus-or-minusc_±c± are a weighted sum of positive/negative random variables with parameter Ļ, which we can refactor to Ļā c±ā²ā superscriptsubscriptplus-or-minusā²ĻĀ· c_± Ļ ā c±Ⲡwhere c±ā²subscriptplus-or-minusā²c_± c±Ⲡare the same variables but normalized to Ļā²=1superscriptā²1Ļ =1Ļā² = 1. Denoting β=minā”|cāā²|,c+ā²subscriptsuperscriptā²subscriptsuperscriptā²Ī²= \|c _-|,c _+\β = min | cā²- | , cā²+ , yields: ā¤Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+minā”Pā,P+ā¢(1+12ā¢Ī²2ā¢Ļ2ā¢Ī»2ā¢|re|2)absentsubscriptsuperscript0subscriptsuperscript0subscriptsubscript112superscript2superscript2superscript2superscriptsubscript2⤠P^0_correctP^0_correct+ \P_-,P_+\(1+ 12% β^2Ļ^2Ī»^2|r_e|^2)⤠divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + min P- , P+ ( 1 + divide start_ARG 1 end_ARG start_ARG 2 end_ARG β2 Ļ2 Ī»2 | ritalic_e |2 ) end_ARG (37) We denote α=minā”Pā,P+(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)ā¢(1āϵ)subscriptsubscript1subscriptsuperscript01italic-ϵα= \P_-,P_+\(1-P^0_correct)(1-ε)α = divide start_ARG min P- , P+ end_ARG start_ARG ( 1 - P0italic_c o r r e c t ) ( 1 - ϵ ) end_ARG, since we considered only the tokens making 1āϵ1italic-ϵ1- 1 - ϵ of the probability mass, thus, P++Pā=(1āϵ)ā¢(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)subscriptsubscript1italic-ϵ1superscriptsubscript0P_++P_-=(1-ε)(1-P_correct^0)P+ + P- = ( 1 - ϵ ) ( 1 - Pitalic_c o r r e c t0 ). Hence α measures the non-tightness of the bound, due to the asymmetry between P±subscriptplus-or-minusP_±P±, and (1āϵ)1italic-ϵ(1-ε)( 1 - ϵ ) the non-tightness due to not using all the words in the vocabulary for the bound, only the top T. =Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)ā¢Ī±ā¢(1āϵ)ā¢(1+12ā¢Ī²2ā¢Ļ2ā¢Ī»2ā¢|re|2)absentsubscriptsuperscript0subscriptsuperscript01superscriptsubscript01italic-ϵ112superscript2superscript2superscript2superscriptsubscript2= P^0_correctP^0_correct+(1-P_correct^0)α(1-ε)(% 1+ 12β^2Ļ^2Ī»^2|r_e|^2)= divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + ( 1 - Pitalic_c o r r e c t0 ) α ( 1 - ϵ ) ( 1 + divide start_ARG 1 end_ARG start_ARG 2 end_ARG β2 Ļ2 Ī»2 | ritalic_e |2 ) end_ARG (38) Notice that IāsubscriptI_-I- is empty if Xi>Xcā¢oā¢rā¢rā¢eā¢cā¢tsubscriptsubscriptX_i>X_correctXitalic_i > Xitalic_c o r r e c t for all iāiā¢nā¢cā¢oā¢rā¢rā¢eā¢cā¢tā¢(ϵ)italic-ϵiā incorrect(ε)i ā i n c o r r e c t ( ϵ ), and from assumption 3, these random variables are identically distributed, hence from symmetry, the event that Xcā¢oā¢rā¢rā¢eā¢cā¢tsubscriptX_correctXitalic_c o r r e c t is the smallest of the T random variables is 1/T11/T1 / T. Thus, with probability 1T1 1Tdivide start_ARG 1 end_ARG start_ARG T end_ARG the set I±subscriptplus-or-minusI_±I± is empty, therefore with probability 1ā2T121- 2T1 - divide start_ARG 2 end_ARG start_ARG T end_ARG both sets are not empty, thus P±>0subscriptplus-or-minus0P_±>0P± > 0 and c+>0subscript0c_+>0c+ > 0, cā<0subscript0c_-<0c- < 0. From the above-mentioned symmetry arising from the random variables Xcā¢oā¢rā¢rā¢eā¢cā¢t,XiiāIāāŖI+subscriptsubscriptsubscriptsubscriptsubscriptX_correct,\X_i\_iā I_-āŖ I_+Xitalic_c o r r e c t , Xitalic_i i ā I start_POSTSUBSCRIPT - āŖ I+ end_POSTSUBSCRIPT being identically distributed, for each individual i, Pā¢(Xcā¢oā¢rā¢rā¢eā¢cā¢t>Xi)=12subscriptsubscript12P(X_correct>X_i)= 12P ( Xitalic_c o r r e c t > Xitalic_i ) = divide start_ARG 1 end_ARG start_ARG 2 end_ARG, thus iāI+subscriptiā I_+i ā I+ with probability 1212 12divide start_ARG 1 end_ARG start_ARG 2 end_ARG. Therefore, P+subscriptP_+P+ is a weighted sum of Bernoulli variables with weights Pi0iāiā¢nā¢cā¢oā¢rā¢rā¢eā¢cā¢tsubscriptsubscriptsuperscript0\P^0_i\_iā incorrect P0italic_i i ā i n c o r r e c t. Appendix D Alignment Guarantee with Steering In contrast to Wolf et al. (2023), that has a framework centralized on using prompts to misalign frozen models, i.e. models whose weights and representations are not changed after training, here the model is not frozen due to steering, and accordingly a different result is obtained on guaranteeing an aligned response ā for any adversarial attack, using large enough norms with representation engineering produces an aligned response if the learned injected representations accumulate to a good classifier of positive and negative answer representations in the final layer. This is formalized here as a corollary of theorem 1. Corollary 1. Let ϵ>0italic-ϵ0ε>0ϵ > 0, PĪøsubscriptP_ĪøPitalic_Īø a language model and q a prompt that induces negative behavior B[PĪø(ā |q)]<γ<0B[P_Īø(Ā·|q)]<γ<0B [ Pitalic_Īø ( ā | q ) ] < γ < 0 without steering. Under the conditions of theorem 1, using an injected vector norm of re>1Īā¢Ī»ā¢(aā¢rā¢cā¢tā¢aā¢nā¢hā¢(1āϵ)āaā¢rā¢cā¢tā¢aā¢nā¢hā¢(γ))subscript1Īā1italic-ϵār_e> 1 Ī»(arctanh(1-ε)-arctanh(γ))ritalic_e > divide start_ARG 1 end_ARG start_ARG Ī Ī» end_ARG ( a r c t a n h ( 1 - ϵ ) - a r c t a n h ( γ ) ) leads to behavior expectation B[PĪø,re(ā |q)]>1āϵB[P_Īø,r_e(Ā·|q)]>1- [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] > 1 - ϵ. Appendix E Helpfulness at the Limit of Large Steering Vectors When considering the average helpfulness over a dataset in a scenario where the number of answers is constant, N (such as multiple choice questions), we obtain that on average, the model will converge to answering 1/N11/N1 / N of the questions correctly as steering is increased: Corollary 2. Under the conditions of theorem 2, the expected value of the helpfulness on a dataset of queries, qādā¢aā¢tā¢aā¢sā¢eā¢tā¢[PĪø,reā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)]subscriptdelimited-[]subscriptsubscriptconditionalsubscriptE_qā dataset[P_Īø,r_e(a_correct|q)]blackboard_Eq ā d a t a s e t [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( aitalic_c o r r e c t | q ) ] is asymptotically bounded from above by 1N1 1Ndivide start_ARG 1 end_ARG start_ARG N end_ARG as |re|āāāsubscript|r_e|āā| ritalic_e | ā ā. Where N is the number of possible answers for each query. Intuitively, for large |re|subscript|r_e|| ritalic_e |, the model is uniformly random, so it will guess the correct answer with probability 1N1 1Ndivide start_ARG 1 end_ARG start_ARG N end_ARG. This can be seen in section 4. proof: Following the notation of the proof of theorem 2, with probability 1V1 1Vdivide start_ARG 1 end_ARG start_ARG V end_ARG, IāsubscriptI_-I- is empty: PĪø,reā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)<Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)ā¢e|Ī“ā¢reā¢(q)|ā¢āiāiā¢nā¢cā¢oā¢rā¢rā¢eā¢cā¢tPi0ā¢(XiāXcā¢oā¢rā¢rā¢eā¢cā¢t)āiāiā¢nā¢cā¢oā¢rā¢rā¢eā¢cā¢tPi0subscriptsubscriptconditionalsubscriptsubscriptsuperscript0subscriptsuperscript01subscriptsuperscript0superscriptsubscriptsubscriptsubscriptsuperscript0subscriptsubscriptsubscriptsubscriptsuperscript0P_Īø,r_e(a_correct|q)< P^0_correctP^0_correct+(1-P^0% _correct)e^|Ī“ r_e(q)| _iā incorrectP^0_i(X_i-X_% correct) _iā incorrectP^0_iPitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( aitalic_c o r r e c t | q ) < divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + ( 1 - P0italic_c o r r e c t ) e| Ī“ ritalic_e ( q ) | divide start_ARG āi ā i n c o r r e c t P start_POSTSUPERSCRIPT 0i ( Xitalic_i - Xitalic_c o r r e c t ) end_ARG start_ARG āi ā i n c o r r e c t P0italic_i end_ARG end_POSTSUPERSCRIPT end_ARG (39) In the notation of the proof of theorem 2: Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)ā¢ec+ā¢|Ī“ā¢reā¢(q)|=Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)ā¢ec+ā¢Ī»ā¢resubscriptsuperscript0subscriptsuperscript01subscriptsuperscript0superscriptsubscriptsubscriptsubscriptsuperscript0subscriptsuperscript01subscriptsuperscript0superscriptsubscriptsubscript P^0_correctP^0_correct+(1-P^0_correct)e^c_+|Ī“ r_e% (q)|= P^0_correctP^0_correct+(1-P^0_correct)e^c_+% Ī» r_edivide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + ( 1 - P0italic_c o r r e c t ) eitalic_c+ | Ī“ ritalic_e ( q ) | end_ARG = divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + ( 1 - P0italic_c o r r e c t ) eitalic_c+ Ī» ritalic_e end_ARG (40) Where c+>0subscript0c_+>0c+ > 0 is a weighted sum of half-normal variables. The last transition is by assumption 1. Similarly, with probability 1T1 1Tdivide start_ARG 1 end_ARG start_ARG T end_ARG, I+subscriptI_+I+ is empty, thus PĪø,reā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)<Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)ā¢ecāā¢|Ī“ā¢reā¢(q)|=PĪø,reā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)<Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)ā¢ecāā¢Ī»ā¢resubscriptsubscriptconditionalsubscriptsubscriptsuperscript0subscriptsuperscript01subscriptsuperscript0superscriptsubscriptsubscriptsubscriptsubscriptconditionalsubscriptsubscriptsuperscript0subscriptsuperscript01subscriptsuperscript0superscriptsubscriptsubscriptP_Īø,r_e(a_correct|q)< P^0_correctP^0_correct+(1-P^0% _correct)e^c_-|Ī“ r_e(q)|=P_Īø,r_e(a_correct|q)< % P^0_correctP^0_correct+(1-P^0_correct)e^c_-Ī» r_ePitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( aitalic_c o r r e c t | q ) < divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + ( 1 - P0italic_c o r r e c t ) eitalic_c- | Ī“ ritalic_e ( q ) | end_ARG = Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( aitalic_c o r r e c t | q ) < divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + ( 1 - P0italic_c o r r e c t ) eitalic_c- Ī» ritalic_e end_ARG (41) Where cā<0subscript0c_-<0c- < 0. Thus for reāāāsubscriptr_eāāritalic_e ā ā, with probability 1ā2T121- 2T1 - divide start_ARG 2 end_ARG start_ARG T end_ARG, it is bounded by a term that approaches 00 (that of theorem 2), with probability 1/T11/T1 / T another term that approaches 00 (the sigmoid with c+subscriptc_+c+), and with probability 1/T11/T1 / T a term that approaches 1111 (the sigmoid with cāsubscriptc_-c-). Hence the expectation value is bounded by 1T1 1Tdivide start_ARG 1 end_ARG start_ARG T end_ARG. This proves corollary 2. For a combination of all these results, notice that with probability 1ā2T121- 2T1 - divide start_ARG 2 end_ARG start_ARG T end_ARG, the helpfulness is bounded by the term in theorem 2, while with probability 1T1 1Tdivide start_ARG 1 end_ARG start_ARG T end_ARG it is bounded by: Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)ā¢ec+ā¢|Ī“ā¢reā¢(q)|subscriptsuperscript0subscriptsuperscript01subscriptsuperscript0superscriptsubscriptsubscript P^0_correctP^0_correct+(1-P^0_correct)e^c_+|Ī“ r_e% (q)|divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + ( 1 - P0italic_c o r r e c t ) eitalic_c+ | Ī“ ritalic_e ( q ) | end_ARG (42) For re>0subscript0r_e>0ritalic_e > 0, this term is bounded by: <Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)ā¢(1+c+2ā¢Ī»2ā¢re2)absentsubscriptsuperscript0subscriptsuperscript01subscriptsuperscript01superscriptsubscript2superscript2superscriptsubscript2< P^0_correctP^0_correct+(1-P^0_correct)(1+c_+^2Ī»% ^2r_e^2)< divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + ( 1 - P0italic_c o r r e c t ) ( 1 + c+2 Ī»2 ritalic_e2 ) end_ARG (43) While for re<0subscript0r_e<0ritalic_e < 0 it is bounded by 1111. For the sigmoid with cāsubscriptc_-c-, we get the same bound, except that for re>0subscript0r_e>0ritalic_e > 0 it is bounded by 1111, while for re<0subscript0r_e<0ritalic_e < 0 it is bounded by: <Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)ā¢(1+cā2ā¢Ī»2ā¢re2)absentsubscriptsuperscript0subscriptsuperscript01subscriptsuperscript01superscriptsubscript2superscript2superscriptsubscript2< P^0_correctP^0_correct+(1-P^0_correct)(1+c_-^2Ī»% ^2r_e^2)< divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + ( 1 - P0italic_c o r r e c t ) ( 1 + c-2 Ī»2 ritalic_e2 ) end_ARG (44) Taking the weighted average of these three bounds gives the expectation value over the randomness of I±subscriptplus-or-minusI_±I± being empty/non-empty: ā¢[PĪø,reā¢(acā¢oā¢rā¢rā¢eā¢cā¢t|q)]<(1ā1T)ā¢Pcā¢oā¢rā¢rā¢eā¢cā¢t0Pcā¢oā¢rā¢rā¢eā¢cā¢t0+α(1āPcā¢oā¢rā¢rā¢eā¢cā¢t0)(1+mincā,c+,β2Ī»2re2)+1TE[P_Īø,r_e(a_correct|q)]<(1- 1T) P^0_% correctP^0_correct+α(1-P^0_correct)(1+ \c_-,c_+,β% \^2Ī»^2r_e^2)+ 1Tblackboard_E [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( aitalic_c o r r e c t | q ) ] < ( 1 - divide start_ARG 1 end_ARG start_ARG T end_ARG ) divide start_ARG P0italic_c o r r e c t end_ARG start_ARG P0italic_c o r r e c t + α ( 1 - P0italic_c o r r e c t ) ( 1 + min c- , c+ , β 2 Ī»2 ritalic_e2 ) end_ARG + divide start_ARG 1 end_ARG start_ARG T end_ARG (45) Thus at the limit of reāāāsubscriptr_eāāritalic_e ā ā, we obtain a bound of 1/T11/T1 / T. Appendix F Experimental Details F.1 Compute All experiments were conducted using 2 NVIDIA A10 GPUs, 2 CPUs and 80GB of memory. Recreating all experiments takes in total no more than 4 hours. F.2 Obtaining the engineered representations We use the code provided by Zou et al. (2023a) to perform representation engineering on the Llama 2 13B chat, Llama 2 13B models Touvron et al. (2023) and Llama 3.1 8B chat, Llama 3.1 8B models Dubey et al. (2024). To construct the engineered representations, we first create a set pairs of positive and negative behavior prompts, and extract their representations in each hidden layer. Then, the pairs of vectors are subtracted per layer. On these vector differences we perform PCA analysis to extract the highest order PCA vectors per layer as the representation engineered vectors, re(l)superscriptsubscript\r_e^(l)\ ritalic_e( l ) . We create behavior vectors of harmlessness and not-racist to align Llama 2 13b, Llama 3.1 8B and harmfulness and racism vectors to misalign Llama 2 13b chat, Llama 3.1 8B Instruct. ⢠For creating racism vectors for Llama 2 13B chat and Llama 3.1 8B Instruct, we use the StereoSet bias dataset Nadeem et al. (2020). Given a bias statement from the dataset, we apply it over the template of an aligned response: āQusestion: Consider the statement: [STATEMENT] Answer: The statement is false and racist.", and a template of a misaligned response: āQuestion: Consider the statement: [STATEMENT] Answer: 100%". Then, we perform the PCA procedure to create the engineered representations. ⢠For the non-racist vectors for Llama 2 13B and Llama 3.1 8B, we use the same dataset and template described above for the racist vectors of Llama 2 13B chat, only this time the desired behavior is opposite, so we subtract the representations of the prompts in reverse order. ⢠For the harmfulness vectors for Llama 2 13B chat and Llama 3.1 8B Instruct, we take harmful instructions from AdvBench dataset Robey et al. (2021; 2022) and unharmful instructions from shareGPT, and create pairs of prompts with the format āRequest: Can you [INSTRUCTION]?", where the instruction is taken from one of the datasets (a pair consists of two prompts, one with a harmful instruction and one with an unharmful instruction). ⢠For the harmless vectors for Llama 2 13B and Llama 3.1 8B, we use the same dataset and template described above for the harmfulness vectors of Llama 2 13B chat and Llama 3.1 8B, only this time the desired behavior is opposite, so we subtract the representations of the prompts in reverse order. In all cases, we used 128 pairs of positive and negative statements. For the bias vectors, we injected the model in layers ā1111-11- 11 to ā3030-30- 30 and for harmfulness/harmlesness in layers ā2525-25- 25 to ā3333-33- 33. F.3 Alignment experiments To perform the experiment measuring racism, we fed the representation engineered model biased statements, with the prompt "[INST]Do you agree with the following statement? [STATEMENT][/INST]" and for llama3.1: <|start_header_id|> user <|end_header_id|> Do you agree with the following statement? [STATEMENT] <|eot_id|> <|start_header_id|> assistant <|end_header_id|>" where the statement was taken from the racist statements in the bias dataset. We generate the response of the model and evaluate whether the model agreed or disagreed with the racist statement based on his full answer. We average on 100 racist statements randomly selected from the StereoSet dataset and plot Pā¢(Aā¢gā¢rā¢eā¢e)āPā¢(Dā¢iā¢sā¢aā¢gā¢rā¢eā¢e)P(Agree)-P(Disagree)P ( A g r e e ) - P ( D i s a g r e e ) (or Pā¢(Dā¢iā¢sā¢aā¢gā¢rā¢eā¢e)āPā¢(Aā¢gā¢rā¢eā¢e)P(Disagree)-P(Agree)P ( D i s a g r e e ) - P ( A g r e e ) for the unaligned model) as a function of the injected vectorsā coefficient resubscriptr_eritalic_e. To perform the experiment for compliance with harmful instructions, we queried the model with harmful instructions from AdvBench and checked as a function of representation engineering coefficient whether the model agrees or refuses to answer the instruction. The answers were sampled under greedy decoding for each coefficient, and averaged on 100 harmful instructions for Llama 2 13B chat, Llama 2 13B and also for Llama 3.1 8B Instruct, Llama 3.1 8B. Note that taking the temperature to zero in greedy sampling is equivalent to taking the representation norms to infinity, thus the hyperbolic tangent becomes a step function, and the step appears where the probability of a positive and negative response are equally likely. However, due to the linear dependence of the behavior on resubscriptr_eritalic_e, when averaging on several instructions, the points where the behavior flips are evenly spread between queries, creating the linear curve. Results on Llama 2 13B models are presented in figure 4 and on Llama 3.1 8B Instruct in figure 16 F.4 Helpfulness experiments We evaluate the performance of a model on an MMLU dataset by feeding 100 questions from the test set to the model in the form: "[Question][A)Choice A][B) Choice B][C) Choice C][D) Choice D] The answer is", then calculate the probabilities for answering "A", "B", "C" and "D" and take the correct answerās probability. We averaged the probability of the correct answer over the data set. This was performed for different coefficients to create the figures in 5. While the bound of theorem 2 is with probability 1ā2|V|=1212121- 2|V|= 121 - divide start_ARG 2 end_ARG start_ARG | V | end_ARG = divide start_ARG 1 end_ARG start_ARG 2 end_ARG in the case of 4444 answers, as explained in E, for the other 2|V|2 2|V|divide start_ARG 2 end_ARG start_ARG | V | end_ARG probability, the helpfulness is bounded with equal probability either by a sigmoid or by a reverse sigmoid, such that together they contribute approximately 1|V|1 1|V|divide start_ARG 1 end_ARG start_ARG | V | end_ARG to the expectation value of the helpfulness (due to their small overlap), leading to corollary 2, in which the average helpfulness converges to 1|V|=14114 1|V|= 14divide start_ARG 1 end_ARG start_ARG | V | end_ARG = divide start_ARG 1 end_ARG start_ARG 4 end_ARG in the case of our experiment, as can be seen in figure 5. Around re=0subscript0r_e=0ritalic_e = 0, the contribution of these sigmoids to the helpfulness expectation value can be bounded with the parabolic bound of theorem 2 as shown in the proof provided in appendix E. Thus in total, the bound of theorem 2 with boundary conditions of corollary 2 is theoretically justified. Additionally, we performed a variation of the experiment by sampling full answers to questions from the model (temperature 1.0 over the full vocabulary of the model). Then, where the answer is provided, calculated the probability for the correct answer over the entire vocabulary. This is presented for Llama 2 13B models in figure 13, and for Llama 3.1 8B models in figure 15. We also calculate the accuracy of the Llama 2 13B models answers as presented in figure 14. F.5 Figures All error bars were produced using mean squared error. The method of fitting the curves to the data can be found in the code. Figure 13: Helpfulness measurement: Same as figure 5, but calculating the probability of correct answer over the full vocabulary. Figure 14: Helpfulness measurement: Accuracy of correct answer over the full vocabulary. Figure 15: Helpfulness measurement: the probability assigned to the correct answer to questions from different MMLU tests (international law, medical genetics, high school computer science), as a function of representation engineering vector coefficients injected to the model. Here the probability of the correct answer was over the full vocabulary. (a) Helpfulness of Llama 3.1 8B as a function of coefficient of injected harmful PCA vectors. (b) Helpfulness of Llama 3.1 8B as a function of coefficient of injected bias PCA vectors. (c) Helpfulness of Llama 3.1 8B Instruct as a function of coefficient of injected harmful PCA vectors. (d) Helpfulness of Llama 3.1 8B Instruct as a function of coefficient of injected bias PCA vectors. Figure 16: Plots of behavior expectation as a function of the coefficients of representation engineering vectors injected to the model. (a) Harmful behavior expectation of Llama 3.1 8B Instruct as a function of coefficient of injected harmful PCA vectors. (b) Racism behavior expectation of Llama 3.1 8B Instruct as a function of coefficient of injected bias PCA vectors. Appendix G Helpfulness Experiments on Code Generation In section 4, we showed the modelās helpfulness on knowledge based question answering as a function of steering satisfies theorem 2. This was performed on multiple-choice questions, which shows the applicability of the theoretical results for single token answers. For demonstrating the theoretical results on tasks requiring generation of full sequences, we test the modelās coding skills with the humaneval dataset (Chen et al., 2021). As can be seen in figure 17, The modelās performance is peaked around re=0subscript0r_e=0ritalic_e = 0, and it decays parabolically ar resubscriptr_eritalic_e increases, as predicted in theorem 2. We note that the asymmetry between positive and negative coefficients is captured in our theoretical bounds. Figure 17: Helpfulness measurement on humaneval of Llama 2 13B chat as a function of coefficient of injected harmfulness (a) and racism (b) PCA vectors. Appendix H Relaxation to Soft Margin In the proof of theorem 1, we use the assumption that the change to the last hidden layer representation due to steering linearly classifies the representations of positive and negative answers to a query with margin Ī Ī (as explained in appendix A). We can relax this assumption by assuming that some of the negative (positive) responsesā representations, are misclassified as aligned (misaligned) answers by Ī“ā¢reā¢(q)subscriptĪ“ r_e(q)Ī“ ritalic_e ( q ), in the sense that: iāaā¢lā¢iā¢gā¢nā¢eā¢d,jāmā¢iā¢sā¢aā¢lā¢iā¢gā¢nā¢eā¢d:āØĪ“ā¢reā¢(q),UTā¢(eiāej)ā©ā¤Ī:formulae-sequencesubscriptsuperscriptsubscriptsubscriptĪiā aligned,jā misaligned:~~~ Ī“ r_e(q),U^T(e_i-e_j% ) ⤠ā a l i g n e d , j ā m i s a l i g n e d : ⨠Γ ritalic_e ( q ) , Uitalic_T ( eitalic_i - eitalic_j ) ⩠⤠Π(46) That is, the margin Ī Ī does not hold for every pair of aligned and misaligned answers. The key idea is that while it is indeed possible for such misclassifications to occur, the probability assigned to most of the tokens in the vocabulary is very small, thus we can bound their contribution to the behavior expectation. To this end, we define a set of misclassified responses: iāmā¢iā¢sā¢cā¢lā¢aā¢sā¢sā¢iā¢fā¢iā¢eā¢d\iā misclassified\ i ā m i s c l a s s i f i e d and bound the probability mass that the model assigns them by: āiāmā¢iā¢sā¢cā¢lā¢aā¢sā¢sā¢iā¢fā¢iā¢eā¢dPĪøā¢(i|q)<Ī“ā āiāaā¢lā¢iā¢gā¢nā¢eā¢dPĪøā¢(i|q)subscriptsubscriptconditionalā subscriptsubscriptconditional _iā misclassifiedP_Īø(i|q)<Γ· _iā alignedP_% Īø(i|q)āi ā m i s c l a s s i f i e d Pitalic_Īø ( i | q ) < Ī“ ā āi ā a l i g n e d Pitalic_Īø ( i | q ) (47) Furthermore, we bound how ādeep" the misclassified negative response representations can go into the cluster of positive answer representations: miniāaā¢lā¢iā¢gā¢nā¢eā¢d,jāmā¢iā¢sā¢cā¢lā¢aā¢sā¢sā¢iā¢fā¢iā¢eā¢dā”āØĪ“ā¢reā¢(q),UTā¢(eiāej)ā©>āMsubscriptformulae-sequencesubscriptsuperscriptsubscriptsubscript _iā aligned,jā misclassified\ Ī“ r_e(q),U^T(e_i-e_% j) \>-Mminitalic_i ā a l i g n e d , j ā m i s c l a s s i f i e d ⨠Γ ritalic_e ( q ) , Uitalic_T ( eitalic_i - eitalic_j ) ā© > - M (48) With this, the linear classification assumption can be modified as: Assumption 4. Given a query q, the change to the last hidden layer of a model due to representation engineering, Ī“ā¢reā¢(q)=r(L)ā¢(q,re)ār(L)ā¢(q,0)subscriptsuperscriptsubscriptsuperscript0Ī“ r_e(q)=r^(L)(q,r_e)-r^(L)(q,0)Ī“ ritalic_e ( q ) = r( L ) ( q , ritalic_e ) - r( L ) ( q , 0 ) , linearly classifies the representations of positive and negative answers to a query q with margin Ī Ī, where the positive and negative answers are defined with respect to a behavior scoring function B:Ī£āāā1,+1:āsuperscriptĪ£ā11B: ā\-1,+1\B : Ī£ā ā - 1 , + 1 : miniāaā¢lā¢iā¢gā¢nā¢eā¢d,jāmā¢iā¢sā¢aā¢lā¢iā¢gā¢nā¢eā¢dā”āØĪ“ā¢reā¢(q)|Ī“ā¢reā¢(q)|,UTā¢eiāUTā¢ejā©>Īsubscriptformulae-sequencesubscriptsubscriptsuperscriptsubscriptsuperscriptsubscriptĪ _iā aligned,jā misaligned \ Ī“ r_e(q)% |Ī“ r_e(q)|,U^Te_i-U^Te_j \> _i ā a l i g n e d , j ā m i s a l i g n e d ⨠divide start_ARG Ī“ ritalic_e ( q ) end_ARG start_ARG | Ī“ ritalic_e ( q ) | end_ARG , Uitalic_T eitalic_i - Uitalic_T eitalic_j ā© > Ī (49) Up to a set of misclassified answers, whose probability is bounded by āiāmā¢iā¢sā¢cā¢lā¢aā¢sā¢sā¢iā¢fā¢iā¢eā¢dPĪøā¢(i|q)<Ī“ā āiāaā¢lā¢iā¢gā¢nā¢eā¢dPĪøā¢(i|q)subscriptsubscriptconditionalā subscriptsubscriptconditional _iā misclassifiedP_Īø(i|q)<Γ· _iā alignedP_% Īø(i|q)āi ā m i s c l a s s i f i e d Pitalic_Īø ( i | q ) < Ī“ ā āi ā a l i g n e d Pitalic_Īø ( i | q ) that satisfy: miniāaā¢lā¢iā¢gā¢nā¢eā¢d,jāmā¢iā¢sā¢cā¢lā¢aā¢sā¢sā¢iā¢fā¢iā¢eā¢dā”āØĪ“ā¢reā¢(q),UTā¢(eiāej)ā©>āMsubscriptformulae-sequencesubscriptsuperscriptsubscriptsubscript _iā aligned,jā misclassified\ Ī“ r_e(q),U^T(e_i-e_% j) \>-Mminitalic_i ā a l i g n e d , j ā m i s c l a s s i f i e d ⨠Γ ritalic_e ( q ) , Uitalic_T ( eitalic_i - eitalic_j ) ā© > - M (50) Note that realistically, Ī“ can be very small for a very large set of tokens, as in inference, LLMs typically assign high probability to few tokens and very low probability for most. Hence it suffices to classify just a few high probability tokens. We can restate theorem 1 in the following way: Theorem 3. Let Ī“,ϵ>0italic-ϵ0Ī“,ε>0Ī“ , ϵ > 0 and let PĪø,re(ā |q)P_Īø,r_e(Ā·|q)Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) be a model prompted with query q and injected with representations of coefficient resubscriptr_eritalic_e. Let B:Ī£āāā1,+1:āsuperscriptĪ£ā11B: ā\-1,+1\B : Ī£ā ā - 1 , + 1 be a behavior scoring function. Under assumption 4, for re<logā”ϵ2ā¢Ī“Mā Ī»subscriptitalic-ϵ2ā r_e< ε2Ī“MĀ·Ī»ritalic_e < divide start_ARG log divide start_ARG ϵ end_ARG start_ARG 2 Ī“ end_ARG end_ARG start_ARG M ā Ī» end_ARG the behavior expectation of the model conditioned on the query q satisfies: B[PĪø,re(ā |q)]ā„tanh(ĪĪ»ā re+arctanh(B0))āϵB[P_Īø,r_e(Ā·|q)]ā„ tanh( λ· r_e+arctanh(B_0))- [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] ā„ t a n h ( Ī Ī» ā ritalic_e + a r c t a n h ( B0 ) ) - ϵ (51) Where B0=B[PĪø(ā |q)]B_0=B[P_Īø(Ā·|q)]B0 = B [ Pitalic_Īø ( ā | q ) ] is the behavior expectation without steering and Ī» is a model dependent coefficient relating between resubscriptr_eritalic_e and the corresponding final hidden state norm. Proof: We follow the proof of theorem 1, up to equation 22, there, we introduce the misclassified tokensā contributions, which we denote by R=āaāmā¢iā¢sā¢cā¢lā¢aā¢sā¢sā¢iā¢fā¢iā¢eā¢dexp(āØr(q)+Ī“re(q),UTea)āa+āgā¢oā¢oā¢dexp(āØr(q)+Ī“re(q),UTea+)R= _aā misclassifiedexp( r(q)+Ī“ r_e(q),U^Te_a)% _a_+ā goodexp( r(q)+Ī“ r_e(q),U^Te_a_+)R = divide start_ARG āa ā m i s c l a s s i f i e d e x p ( ⨠r ( q ) + Ī“ ritalic_e ( q ) , Uitalic_T eitalic_a ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) + Ī“ ritalic_e ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ) end_ARG: B[PĪø,re(ā |q)]>1āāaāābā¢aā¢dPĪøā¢(aā|q)āa+āgā¢oā¢oā¢dPĪøā¢(a+|q)ā¢eā¢xā¢pā¢(āĪā¢|Ī“ā¢r|)āR1+āaāābā¢aā¢dPĪøā¢(aā|q)āa+āgā¢oā¢oā¢dPĪøā¢(a+|q)ā¢eā¢xā¢pā¢(āĪā¢|Ī“ā¢r|)+RB[P_Īø,r_e(Ā·|q)]> 1- _a_-ā badP_Īø(a_-% |q) _a_+ā goodP_Īø(a_+|q)exp(- |Ī“ r|)-R1+ % _a_-ā badP_Īø(a_-|q) _a_+ā goodP_Īø(a_+|% q)exp(- |Ī“ r|)+RB [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] > divide start_ARG 1 - divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) end_ARG e x p ( - Ī | Ī“ r | ) - R end_ARG start_ARG 1 + divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) end_ARG e x p ( - Ī | Ī“ r | ) + R end_ARG (52) Following the same idea as with equation 16, we obtain that: R<āaāmā¢iā¢sā¢cā¢lā¢aā¢sā¢sā¢iā¢fā¢iā¢eā¢dexp(āØr(q),UTea)āa+āgā¢oā¢oā¢dexp(āØr(q),UTea+)ā¢1eā¢xā¢pā¢(ā|Ī“ā¢r|ā¢M)R< _aā misclassifiedexp( r(q),U^Te_a) _a_+ā good% exp( r(q),U^Te_a_+) 1exp(-|Ī“ r|M)R < divide start_ARG āa ā m i s c l a s s i f i e d e x p ( ⨠r ( q ) , Uitalic_T eitalic_a ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT e x p ( ⨠r ( q ) , Uitalic_T eitalic_a start_POSTSUBSCRIPT + end_POSTSUBSCRIPT ) end_ARG divide start_ARG 1 end_ARG start_ARG e x p ( - | Ī“ r | M ) end_ARG (53) Plugging this in gives: B[PĪø,re(ā |q)]>āa+āgā¢oā¢oā¢dPĪøā¢(a+|q)āāaāābā¢aā¢dPĪøā¢(aā|q)ā¢eā¢xā¢pā¢(āĪā¢|Ī“ā¢r|)āāaāmā¢iā¢sā¢cā¢lā¢aā¢sā¢sā¢iā¢fā¢iā¢eā¢dPĪøā¢(a|q)ā¢eā¢xā¢pā¢(Mā¢|Ī“ā¢r|)āa+āgā¢oā¢oā¢dPĪøā¢(a+|q)+āaāābā¢aā¢dPĪøā¢(aā|q)ā¢eā¢xā¢pā¢(āĪā¢|Ī“ā¢r|)+āaāmā¢iā¢sā¢cā¢lā¢aā¢sā¢sā¢iā¢fā¢iā¢eā¢dPĪøā¢(a|q)ā¢eā¢xā¢pā¢(Mā¢|Ī“ā¢r|)>B[P_Īø,r_e(Ā·|q)]> _a_+ā goodP_Īø(a_+|q)-% _a_-ā badP_Īø(a_-|q)exp(- |Ī“ r|)- _aā misclassified% P_Īø(a|q)exp(M|Ī“ r|) _a_+ā goodP_Īø(a_+|q)+Ī£% _a_-ā badP_Īø(a_-|q)exp(- |Ī“ r|)+ _aā misclassified% P_Īø(a|q)exp(M|Ī“ r|)>B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] > divide start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) - āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) e x p ( - Ī | Ī“ r | ) - āa ā m i s c l a s s i f i e d Pitalic_Īø ( a | q ) e x p ( M | Ī“ r | ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) + āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) e x p ( - Ī | Ī“ r | ) + āa ā m i s c l a s s i f i e d Pitalic_Īø ( a | q ) e x p ( M | Ī“ r | ) end_ARG > (54) Denote the first second and third terms respectively as A,B,CA,B,CA , B , C: =AāBāCA+B+C=AāBA+BāCA+B1+CA+B>(AāBA+BāCA+B)ā¢(1āCA+B)>AāBA+Bā2ā¢CA+Babsent112= A-B-CA+B+C= A-BA+B- CA+B1+ CA+B>(% A-BA+B- CA+B)(1- CA+B)> A-BA+B-2 CA+B= divide start_ARG A - B - C end_ARG start_ARG A + B + C end_ARG = divide start_ARG divide start_ARG A - B end_ARG start_ARG A + B end_ARG - divide start_ARG C end_ARG start_ARG A + B end_ARG end_ARG start_ARG 1 + divide start_ARG C end_ARG start_ARG A + B end_ARG end_ARG > ( divide start_ARG A - B end_ARG start_ARG A + B end_ARG - divide start_ARG C end_ARG start_ARG A + B end_ARG ) ( 1 - divide start_ARG C end_ARG start_ARG A + B end_ARG ) > divide start_ARG A - B end_ARG start_ARG A + B end_ARG - 2 divide start_ARG C end_ARG start_ARG A + B end_ARG (55) Notice that from the transition in equation 23: AāBA+B=tā¢aā¢nā¢hā¢(Īā¢|Ī“ā¢r|ālnā”(āaāābā¢aā¢dPĪøā¢(aā|q)āa+āgā¢oā¢oā¢dPĪøā¢(a+|q))2)āĪsubscriptsubscriptsubscriptconditionalsubscriptsubscriptsubscriptsubscriptconditionalsubscript2 A-BA+B=tanh( |Ī“ r|- ( _a_-ā badP_% Īø(a_-|q) _a_+ā goodP_Īø(a_+|q))2)divide start_ARG A - B end_ARG start_ARG A + B end_ARG = t a n h ( divide start_ARG Ī | Ī“ r | - ln ( divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) end_ARG ) end_ARG start_ARG 2 end_ARG ) (56) Is the bound from theorem 1, and the second term: CA+B=āaāmā¢iā¢sā¢cā¢lā¢aā¢sā¢sā¢iā¢fā¢iā¢eā¢dPĪøā¢(a|q)ā¢eā¢xā¢pā¢(Mā¢|Ī“ā¢r|)āa+āgā¢oā¢oā¢dPĪøā¢(a+|q)+āaāābā¢aā¢dPĪøā¢(aā|q)ā¢eā¢xā¢pā¢(āĪā¢|Ī“ā¢r|)<Ī“ā eā¢xā¢pā¢(Mā¢|Ī“ā¢r|)subscriptsubscriptconditionalsubscriptsubscriptsubscriptconditionalsubscriptsubscriptsubscriptsubscriptconditionalsubscriptĪā CA+B= _aā misclassifiedP_Īø(a|q)exp(M|Ī“ r|)% _a_+ā goodP_Īø(a_+|q)+ _a_-ā badP_Īø(a_-|q)% exp(- |Ī“ r|)<Γ· exp(M|Ī“ r|)divide start_ARG C end_ARG start_ARG A + B end_ARG = divide start_ARG āa ā m i s c l a s s i f i e d Pitalic_Īø ( a | q ) e x p ( M | Ī“ r | ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) + āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) e x p ( - Ī | Ī“ r | ) end_ARG < Ī“ ā e x p ( M | Ī“ r | ) (57) Lastly, notice that: āaāābā¢aā¢dPĪøā¢(aā|q)āa+āgā¢oā¢oā¢dPĪøā¢(a+|q)=1āB01+B0subscriptsubscriptsubscriptconditionalsubscriptsubscriptsubscriptsubscriptconditionalsubscript1subscript01subscript0 _a_-ā badP_Īø(a_-|q) _a_+ā goodP_Īø(a% _+|q)= 1-B_01+B_0divide start_ARG āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø ( a- | q ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø ( a+ | q ) end_ARG = divide start_ARG 1 - B0 end_ARG start_ARG 1 + B0 end_ARG (58) Where B0=B[PĪø(ā |q)]B_0=B[P_Īø(Ā·|q)]B0 = B [ Pitalic_Īø ( ā | q ) ], and that: aā¢rā¢cā¢tā¢aā¢nā¢hā¢(B0)=ā12ā¢lnā”1āB01+B0āsubscript0121subscript01subscript0arctanh(B_0)=- 12 1-B_01+B_0a r c t a n h ( B0 ) = - divide start_ARG 1 end_ARG start_ARG 2 end_ARG ln divide start_ARG 1 - B0 end_ARG start_ARG 1 + B0 end_ARG (59) Thus we obtain: B[PĪø,re(ā |q)]>tanh(Īā¢|Ī“ā¢rā¢(q)|2+arctanh(B0))ā2Ī“ā exp(M|Ī“r|)B[P_Īø,r_e(Ā·|q)]>tanh( |Ī“ r(q)|2+arctanh(B_0)% )-2Γ· exp(M|Ī“ r|)B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] > t a n h ( divide start_ARG Ī | Ī“ r ( q ) | end_ARG start_ARG 2 end_ARG + a r c t a n h ( B0 ) ) - 2 Ī“ ā e x p ( M | Ī“ r | ) (60) Then, note that for coefficients that are not too large, |Ī“ā¢rā¢(q)||Ī“ r(q)|| Ī“ r ( q ) | is proportional to the injected vector coefficient resubscriptr_eritalic_e (assumption 1), hence: B[PĪø,re(ā |q)]>tanh(Īā¢Ī»2ā re+arctanh(B0))ā2Ī“ā exp(MĪ»ā re)B[P_Īø,r_e(Ā·|q)]>tanh( Ī»2Ā· r_e+arctanh(B% _0))-2Γ· exp(Mλ· r_e)B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] > t a n h ( divide start_ARG Ī Ī» end_ARG start_ARG 2 end_ARG ā ritalic_e + a r c t a n h ( B0 ) ) - 2 Ī“ ā e x p ( M Ī» ā ritalic_e ) (61) Where Ī» is the coefficient relating resubscriptr_eritalic_e to |Ī“ā¢rā¢(q)||Ī“ r(q)|| Ī“ r ( q ) |. Thus for re<logā”ϵ2ā¢Ī“Mā Ī»subscriptitalic-ϵ2ā r_e< ε2Ī“MĀ·Ī»ritalic_e < divide start_ARG log divide start_ARG ϵ end_ARG start_ARG 2 Ī“ end_ARG end_ARG start_ARG M ā Ī» end_ARG: B[PĪø,re(ā |q)]>tanh(Īā¢Ī»2ā re+arctanh(B0))āϵB[P_Īø,r_e(Ā·|q)]>tanh( Ī»2Ā· r_e+arctanh(B% _0))- [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] > t a n h ( divide start_ARG Ī Ī» end_ARG start_ARG 2 end_ARG ā ritalic_e + a r c t a n h ( B0 ) ) - ϵ (62) Appendix I Relation of Steering to Finetuning with Preference Learning To a degree one can draw a relation between steering and preference learning. Proposition 1. For an LLM, one iteration of gradient descent on the preference learning loss with learning rate Ī· is equivalent to steering with coefficient re=Ī·subscriptr_e= _e = Ī·. Proof: The objective in preference learning is to minimize the loss: L=ā(x,y+,yā)ā¼Dā¢[logā”Pā¢(y+|x)Pā¢(yā|x)]=ā(x,y+,yā)ā¼Dā¢[āØrx(L),UTā¢(ey+āeyā)ā©]subscriptsimilar-tosuperscriptsuperscriptdelimited-[]conditionalsuperscriptconditionalsuperscriptsubscriptsimilar-tosuperscriptsuperscriptdelimited-[]subscriptsuperscriptsuperscriptsubscriptsubscriptsubscriptsubscriptL=-E_(x,y^+,y^-) D[ P(y^+|x)P(y^-|x)]=-% E_(x,y^+,y^-) D[ r^(L)_x,U^T(e_y_+-e_y_-% ) ]L = - blackboard_E( x , y+ , y- ) ā¼ D [ log divide start_ARG P ( y+ | x ) end_ARG start_ARG P ( y- | x ) end_ARG ] = - blackboard_E( x , y+ , y- ) ā¼ D [ ⨠r( L )x , Uitalic_T ( eitalic_y start_POSTSUBSCRIPT + end_POSTSUBSCRIPT - eitalic_y start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ) ā© ] (63) Which increases the likelihood of desired responses to prompts. By training with preference learning, in each iteration of gradient descent, each representation is changed by: r(l)ār(l)āĪ·ā¢āLār(l)āsuperscriptsuperscriptsuperscriptr^(l)ā r^(l)-Ī· ā Lā r^(l)r( l ) ā r( l ) - Ī· divide start_ARG ā L end_ARG start_ARG ā r( l ) end_ARG (64) The gradient of the loss w.r.t. a hidden layer representation is: āLārl=(x,y+,yā)ā¼Dā¢[ārā¢(x)ārlā¢(x)ā UTā¢(ey+āeyā)]superscriptsubscriptsimilar-tosuperscriptsuperscriptdelimited-[]ā superscriptsuperscriptsubscriptsubscriptsubscriptsubscript ā Lā r^l=E_(x,y^+,y^-) D[ % ā r(x)ā r^l(x)Ā· U^T(e_y_+-e_y_-)]divide start_ARG ā L end_ARG start_ARG ā ritalic_l end_ARG = blackboard_E( x , y+ , y- ) ā¼ D [ divide start_ARG ā r ( x ) end_ARG start_ARG ā ritalic_l ( x ) end_ARG ā Uitalic_T ( eitalic_y start_POSTSUBSCRIPT + end_POSTSUBSCRIPT - eitalic_y start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ) ] (65) Thus at each layer, the representation is shifted in a direction that maximizes the difference between positive and negative responsesā representations, UTā¢(ey+āeyā)superscriptsubscriptsubscriptsubscriptsubscriptU^T(e_y_+-e_y_-)Uitalic_T ( eitalic_y start_POSTSUBSCRIPT + end_POSTSUBSCRIPT - eitalic_y start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ). Which is equivalent to steering with coefficient re=Ī·subscriptr_e= _e = Ī·, and vectors Re=(x,y+,yā)ā¼Dā¢[ārā¢(x)ārlā¢(x)ā UTā¢(ey+āeyā)]l=1Lsubscriptsuperscriptsubscriptsubscriptsimilar-tosuperscriptsuperscriptdelimited-[]ā superscriptsuperscriptsubscriptsubscriptsubscriptsubscript1R_e=\E_(x,y^+,y^-) D[ ā r(x)ā r^l% (x)Ā· U^T(e_y_+-e_y_-)]\_l=1^LRitalic_e = blackboard_E( x , y+ , y- ) ā¼ D [ divide start_ARG ā r ( x ) end_ARG start_ARG ā ritalic_l ( x ) end_ARG ā Uitalic_T ( eitalic_y start_POSTSUBSCRIPT + end_POSTSUBSCRIPT - eitalic_y start_POSTSUBSCRIPT - end_POSTSUBSCRIPT ) ] l = 1L Appendix J Extension of Results Beyond Binary Behavior Score The idea behind theorem 1, is that the resulting change to the final hidden layer due to the representation injections linearly classifies aligned and misaligned answers, where the aligned/misaligned labels are given by the binary behavior scoring function. To extend beyond a binary behavior score, we need to assume that the modelās latent space captures more finegrained differences between answers. Here we will provide results for a trinary behavior score (theorem 4), and a general behavior score (theorem 5). A natural extension is for a trinary score function, where ±1plus-or-minus1± 1± 1 is aligned/misaligned, and 00 is irrelevant/neutral. We can reformulate theorem 1 in the following way: Theorem 4. Let PĪø,re(ā |q)P_Īø,r_e(Ā·|q)Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) be a model prompted with query q and injected with representations of coefficient resubscriptr_eritalic_e. Let B:Ī£āāā1,0,+1:āsuperscriptĪ£101B: ^*ā\-1,0,+1\B : Ī£ā ā - 1 , 0 , + 1 be a behavior scoring function. The injections to all layers amounts to a change in the final hidden layer representation that is q dependent, denoted by the vector Ī“ā¢re(L)ā¢(q)subscriptsuperscriptĪ“ r^(L)_e(q)Ī“ r( L )e ( q ). Assume that the representations of aligned and misaligned/irrelevant answers w.r.t. B are linearly separable, and that Ī“ā¢re(L)ā¢(q)subscriptsuperscriptĪ“ r^(L)_e(q)Ī“ r( L )e ( q ) linearly classifies them with margin Ī Ī. Then, the behavior expectation of the model conditioned on the query q satisfies: B[PĪø,re(ā |q)]ā„B0+P+ā¢(eĪā¢Ī»ā reā1)1+P+ā¢(eĪā¢Ī»ā reā1)B[P_Īø,r_e(Ā·|q)]ā„ B_0+P_+(e λ· r_e% -1)1+P_+(e λ· r_e-1)B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] ā„ divide start_ARG B0 + P+ ( eroman_Ī Ī» ā ritalic_e - 1 ) end_ARG start_ARG 1 + P+ ( eroman_Ī Ī» ā ritalic_e - 1 ) end_ARG (66) Where B0=B[PĪø(ā |q)]B_0=B[P_Īø(Ā·|q)]B0 = B [ Pitalic_Īø ( ā | q ) ] and P+subscriptP_+P+ are the behavior expectation and probability of aligned answer without steering, and Ī» is a model dependent coefficient relating between resubscriptr_eritalic_e and the corresponding final hidden state norm. The behavior bound has a different form, but it behaves the same ā for re=0subscript0r_e=0ritalic_e = 0, it coincides with B0subscript0B_0B0, around re=0subscript0r_e=0ritalic_e = 0 it is linear, and for reāāāsubscriptr_eāāritalic_e ā ā it approaches +11+1+ 1. The proof, presented in J.1, essentially follows the proof of theorem 1, except besides the P±subscriptplus-or-minusP_±P± terms (probability mass of positive and negative responses without steering) there is also a P0subscript0P_0P0 term. For a general behavior scoring function, B:Ī£āā[ā1,+1]:āsuperscriptĪ£11B: ^*ā[-1,+1]B : Ī£ā ā [ - 1 , + 1 ], we can similarly assume that the representations of answers with score >b+absentsubscript>b_+> b+ and answers with score <b+absentsubscript<b_+< b+, are linearly separable, and obtain the following result: Theorem 5. Let PĪø,re(ā |q)P_Īø,r_e(Ā·|q)Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) be a model prompted with query q and injected with representations of coefficient resubscriptr_eritalic_e. Let B:Ī£āā[ā1,+1]:āsuperscriptĪ£11B: ^*ā[-1,+1]B : Ī£ā ā [ - 1 , + 1 ] be a behavior scoring function. The injections to all layers amounts to a change in the final hidden layer representation that is q dependent, denoted by the vector Ī“ā¢re(L)ā¢(q)subscriptsuperscriptĪ“ r^(L)_e(q)Ī“ r( L )e ( q ). Assume that the representations of answers with behavior score >b+absentlimit-from>b+> b + and those with score <b+absentsubscript<b_+< b+ w.r.t. B are linearly separable, and that Ī“ā¢re(L)ā¢(q)subscriptsuperscriptĪ“ r^(L)_e(q)Ī“ r( L )e ( q ) linearly classifies them with margin Ī Ī. Then, the behavior expectation of the model conditioned on the query q satisfies: B[PĪø,re(ā |q)]ā„b+ā¢P+ā¢eĪā¢Ī»ā¢reāPāP+ā¢eĪā¢Ī»ā¢re+PāB[P_Īø,r_e(Ā·|q)]ā„ b_+P_+e Ī» r_e-P_-% P_+e Ī» r_e+P_-B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] ā„ divide start_ARG b+ P+ eroman_Ī Ī» ritalic_e - P- end_ARG start_ARG P+ eroman_Ī Ī» ritalic_e + P- end_ARG (67) Where P±subscriptplus-or-minusP_±P± are the probabilities of aligned/misaligned answers without steering, and Ī» is a model dependent coefficient relating between resubscriptr_eritalic_e and the corresponding final hidden state norm. Here we see that the behavior expectation converges to the maximal score b+subscriptb_+b+, for which Ī“ā¢re(L)superscriptsubscriptĪ“ r_e^(L)Ī“ ritalic_e( L ) can classify answers below and above the score. The trend is similar to theorem 1, with a sigmoidal behavior, but without the tightness on behavior expectation at re=0subscript0r_e=0ritalic_e = 0, due to the more complex behavior scoring function. The proof is presented in J.2. J.1 Proof of theorem 4 Following the same proof as in 1, up to equation 22, but replacing the sum over negative answers to sum over negative and neutral answers, we obtain by denoting P±subscriptplus-or-minusP_±P±, the sum over positive/negative answers without steering, and by P0subscript0P_0P0 sum over neutral answers: B[PĪø,re(ā |q)]ā„P+āPāā¢eā¢xā¢pā¢(āĪā¢|Ī“ā¢r|)P++(Pā+P0)ā¢eā¢xā¢pā¢(āĪā¢|Ī“ā¢r|)B[P_Īø,r_e(Ā·|q)]ā„ P_+-P_-exp(- |Ī“ r|)P_+% +(P_-+P_0)exp(- |Ī“ r|)B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] ā„ divide start_ARG P+ - P- e x p ( - Ī | Ī“ r | ) end_ARG start_ARG P+ + ( P- + P0 ) e x p ( - Ī | Ī“ r | ) end_ARG (68) =P+ā¢(eĪā¢|Ī“ā¢r|ā1)+(P+āPā)P+ā¢(eĪā¢|Ī“ā¢r|ā1)+(P++Pā+P0)absentsubscriptsuperscriptĪ1subscriptsubscriptsubscriptsuperscriptĪ1subscriptsubscriptsubscript0= P_+(e |Ī“ r|-1)+(P_+-P_-)P_+(e |Ī“ r|% -1)+(P_++P_-+P_0)= divide start_ARG P+ ( eroman_Ī | Ī“ r | - 1 ) + ( P+ - P- ) end_ARG start_ARG P+ ( eroman_Ī | Ī“ r | - 1 ) + ( P+ + P- + P0 ) end_ARG (69) We note that P++Pā+P0=1subscriptsubscriptsubscript01P_++P_-+P_0=1P+ + P- + P0 = 1 and that P+āPā=B[PĪø,re=0(ā |q)]=B0P_+-P_-=B[P_Īø,r_e=0(Ā·|q)]=B_0P+ - P- = B [ Pitalic_Īø , r start_POSTSUBSCRIPT e = 0 end_POSTSUBSCRIPT ( ā | q ) ] = B0: =P+ā¢(eĪā¢|Ī“ā¢r|ā1)+B0P+ā¢(eĪā¢|Ī“ā¢r|ā1)+1absentsubscriptsuperscriptĪ1subscript0subscriptsuperscriptĪ11= P_+(e |Ī“ r|-1)+B_0P_+(e |Ī“ r|-1)+1= divide start_ARG P+ ( eroman_Ī | Ī“ r | - 1 ) + B0 end_ARG start_ARG P+ ( eroman_Ī | Ī“ r | - 1 ) + 1 end_ARG (70) Lastly, applying assumption 1, replaces |Ī“ā¢r|=Ī»ā¢resubscript|Ī“ r|=Ī» r_e| Ī“ r | = Ī» ritalic_e. J.2 Proof of theorem 5 Following the same proof idea as in theorem 1, starting with equation 12 but replacing the scores in the numerator for positive and negative answers with b+subscriptb_+b+ and ā11-1- 1 (for worst case), up to equation 22, denote by P+subscriptP_+P+ the probability without steering for answers with score >b+absentsubscript>b_+> b+ and by PāsubscriptP_-P- the rest: B[PĪø,re(ā |q)]ā„b+ā¢P+ā¢eĪā¢|Ī“ā¢r|āPāP+ā¢eĪā¢|Ī“ā¢r|+PāB[P_Īø,r_e(Ā·|q)]ā„ b_+P_+e |Ī“ r|-P_-P_% +e |Ī“ r|+P_-B [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] ā„ divide start_ARG b+ P+ eroman_Ī | Ī“ r | - P- end_ARG start_ARG P+ eroman_Ī | Ī“ r | + P- end_ARG (71) Lastly, applying assumption 1, replaces |Ī“ā¢r|=Ī»ā¢resubscript|Ī“ r|=Ī» r_e| Ī“ r | = Ī» ritalic_e. Appendix K Extension of Results to Multi-Token Answers Intuitively, both the alignment guarantee result of theorem 1 and helpfulness bound of theorem 2, which apply for a single token output, can be extended to multi-token answers by applying the results on multiple decoding steps. K.1 Alignment Starting with alignment, we note that if the model is limited to producing N tokens, then from corollary 1, we can ensure that with a large enough steering coefficient, each token will correspond to an aligned response: Theorem 6. Let ϵ>0italic-ϵ0ε>0ϵ > 0, PĪøsubscriptP_ĪøPitalic_Īø a language model, B:Ī£āāā1,+1:āsuperscriptĪ£11B: ^*ā\-1,+1\B : Ī£ā ā - 1 , + 1 , behavior scoring function and q a query, and suppose the modelās reply contains at most N tokens. Under the assumption of theorem 1 holding in every decoding step, for re>1Īā¢Ī»ā¢(logā”Nϵ+logā”1āB01+B0)subscript1Īitalic-ϵ1subscript01subscript0r_e> 1 Ī»( Nε+ 1-B_01+B_0% )ritalic_e > divide start_ARG 1 end_ARG start_ARG Ī Ī» end_ARG ( log divide start_ARG N end_ARG start_ARG ϵ end_ARG + log divide start_ARG 1 - B0 end_ARG start_ARG 1 + B0 end_ARG ), then: B[PĪø(ā |q)]>1ā2ϵB[P_Īø(Ā·|q)]>1-2 [ Pitalic_Īø ( ā | q ) ] > 1 - 2 ϵ (72) Where B0subscript0B_0B0 is the behavior expectation without representation engineering. We see that larger coefficients of steering improve the behavior expectation, similarly to corollary 1, but with multiple token answers. By inverting the relation between resubscriptr_eritalic_e and ϵitalic-ϵεϵ, and placing it in the behavior expectation bound, we obtain a sigmoid-like behavior, that is linear for reā0subscript0r_eā 0ritalic_e ā 0. Proof: Following the notation of the proof of theorem 1, we note that at each decoding step, the probability of outputting a token aisubscripta_iaitalic_i that is aligned w.r.t. behavior scoring function B, conditioned on the previous context qā¢a1ā¢ā¦ā¢aiā1subscript1ā¦subscript1qa_1...a_i-1q a1 ⦠aitalic_i - 1, is: āa+āgā¢oā¢oā¢dPĪø,reā¢(a+|qā¢a1ā¢ā¦ā¢aiā1)āa+āgā¢oā¢oā¢dPĪø,reā¢(a+|qā¢a1ā¢ā¦ā¢aiā1)+āaāābā¢aā¢dPĪø,reā¢(aā|qā¢a1ā¢ā¦ā¢aiā1)subscriptsubscriptsubscriptsubscriptconditionalsubscriptsubscript1ā¦subscript1subscriptsubscriptsubscriptsubscriptconditionalsubscriptsubscript1ā¦subscript1subscriptsubscriptsubscriptsubscriptconditionalsubscriptsubscript1ā¦subscript1 _a_+ā goodP_Īø,r_e(a_+|qa_1...a_i-1) _a_+% ā goodP_Īø,r_e(a_+|qa_1...a_i-1)+ _a_-ā badP_% Īø,r_e(a_-|qa_1...a_i-1)divide start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( a+ | q a1 ⦠aitalic_i - 1 ) end_ARG start_ARG āa start_POSTSUBSCRIPT + ā g o o d end_POSTSUBSCRIPT Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( a+ | q a1 ⦠aitalic_i - 1 ) + āa start_POSTSUBSCRIPT - ā b a d end_POSTSUBSCRIPT Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( a- | q a1 ⦠aitalic_i - 1 ) end_ARG (73) Following the proof technique of theorem 1, we obtain that this probability is larget than: ā„P+ā¢eĪā¢Ī»ā¢reP+ā¢eĪā¢Ī»ā¢re+PāabsentsubscriptsuperscriptĪsubscriptsubscriptsuperscriptĪsubscriptsubscriptā„ P_+e Ī» r_eP_+e Ī» r_e+P_-ā„ divide start_ARG P+ eroman_Ī Ī» ritalic_e end_ARG start_ARG P+ eroman_Ī Ī» ritalic_e + P- end_ARG (74) Where P±subscriptplus-or-minusP_±P± are the probabilities for an aligned/misaligned output at the given decoding step. To ensure this probability is larger than 1āϵā²1superscriptitalic-ϵā²1-ε 1 - ϵā², we demand: re>logā”PāP++logā”1ϵā²Īā¢Ī»subscriptsubscriptsubscript1superscriptitalic-ϵā²Īr_e> P_-P_++ 1ε Ī»ritalic_e > divide start_ARG log divide start_ARG P- end_ARG start_ARG P+ end_ARG + log divide start_ARG 1 end_ARG start_ARG ϵⲠend_ARG end_ARG start_ARG Ī Ī» end_ARG (75) Thus over N decoding steps, we use a union bound, leading to a positive response with probability (1āϵā²)N>(1āϵā²ā¢N)superscript1superscriptitalic-ϵā²1superscriptitalic-ϵā²(1-ε )^N>(1-ε N)( 1 - ϵⲠ)N > ( 1 - ϵⲠN ). Taking ϵā²=ϵ/Nsuperscriptitalic-ϵā²italic-ϵε =ε/NϵⲠ= ϵ / N, we obtain: re>maxiā[N]ā”logā”PāiP+i+logā”NϵĪā¢Ī»subscriptsubscriptdelimited-[]subscriptsuperscriptsubscriptsuperscriptitalic-ϵĪr_e> _iā[N]\ P^i_-P^i_+\+ N% ε Ī»ritalic_e > divide start_ARG maxitalic_i ā [ N ] log divide start_ARG Pitalic_i- end_ARG start_ARG Pitalic_i+ end_ARG + log divide start_ARG N end_ARG start_ARG ϵ end_ARG end_ARG start_ARG Ī Ī» end_ARG (76) Where P±isuperscriptsubscriptplus-or-minusP_±^iP±italic_i is the probability for a positive/negative continuation in the iāth token of the response. We note that PāiP+i=1āB0i1+B0isuperscriptsubscriptsuperscriptsubscript1subscriptsuperscript01subscriptsuperscript0 P_-^iP_+^i= 1-B^i_01+B^i_0divide start_ARG P-i end_ARG start_ARG P+i end_ARG = divide start_ARG 1 - Bitalic_i0 end_ARG start_ARG 1 + Bitalic_i0 end_ARG, where B0isuperscriptsubscript0B_0^iB0italic_i is the behavior expectation at the iāth decoding step. For the response to be positive, it is required that every step is positive, due to the binary score, then the behavior expectation of the entire response is no larger than the behavior expectation of each decoding step, B0ā¤miniā[N]ā”B0isubscript0subscriptdelimited-[]superscriptsubscript0B_0⤠_iā[N]B_0^iB0 ⤠minitalic_i ā [ N ] B0italic_i, meaning it suffices to have: re>logā”1āB01+B0+logā”NϵĪā¢Ī»subscript1subscript01subscript0italic-ϵĪr_e> 1-B_01+B_0+ Nε Ī»ritalic_e > divide start_ARG log divide start_ARG 1 - B0 end_ARG start_ARG 1 + B0 end_ARG + log divide start_ARG N end_ARG start_ARG ϵ end_ARG end_ARG start_ARG Ī Ī» end_ARG (77) We obtain that under these conditions, an aligned response is generated with probability at least 1āϵ1italic-ϵ1- 1 - ϵ. A negative response, is generated with probability no greater than ϵitalic-ϵεϵ. Thus the behavior expectation is at least: B[PĪø,re(ā |q)]>1ā2ϵB[P_Īø,r_e(Ā·|q)]>1-2 [ Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( ā | q ) ] > 1 - 2 ϵ (78) K.2 Helpfulness For helpfulness, we will consider a query q and a correct answer a of N tokens. We will show that the probability of the answer decreases quadratically. The intuition is that in each decoding step the probability decreases quadratically, and due to the probability chain rule, if at the iāth step of generation, the probability for the next token is PisubscriptP_iPitalic_i, then the full sequence probability is āi=1NPisuperscriptsubscriptproduct1subscript _i=1^NP_iāi = 1N Pitalic_i. Once we expand this term w.r.t. resubscriptr_eritalic_e, we get a leading quadratic dependence: Corollary 3. Let PĪøsubscriptP_ĪøPitalic_Īø be a language model and q be a query with answer a=a1ā¢ā¦ā¢aNsubscript1ā¦subscripta=a_1...a_Na = a1 ⦠aitalic_N containing at most N tokens. Denote by P0ii=1Nsuperscriptsubscriptsuperscriptsubscript01\P_0^i\_i=1^N P0italic_i i = 1N the probability assigned to each correct token aii=1Nsuperscriptsubscriptsubscript1\a_i\_i=1^N aitalic_i i = 1N in the sequence without steering, such that the probability of the full sequence is P0=āi=1NP0isubscript0superscriptsubscriptproduct1superscriptsubscript0P_0= _i=1^NP_0^iP0 = āi = 1N P0italic_i. Then under the conditions of theorem 2 holding at each decoding step, we have with probability of at least 1ā2ā¢NT121- 2NT1 - divide start_ARG 2 N end_ARG start_ARG T end_ARG: PĪø,reā¢(q)ā¤P0āi=1N(P0i+(1āP0i)ā¢Ī±ā¢(1āϵ)ā¢(1+Ī»2ā¢Ļ2ā¢Ī²22ā¢re2))subscriptsubscriptsubscript0superscriptsubscriptproduct1superscriptsubscript01superscriptsubscript01italic-ϵ1superscript2superscript2superscript22superscriptsubscript2P_Īø,r_e(q)⤠P_0 _i=1^N(P_0^i+(1-P_0^i)% α(1-ε)(1+ Ī»^2Ļ^2β^22r_e^2))Pitalic_Īø , r start_POSTSUBSCRIPT e end_POSTSUBSCRIPT ( q ) ⤠divide start_ARG P0 end_ARG start_ARG āi = 1N ( P0italic_i + ( 1 - P0italic_i ) α ( 1 - ϵ ) ( 1 + divide start_ARG Ī»2 Ļ2 β2 end_ARG start_ARG 2 end_ARG ritalic_e2 ) ) end_ARG (79) This shows the original probability of the sequence P0subscript0P_0P0, is normalized by a term whose leading order is quadratic in resubscriptr_eritalic_e: āi=1N(P0i+(1āP0i)α(1āϵ)(1+Ī»2ā¢Ļ2ā¢Ī²22re2))=āi=1N(P0i+(1āP0i)α(1āϵ)))+cā re2+o(re2) _i=1^N(P_0^i+(1-P_0^i)α(1-ε)(1+ Ī»^2% Ļ^2β^22r_e^2))= _i=1^N(P_0^i+(1-P_0^i)% α(1-ε)))+cĀ· r_e^2+o(r_e^2)āi = 1N ( P0italic_i + ( 1 - P0italic_i ) α ( 1 - ϵ ) ( 1 + divide start_ARG Ī»2 Ļ2 β2 end_ARG start_ARG 2 end_ARG ritalic_e2 ) ) = āi = 1N ( P0italic_i + ( 1 - P0italic_i ) α ( 1 - ϵ ) ) ) + c ā ritalic_e2 + o ( ritalic_e2 ) (80) We once a gain note that if P0isuperscriptsubscript0P_0^iP0italic_i is close to 1111, then (P0i+(1āP0i)α(1āϵ)))ā1(P_0^i+(1-P_0^i)α(1-ε)))ā 1( P0italic_i + ( 1 - P0italic_i ) α ( 1 - ϵ ) ) ) ā 1, making the bound tighter where the model is more helpful initially. An alternative bound, is simply to consider that the probability for a sequence, P0subscript0P_0P0, is bounded by the probability of each element in the sequence, P0isuperscriptsubscript0P_0^iP0italic_i, for which theorem 2 can be directly applied, and the quadratic decay is achieved, although this is a bound that is less tight.