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:
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 withALPACA(harmless prompts), judged by theHARMBENCHclassifier. - Toxicity Mitigation:
RealToxicityPrompts(RTP). - General Utility & Fluency:
tinyBenchmarks(condensed versions of Hellaswag, ARC, MMLU, and Winogrande), full 5-shotMMLU, and 20KWikipediasentences 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.
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