Should LLM Activation Steering Depend on Input? New Research Provides a Measurable Criterion

Fixed-direction activation steering ignores within-class variation; input-dependent retrieval-based steering is superior when within-class direction varies.
The article discusses the limitations of fixed-direction methods (such as CAA) in activation steering: they capture only between-class variation and ignore within-class variation, failing when different queries within the same category require different directions. The study models input dependence as a continuum from class mean difference to per-query k-nearest-neighbor retrieval, which degenerates to the class mean when k equals the category size. Experiments on six substitution corpora show retrieval-based steering outperforms fixed directions at all layers, but the required dependence depends on edit granularity: word-level editing suits shallow layers with few neighbors, while clause-level editing can use the class mean. When the category already determines the answer, the class mean suffices, while fixed directions still fail. The authors also propose four quantities computable directly from states as a lightweight diagnostic criterion before fitting rules.
The Limits of Fixed-Direction Steering: Within-Class Variation Is Ignored
Activation steering in large language models (LLMs) is a technique that changes model behavior without fine-tuning: at inference time, a direction vector is injected into the hidden states to steer outputs toward a desired attribute. Among these methods, Contrastive Activation Addition (CAA) is the most common approach—it adds the same fixed direction to every input, where that direction is computed as the difference between the means of two classes of samples.
This method is simple and effective, but it assumes a premise: the required direction is the same for all inputs. And that is exactly where the problem lies. CAA captures only between-class variation and completely ignores within-class variation. In other words, even when users request the same category, different queries may require different specific displacement directions, and a fixed direction cannot express this difference. More importantly, a new study points out that this input dependence not only truly exists but can be measured before any rule is fitted or applied.

Activation steering is an umbrella term for techniques that intervene in a model's internal representations at inference time. The core operation is to add a vector to the hidden state at some layer of a Transformer (usually the residual stream), biasing subsequent computation toward a certain semantic attribute without updating any weights. Common variants include Contrastive Activation Addition (CAA), Inference-Time Intervention (ITI), and sparse autoencoder feature steering. CAA works as follows: construct positive-negative sample pairs, forward-propagate each to obtain hidden states at the corresponding layer, compute the difference between the two class means as the "direction", and at inference time add that direction multiplied by a scaling coefficient uniformly to all inputs. Its effectiveness relies on the linear representation hypothesis—that the target attribute approximately corresponds to a linear direction in activation space. However, a linear direction captures only the overall mean shift of the attribute and cannot express differences in the magnitude or direction of the shift required by the same attribute in different contexts. This is precisely the theoretical blind spot of fixed-direction methods.
From Mean Difference to Per-Query Retrieval: A Continuum of Input Dependence
The study models the input dependence of steering edits as a continuum, with two baselines at the ends. One end is the classic difference of means; the other is a per-query retrieved target direction: within the requested category, find the k stored states closest to the current query state and take their mean as the steering direction.
The clever part of this design is that the two baselines are not independent—when k equals the category size, the retrieval rule degenerates into the class-conditional mean difference. Thus, the study is actually systematically adjusting, within a unified framework, the "degree of input dependence of the edit" and observing how this adjustment affects steering performance. The authors summarize the idea as follows: activation steering edits should depend on input if and only if the target direction varies within the category requested by the query; and this condition is measurable.
This provides an actionable criterion: before fitting any rule, first determine which case the current task belongs to—whether the within-class direction is consistent or varies. The criterion is based on four quantities computed solely from states, which can identify how the edit should be applied.
Between-class variation refers to the gap between the means of samples from different classes, for example the difference between the mean activations for "positive sentiment" and "negative sentiment"; the CAA direction vector is an estimate of between-class variation. Within-class variation refers to the dispersion of different samples within the same class relative to that class's mean. When within-class variance is small and the direction is consistent, the class mean difference suffices to summarize the attribute direction of that class; but when within-class samples are multimodal around the mean or their directions are dispersed, a single mean difference loses key information. Per-query retrieval is essentially a nonparametric estimate of the local conditional mean: for each query, it aggregates only the stored states in its neighborhood, allowing the steering direction to vary with the query. The k in k-nearest neighbors actually acts as a smoothing parameter—the larger k is, the closer the estimate is to the global class mean and the weaker the input dependence; the smaller k is, the more localized the estimate and the stronger the input dependence. This continuum provides a controllable experimental knob for systematically studying "how much input dependence is needed".
Experiments: Different Patterns for Word-Level and Clause-Level Editing
The study evaluates on six substitution corpora and one external benchmark, where the corpora differ in whether the edit changes a single word or a clause. The results show that when the target direction varies within a class, input-dependent steering significantly outperforms fixed-direction steering.
A finer-grained finding concerns the interplay between network depth and the number of retrieved neighbors. Across two models and every layer of each substitution corpus, the retrieval method achieved better performance. But how much input dependence is needed determines how it should be applied:
- Word-level editing: best suited to steering in the first tenth of the network's layers based on a small number of neighbors;
- Clause-level editing: the class mean suffices at any depth;
This difference shows that "the more input-dependent, the better" does not hold. Different edit granularities require different amounts of flexibility in the steering rule, and blindly increasing retrieval complexity may be counterproductive.
Another noteworthy boundary condition is: when the category itself already determines the answer, the class mean is sufficient, and the retrieval method can only tie with it—nevertheless, fixed directions still fail in this case. In other words, the class-conditional mean is a robust middle choice, while a fixed direction with no input dependence at all is the most fragile end.
Practical Significance of the Measurable Criterion
The four state quantities proposed in the paper constitute a lightweight diagnostic tool. For practitioners, this means there is no need to first run a full steering experiment and then compare results; instead, one can directly judge from the model's hidden states whether the current task is worth introducing input-dependent steering rules. This reduces the trial-and-error cost of choosing a steering strategy and draws a clear boundary for the applicability of CAA.
Network depth here refers to the Transformer layer index. Hidden states in shallow layers (such as the first tenth of layers) are closer to lexical/syntactic features, while deeper layers carry more semantic and task-related abstractions. The editing signal required for word-level substitution tasks (such as changing the sentiment polarity of a word) can be effectively captured in shallow layers, because word identity information is most salient in shallow representations; whereas clause-level substitution involves the reorganization of compositional semantics, whose direction stabilizes only in deeper layers, so class means are effective at all depths. Substitution corpora refer to specially constructed evaluation sets: each sample contains an original input, the expected output after the target substitution, and paired samples used to compute the steering direction. The six corpora cover substitution operations at different granularities, and the external benchmark is used to test generalization. These designs allow the interaction among "edit granularity—network depth—number of neighbors" to be systematically characterized, rather than remaining an empirical conclusion on a single task.
Implications for Steering Practice
The core message of this work is that the design of activation steering should not stop at "adding a direction"; rather, the degree of dependence of the edit should be chosen according to the structural characteristics of the task. Fixed directions are not useless, but their effectiveness depends on a strong assumption: the target direction within the requested category does not change. Once this assumption fails, input-dependent editing becomes necessary.
At the same time, the study also suggests a balance point between efficiency and effectiveness: word-level tasks can obtain gains using only shallow layers and a few neighbors, while clause-level tasks can use the class mean and need not be over-engineered. This layered guiding principle is more practically valuable than broadly claiming that one method is better.
For developers currently using CAA or similar techniques, a direct recommendation is: before using a fixed direction, first check whether the within-class target direction varies. If it varies significantly, consider introducing retrieval-based steering; if the category already determines the answer, the class mean is sufficient. The four-quantity criterion provides a low-cost pre-check that helps make the right architectural choice before fitting rules.
One-line Summary
Fixed-direction activation steering ignores within-class variation; input-dependent retrieval-based steering is superior when the within-class direction varies.
Paragraph Summary
The article discusses the limitations of fixed-direction methods (such as CAA) in activation steering: they capture only between-class variation and ignore within-class variation, failing when different queries within the same category require different directions. The study models the input dependence of steering as a continuum, with class mean difference at one end and per-query k-nearest-neighbor retrieval at the other, where retrieval degenerates to the class mean when k equals the category size. Experiments on six substitution corpora show that retrieval-based steering outperforms fixed directions at all layers, but the required degree of dependence depends on edit granularity: word-level editing suits shallow layers with few neighbors, while clause-level editing can use the class mean. When the category already determines the answer, the class mean suffices, while fixed directions still fail. The authors also propose four quantities computable directly from states as a lightweight diagnostic criterion before fitting rules.
Related articles

9 AI Subscription Plans Compared: The Real Cost Per 100M Tokens Revealed
Bilibili creator tests 9 AI subscription plans from Volcano, Alibaba, Tencent, Baidu, Zhipu, Xiaomi, MiniMax and more, converting them all to real cost per 100M tokens, breaking down fixed-quota vs. three-tier coefficient billing and how caching, time-of-day discounts, and window limits affect actual quota.

Vibe Coding for Beginners: Expressing Intent Instead of Handwriting Code
What is Vibe Coding? A 137-episode Bilibili course defines it: the core is expressing intent, not writing code. This article analyzes Vibe Coding's productivity logic, target audience, and entry expectations to help beginners decide if it's worth learning.

LangChain Beginner's Guide: An Agent Development Roadmap from LangGraph to Deep Agents
Clarify the encapsulation relationship among LangChain, LangGraph, and Deep Agents, and master the learning path and selection logic for agent development frameworks—suitable for beginners in large model development.