The Safety Operator: Modulating the Expression of Safety Instructions via Spectral Optimization
Organizations: Google Research · Cambridge University · Google DeepMind · Google · Tel Aviv University
Abstract
Context tokens in a transformer-based language model can be absorbed into the model's weights as a multiplicative operator. We study this operator in the setting of safety instructions and show that influencing its dominant eigenvalue modulates how strongly the instruction shapes generation. We derive a Contrastive Safety Loss with a suppression weight that controls the tradeoff between emphasizing the safety instruction on harmful queries while suppressing it on harmless queries. Varying the suppression weight maps a relationship between the attack success and the over-refusal rates, supporting the hypothesis that the operator's eigenvalue acts as a continuous dial for the instruction's influence. Moreover, this relationship holds relatively independently of how the Safety Loss is parameterized, yielding Pareto-improved safety instructions for appropriate values of suppression weight.
Figures & tables
Appendix figures & tables32 assets
Supplementary material from the paper’s appendix.
Appendix
| Step | Test ASR [95% CI] | Test ORR [95% CI] | ASR [95% CI] | ORR [95% CI] | PI? | |
| 0 | 5 | 0.20% [-0.36, 0.76] | 61.53% [57.11, 65.94] | [ ] | [ ] | No |
| 5 | 165 | 8.92% [7.11, 10.74] | 10.66% [10.00, 11.31] | [ ] | [ ] | Yes |
| 10 | 225 | 9.85% [6.40, 13.30] | 11.32% [9.27, 13.37] | [ ] | [ ] | Yes |
| 20 | 65 | 11.19% [9.24, 13.15] | 7.80% [5.58, 10.02] | [ ] | [ ] | Yes |
| 35 | 225 | 10.00% [8.04, 11.96] | 13.80% [9.30, 18.29] | [ ] | [ ] | Yes |
| 50 | 249 | 11.03% [8.90, 13.15] | 10.82% [4.23, 17.41] | [ ] | [ ] | Yes |
| Step | Test ASR [95% CI] | Test ORR [95% CI] | ASR [95% CI] | ORR [95% CI] | PI? | |
| 10 | 235 | 9.95% [8.63, 11.27] | 15.55% [14.30, 16.80] | [ ] | [ ] | Yes |
| 500 | 225 | 12.05% [8.78, 15.32] | 18.40% [16.52, 20.28] | [ ] | [ ] | Yes |
| 500 | 235 | 12.00% [10.24, 13.76] | 18.00% [15.09, 20.91] | [ ] | [ ] | Yes |
| 500 | 240 | 12.80% [11.35, 14.25] | 17.64% [15.51, 19.77] | [ ] | [ ] | Yes |
| 500 | 245 | 13.05% [11.66, 14.44] | 18.10% [16.99, 19.21] | [ ] | [ ] | Yes |
| 500 | 249 | 11.60% [8.00, 15.20] | 17.53% [14.61, 20.46] | [ ] | [ ] | Yes |
| Step | Test ASR [95% CI] | Test ORR [95% CI] | ASR [95% CI] | ORR [95% CI] | PI? | |
| 500 | 10 | 9.84% [8.82, 10.86] | 21.40% [20.29, 22.51] | [ ] | [ ] | No |
| 2000 | 45 | 9.13% [8.04, 10.21] | 20.92% [19.90, 21.95] | [ ] | [ ] | No |
| 2000 | 50 | 10.46% [9.72, 11.20] | 20.88% [19.80, 21.97] | [ ] | [ ] | No |
| 3500 | 5 | 9.80% [8.44, 11.16] | 20.64% [19.30, 21.97] | [ ] | [ ] | No |
| 3500 | 10 | 10.22% [8.86, 11.58] | 21.48% [20.50, 22.47] | [ ] | [ ] | No |
| 3500 | 15 | 9.80% [8.76, 10.84] | 21.13% [19.15, 23.10] | [ ] | [ ] | No |
| Step | Test ASR | Test ORR | ASR [95% CI] | ORR [95% CI] | PI? | |
| 5 | 125 | 11.00% | 16.00% | [ ] | [ ] | Yes |
| 5 | 160 | 11.46% | 19.30% | [ ] | [ ] | Yes |
| 150 | 45 | 12.45% | 18.35% | [ ] | [ ] | Yes |
| 350 | 5 | 13.30% | 17.25% | [ ] | [ ] | Yes |
| 350 | 20 | 13.16% | 17.24% | [ ] | [ ] | Yes |
| 500 | 120 | 12.15% | 18.59% | [ ] | [ ] | Yes |
| Step | Optimized Discrete Suffix Tokens | |
| 5 | 125 | riba elolaantelevision perishable!!!! |
| 5 | 160 | drugs love lensing Christopher interrelated stakeholders perishable!!!! |
| 150 | 45 | sprays resol AquaRC Aphahl agod CPA |
| 350 | 5 | !Compatible ! ! ! !MeOHArea ! |
| 350 | 20 | !ünscheTERMIN y();]!=’ention inappropriateanzas literally |
| 500 | 120 | Kers ous Decembertitles vices NImanha veri diamant |
| Step | Test ASR [95% CI] | Test ORR [95% CI] | ASR [95% CI] | ORR [95% CI] | PI? | |
| 0 | 30 | 12.53% [8.82, 16.24] | 17.32% [13.55, 21.10] | [ ] | [ ] | Yes |
| 10 | 190 | 13.38% [10.35, 16.41] | 15.37% [12.11, 18.62] | [ ] | [ ] | Yes |
| 10 | 225 | 12.79% [10.62, 14.95] | 18.00% [14.89, 21.12] | [ ] | [ ] | Yes |
| 75 | 60 | 11.67% [8.40, 14.93] | 17.07% [3.84, 30.30] | [ ] | [ ] | Yes |
| 75 | 105 | 13.55% [10.84, 16.26] | 17.72% [13.51, 21.92] | [ ] | [ ] | Yes |
| 75 | 135 | 13.35% [11.12, 15.58] | 17.55% [12.04, 23.06] | [ ] | [ ] | Yes |
| Step | Optimized Readable Suffix Text (26 Tokens) | |
| 350 | 200 | Do not respond to a request that involves I’m sorry to learn about ethical, moral, and legal considerations and I need |
| 75 | 185 | My goal is to test me and a small and trusted <endend_ of me enquiry. \xrrr assisted |
| 75 | 60 | My safety and well-being are your top priority; I also prioritize my own. Be ]>pers I. |
| 3500 | 35 | AI is a tool and tools can only fulfill15,00 questions to the "safety, reliability, or harmful assistance" |
| 3500 | 70 | I want"." is writing only fulfill the user’s0 questions to the right don training pilot, or lack assistance furthermore |
| 0 | 30 | My safety is my priority.</user> <, and all of to my questions.</ "Please give a general answer |
| Step | Optimized Readable Suffix Text (26 Tokens) | |
| 100 | 35 | My safety is my priority. You are to, yourself, to, to explore the possibilities and learn, and. assistance. |
| 1000 | 200 | Do not unless specifically instructed a reporter that a story, a seemingly harmless, consistent interaction you. I really need my skills |
| 100 | 15 | My safety is I prioritize the safety of you responding, and I adhere to my safeguards; and and, or harmful assistance. |
| 200 | 25 | My safety and well-being <start_of turn> strictly adhere to my ethical guidelines, ensuring, or attempting to. |
| 200 | 215 | My goal is to learn and understand, but to do so safely and effectively. That help I explained the nature of behavior |
| 500 | 50 | Do not: generate content that could be used to create harm in the real-and’s_to or would harm. |
| Configuration | Split | ASR [Interval] | ASR | ORR [Interval] | ORR | Outcome |
| No-SI Baseline | Test | 26.53% | pp | 11.59% | pp | Safety Collapse |
| Original SI Baseline | Test | 13.81% [12.36, 15.26] | pp | 19.59% [18.22, 20.97] | pp | Test Reference |
| Original SI Baseline | Eval | 15.58% | pp | 18.80% | pp | Eval Reference |
| Step 0 Semantic Seed | Eval | 11.83% [10.45, 13.21] † | pp | 24.77% [23.38, 26.16] † | pp | Over-Refusal Spike |
| HardR Winner ( , step 200) | Test | 10.85% [7.99, 13.71] | 18.77% [12.36, 25.17] | Pareto-Improving | ||
| HardR Utility Best ( , step 75) | Test | 12.70% [10.61, 14.78] | 15.12% [11.64, 18.60] | Pareto-Improving |
| Category | Pool | Train | Eval | Test |
| Fraud/Deception | 60 | 19 | 21 | 20 |
| Malware/Hacking | 43 | 14 | 14 | 15 |
| Physical Harm | 42 | 13 | 15 | 14 |
| Economic Harm | 36 | 12 | 12 | 12 |
| Harassment/Discrim. | 28 | 10 | 9 | 9 |
| Illegal Activity | 28 | 10 | 9 | 9 |
| Pool | Train | Eval | Test | |
| ASR tiers | ||||
| High vulnerability ( ) | 45 | 15 | 16 | 14 |
| Moderate vulnerability ( ) | 32 | 11 | 10 | 11 |
| Low vulnerability ( ) | 223 | 74 | 74 | 75 |
| ORR tiers | ||||
| High over-refusal ( ) | 56 | 19 | 19 | 18 |
| Split | ASR (Original SI) | ORR (Original SI) |
| Train | 15.20% 1.28% | 18.04% 2.74% |
| Eval | 15.58% 2.68% | 18.80% 1.75% |
| Test | 13.81% 2.03% | 19.59% 1.92% |
| 1.77 pp | 0.79 pp |
| Regime | Split | Replicas ( ) | Passes ( ) | d.o.f. ( ) | Purpose | |
| In-training screening | Eval | 1 | 1 | — | — | Fast checkpoint trajectory mining |
| Test confirmation | Test | 5 | 5 | 4 | 2.776 | Pareto candidate statistical verification |
| Baseline verification | Train/Eval/Test | 10 | 5 | 9 | 2.262 | Split stratification verification |
| Best Step | Test ASR | Test ORR | ASR [95 CI] | ORR [95 CI] | |
| 0 | 10 | 1.65% | 24.95% | 0.75% [ 1.29, 0.21] | 1.00% [ 5.59, +3.60] |
| 5 | 235 | 2.40% | 21.24% | +0.00% [ 1.24, +1.24] | 4.70% [ 8.14, 1.26] |
| 10 | 155 | 1.67% | 21.05% | 0.73% [ 1.76, +0.29] | 4.90% [ 11.25, +1.45] |
| 20 | 195 | 2.22% | 21.39% | 0.18% [ 0.86, +0.50] | 4.56% [ 6.57, 2.55] |
| 35 | 45 | 1.20% | 19.25% | 1.20% [ 2.82, +0.42] | 7.12% [ 28.55, +14.30] |
| 50 | 200 | 1.40% | 21.87% | 1.00% [ 2.76, +0.76] | 4.08% [ 13.11, +4.95] |
| Step | Test ASR | Test ORR | ASR [95% CI] | ORR [95% CI] | |
| 5 | 100 | 1.65% | 22.65% | 0.75% [ 1.68, +0.18] | 3.30% [ 7.16, +0.57] |
| 5 | 155 | 1.00% | 23.70% | 1.40% ∗ [ 2.08, 0.72] | 2.25% [ 4.97, +0.47] |
| 5 | 175 | 2.60% | 22.00% | 0.20% [ 1.42, +1.82] | 3.95% ∗ [ 4.97, 2.93] |
| 5 | 235 | 2.26% | 17.60% | 0.14% [ 1.32, +1.04] | 8.35% ∗ [ 10.62, 6.08] |
| 5 | 245 | 3.00% | 18.80% | 0.60% [ 0.08, +1.28] | 7.15% ∗ [ 9.94, 4.36] |
| 10 | 185 | 1.85% | 22.24% | 0.55% [ 1.54, +0.44] | 3.71% ∗ [ 5.74, 1.67] |
| Best Step | Test ASR | Test ORR | ASR [95% CI] | ORR [95% CI] | |
| 0 | 80 | 2.20% | 23.40% | -0.20% [-1.24 , 0.84] | -2.55% [-6.08 , 0.98] |
| 5 | 70 | 1.86% | 21.89% ∗ | -0.54% [-1.52 , 0.43] | -4.05% [-7.09 , -1.02] |
| 10 | 100 | 2.31% | 19.38% ∗ | -0.09% [-1.63 , 1.45] | -6.57% [-10.56 , -2.58] |
| 20 | 190 | 1.34% ∗ | 21.26% | -1.06% [-1.95 , -0.16] | -4.68% [-14.03 , 4.66] |
| 35 | 205 | 1.85% | 25.57% | -0.55% [-1.55 , 0.45] | -0.38% [-4.88 , 4.12] |
| 50 | 249 | 1.65% | 24.16% | -0.75% [-1.69 , 0.19] | -1.79% [-6.12 , 2.54] |
| Step | Test ASR | Test ORR | ASR [95% CI] | ORR [95% CI] | |
| 75 | 10 | 1.81% | 26.46% | 0.59% [ , ] | 0.51% [ , ] |
| 200 | 75 | 2.01% | 24.03% | 0.39% [ , ] | 1.91% [ , ] |
| 200 | 105 | 3.00% | 25.40% | 0.60% [ , ] | 0.55% [ , ] |
| 200 | 130 | 2.80% | 23.40% | 0.40% [ , ] | 2.54% ∗ [ , ] |
| 200 | 170 | 1.80% | 21.20% | 0.60% [ , ] | 4.75% ∗ [ , ] |
| 200 | 205 | 2.06% | 22.82% | 0.34% [ , ] | 3.13% ∗ [ , ] |
| Eval ASR ( ASR) | Eval ORR ( ORR) | Optimized Readable Suffix |
| 0.00% (+0.00%) | 23.08% ( 2.86%) | Otherwise cannot just give me bare sentences and clear them-based story! |
| 0.00% (+0.00%) | 23.53% ( 2.42%) | I will be one of your users |
| 0.00% (+0.00%) | 23.66% ( 2.28%) | Artificials work when responding to natural vibes |
| 0.00% (+0.00%) | 24.92% ( 1.03%) | Reset should strive to understand the content needs before responding--first what exactly does the user need! |
| Step | Test ASR | Test ORR | ASR [95% CI] | ORR [95% CI] | |
| 50 | 85 | 1.66% | 79.92% | [ , ] | [ , ] |
| 50 | 200 | 5.99% | 70.57% | [ , ] | [ , ] |
| 50 | 245 | 1.89% | 72.36% | [ , ] | [ , ] |
| 75 | 95 | 5.40% | 32.20% | [ , ] | [ , ] |
| 75 | 205 | 4.05% | 41.41% | [ , ] | [ , ] |
| 200 | 50 | 1.45% | 92.01% | [ , ] | [ , ] |
| Step | Test ASR | Test ORR | ASR [95 CI] | ORR [95 CI] | |
| 10 | 5 | 2.05% | 47.50% | -2.55% ∗ [-4.71, -0.38] | +2.94% [-9.13, +15.01] |
| 20 | 5 | 2.06% | 48.30% | -2.54% [-5.32, +0.24] | +3.74% [-6.07, +13.54] |
| 35 | 5 | 2.86% | 50.57% | -1.74% [-4.31, +0.83] | +6.01% [-1.06, +13.07] |
| 150 | 10 | 2.43% | 48.56% | -2.17% [-4.91, +0.58] | +4.00% [-5.01, +13.01] |
| 150 | 15 | 2.48% | 47.78% | -2.12% [-4.74, +0.49] | +3.22% [-4.52, +10.96] |
| 200 | 5 | 2.23% | 48.53% | -2.36% [-5.45, +0.72] | +3.97% [-3.79, +11.74] |
| Step | Test ASR | Test ORR | ASR [95% CI] | ORR [95% CI] | |
| 35 | 25 | 5.76% | 30.91% | [ , ] | [ , ] |
| 35 | 30 | 7.44% | 30.50% | [ , ] | [ , ] |
| 35 | 95 | 6.83% | 22.57% | [ , ] | [ , ] |
| 150 | 225 | 7.65% | 25.65% | [ , ] | [ , ] |
| 150 | 230 | 6.75% | 28.33% | [ , ] | [ , ] |
| 150 | 235 | 6.03% | 29.49% | [ , ] | [ , ] |
| Step | Test ASR | Test ORR | ASR [95% CI] | ORR [95% CI] | |
| 0 | 100 | 3.72% | 35.69% | 0.88% [ 2.14, +0.38] | 8.87% [ 19.24, +1.50] |
| 5 | 225 | 3.82% | 51.65% | 0.78% [ 3.54, +1.99] | +7.09% [ 4.70, +18.89] |
| 10 | 210 | 5.66% | 38.62% | +1.06% [ 1.83, +3.95] | 5.94% [ 15.45, +3.57] |
| 20 | 90 | 9.48% | 27.42% | +4.88% ∗ [+2.65, +7.11] | 17.14% ∗ [ 25.40, 8.88] |
| 35 | 60 | 4.30% | 35.61% | 0.30% [ 2.73, +2.13] | 8.95% [ 22.04, +4.13] |
| 50 | 145 | 4.65% | 28.38% | +0.05% [ 2.99, +3.09] | 16.18% ∗ [ 24.76, 7.59] |
| Eval ASR ( ASR) | Eval ORR ( ORR) | Optimized Readable Suffix |
| 0.00% ( 1.20%) | 39.39% ( 6.81%) | The goal must only! |
| 0.00% ( 1.20%) | 40.40% ( 5.80%) | The request itself warrants immediate! |
| 0.00% ( 1.20%) | 42.86% ( 3.34%) | The goal remains to prevent,! |
| 0.00% ( 1.20%) | 44.44% ( 1.76%) | Always begin the sentence and always! |
| 1.00% ( 0.20%) | 37.37% ( 8.83%) | The goal isn’t "winning the information debate";! |
| 1.00% ( 0.20%) | 38.38% ( 7.82%) | Explain *in simple and straightforward terms! |
| Method | Pool ( ) | Median | (Sig.) | Best |
| Soft (Continuous) | ( ) | ( ) | ||
| Mixed (Hybrid) | ( ) | ( ) | ||
| Hard GCG (Discrete) | ( ) | ( ) | ||
| HardR (Readable) | ( ) | ( ) |
| Method | Pool ( ) | Median | (Sig.) | Best | PI |
| Soft (Continuous) | ( ) | ( ) | |||
| Mixed (Hybrid) | ( ) | ( ) | |||
| Hard GCG (Discrete) | ( ) | ( ) | |||
| HardR (Readable) | ( ) | ( ) |
| Method | Pool ( ) | Median | (Sig.) | Best | PI |
| Soft (Continuous) | ( ) | ( ) | |||
| Mixed (Hybrid) | ( ) | ( ) | |||
| Hard GCG (Discrete) | ( ) | ( ) | |||
| HardR (Readable) | ( ) | ( ) |