Contrastive Activation Addition is an inference-time intervention technique that computes a steering vector by subtracting the mean residual stream activations of a negative-prompt dataset from those of a positive-prompt dataset. This difference vector captures a high-level behavioral direction, such as honesty or sentiment, and is added to the model's forward pass to reliably induce the target behavior without weight modification.
Glossary
Contrastive Activation Addition

What is Contrastive Activation Addition?
A method for computing a steering vector by subtracting the mean activations of a negative-prompt dataset from a positive-prompt dataset and adding the difference during inference.
The method operates by caching activations at a chosen layer for paired contrastive prompts, then injecting the scaled difference vector during subsequent generations. As a form of representation engineering, it provides a lightweight, top-down control mechanism that directly manipulates a model's cognitive state, enabling researchers to steer outputs toward desired attributes while preserving the original model weights.
Key Characteristics of Contrastive Activation Addition
Contrastive Activation Addition (CAA) is a lightweight, inference-time control method that computes a steering vector by subtracting the mean activations of a negative-prompt dataset from a positive-prompt dataset. This difference vector is then added to the model's residual stream to reliably induce a desired high-level behavior without retraining.
Contrastive Vector Computation
The steering vector is derived from a contrastive pair of datasets. The process involves:
- Positive Dataset: Prompts eliciting the target behavior (e.g., honest answers).
- Negative Dataset: Prompts eliciting the opposite behavior (e.g., deceptive answers).
- Subtraction: The final vector is calculated as
v_steer = mean(act_pos) - mean(act_neg). This isolates the directional difference in activation space corresponding to the behavioral shift.
Inference-Time Intervention
CAA is applied purely during the forward pass, leaving model weights untouched. The computed steering vector is multiplied by a scaling coefficient and added directly to the residual stream at a specific layer and token position. This allows for dynamic, context-dependent control without the compute cost of fine-tuning. The intervention is typically applied to all layers simultaneously for a robust effect.
Behavioral Modification Scope
CAA can steer a wide range of high-level, abstract behaviors by targeting the appropriate contrastive pair. Documented use cases include:
- Honesty: Steering models away from sycophancy toward truthful responses.
- Sentiment: Inducing positive or negative emotional tone in generated text.
- Refusal: Modulating a model's tendency to reject harmful or sensitive requests.
- Power-Seeking: Reducing the expression of instrumental convergence tendencies.
Relationship to Representation Engineering
CAA is a core technique within the broader Representation Engineering (RepE) paradigm. RepE posits that high-level cognitive functions are encoded as linear directions in activation space. CAA provides the 'write' operation for this framework, enabling top-down control. It contrasts with bottom-up probing methods by actively manipulating the discovered representations to causally verify their function.
Comparison to Activation Patching
While both are causal intervention methods, they differ fundamentally:
- Activation Patching: Replaces an activation from one input with a cached activation from a different specific input to localize a computation.
- Contrastive Activation Addition: Adds a pre-computed, generalized direction vector derived from a statistical contrast between two datasets, representing a behavioral delta rather than a specific memory.
Advantages Over Fine-Tuning
CAA offers distinct operational benefits for behavior modification:
- Weight Preservation: The base model's knowledge and capabilities remain fully intact.
- Dynamic Control: The steering coefficient can be adjusted or zeroed out in real-time.
- Compute Efficiency: Requires only a forward pass of the target model on contrastive datasets to compute the vector, avoiding gradient-based optimization.
- Composability: Multiple steering vectors for different behaviors can theoretically be combined.
Frequently Asked Questions
Clear, technical answers to the most common questions about computing and applying steering vectors using the Contrastive Activation Addition method.
Contrastive Activation Addition (CAA) is an inference-time intervention technique that computes a steering vector by subtracting the mean residual stream activations of a negative-prompt dataset from the mean activations of a positive-prompt dataset. This difference vector captures a high-level behavioral direction, such as 'truthfulness' or 'refusal.' During the forward pass, the vector is multiplied by a scalar coefficient and added to the residual stream at a specific layer, effectively shifting the model's internal representations to induce the desired behavior without updating the original model weights. The core mechanism relies on the linear representation hypothesis, which posits that high-level concepts are encoded as linear directions in activation space.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Contrastive Activation Addition is part of a broader ecosystem of techniques for reading and writing model representations. These related methods form the toolkit for decoding and steering neural network behavior.
Steering Vector
A direction in a model's activation space that, when added to the residual stream during inference, reliably modifies high-level behavior. Contrastive Activation Addition is the primary method for computing a steering vector by subtracting mean negative-prompt activations from mean positive-prompt activations. Once extracted, the vector can be scaled and applied at specific layers to induce behaviors like truthfulness, refusal, or specific stylistic tones.
Activation Addition
A lightweight control method that adds a pre-computed bias vector to the residual stream at a specific layer to induce a desired behavior without updating model weights. Contrastive Activation Addition is a specific instantiation of this broader technique. Key properties:
- Operates during the forward pass only
- Requires no retraining or fine-tuning
- Effects are often composable and reversible
- Can be applied at single or multiple layers simultaneously
Representation Engineering
A top-down control paradigm that reads and writes high-level cognitive vectors in a model's activation space to monitor and steer behavior. Contrastive Activation Addition serves as the writing mechanism within this framework. The approach treats neural representations as manipulable objects:
- Reading: Linear probes detect encoded concepts
- Writing: Steering vectors modify ongoing computation
- Monitoring: Activation patterns reveal model state in real-time
Inference-Time Intervention
A general class of techniques that modify a model's internal activations during the forward pass to alter behavior without updating original weights. Contrastive Activation Addition belongs to this family alongside:
- Activation Patching: Replacing activations with cached values from other inputs
- DoLa Decoding: Contrasting logits from early vs. late layers
- Contrastive Decoding: Maximizing probability differences between expert and amateur models All share the principle of manipulating computation at runtime rather than during training.
Linear Probing
A technique for training a simple linear classifier on top of a frozen model's internal representations to diagnose what information is encoded at a specific layer. Contrastive Activation Addition relies on probing to validate that the computed steering vector actually captures the intended concept. The workflow:
- Train a probe to classify a concept from activations
- The probe's weight vector defines the concept direction
- This direction can then be used as a steering vector
- Probe accuracy confirms concept separability in activation space
Causal Mediation Analysis
A statistical framework for quantifying how much a model's output depends on a specific intermediate representation by measuring the effect of intervening on that representation. Contrastive Activation Addition is a form of causal intervention that tests whether adding a concept vector causes the expected behavioral change. The analysis pipeline:
- Zero-shot intervention: Apply steering vector and measure effect
- Ablation comparison: Compare against removing the concept entirely
- Dose-response: Vary the scaling coefficient to map causal influence
- Cross-layer analysis: Identify which layers are causally responsive to the intervention

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us