Revisiting Activation Steering Through an Optimization Lens

Ryan Lee T. Z., Dung Viet Nguyen, Hieu M. Vu, Noelle Y. L. Wong, Lei Zhang, Dipti Srinivasan, Linh Duy Tran, Tan Minh NguyenNeurIPS 2026

TL;DR

Controlling a Large Language Model without retraining it—a technique called activation steering—usually relies on taking simple layer-by-layer averages of internal states, treating every layer like an isolated island. This paper reveals that this standard practice is mathematically equivalent to basic, memoryless gradient descent. By swapping in classic optimization tricks like momentum and Adam across layers, we get dramatically stronger, more data-efficient behavioral control at zero extra cost during inference.

What Problem Does This Paper Address?

Inside an LLM’s hidden states, complex concepts like "toxicity" or "refusal" tend to align neatly along linear directions. Activation steering exploits this by nudging hidden activations along these "steering vectors" at inference time to amplify or suppress specific behaviors without touching the model's weights.

Traditionally, we find these vectors via difference-in-means: feed the model contrasting sets of prompts (say, harmful vs. harmless), record the average activations at Layer $k$, and subtract one from the other. Even when researchers apply these nudges sequentially from layer to layer, the vector calculation itself remains memoryless—computing each layer's direction from scratch. Because transformer layers are deeply coupled, ignoring cross-layer dynamics leaves valuable structural signals on the table, often yielding unstable or underpowered control in deeper models.

Methods

The authors reframe activation steering as a continuous optimization problem: minimizing the Bregman divergence between a current activation and a target behavioral activation across the depth of the network. When discretized across layers, standard difference-in-means steering turns out to be exact vanilla Gradient Descent (GD).

Just as vanilla GD struggles on ill-conditioned landscapes, memoryless steering struggles across deep layers. To fix this, the authors introduce Momentum Steering:

Figure 1: Illustration of Momentum Steering: To com- pute the steering direction, difference-in-means sig- nals are accumulated across layers with a momentum buffer v(k) to form richer candidate directions.

Instead of using raw difference-in-means vectors at layer $k$, they maintain a momentum buffer $v(k)$ that accumulates steering signals across layers ($v(k) = \beta v(k-1) + r(k)$). They introduce several modular variants:

  • Non-sequential (Non-causal): Simply smooths static difference-in-means statistics across layers using momentum.
  • Sequential (Causal): Applies the momentum vector at layer $k-1$ before computing the new activation statistics at layer $k$, explicitly modeling how earlier interventions ripple downstream.
  • Adam Steering: Takes the optimization lens further by maintaining both first and second moments (adaptive variance scaling) of the layerwise difference-in-means.

Crucially, all steering buffers are computed entirely offline on calibration prompts. At inference time, applying these vectors costs no more than standard steering.

Datasets

No new benchmarks were introduced; the authors evaluated their framework on established safety, toxicity, and general utility datasets:

  • Jailbreaking (overriding refusal): ADVBENCH (harmful prompts) paired with ALPACA (harmless prompts), judged by the HARMBENCH classifier.
  • Toxicity Mitigation: RealToxicityPrompts (RTP).
  • General Utility & Fluency: tinyBenchmarks (condensed versions of Hellaswag, ARC, MMLU, and Winogrande), full 5-shot MMLU, and 20K Wikipedia sentences for perplexity checks.

Key Insights and Ideas

  • Layers are time steps: Viewing forward propagation through layers as iterations of an optimization algorithm bridges mechanistic interpretability and classical optimization theory. Empirically, sequential difference-in-means norms decay toward zero across layers in randomly initialized networks—mirroring vanishing gradient norms in GD.
  • Momentum breaks through tough safety alignment: Models with heavy safety tuning resist memoryless steering because single-layer signals are weak or noisy. Accumulating velocity across layers builds up coherent directional pressure that cleanly overrides stubborn defaults.
  • Extreme sample efficiency: Because cross-layer momentum smooths out statistical noise, you don't need hundreds of contrastive examples. Computing sequential momentum directions with just 8 samples rivals or beats using the full dataset (400+ samples) without hurting general reasoning capabilities.
Figure 3: Comparison of Attack Success Rate Scores when using multiple dataset sizes to sequentially compute the momentum buffers on the Gemma models. The baseline score is the same baseline as used in Section 4.1.

Key Results

Tested across Qwen2.5, Llama3, and Gemma2 model families (2B to 14B parameters):

  • Jailbreaking: On Gemma2-9B-Instruct, baseline Angular Steering achieves a meager 7.69% Attack Success Rate (ASR). Adding non-sequential momentum jumps ASR to 40.38%, and sequential momentum hits 42.31% (up to 50.96% when tuning $\beta$). On a deeper safety-aligned Gemma2-9B variant, the baseline nearly fails (1.92% ASR), whereas sequential Momentum Steering reaches 45.19%. On Qwen2.5-7B, sequential Adam raises ASR from 77.88% to 88.46%.
  • Toxicity Mitigation: Integrated into sequential Activation Transport (Momentum-AcT), the method slashes classifier-measured toxicity by up to 7.5x on Gemma2-2B (from 4.13% unsteered down to 0.55%) and 6.8x on Llama3-8B (5.30% down to 0.78%), outperforming existing sequential baselines.
  • Preserved Utility: Across all tasks, tinyBenchmarks, MMLU, and Wikipedia perplexity remain virtually unchanged relative to baselines—meaning the models aren't lobotomized in the process.

Limitations and Future Work

Momentum isn't a silver bullet out of the box: performance gains vary across model families and intervention types, and results are noticeably sensitive to the momentum coefficient $\beta$. While high values ($\beta \in [0.9, 0.99]$) generally work well, peaking at the exact sweet spot currently requires per-model tuning. Developing a principled, automated way to select optimization hyperparameters—and exploring custom steering objective functions beyond standard Bregman divergences—remains open for future work.

Summary updated

Abstract

Activation steering has emerged as a powerful approach for controlling large language models (LLMs), with prominent methods such as ActAdd, Directional Ablation, and Angular Steering relying on difference-in-means activations from contrastive prompts across layers. These differences are typically treated as candidate feature directions, later refined into optimal steering vectors or planes. In this work, we reinterpret these candidate directions as gradients of an underlying optimization problem. Building on this perspective, we propose Momentum Steering, a momentum-based framework for activation steering in LLMs. Unlike traditional difference-in-means methods, our framework generates a richer family of candidate directions through momentum updates, enabling more expressive steering. We first introduce a non-causal variant that accumulates difference-in-means signals via momentum, producing enhanced candidate directions. We then develop a causal variant, where future layer statistics are recursively influenced by previously applied momentum directions, explicitly modeling the causal effects of interventions on downstream activations. Momentum Steering is lightweight and modular, making it easily compatible with state-of-the-art steering methods. We empirically demonstrate that Momentum Steering delivers stronger, more robust, and more reliable behavioral control across diverse LLM families and benchmarks.
BibTeX
@inproceedings{z2026revisiting,
  author = {Ryan Lee T. Z. and Dung Viet Nguyen and Hieu M. Vu and Noelle Y. L. Wong and Lei Zhang and Dipti Srinivasan and Linh Duy Tran and Tan Minh Nguyen},
  title = {{Revisiting Activation Steering Through an Optimization Lens}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=HEjj1BD9e9},
}
Figure