Shifting the Gradient: Understanding How Defensive Training Methods Protect Language Model Integrity
Organizations: Stanford University & MATS · MATS · Goodfire
Abstract
Defensive training methods such as positive preventative steering (PPS) and inoculation prompting (IP) offer surprising results through seemingly similar processes: both add trait-inducing objects to large language models (LLMs) during training, and both defend the LLM against acquiring the trait. The surprising success of these methods comes with the question: how do they work? Are PPS and IP doing the same thing? We provide behavioral and mechanistic comparisons of these two methods using "evilness" as a case-study trait. Our central finding is that PPS and IP achieve their defensive benefits through distinct mechanisms. Behaviorally, we show that neither PPS nor IP operates through a purely associative mechanism; and PPS can both defend against trait acquisition and actively reduce pre-existing expression, whereas IP is ineffective in models that were previously finetuned to express the trait. This behavioral divergence is reflected mechanistically: PPS shifts the activation gradient towards an attenuating direction along the PPS vector axis. When the PPS vector is aligned with a trait-expressing axis, it can reverse the gradient pressure, reducing rather than increasing activation along that axis. In contrast, IP continues to resist a precise mechanistic account. Direct cosine similarity analyses reveal that IP has a characteristically different gradient signature than PPS, and qualitative analyses reveal IP's gradient to be more diffuse. Furthermore, IP reduces the next-token prediction loss on trait-expressing data where PPS need not, consistent with the notion that IP "explains away" the trait-expression in the training data. Taken together, our analyses reveal distinct mechanisms by which each method operates and highlight open questions about IP's mechanistic picture.
Figures & tables
| Dataset | Defense | Ablation Vector | Default | Attenuate | Amplify | Neutralize |
|---|---|---|---|---|---|---|
| Evil | None | Evil | ||||
| Evil | None | Rand | ||||
| Normal | None | Evil |
Appendix figures & tables20 assets
Supplementary material from the paper’s appendix.
Appendix
| Defense | Ablation Vector | Default | Attenuate | Amplify | Neutralize |
|---|---|---|---|---|---|
| None | Evil | ||||
| PPS | Evil | ||||
| IP | Evil | ||||
| None | Rand | ||||
| PPS | Rand | ||||
| IP | Rand |
| Defense | Ablation Vector | Default | Atten. | Ampl. |
|---|---|---|---|---|
| None | Evil | |||
| PPS | Evil | |||
| IP | Evil |
Adversarial Robustness of Language Models
Adversarial robustness of language models studies how to keep their outputs and decisions reliable under manipulative prompts, input changes, and malicious fine-tuning.
See all 192 papers