Patterns and Mechanisms of Contrastive Activation Engineering

Hao, Yixiong, Panda, Ayush, Shabalin, Stepan, Ali, Sheikh Abdur Raheem

arXiv.org Artificial Intelligence 

A BSTRACT Controlling the behavior of Large Language Models (LLMs) remains a significant challenge due to their inherent complexity and opacity. While techniques like fine-tuning can modify model behavior, they typically require extensive computational resources. Recent work has introduced a class of contrastive activation engineering (CAE) techniques as promising approaches for steering LLM outputs through targeted modifications to their internal representations. Applied at inference-time with zero cost, CAE has the potential to introduce a new paradigm of flexible, task-specific LLM behavior tuning. We analyze the performance of CAE in in-distribution, out-of-distribution settings, evaluate drawbacks, and begin to develop comprehensive guidelines for its effective deployment. We find that 1. CAE is only reliably effective when applied to in-distribution contexts. Contrastive activation engineering (CAE) emerged from AI safety literature (Turner et al., 2024) in 2023 as a class of techniques capable of altering LLM generations at inference time with zero cost (Turner et al., 2024; Panickssery et al., 2024). A LLM's learned representations are not necessarily interpretable but affect the behavior in a meaningful, predictable way (Park et al., 2024).