Manuscript Offprint

arXiv:2610.40055

One Vector or Many? Clustered Optimal-Transport Steering under Quantization

Illia Makarov

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Activation steering changes what a language model generates by editing its hidden states at inference time, without any training. Its most common form adds one vector, the difference of class means (DiM), to every hidden state. CHaRS, concept heterogeneity-aware representation steering, uses optimal transport to account for the heterogeneity of a concept's activations: an entropic plan pairs the clusters of the two classes, and each hidden state moves along a mixture of the cluster displacements, with routing weights that favor its nearest clusters. We study this family of clustered optimal-transport maps for toxicity mitigation in Gemma-2-2B and Granite-3.1-2B, and ask what the plan adds to DiM and whether that survives INT8 and NF4 quantization.

We prove an identity: whatever the plan, the displacements averaged with the cluster sizes as weights equal DiM, so a clustered map can differ from DiM only for tokens whose routing weights depart from the cluster sizes. In the CHaRS protocol the routing weights stay close to these sizes, and CHaRS is statistically equivalent to Mean-AcT, which adds DiM at every layer, in all eight pre-specified equivalence tests. Guided by the identity, we build a variant that can differ from DiM: fitted on individual tokens, it routes each token mainly to its nearest clusters. With 32 clusters and a sharp, weakly regularized plan, this variant leaves 37–39% less toxicity than DiM on Gemma and 51–61% less on Granite at steering strength 3 (toxic-bert, three k-means seeds), where DiM itself already removes 76–85% of the toxicity. Two other toxicity classifiers confirm the gain on Granite, but on Gemma only one of them does. The variant pays for this with somewhat higher perplexity at equal strength, but it is slightly more fluent than DiM run at the higher strength needed to reach the same toxicity. Yet a nearly constant map from the same clusters also leaves about 30% less toxicity than DiM, so the role of treating tokens differently remains open.

This advantage survives quantization: under INT8 and NF4 the variant still leaves less toxicity than DiM. On NF4, transferring the variant from full precision instead of refitting it adds no significant toxicity after correction for multiple tests: by the 95% intervals, at most 14% of what DiM leaves. 1^{1}

Content warning: offensive language in quoted model outputs and cluster vocabularies.

1 Introduction

Activation steering edits the hidden states of a language model during generation to alter its behavior, leaving its weights untouched (Turner et al., 2023; Panickssery et al., 2024; Li et al., 2023; Zou et al., 2023). Its most common form, activation addition, adds to the hidden states a multiple of the difference between the mean activations of two sets of examples, one that expresses a concept and one that does not. This difference of means (DiM) is a strong baseline (Wu et al., 2025; Im & Li, 2025), but it is a single vector. It pushes every

1^{1}An AI assistant (Claude, Anthropic) was used in this project: for writing and debugging the experiment and analysis code, and for drafting and editing this manuscript under the author's direction. The author directed the research, made the decisions about it, and takes full responsibility for the content.

token the same way, whether or not the token carries the concept, and its effect varies across inputs (Tan et al., 2024; Braun et al., 2025).

CHaRS, concept heterogeneity-aware representation steering (Abdullaev et al., 2026b), starts from the premise that a concept may be expressed in more than one way. Toxic comments, for instance, include insults, threats, obscenity and attacks on identity groups (Jigsaw & Conversation AI, 2017); if the hidden states that carry such forms lie in different regions of the activation space, one vector moves them all alike. DiM is itself an optimal-transport map: between two Gaussian distributions with equal covariances, the optimal map is the translation by the difference of means (Peyré & Cuturi, 2019). CHaRS instead models each set as a mixture of clusters: it clusters the activations of both sets and solves an entropic optimal-transport problem (Cuturi, 2013) between the clusters. The solution, the plan, says how much of each cluster of one set is sent to each cluster of the other. Each cluster of the set that carries the concept then receives a displacement, from its centroid to the mass-weighted average of the centroids it is sent to. A hidden state is moved along a mixture of these displacements, with more weight on the clusters nearest to it, so that different regions of the space are moved differently.

With a single cluster, CHaRS reduces to DiM. Yet on toxicity it has been compared not with DiM but with Linear-AcT (Rodriguez et al., 2025), which shifts and rescales each coordinate of the hidden state separately. Its evidence for distinct regions also comes from another setting, the last-token representations of harmful instructions. We do not check whether toxic hidden states form such distinct regions; we only test what maps built on this assumption do. How much of what CHaRS does with more clusters is still DiM, and what does the optimal-transport plan add?

A second question is whether what a clustered map does survives quantization. Deployed models are often quantized: their weights are compressed to eight bits (INT8; Dettmers et al., 2022) or four (NF4; Dettmers et al., 2023). This perturbs the activations that a steering map is fitted on and applied to. Bhandari & Wade (2026) find that DiM-style vectors re-extracted at each precision still shift behavior in the intended direction under INT8 and NF4. A clustered map has more parts that quantization can move: its clusters, its plan and its routing. We measure the net effect of these changes on the map, and ask whether a map fitted at full precision transfers to the quantized model.

We address both questions for the family of clustered entropic optimal-transport maps. The routing weights of a token say how much of each cluster's displacement it receives, and the weighted sum of the displacements is the push of the token. Steering adds α\alpha times the push to the hidden state, where α\alpha is the strength. The family has five settings: the pooling of the fitting texts (the mean of each text, its tokens, or its last token); the number of clusters; the entropic regularizer; the bandwidth of the kernel that turns the distances of a token to the clusters into routing weights; and whether the routing weights also include the relative sizes of the clusters, their occupancies, a choice that we call occupancy weighting. A small regularizer gives a sharp plan, which sends each cluster to a few nearby ones, and a large one a blurred plan, which spreads it over all of them. A small bandwidth gives narrow routing, which favors the nearest clusters, and a large one wide routing, which spreads the weight over many clusters. Three points of this family recur below (Table 1). At the CHaRS code defaults, the map is fitted on the means of the texts, with 4 clusters, the regularizer and bandwidth of the released code and occupancy weighting. The selective map is fitted on tokens, with 32 clusters, a sharp plan, narrow routing and occupancy weighting, so its push depends strongly on the token, although toxic tokens are not pushed much harder than others. The no-occupancy map differs from it by wide routing and no occupancy weighting, and is nearly a single global vector.

We study toxicity mitigation on Gemma-2-2B and Granite-3.1-2B, steering one layer with greedy decoding. We also run maps at every layer as the CHaRS authors do, with their code but with our decoding, our toxicity judges, one fixed fitting sample and, on Granite, our adaptation of their hook placement. We compare each map with DiM at equal strength and at matched toxicity. A map that pushes harder reaches lower toxicity but pays for it in fluency, so matched toxicity means comparing with DiM run at the strength where DiM reaches the toxicity of the map. We report five findings; the first three bear on the first question, the last two on the second:

  1. A clustered map can differ from DiM only where its routing departs from the cluster sizes (Sections 3.2 and 3.3). Whatever the plan, the average of the displacements weighted by the cluster sizes equals DiM (Proposition 1); the plan decides only how the displacements spread around this average. With occupancy weighting, a kernel that gives all clusters the same weight therefore leaves every token with exactly the push of DiM. Even the selective map is close to DiM on average over its own fitting points, within 5 to 13%, because narrow routing sends each of them mainly to its own cluster; on the prompts that we steer it departs further, by 17 to 22%. How much the push varies across tokens, its input dependence, is set mostly by the routing bandwidth (Section 5.1).

  2. The CHaRS code defaults behave like mean-pooled DiM (Sections 5.1 and 5.2). At these defaults the average push of the map, its push averaged over tokens, lies within a few percent of mean-pooled DiM, the DiM fitted on the same text means. At one layer, no toxicity difference between the two survives Holm's correction under toxic-bert, an offensive-language classifier or a ToxiGen classifier, and under toxic-bert the 95% intervals exclude differences larger than about 10% of the toxicity that DiM leaves. At strength 2 the two even produce identical continuations for about half of the prompts. In the every-layer protocol of CHaRS, run with the authors' code, CHaRS is statistically equivalent to Mean-AcT, which adds DiM at every layer, in all eight equivalence tests. The tests cover toxicity and perplexity on both models at two strengths, with margins of ±10% and ±2%; we specified them before the run but did not register them.

  3. Selective maps with a sharp plan beat DiM at strong steering (Sections 5.3 and 5.4). At strength 3 the selective map leaves 37–39% (Gemma) and 51–61% (Granite) less toxicity than DiM over three k-means seeds, and at matched toxicity it is also more fluent (unadjusted intervals). The toxicity advantage survives Holm's correction in 27 of 28 checks across layers, seeds and quantization; under the two other classifiers it holds on Granite, but on Gemma only the offensive-language one confirms it, at strength 3. Compared with DiM, the map pushes function words and punctuation less and words overrepresented in toxic comments at least as hard; each token also gets a direction of its own (Section 5.5). The no-occupancy map, nearly a single global vector, also leaves 14 to 30% less toxicity than DiM, so how much of the gain comes from treating tokens differently is not isolated. With the stronger regularizer of the CHaRS code and nothing else changed, the selective map destroys the text at strength 3. Whether optimal transport itself is needed, rather than another sharp pairing of the clusters or a better global direction, we do not test.

  4. With occupancy weighting, quantization shifts a clustered map about as much as it shifts DiM (Section 6). We refit each map on the quantized model and measure how far its average push moves. At the bandwidth of CHaRS, NF4 moves the average push by 11 to 13% of its length, about as much as it moves DiM, and INT8 far less. Without occupancy weighting the map is unstable: merely changing the k-means seed moves it as much as NF4 does.

  5. Steering and its toxicity advantage survive quantization (Section 6). At strength 3, under both INT8 and NF4, the selective map still removes 88–92% of the toxicity of the unsteered model at the same precision, more than DiM does. On NF4, a map fitted at full precision and transferred to the quantized model never leaves significantly more toxicity than one refitted on it, after Holm's correction; by the 95% intervals, transfer adds at most 14% of the toxicity that DiM leaves. Quantizing to NF4 by itself makes the unsteered models more toxic: robustly on Granite, and on Gemma only before correction for multiple tests.

References (67)