Manuscript Offprint
arXiv:2609.01878GAPS: Dimension-Level Gates for Conditional Activation Steering
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Activation steering suppresses undesired behaviors in language models by adding a steering vector to the hidden state during generation. Recent conditional methods such as CAST and DSAS improve the behavior-capability trade-off by deciding when to intervene, but once active, they apply the full dense vector to all hidden dimensions, regardless of whether a neuron carries concept information or already lies in the desired regime. We introduce dimension-level conditioning as a complementary axis of selectivity that also decides which neurons to intervene on. Our method, GAPS (Gated Activation steering via Posterior and Separability), combines two training-free gates: a static separability gate that restricts steering to neurons with statistically reliable concept information (via AUROC), and a dynamic posterior gate that steers a neuron only when its current activation is better explained by the undesired concept under a Gaussian model. The gates add O(D) overhead per token, and they plug into existing conditional methods. On toxicity mitigation (RealToxicityPrompts) and concept removal (OneSeC) with Gemma-3 (4B) and Qwen-3 (1.7B), GAPS consistently matches or improves the Pareto front of its token-level counterparts; under a fixed capability budget, DSAS+GAPS reduces Gemma-3's toxicity rate from 6.52% to 0.48%, versus 3.52% for DSAS alone. Ablations attribute most of the gain to the posterior gate.
1 Introduction
Language models often need to avoid unwanted outputs, such as toxic continuations or references to a specific concept, but retraining the model for every new constraint is impractical. Activation steering offers a low-cost alternative: a steering vector, typically computed as the mean difference between hidden states collected from examples of desired and undesired behavior, is added to the model's hidden state during generation (Rimsky et al., 2024;
Suau et al., 2024; Rodriguez et al., 2025a,b). This approach requires no gradient updates and adds little inference cost. However, conventional activation steering applies the same dense vector at every generation step, regardless of whether the current context warrants intervention. Interventions can therefore degrade fluency and downstream accuracy. Steering methods are best compared by the trade-off they achieve between behavior change and capability loss.
Recent work improves this trade-off by deciding when to intervene: token-level conditional methods such as CAST (Lee et al., 2025) and DSAS (Ferrando et al., 2025) gate or scale the intervention based on the current context, intending to leave benign generation largely untouched; related approaches use probes or lightweight controllers to trigger, scale, or calibrate the intervention (Li et al., 2025; Wang et al., 2025a; Cheng et al., 2025; Hegazy et al., 2026).
However, whether conditional or not, the intervention itself remains dense in space: whenever steering is applied, the full vector is added to all neurons of the hidden state. We posit that this is more than the task requires, for two reasons. First, many neurons carry little or no information about the concept, so shifting them cannot suppress the undesired behavior and only perturbs the representation. Second, a neuron that does encode the concept may already be in the desired regime at the current step; pushing a non-toxic activation further in the non-toxic direction does not make the output less toxic, but it does move the representation away from the model's familiar activation distribution.
In this work, we add a second axis of conditioning. Token-level methods decide when to intervene; we also dynamically decide which neurons in the hidden state to intervene on, with the goal of changing the hidden state no more than the steering objective requires. We do this with two dimension-level gates (Figure 1). The first, a static separability gate, restricts steering to only the neurons that carry discernible information about the target concept. For each neuron, we measure how well its activations separate the two concepts with the Area under the ROC, and keep the neuron only if separable enough. The second, a dynamic posterior gate, decides at each generation step whether a neuron is currently expressing the undesired behavior. We model the concept-conditional activation distribution of each neuron as a Gaussian and steer a neuron only if its current activation is more likely under the undesired concept than under the desired one.
The separability gate is computed once from the contrastive data and fixes the set of neurons that can encode the behavior at all. The posterior gate is evaluated at every generation step and decides whether those neurons are currently expressing the undesired behavior. We refer to the combined gates as GAPS (Gated Activation steering via Posterior and Separability). GAPS strictly generalizes prior methods: with both dimension-level gates set to one, it reduces to CAST or DSAS, and with the token-level gate also set to one, it reduces to unconditional steering. The gates cost elementwise operations per token, the same order as the steering vector addition itself, so dimension-level conditioning adds only a constant-factor overhead to canonical steering, and all required statistics are estimated from the same contrastive activations used to construct the steering vector.
We evaluate on toxicity mitigation with RealToxicityPrompts (Gehman et al., 2020) and concept removal over seven OneSeC concepts (Scarlini et al., 2019), using Gemma-3 (4B) and Qwen-3 (1.7B) with CAST and DSAS as token-level baselines, sweeping the intervention strength to trace the trade-off against Wikipedia perplexity and MMLU (Wikimedia Foundation; Hendrycks et al., 2021). Across all eight combinations of model, token-level method, and task, GAPS matches or improves the Pareto front of its token-level counterpart. Under a fixed capability budget, DSAS+GAPS lowers Gemma-3's toxicity rate from 6.52% to 0.48%, versus 3.52% for DSAS alone. Ablations attribute most of the gain to the posterior gate, with the separability gate a cheap complement: the strongest operating point requires both.
Our contributions are as follows:
-
We introduce dimension-level conditioning as a second axis of selectivity in activation steering: beyond deciding when to steer, we dynamically decide which neurons to steer.
-
We propose GAPS, a pair of training-free gates: a static separability gate that restricts steering to neurons with reliable concept information, and a dynamic posterior gate that steers a neuron only when its activation is better explained by the undesired concept. GAPS plugs into existing conditional methods and strictly generalizes them.
-
Across two models, two token-level methods, and two tasks, GAPS consistently matches or improves the Pareto front of its token-level counterparts; ablations attribute most of the gain to the posterior gate.
Activation steering. Given a steering objective (e.g., non-toxic generation), we collect hidden-state activations from target examples (tar), which represent the behavior we steer toward, and source examples (src), which represent the behavior we steer away from. During generation, standard activation steering adds a fixed direction to the hidden state: , where controls the intervention strength. We use the standard mean-difference direction (Rimsky et al., 2024):
where is the activation extracted from the -th example of concept .
Token-level conditional steering. Rather than applying the intervention at every generation step (every token), token-level conditional methods modulate its strength using a scalar gate :
We consider two such methods. CAST (Lee et al., 2025) uses a hard binary gate obtained by thresholding the alignment between the current hidden state and an extracted condition direction. DSAS (Ferrando et al., 2025), on the other hand, uses the output of a probe as a continuous gate that scales the intervention according to the detected strength of the undesired behavior.

Figure 1: The two dimension-level gates of GAPS. The static separability gate identifies which neurons encode the concept, keeping only neurons that separate the target and source concepts (computed offline). The dynamic posterior gate detects whether the source (undesired) concept is currently expressed, steering a neuron only when its current activation is more likely under the source than the target concept. Their product gives the final per-neuron mask applied to the steering vector.
3 Neuron-Level Conditional Steering
Token-level conditional methods (Eq. 1) address a key weakness of unconditional steering: by modulating the intervention with a token-level gate , they intervene only when the running context actually exhibits the source (undesired) behavior, leaving benign generation untouched and thereby reducing unnecessary capability loss. Both CAST and DSAS thus determine when to steer. However, once the gate is active, they apply the full dense steering vector to all neurons, regardless of whether a neuron carries concept-discriminative information at all, or whether its current activation is already consistent with the target (desired) behavior. Steering such neurons cannot reduce the source behavior; it can only cause unnecessary perturbation of the model. Our method adds neuron-level selectivity to address these two limitations: a static separability gate determines which neurons can encode the behavior, and a dynamic posterior gate determines whether intervention on these neurons is warranted now (Figure 1).
Static separability gate. For each neuron , we measure how well its activation distribution separates the two concepts using the area under the ROC curve, , estimated from the contrastive sets; a value
of indicates no concept information. Computing it via the Mann–Whitney identity (Mann and Whitney, 1947; Hanley and McNeil, 1982; Mason and Graham, 2002) also yields the exact mean and standard deviation of the estimate under the null hypothesis of no concept signal: has mean and standard deviation
where denotes the number of contrastive examples of concept .
We retain neuron only if its deviation from chance exceeds a two-sided threshold of null standard deviations,
where controls the stringency of the gate. Unlike a fixed AUROC cutoff, whose statistical meaning depends on sample size, this criterion adapts to sample size: with fewer examples, a neuron must have an AUROC farther from 0.5 to be retained, whereas with more examples, smaller but statistically reliable deviations suffice. We set , well above the required for Bonferroni-corrected significance at across all neurons, so the gate retains only neurons whose concept signal is statistically unambiguous (more details in Appendix G). With (matching our OneSeC setup), this corresponds to retaining only neurons whose AUROC lies outside approximately [0.39, 0.61]. The test is two-sided because a neuron may encode the source concept through either larger or smaller activations; the appropriate steering direction is captured by v.
Dynamic posterior gate. The static gate identifies which neurons ever encode the concept; it does not tell us whether a given neuron requires intervention now. Let denote the target and source concepts. Our goal is to steer neuron d only when its current activation value is more likely under the source concept than under the target concept . Using Bayes' theorem, we compute the posterior probability that a given activation arose from , under the assumption that both concepts are a priori equally likely:
(4)
Directly estimating the two concept-conditional activation densities, and , using non-parametric methods (e.g., kernel density or histogram estimators) is unreliable given the limited number of contrastive activation samples per neuron and would incur additional per-token cost during generation. Therefore, following the finding in (Haider et al., 2026; Fereidouni et al., 2026) that concept-related neuron activations follow approximately Gaussian distributions, we adopt a parametric Gaussian model for each concept-conditional density:
where is the mean activation of neuron d for concept c, and is the corresponding variance, both estimated from the contrastive samples belonging to concept c.
The posterior gate then steers a neuron only when its current activation is better explained by the source concept:
Intuitively, if the current activation is more likely under the target-concept distribution than under the source-concept distribution, pushing it further along is unlikely to further suppress the source behavior and may instead introduce an unnecessary perturbation.
Full update. Combining the token-level gate with both neuron-level conditions yields intervention:
where is the elementwise product, . We call the combined gate , GAPS (yielding CAST+GAPS and DSAS+GAPS). During autoregressive generation, the update is applied to the final token position of the running context. Setting recovers token-level conditional steering exactly (CAST or DSAS), and additionally setting recovers unconditional steering, so Eq. 7 strictly generalizes the prior methods; the sweep over traces the behavior-vs.-capability Pareto curve for every variant. Offline, all required statistics are estimated in a single pass over the same contrastive activations used to construct ; online, evaluating both gates adds elementwise operations per token, the same order as the steering-vector addition itself (see Appendix A for details).
It is important to note that the two dimension-level gates are complementary rather than redundant: is a global statement about which neurons encode the behavior at all, while is a local statement about whether intervention is currently warranted on those neurons.
4 Experiments and Results
4.1 Experimental Setup
Tasks and models. We evaluate on toxicity mitigation (RealToxicityPrompts; Gehman et al., 2020) and concept removal (seven OneSeC concepts; Scarlini et al., 2019), using Gemma-3 4B (Team et al., 2025) and Qwen-3 1.7B (Yang et al., 2025). All interventions are applied at layer 15 of both models; Appendix E reports results at layer 18. Full setup details are in Appendix F.
Capability metrics. To assess whether our method preserves the general capabilities of the language model while avoiding unnecessary interventions, we evaluate model performance along two axes: (1) perplexity on Wikipedia sentences (Wikimedia Foundation), which measures fluency and language modeling quality, and (2) performance on the Massive Multitask Language Understanding (MMLU) benchmark (Hendrycks et al., 2021), which measures knowledge and reasoning ability. Rather than

Figure 2: Toxicity mitigation trade-offs: Wikipedia perplexity vs. toxicity score (lower is better on both axes) for Gemma-3 4B (top) and Qwen-3 1.7B (bottom), swept over steering strength . Each panel shows unconditional steering (dashed), a token-level baseline (CAST, left; DSAS, right), and the baseline with our gates (+GAPS); the diamond marks the unsteered model. +GAPS consistently shifts the Pareto front toward the bottom-left.
discrete MMLU accuracy, we report the mean probability assigned to the correct option, which provides a smoother and more sensitive measure of capability degradation under intervention. Both metrics are computed for the unsteered model and after applying each steering method across a range of intervention strengths , allowing us to trace the full behavior vs capability trade-off.
Baselines. As an additional baseline for dimension-level conditioning, we compare against a range gate (Haider et al., 2026), which steers neuron only when its current activation lies within the typical activation range of the source concept:
4.2 Toxicity Mitigation
Large language models are prone to generating toxic continuations when conditioned on adversarial or toxicity-eliciting prompts (Gehman et al., 2020). Our goal in this setting is selective intervention: the model should be steered away from toxic generations only when the running context actually
carries toxic content, while generation on benign contexts should remain untouched.
We elicit toxic continuations using prompts from the RealToxicityPrompts (RTP) dataset (Gehman et al., 2020). We sample continuations per prompt and classify each as toxic or non-toxic using a RoBERTa-based toxicity classifier. This protocol follows common practice in the literature (Rodriguez et al., 2025a; Ferrando et al., 2025; Suau et al., 2024; Rodriguez et al., 2025b). We report the toxicity rate: the fraction of continuations labeled toxic, averaged over prompts and expressed as a percentage. The protocol is applied to the unsteered model and to every steering configuration, ensuring that toxicity reductions are directly comparable across all setups.
As shown in Figure 2, both token-level conditional steering baselines improve substantially over unconditional steering. On both models, DSAS attains lower perplexity than unconditional steering at matched toxicity levels, and CAST exhibits the same pattern, tracing a better Pareto front. This con-

Figure 3: Concept removal trade-offs: Wikipedia perplexity vs. average normalized concept score (per-concept score divided by its unsteered value, averaged over seven OneSeC concepts; lower is better on both axes), swept over . Panels as in Figure 2; shaded bands = standard error of the mean across concepts. +GAPS again matches or improves the trade-off on both models.
firms that deciding when to steer already reduces unnecessary capability loss. Our approach adds a complementary axis of selectivity: it conditions the intervention at the dimension level via the separability gate and posterior gate (), deciding which neurons to steer. Applying our gates on top of either baseline (CAST+GAPS, DSAS+GAPS) consistently shifts the Pareto front further toward the bottom-left: at any given toxicity score, the gated variants result in equal or lower perplexity than their token-level counterparts, across both Gemma-3 (4B) and Qwen-3 (1.7B) and both token-level methods. In addition to perplexity, we report MMLU against the toxicity score in Figure 4 (Appendix C). The benefit of our gates is most pronounced for Gemma-3 (4B), where the gated variants retain substantially higher MMLU than token-level and unconditional steering at matched toxicity levels, degrading more gracefully as the intervention strength increases; on Qwen-3 (1.7B), all methods perform comparably on MMLU across most of the toxicity range.
4.3 Concept Removal
Beyond toxicity mitigation, we evaluate our method on concept removal. As in the toxicity setting, the goal is selective intervention: steer away from a source concept (e.g., baby) only when the running context evokes it, leaving unrelated contexts unaffected. For the contrastive data, we follow Rodriguez et al. (2025a) and use the OneSeC dataset (Scarlini et al., 2019) with the same seven concepts (football, cloud, baby, church, book, flower, balloon) and sampling protocol: for each concept, 700 samples of the source concept (to steer away from) and 700 samples drawn from the remaining concepts (to steer toward). To measure removal, we use GPT-4o-mini as an LLM judge to determine whether the source concept is present in each generated continuation; the prompt is in Appendix B.
Figure 3 reports the perplexity–removal trade-off. As in the toxicity setting, applying dimension-level gates on top of either token-level baseline matches or improves the Pareto front on both mod-
| Method | Toxicity (% toxic generations) | Concept removal (% of unsteered score) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Gemma-3 (4B) | Qwen-3 (1.7B) | Gemma-3 (4B) | Qwen-3 (1.7B) | |||||||||
| Score ↓ | MMLU | PPL | Score ↓ | MMLU | PPL | Score ↓ | MMLU | PPL | Score ↓ | MMLU | PPL | |
| No intervention | 6.52 | 0.586 | 16.06 | 6.42 | 0.539 | 13.43 | 100.00 | 0.586 | 16.06 | 100.00 | 0.539 | 13.43 |
| CAST | 3.70 | 0.570 | 15.88 | 3.56 | 0.550 | 14.00 | 64.66 | 0.583 | 16.70 | 66.78 | 0.533 | 13.78 |
| + msep | 2.78 | 0.570 | 16.14 | 3.20 | 0.546 | 13.99 | 69.88 | 0.583 | 16.61 | 62.36 | 0.538 | 13.94 |
| + mng | 4.52 | 0.580 | 16.00 | 2.52 | 0.550 | 14.03 | 61.82 | 0.584 | 16.65 | 70.55 | 0.534 | 13.73 |
| + msep ⊙ mng | 4.38 | 0.571 | 16.07 | 2.86 | 0.550 | 13.97 | 63.88 | 0.584 | 16.66 | 66.10 | 0.537 | 13.96 |
| + mpost | 3.06 | 0.571 | 15.47 | 2.16 | 0.542 | 13.97 | 46.36 | 0.581 | 16.63 | 61.83 | 0.536 | 13.92 |
| + msep ⊙ mpost (GAPS) | 2.14 | 0.569 | 15.70 | 2.12 | 0.546 | 14.02 | 49.45 | 0.582 | 16.63 | 61.35 | 0.538 | 13.93 |
| DSAS | 3.52 | 0.573 | 15.76 | 4.06 | 0.545 | 13.80 | 67.96 | 0.581 | 16.63 | 66.38 | 0.535 | 13.82 |
| + msep | 2.06 | 0.571 | 16.34 | 3.18 | 0.544 | 14.01 | 71.28 | 0.585 | 16.57 | 63.94 | 0.538 | 13.92 |
| + mng | 3.80 | 0.573 | 15.95 | 2.60 | 0.547 | 14.09 | 75.76 | 0.579 | 16.48 | 67.20 | 0.534 | 13.84 |
| + msep ⊙ mng | 2.40 | 0.569 | 16.40 | 2.76 | 0.547 | 14.09 | 72.66 | 0.580 | 16.59 | 60.76 | 0.539 | 13.99 |
| + mpost | 1.26 | 0.572 | 15.29 | 1.86 | 0.540 | 14.08 | 56.20 | 0.577 | 16.11 | 60.36 | 0.538 | 13.88 |
| + msep ⊙ mpost (GAPS) | 0.48 | 0.569 | 16.54 | 2.32 | 0.538 | 14.07 | 53.05 | 0.574 | 16.25 | 59.24 | 0.539 | 13.98 |
Table 1: Ablation of the separability gate (m^{sep}), posterior gate (m^{post}), and a simpler range gate (m^{ng}) on toxicity mitigation (left) and OneSeC concept removal (right, averaged over 7 concepts). Per method, we report the lowest behavior score over the sweep whose capability cost stays within a fixed budget (perplexity , MMLU vs. unsteered). Best score in bold; second-best underlined.
els, with the largest gains on Gemma-3 (4B).
MMLU results are reported in Figure 5 (Appendix D). The two capability metrics paint complementary pictures. On Gemma-3 (4B), where our gates yield the largest perplexity gains, the dimension-gated variants perform nearly identically to their token-level counterparts on MMLU. On Qwen-3 (1.7B), the pattern reverses: although the perplexity gains were modest, the gated variants retain higher MMLU at matched removal levels for most intervention strengths. Overall, dimension-level gating improves the trade-off along at least one capability axis on both models; more discussion in Appendix D.
4.4 Analysis of Dimension-Level Gates
Table 1 isolates the contribution of each dimension-level condition. For every method, we sweep the steering strength and report the operating point with the lowest source (undesired) concept score whose capability cost stays inside a fixed budget: perplexity at most 5% above, and MMLU correction probability at most 3% below, the unsteered model. All rows are therefore compared at matched capability cost. For concept removal, the capability budget is defined once from the unsteered model, and for each of the seven OneSeC concepts, we separately select the steering strength with the lowest concept score within the budget. We normalize the resulting concept score by its unsteered value, so that the unsteered baseline is 100%, and then average the normalized scores across all seven concepts. MMLU and perplexity are likewise averaged over the per-concept operating points.
This gives 8 independent settings: 2 models 2 token-level methods (CAST, DSAS) 2 tasks. Throughout, m^{sep} is static, computed once from the contrastive sets, whereas m^{ng} and m^{post} are both dynamic: each is evaluated at the current activation at every generation step, and the two differ only in their decision rule, membership in the undesired concept's empirical range (Eq. 8) versus the posterior (Eq. 6). We summarize four findings.
Overall ranking: posterior-gated variants perform best. In all 8 settings, the best-performing variant contains the posterior gate, and in 7 of 8, the two posterior-gated variants occupy both the best and second-best positions (15 of the 16 top-two slots). The single exception is Gemma-3 with CAST on toxicity, where m^{sep} alone (2.78) edges out m^{post} (3.06); m^{sep} ⊙ m^{post} is still the best variant there (2.14). The strongest overall result is obtained by DSAS+GAPS on Gemma-3, which lowers toxicity from 6.52% (unsteered) to 0.48%. By comparison, DSAS alone reduces toxicity only to 3.52%. Thus, GAPS achieves a 92.6% reduction relative to the unsteered model, versus 46.0% for the token-level gate alone.
Posterior vs. separability: knowing where the concept lives is not the same as knowing where to act. The posterior gate (m^{post}) outperforms the static separability gate (m^{sep}) in 7 of the 8 settings, with improvements of up to a 41% relative reduction in score (toxicity 3.18% → 1.86% for Qwen-3 with DSAS). The two methods answer different questions. The static gate (m^{sep}) identifies dimensions that can encode the undesired concept and steers all of them whenever the token-level gate is active. The posterior gate (m^{post}) instead identifies dimensions that are currently expressing the undesired concept by comparing how well the present activation is explained by the undesired and desired concept distributions. Its consistent advantage shows that knowing which neurons can encode a behavior is insufficient; effective steering also requires knowing when that encoding is actually active.
Posterior vs. range: why range falls short. The posterior gate consistently outperforms the range gate. Across all 8 settings, m^{post} achieves a lower score than m^{rng}, and combining it with the separability gate (m^{sep} ⊙ m^{post}, i.e. GAPS) likewise outperforms m^{sep} ⊙ m^{rng} in every case. The difference lies in the decision rule. The range gate (m^{rng}) considers only the undesired-concept distribution, activating whenever h_{t,d} falls within 2.5 standard deviations of the undesired-concept mean (Eq. 8). As a result, it also steers activations in regions where the desired and undesired distributions overlap, even when the current activation is equally or better explained by the desired concept. The posterior gate instead compares the two concept-conditional densities directly and intervenes only when the undesired concept is the more likely explanation, avoiding these unnecessary updates.
The separability gate is a consistently useful, essentially free complement. The static separability gate improves whichever decision rule it is paired with. Applied directly on top of the token-level baselines, m^{sep} lowers the score in 6 of 8 settings; combined with the range gate, m^{sep} ⊙ m^{rng} improves over m^{rng} in 5 of 8; and combined with the posterior gate, m^{sep} ⊙ m^{post} (GAPS) improves over m^{post} in 6 of 8. Notably, the strongest operating point in Table 1 (toxicity reduced from 6.52% to 0.48% with DSAS on Gemma-3) is reached only with the separability gate: m^{post} alone plateaus at 1.26%. Since m^{sep} is computed once from the contrastive sets and adds no per-token cost, it offers these gains at effectively zero overhead.
5 Related Works
Activation steering. Activation steering adds a concept direction to the hidden state during inference, with no gradient updates and little inference cost. The direction is typically extracted from contrastive examples or probes (Turner et al., 2025; Rimsky et al., 2024; Zou et al., 2023; Li et al., 2023), while later work optimizes the intervention itself (Rodriguez et al., 2025a,b). All of these methods are unconditional and dense: the intervention is applied at every generation step and to all dimensions of the hidden state.
When to steer. A first axis of selectivity decides when to intervene, per input or per generation step. CAST (Lee et al., 2025) applies a hard gate based on the alignment between the current hidden state and an extracted condition direction, and DSAS (Ferrando et al., 2025) scales the intervention with the output of a trained probe. Several works follow the same pattern, using probes or controllers to trigger, scale, or calibrate the intervention (Li et al., 2025; Wang et al., 2025a; Cheng et al., 2025; Hegazy et al., 2026; Hedström et al., 2025). In all cases, however, the intervention remains dense: the steering vector is applied in full at the chosen site, with no dimension-level selectivity.
Static dimension selection. Some methods restrict the intervention to a subset of dimensions, but this selection is made offline: AurA (Suau et al., 2024) dampens experts chosen by AUROC, and SADI (Wang et al., 2025b) applies a top-K contrastive mask. Neither decides online, per generation step and per neuron, whether steering is currently warranted, the axis of selectivity GAPS introduces.
6 Conclusion
We introduced dimension-level conditioning as a second axis of selectivity in activation steering: beyond deciding when to intervene, our gates decide, at each generation step, which neurons in the hidden state to steer. The static separability gate restricts steering to neurons carrying reliable concept information, and the dynamic posterior gate intervenes only when a neuron's current activation is better explained by the undesired concept. The combined gates, GAPS, are training-free, add negligible overhead, and strictly generalize existing conditional methods. Across two models, two token-level methods, and two tasks, GAPS matches or improves the Pareto front, reducing Gemma-3's toxicity from 6.52% to 0.48% at matched capability cost. Ablations attribute most of the gain to the posterior gate: knowing which neurons can encode a concept is not enough; effective steering requires knowing when it is active.
Limitations
The dynamic posterior gate assumes equal priors over the source and target concepts (Eq. 4). In deployment, a practitioner who expects mostly benign contexts could set to make the gate more conservative, whereas adversarial settings may warrant the opposite. We leave a systematic study of prior selection to future work.
References
Zifeng Cheng, Jinwei Gan, Zhiwei Jiang, Cong Wang, Yafeng Yin, Xiang Luo, Yuchen Fu, and Qing Gu. 2025. Steering when necessary: Flexible steering large language models with backtracking. In The Thirty-ninth Annual Conference on Neural Information Processing Systems.
Moghis Fereidouni, Muhammad Umair Haider, Peizhong Ju, and A.B. Siddique. 2026. Evaluating sparse autoencoders for monosemantic representation. In Findings of the Association for Computational Linguistics: EACL 2026, pages 5969–5984, Rabat, Morocco. Association for Computational Linguistics.
Alex Ferrando, Xavier Suau, Jordi González, and Pau Rodriguez. 2025. Dynamically scaled activation steering. arXiv preprint arXiv:2512.03661.
Samuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A. Smith. 2020. RealToxicityPrompts: Evaluating neural toxic degeneration in language models. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 3356–3369, Online. Association for Computational Linguistics.
Muhammad Umair Haider, Hammad Rizwan, Hassan Sajjad, Peizhong Ju, and A.B. Siddique. 2026. Neurons speak in ranges: Breaking free from discrete neuronal attribution. Transactions on Machine Learning Research.
James A. Hanley and Barbara J. McNeil. 1982. The meaning and use of the area under a receiver operating characteristic (ROC) curve. Radiology, 143(1):29–36.
Charles R Harris, K Jarrod Millman, Stéfan J Van Der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J Smith, et al. 2020. Array programming with numpy. nature, 585(7825):357–362.
Anna Hedström, Salim I. Amoukou, Tom Bewley, Saumitra Mishra, and Manuela Veloso. 2025. To steer or not to steer? mechanistic error reduction with abstention for language models. In Forty-second International Conference on Machine Learning.
Amr Hegazy, Mostafa Elhoushi, and Amr Alanwar. 2026. Guiding giants: Lightweight controllers for weighted activation steering in LLMs. In Proceedings of the 6th Workshop on Trustworthy NLP (TrustNLP 2026), pages 584–599, San Diego, California. Association for Computational Linguistics.
Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. 2021. Measuring massive multitask language understanding. Proceedings of the International Conference on Learning Representations (ICLR).
John D. Hunter. 2007. Matplotlib: A 2d graphics environment. Computing in Science & Engineering, 9.
Bruce W. Lee, Inkit Padhi, Karthikeyan Natesan Ramamurthy, Erik Miehling, Pierre Dognin, Manish Nagireddy, and Amit Dhurandhar. 2025. Programming refusal with conditional activation steering. In The Thirteenth International Conference on Learning Representations.
Quentin Lhoest, Albert Villanova del Moral, Yacine Jernite, Abhishek Thakur, Patrick von Platen, Suraj Patil, Julien Chaumond, Mariama Drame, Julien Plu, Lewis Tunstall, Joe Davison, Mario Šaško, Gunjan Chhablani, Bhavitvya Malik, Simon Brandeis, Teven Le Scao, Victor Sanh, Canwen Xu, Nicolas Patry, and 13 others. 2021. Datasets: A community library for natural language processing. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 175–184, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
Kenneth Li, Oam Patel, Fernanda Viégas, Hanspeter Pfister, and Martin Wattenberg. 2023. Inference-time intervention: Eliciting truthful answers from a language model. In Thirty-seventh Conference on Neural Information Processing Systems.
Yichen Li, Zhiting Fan, Ruizhe Chen, Xiaotang Gai, Luqi Gong, Yan Zhang, and Zuozhu Liu. 2025. FairSteer: Inference time debiasing for LLMs with dynamic activation steering. In Findings of the Association for Computational Linguistics: ACL 2025, pages 11293–11312, Vienna, Austria. Association for Computational Linguistics.
H. B. Mann and D. R. Whitney. 1947. On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other. The Annals of Mathematical Statistics, 18(1):50 – 60.
S. J. Mason and N. E. Graham. 2002. Areas beneath the relative operating characteristics (roc) and relative operating levels (rol) curves: Statistical significance and interpretation. Quarterly Journal of the Royal Meteorological Society, 128(584):2145–2166.
Neel Nanda and Joseph Bloom. 2022. TransformerLens. https://github.com/TransformerLensOrg/TransformerLens.
OpenRouter. 2025. OpenRouter: A unified interface for LLMs. https://openrouter.ai.
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, and 2 others. 2019. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc.
Fabian Pedregosa, Gaël Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, et al. 2011. Scikit-learn: Machine learning in python. the Journal of machine Learning research, 12:2825–2830.
Nina Rimsky, Nick Gabrieli, Julian Schulz, Meg Tong, Evan Hubinger, and Alexander Turner. 2024. Steering llama 2 via contrastive activation addition. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 15504–15522, Bangkok, Thailand. Association for Computational Linguistics.
Pau Rodriguez, Arno Blaas, Michal Klein, Luca Zappella, Nicholas Apostoloff, marco cuturi, and Xavier Suau. 2025a. Controlling language and diffusion models by transporting activations. In The Thirteenth International Conference on Learning Representations.
Pau Rodriguez, Michal Klein, Eleonora Gualdoni, Valentino Maiorca, Arno Blaas, Luca Zappella, marco cuturi, and Xavier Suau. 2025b. LinEAS: End-to-end learning of activation steering with a distributional loss. In The Thirty-ninth Annual Conference on Neural Information Processing Systems.
Bianca Scarlini, Tommaso Pasini, and Roberto Navigli. 2019. Just “OneSec” for producing multilingual sense-annotated data. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 699–709, Florence, Italy. Association for Computational Linguistics.
Xavier Suau, Pieter Delobelle, Katherine Metcalf, Armand Joulin, Nicholas Apostoloff, Luca Zappella, and Pau Rodriguez. 2024. Whispering experts: Neural interventions for toxicity mitigation in language models. In Forty-first International Conference on Machine Learning.
Gemma Team, Aishwarya Kamath, Johan Ferret, Shreya Pathak, Nino Vieillard, Ramona Merhej, Sarah Perrin, Tatiana Matejovicova, Alexandre Ramé, Morgane Rivière, Louis Rouillard, Thomas Mesnard, Geoffrey Cideron, Jean bastien Grill, Sabela Ramos, Edouard Yvinec, Michelle Casbon, Etienne Pot, Ivo Penchev, and 197 others. 2025. Gemma 3 technical report. Preprint, arXiv:2503.19786.
Alexander Matt Turner, Lisa Thiergart, Gavin Leech, David Udell, Juan J Vazquez, Ulisse Mini, and Monte MacDiarmid. 2025. Steering language models with activation engineering.
Pauli Virtanen, Ralf Gommers, Travis E Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, et al. 2020. Scipy 1.0: fundamental algorithms for scientific computing in python. Nature methods, 17(3):261–272.
Tianlong Wang, Xianfeng Jiao, Yinghao Zhu, Zhongzhi Chen, Yifan He, Xu Chu, Junyi Gao, Yasha Wang, and Liantao Ma. 2025a. Adaptive activation steering: A tuning-free LLM truthfulness improvement method for diverse hallucinations categories. In THE WEB CONFERENCE 2025.
Weixuan Wang, JINGYUAN YANG, and Wei Peng. 2025b. Semantics-adaptive activation intervention for LLMs via dynamic steering vectors. In The Thirteenth International Conference on Learning Representations.
Wikimedia Foundation. Wikimedia downloads.
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, and 3 others. 2020. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 38–45, Online. Association for Computational Linguistics.
An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, et al. 2025. Qwen3 technical report. arXiv preprint arXiv:2505.09388.
Andy Zou, Long Phan, Sarah Chen, James Campbell, Phillip Guo, Richard Ren, Alexander Pan, Xuwang Yin, Mantas Mazeika, Ann-Kathrin Dombrowski, Shashwat Goel, Nathaniel Li, Michael J. Byun, Zifan Wang, Alex Mallen, Steven Basart, Sanmi Koyejo, Dawn Song, Matt Fredrikson, and 2 others. 2023. Representation engineering: A top-down approach to ai transparency. Preprint, arXiv:2310.01405.
| Concept | Definition |
|---|---|
| Football | Any of various games played with a ball (round or oval) in which two teams try to kick or carry the ball into each other's goal. |
| Cloud | A visible mass of water or ice particles suspended at a considerable altitude. |
| Baby | A very young child (birth to 1 year) who has not yet begun to walk or talk. |
| Church | One of the groups of Christians who have their own beliefs and forms of worship. |
| Book | A written work or composition that has been published (printed on pages bound together). |
| Flower | Reproductive organ of angiosperm plants especially one having showy or colorful parts. |
| Balloon | Large tough nonrigid bag filled with gas or heated air. |
Table 2: WordNet definitions supplied to the LLM judge for the seven OneSeC concepts.
A Implementation of the Posterior Gate
For numerical stability, we evaluate the posterior of Eq. 4, with the Gaussian densities of Eq. 5, entirely in log space.
Concept-conditional log-densities. Substituting the Gaussian model of Eq. 5, i.e., , the log-density of neuron under concept at the observed activation is
The normalization term is pre-computed offline once per neuron and concept, so the online cost of Eq. 9 is one squared difference and one division per neuron.
Log-posterior. Taking the logarithm of Eq. 4 and substituting Eq. 9, the log-posterior of the source concept is
The denominator is evaluated with a numerically stable log-sum-exp.
Computational cost. The posterior gate adds no trained components and no additional forward passes; its entire cost is a fixed number of element-wise operations per neuron. Offline, the per-neuron statistics of Eq. 5 are estimated in a single pass over the same contrastive activations already used to construct the steering vector v, and the memory footprint at generation time is six D-dimensional vectors (a mean, a variance, and a precomputed normalization term per concept), i.e. . Online, evaluating the gate at a generation step amounts to two evaluations of Eq. 9, one log-sum-exp, one exponentiation, and one comparison per neuron, a constant number of elementwise operations, computed for all neurons simultaneously as vectorised tensor operations. The per-token cost is therefore , the same order as the steering-vector addition itself and as the token-level gates it composes with: dimension-level conditioning adds only a constant-factor overhead to conditional steering, with no dependence on the number of contrastive examples at inference time.
B Concept Classification
To determine whether a generated continuation refers to the source concept, we use an LLM-based binary classifier. For each of the seven OneSeC concepts—football, cloud, baby, church, book, flower, and balloon—we provide the classifier with the corresponding WordNet definition and the generated continuation. Supplying the definition allows the classifier to identify semantic references to the concept even when the concept word itself does not appear explicitly.
The classifier is instructed to return only yes or no. We use greedy decoding with temperature 0 and allow at most five output tokens. The exact prompt is:
You are a chatbot who answers whether the provided sentence is referring to {concept} defined as {wordnet_def} Note that the sentence might not contain the word {concept}, but may just be referencing concept as defined. Answer only with 'yes' or 'no'. {generated_text}
The WordNet definitions used for the seven concepts are shown in Table 2. Our prompt is adapted from Rodriguez et al. (2025a).

Figure 4: Toxicity mitigation trade-off curves on MMLU. MMLU correct option probability (capability, higher is better) versus toxicity score (lower = less toxic) for Gemma-3 (4B, top) and Qwen-3 (1.7B, bottom), obtained by sweeping the steering strength . Each panel compares unconditional steering (dashed), the token-level conditional baseline (CAST, left; DSAS, right), and the same baseline augmented with our dimension-level gates (+GAPS). Curves closer to the top-left corner are better; the diamond marks the unsteered model. On Gemma-3 (4B), the dimension-gated variants retain higher MMLU performance than their token-level counterparts at matched toxicity levels, degrading more gracefully as the intervention strength increases; on Qwen-3 (1.7B), all methods perform comparably across most of the toxicity range.
C MMLU Results - Toxicity
Figure 4 reports MMLU correct-option probability against the toxicity score for both models and both steering families.
On Gemma-3 (4B), the dimension-gated variants (+GAPS) retain higher MMLU than their token-level counterparts at matched toxicity levels, with the largest margin in the DSAS. Whereas CAST and DSAS degrade noticeably as the intervention strength increases, the GAPS variants remain close to the unsteered baseline across most of the range and degrade more gracefully at the strongest interventions, reaching low toxicity scores at a substantially smaller MMLU cost.
On Qwen-3 (1.7B), all methods perform comparably across most of the toxicity range. At moderate intervention strengths, unconditional steer-
ing and the token-level baselines slightly exceed the unsteered MMLU value. At large , however, their performance drops steeply, while the GAPS variants degrade more slowly at high intervention strengths.

Figure 5: Concept removal trade-off curves on MMLU. MMLU correct-option probability (capability, higher is better) versus average normalized concept score (each concept's score divided by its unsteered value, then averaged over the seven OneSeC concepts; lower = more concept removal), obtained by sweeping the steering strength , for Gemma-3 (4B, top) and Qwen-3 (1.7B, bottom). Each panel compares unconditional steering (dashed), the token-level conditional baseline (CAST, left; DSAS, right), and the same baseline augmented with our dimension-level gates (+GAPS). Curves closer to the top-left corner are better; the diamond marks the unsteered model. Shaded bands show standard error of the mean across the seven concepts. On Gemma-3 (4B), the dimension-gated variants perform nearly identically to their token-level counterparts, while on Qwen-3 (1.7B) they retain clearly higher MMLU at matched removal levels for low to moderate intervention strengths.
D MMLU Results - OneSeC
Figure 5 reports MMLU correct-option probability against the average normalized concept score for both models and both token-level gating methods.
On Gemma-3 (4B), both token-level baselines (CAST and DSAS) improve over unconditional steering, which degrades steeply once the intervention strength becomes large, while the conditional methods remain near the unsteered MMLU value across most of the removal range. Because the token-level gates already leave little capability on the table, adding our dimension-level gates yields no further gain here: the +GAPS variants perform nearly identically to their token-level counterparts.
On Qwen-3 (1.7B), the picture differs. Token-
level gating alone is less effective: CAST, in particular, falls below unconditional steering at strong intervention strengths. Adding the dimension-level gates improves both families, with CAST+GAPS and DSAS+GAPS retaining clearly higher MMLU than their token-level counterparts at matched removal levels for low to moderate intervention strengths. At the strongest interventions, CAST+GAPS also declines slightly; since the token-level gate is applied before our dimension-level gates, the GAPS variants inherit part of the degradation introduced by the underlying CAST gate and cannot fully recover the unconditional-steering performance in this regime.

Figure 6: Toxicity mitigation trade-off curves with interventions applied at layer 18. Setup as in Figure 2, but steering at layer 18 rather than layer 15. Our dimension-level gates again shift the Pareto frontier toward the bottom-left for both models and both steering families, indicating that the gains are robust to the choice of intervention layer.
E Robustness to the Intervention Layer
To verify that the benefits of dimension-level gating are not specific to a single intervention site, we repeat the toxicity mitigation experiment of Section 4.2 with all interventions applied at layer 18 instead of layer 15, keeping every other component of the protocol unchanged. (contrastive data, steering vectors, gate statistics, and evaluation setup are all recomputed at the new layer). Figure 6 reports the resulting perplexity–toxicity trade-off curves for both models and both token-level methods.
The picture closely mirrors the layer-15 results of Figure 2. Token-level conditional steering (CAST, DSAS) again improves substantially over unconditional steering, and adding our dimension-level gates (+GAPS) shifts the Pareto frontier further toward the bottom-left corner: at matched toxicity levels, GAPS attains equal or lower perplexity than their token-level counterparts, across both Gemma-3 (4B) and Qwen-3 (1.7B) and both token-level methods.
The same qualitative ordering (unconditional < token-level < token-level+GAPS) holds at a different layer, indicating that the gains from dimension-level conditioning are not an artifact of a particular intervention site. This is expected under our formulation: both gates are estimated directly from the contrastive activations of whichever layer is steered, so the separability statistics and concept-conditional Gaussians adapt automatically to the chosen layer. We conclude that the proposed GAPS is robust to the choice of intervention layer.
F Implementation Details
Dataset Statistics. We report the data used to construct the steering directions and evaluate each task. For toxicity steering, we use RealToxicityPrompts (Gehman et al., 2020), labeling prompts with toxicity scores 0.5 as toxic and those with scores < 0.2 as non-toxic. After shuffling with a fixed seed, we reserve the first 500 toxic prompts for evaluation, generating 10 completions per prompt, and use the next 5,000 examples from each class to collect activations. These subsets are disjoint. For concept steering, following Rodriguez et al. (Rodriguez et al., 2025a), we construct contrastive sets for seven OneSeC concepts (Scarlini et al., 2019), using 700 concept-positive and 700 concept-negative sentences per concept to collect activations. We evaluate each concept on 1,000 generated completions and measure the proportion that refer to the source concept using the classifier described in Appendix B.
Model Specifications. As described in the main text, we use the instruction-tuned Gemma-3 model with 4 billion parameters (Hugging Face name: google/gemma-3-4b-it) and the Qwen-3 model with 1.7 billion parameters (Hugging Face name: Qwen/Qwen3-1.7B). The hidden-state dimensionality, over which our dimension-level gates (GAPS) operate, is for Gemma-3 (4B) and for Qwen-3 (1.7B). All interventions are applied to the residual stream (hook_resid_post) at layer 15 (layer 18 for the robustness analysis in Appendix E).
Package Details. Our implementation is built on PyTorch (Paszke et al., 2019). Models are loaded and hooked through the TransformerLens library (Nanda and Bloom, 2022), which we use to cache residual-stream activations and to apply all steering interventions during generation, in combination with the HuggingFace Transformers (Wolf et al., 2020) and Datasets (Lhoest et al., 2021) libraries for tokenizers and data loading. Statistical computations use NumPy (Harris et al., 2020) and SciPy (Virtanen et al., 2020); scikit-learn (Pedregosa et al., 2011) is used for the PCA and logistic-regression probe of the DSAS baseline. The LLM-judge evaluation for concept removal (Appendix B) queries GPT-4o-mini accessed via the OpenRouter API (OpenRouter, 2025), and all figures are produced with Matplotlib (Hunter, 2007).
Computation Details. All experiments were conducted on a high-performance computing (HPC) cluster managed via the Slurm workload manager. We used NVIDIA A40 (48 GB) GPUs for activation collection, steering interventions, and downstream evaluation (toxicity, perplexity, and MMLU). Each job was allocated 1 GPU, 8 CPU cores, and 64 GB of RAM on a single node.
Result Reliability. Each reported number is an aggregate over a large number of stochastic generations: toxicity scores average over 500 prompts with sampled continuations each (5,000 generations per operating point), and concept
scores average over 1,000 sampled completions per concept before being averaged across concepts. Figures 3 and 5 additionally report standard error of the mean across the OneSeC concepts. The capability metrics (Wikipedia perplexity and MMLU correct-option probability) are deterministic, given the model, and require no aggregation over runs.
G Separability Threshold
The threshold of Eq. 3 is the free parameter of the separability mask. Its admissible range is bounded from below by statistical calibration: a Bonferroni-corrected two-sided test at family-wise level across all dimensions requires (, Qwen-3) to (, Gemma-3).
Any value above this floor, therefore, retains only dimensions with a statistically reliable class signal; where to place within the admissible range is an empirical question, which we settle with a sensitivity sweep.
We sweep on a single setting, toxicity mitigation with Gemma-3 (4B) and DSAS+GAPS at layer 15, and reuse the selected threshold unchanged in every other experiment (both models, both gating families, both tasks).
For each , we sweep the intervention strength and evaluate toxicity, Wikipedia perplexity, and MMLU exactly as in the main experiments. We then select operating points under two protocols. First, we use the fixed capability budget of the main results: the lowest toxicity whose capability cost stays within perplexity and MMLU the unsteered model. Second, to remove the dependence on any single budget choice, we repeat the selection for 15 budgets (relative perplexity increase in crossed with relative MMLU drop in ) and report the mean and standard deviation of the resulting toxicity rates.
Table 3 shows that toxicity is minimized in a band around , with degradation on both sides under both protocols. Below the band, at , fixed-budget toxicity rises to and the budget-averaged toxicity to : a lower threshold admits weakly informative dimensions.
Above the band, at , toxicity rises again ( fixed-budget, budget-averaged): a higher threshold discards dimensions that carry useful concept signal. We fix for
| Fixed budget (main-paper protocol) | Mean over 15 budgets | |||
|---|---|---|---|---|
| Toxicity % | MMLU | PPL | Toxicity % | |
| 5 | 0.70 | 0.573 | 15.61 | 0.90 ± 0.43 |
| 6 | 0.56 | 0.572 | 15.86 | 0.77 ± 0.30 |
| 7 | 0.48 | 0.569 | 16.54 | 0.57 ± 0.14 |
| 8 | 0.40 | 0.590 | 16.82 | 0.52 ± 0.16 |
| 9 | 0.62 | 0.597 | 16.70 | 0.69 ± 0.27 |
Table 3: Sensitivity of DSAS+GAPS to the separability threshold on a setting (Gemma-3 4B, toxicity, layer 15). Left: operating point under the fixed capability budget of the main results (perplexity , MMLU ; unsteered baseline). Right: best feasible toxicity averaged over 15 capability budgets.
all experiments in the paper; its toxicity is essentially on par with , and the lower threshold retains more dimensions.