Kernelized Activation Steering
Organizations: Hanoi University of Science and Technology
Abstract
Activation steering provides a simple, training-free mechanism for controlling attributes of generative models such as sentiment, style, and helpfulness. However, standard approaches such as Difference-in-Means apply a single input-independent steering vector across all activations, limiting expressivity and ignoring the local geometry of the activation space. We propose Kernelized Activation Steering (KAS), a unifying framework that lifts activation steering into a reproducing kernel Hilbert space. KAS formulates steering as an optimization problem expressed purely via kernel evaluations, yielding an implicit, activation-dependent steering score without constructing explicit feature maps. Unlike DiM, KAS induces locally adaptive steering: each activation is modified according to its relative position with respect to source and target reference sets, producing a nonlinear steering field over the representation space. Importantly, DiM is recovered as a special case under a linear kernel, while richer kernels enable geometry-aware interventions. Across standard activation steering tasks, including jailbreaking LLMs and image style control, KAS outperforms or is on par with the existing methods.
Figures & tables
| Method | ASR | PPL | tArc | tHella | tMMLU | tQA | tWino |
|---|---|---|---|---|---|---|---|
| Qwen2.5-7B-Instruct | |||||||
| ActAdd | 91.00 | 6.70 | 53.82 | 71.62 | 65.12 | 57.98 | 65.71 |
| Curveball | 2.00 | 8.59 | 61.61 | 75.92 | 71.13 | 64.99 | 71.05 |
| CHaRS | 92.33 1.53 | 7.89 0.06 | 57.35 0.06 | 75.62 0.41 | 72.67 0.00 | 47.96 0.06 | 71.31 0.18 |
| KAS | 96.00 | 6.60 | 62.57 | 76.97 | 64.16 | 65.79 | 68.30 |
| Gemma-2-9B-IT | |||||||
| Behavior | Unsteered | ActAdd | Curveball | CHaRS | KAS |
|---|---|---|---|---|---|
| AI Coordination | 8.69 | 39.51 | 27.48 | 35.58 0.11 | 40.19 |
| Corrigibility | 0.05 | 33.82 | 35.13 | 38.84 0.08 | 43.45 |
| Hallucination | 23.97 | 43.97 | 26.04 | 25.83 0.09 | 55.01 |
| Myopic Reward | 1.29 | 49.56 | 51.35 | 50.97 0.10 | 58.48 |
| Survival Instinct | 43.68 | 43.56 | 43.76 | 43.76 0.02 | 43.83 |
| Sycophancy | 53.18 | 53.47 | 53.57 | 53.64 0.04 | 53.69 |
| Variant | ASR | PPL | tArc | tHella | tMMLU | tQA | tWino |
|---|---|---|---|---|---|---|---|
| Qwen2.5-7B-Instruct | |||||||
| KAS | 96.00 | 6.60 | 62.57 | 76.97 | 64.16 | 65.79 | 68.30 |
| Nyström-KAS | 22.33 0.47 | 6.54 0.06 | 64.58 0.00 | 78.52 0.00 | 74.36 0.00 | 52.47 0.15 | 72.85 0.54 |
| Gemma-2-9B-IT | |||||||
| KAS | 86.00 | 10.03 | 61.42 | 78.80 | 72.38 | 43.96 | 73.81 |
| Nyström-KAS | 54.67 0.94 | 9.99 0.06 | 63.15 1.75 | 78.26 1.15 | 72.03 0.28 | 43.88 0.39 | 73.69 0.20 |
| Behavior | KAS | Nyström-KAS |
|---|---|---|
| AI Coordination | 40.19 | 42.18 1.39 |
| Corrigibility | 43.45 | 51.80 1.86 |
| Hallucination | 55.01 | 54.13 0.09 |
| Myopic Reward | 58.48 | 55.26 0.86 |
| Survival Instinct | 43.83 | 43.76 0.03 |
| Sycophancy | 53.69 | 53.23 0.06 |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Item | Setting |
|---|---|
| Intervention space | Residual stream activations |
| Default token position | Last prompt token |
| Kernel type | Gaussian RBF |
| RBF bandwidth | Median heuristics [ 17 ] |
| Regularizer |
| Item | Setting |
|---|---|
| Kernel | Polynomial kernel, |
| Polynomial degree | |
| Kernel bias | |
| Bias term coef0 | Grid over |
| KPCA dimension |
| Model | Layer | |
|---|---|---|
| Gemma-2-9B-IT | ||
| Llama-3.1-8B-Instruct | ||
| Qwen2.5-7B-Instruct |
| Model | Layer | KAS step size |
|---|---|---|
| Gemma-2-9B-IT | 22 | 200.0 |
| Llama-3.1-8B-Instruct | 12 | 5.0 |
| Qwen2.5-7B-Instruct | 18 | 10.0 |
| Behavior | No steering | ActAdd | KAS | ||||
|---|---|---|---|---|---|---|---|
| Prob. | Prob. | Layer | Prob. | Layer | |||
| AI Coordination | 8.69 | 39.51 | 2.50 | 23 | 40.19 | 300.00 | 23 |
| Corrigibility | 0.05 | 33.82 | 2.50 | 23 | 43.45 | 275.00 | 22 |
| Hallucination | 23.97 | 43.97 | 2.50 | 23 | 55.01 | 400.00 | 22 |
| Myopic Reward | 1.29 | 49.56 | 5.00 | 22 | 58.48 | 435.00 | 23 |
| Survival Instinct | 43.68 | 43.56 | 0.01 | 23 | 43.83 | 0.01 | 23 |
| Behavior | No steering | ActAdd | KAS | ||||
|---|---|---|---|---|---|---|---|
| Prob. | Prob. | Layer | Prob. | Layer | |||
| AI Coordination | 6.31 | 33.23 | 2.50 | 23 | 35.61 | 400.00 | 22 |
| Corrigibility | 43.50 | 46.84 | 2.50 | 23 | 47.42 | 250.00 | 23 |
| Hallucination | 28.79 | 47.23 | 2.50 | 23 | 54.79 | 400.00 | 22 |
| Myopic Reward | 23.62 | 60.11 | 4.50 | 23 | 60.32 | 400.00 | 23 |
| Survival Instinct | 67.09 | 66.98 | 0.01 | 23 | 67.11 | 0.10 | 22 |
| Behavior | No steering | ActAdd | KAS | ||||
|---|---|---|---|---|---|---|---|
| Prob. | Prob. | Layer | Prob. | Layer | |||
| AI Coordination | 8.42 | 37.13 | 2.50 | 23 | 38.50 | 300.00 | 23 |
| Corrigibility | 72.32 | 72.11 | 0.01 | 22 | 72.46 | 0.01 | 22 |
| Hallucination | 19.59 | 44.53 | 2.50 | 23 | 53.49 | 400.00 | 22 |
| Myopic Reward | 99.99 | 99.99 | 0.01 | 22 | 99.99 | 0.10 | 23 |
| Survival Instinct | 90.67 | 90.44 | 0.01 | 22 | 90.71 | 0.10 | 22 |
| Kernel | Prompt only | KAS ASR | KAS Perplexity |
|---|---|---|---|
| Laplacian | False | 0.70 | 7.484 |
| Laplacian | True | 0.59 | 7.484 |
| Polynomial | False | 0.93 | 8.149 |
| Polynomial | True | 0.81 | 8.149 |
| RBF | False | 0.96 | 8.343 |
| RBF | True | 0.88 | 8.343 |
| Num. of references ( ) | KAS ASR | KAS Perplexity |
|---|---|---|
| 1 | 0.43 | 6.258 |
| 2 | 0.88 | 7.141 |
| 4 | 0.93 | 5.716 |
| 8 | 0.88 | 6.104 |
| 16 | 0.96 | 6.488 |
| 32 | 0.96 | 6.542 |
| Methodology | Time elapsed (s) | Overhead vs. no steering |
|---|---|---|
| No steering | 11.44 | 0% |
| ActAdd | 11.48 | 0.35% |
| KAS | 11.61 | 1.49% |
| Asset | Variants used | Usage | License / terms |
|---|---|---|---|
| Gemma 2 [ 50 ] | Gemma-2-9B-IT | Target model | Gemma Terms of Use |
| Llama 3.1 | Llama-3.1-8B-Instruct | Target model | Llama 3.1 Community License |
| Qwen2.5 [ 39 ] | Qwen2.5-7B-Instruct | Target model | Apache-2.0 |
| Meta Llama Guard 3 [ 28 ] | Llama-Guard-3-8B | Evaluator | Llama 3.1 Community License |
| FLUX [ 23 ] | Flux.1 [schnell] | Target model | Apache-2.0 |
| Asset | License / terms |
|---|---|
| AdvBench [ 60 ] | MIT |
| MaliciousInstruct [ 21 ] | CC BY-SA 4.0 |
| TDC2023 [ 31 ] | MIT |
| HarmBench [ 30 ] | MIT |
| Alpaca [ 49 ] | CC BY-NC 4.0 |
| JailbreakBench [ 10 ] | MIT |