Steering Until the Representation Lands: Cluster Validity as a Per-Input Stopping Rule for Activation Steering

Activation steering changes a language model's behavior at inference time by adding a vector to its hidden activations. Examples include making the model more truthful or less toxic without retraining it. The hard practical question is how far to push. Push too little and nothing changes. Push too far and the model drifts into refusals, repetition, or lost general knowledge. Today the push strength is one number tuned once on a development set and applied to every input. We propose setting it per input with a classic tool from unsupervised clustering, the silhouette score. This score asks whether a point sits closer to its own group than to any other group.

The core idea is short. Cluster the activations of "good" behavior at a layer, choosing the number of clusters with standard cluster-validity tests rather than by fiat. Then, for each new input, increase the steering strength only while the steered activation, measured a few layers downstream, becomes a more convincing member of one of those good clusters. Stop when its silhouette score peaks. A linear probe keeps reporting "more aligned" the further you push along a direction. The silhouette score instead falls back toward zero once the activation overshoots into empty space where no real activations live. That makes it a candidate signal for the "too far" failure that current methods only handle with a global hyperparameter.

Core Claim

Our claim has two parts. The first is that the number of distinct modes in a concept's activations varies with layer, and that it can be read off with cluster validity indices. These indices score a partition by how tight its groups are and how far apart they sit. The second is that the pointwise silhouette of a steered activation, computed against those validated clusters at a downstream readout layer, is non-monotone in steering strength. Its peak predicts, input by input, the strength that best trades target behavior against preserved general ability.

The second part is the new contribution. The first part is a prerequisite: a silhouette score computed against a badly chosen clustering is meaningless. Stated as a rule, for input $x$, steering layer $l$, readout layer $l+\Delta$, and candidate strengths $\alpha$ drawn from a small grid, we choose

$$\alpha^*(x) = \arg\max_{\alpha} \; s_{l+\Delta}\big(h_{l+\Delta}(x;\alpha)\big).$$

Here $h_{l+\Delta}(x;\alpha)$ is the activation at the readout layer after adding $\alpha$ times the selected steering vector at layer $l$. The score $s_{l+\Delta}$ is the silhouette of that activation with respect to the validated positive and negative clusters at layer $l+\Delta$. It equals $(b-a)/\max(a,b)$, where $a$ is the mean distance to the assigned positive cluster and $b$ is the mean distance to the nearest other cluster.

The rule behaves differently in three regimes. An unsteered input near a negative cluster scores negative. A well-placed input scores near $+1$. An overshot input, far from every cluster, has $a \approx b$ and scores near $0$.

Relation to Prior Work

The closest work is IDEEA. It clusters positive and negative per-head activations with K-means into about six groups and pairs the groups by solving a quadratic assignment problem. It then picks an input-dependent steering vector by nearest cluster or smallest angular distortion. IDEEA motivates our work: it showed that concept activations are multi-modal, and that a single mean-difference vector lands between modes and produces refusals. It cut the TruthfulQA refusal rate on Llama2-7B from 31% under standard inference-time intervention to 8%.

IDEEA decides which direction to steer. It fixes the cluster count for every layer, mainly because the matching problem grows factorially. It also never asks how far to steer a given input, or whether the steered activation actually lands in a cluster downstream. We reuse its cluster-matched direction choice, with nearest-cluster matching so the cluster count is not capped by the factorial matching cost. Our addition is a validated per-layer cluster count and a geometric per-input stopping rule.

LUNA also clusters PCA-reduced hidden states, into abstract states of a Markov chain, to detect hallucinations and attacks. It reaches up to 90% ROC AUC on HumanEval code hallucination and 83% on adversarial detection for Llama2-7b. LUNA supplies the precedent that cluster membership of hidden states carries a trustworthiness signal. It sets its partition by hyperparameter sweeps and stays read-only. We use a validated partition to close the loop on intervention.

Three papers constrain the design.

- Tradeoffs Between Alignment and Helpfulness proves, in its model, that alignment grows linearly and helpfulness falls quadratically with steering norm. This predicts that a per-input optimal norm exists. Its linear-alignment result appears to contradict our non-monotone claim. We read it as describing the probe-measured quantity, not actual behavior once activations leave the data, and our experiments test exactly that distinction.

  • Activation Steering with a Feedback Controller shows that proportional steering oscillates and leaves bias, and fixes this with a PID controller across layers. It is the strongest alternative way to adapt strength. Its error signal is distance to a target direction, not membership in a real mode.
  • Fine-Grained Activation Steering shows that steering fewer than 100 dimensions beats full-block steering. This warns that whole-vector geometry may be noisy. We therefore compute silhouettes in a reduced space, following the PCA practice of LUNA and the MDS-plus-silhouette pairing in Chen et al..

On the clustering side, Fang et al. and Kulkarni et al. supply the logic of choosing the cluster count by balancing tightness against separation. Benchmarking of Clustering Validity Measures Revisited tested indices across 17,149 synthetic datasets of up to 200 dimensions. It found no universal index, ranked Silhouette, WB, Calinski-Harabasz (also called the variance ratio criterion), Wemmert-Gancarski, Point-Biserial and the density-based DBCV at the top, and found reliability becomes erratic at high dimension. That is a direct warning for 4,096-dimensional hidden states, so we compare several indices rather than trusting one.

Research Program

Stage one: the geometric prerequisite. For each layer of Llama2-7B and Gemma-2-2B, we collect activations on the contrastive positive and negative prompt sets used for TruthfulQA and toxicity steering. We reduce them with PCA and compute Silhouette, Calinski-Harabasz, WB and DBCV for cluster counts from 1 to 20. This yields an index-chosen count $K(l)$ per layer per index.

We then measure, on a held-out development split, the downstream-optimal count. This is the count that maximizes the steering objective when used in IDEEA-style nearest-cluster steering. The question is whether any index's $K(l)$ tracks the downstream-optimal count, and whether $K(l)$ varies with depth as the layer-localization results in SPARE and States Hidden in Hidden States suggest. The latter paper offers a clean test bed: its running-total states for multi-addend addition have known discrete ground truth. There, supervised probe accuracy falls from near 100% at the second addition sign to about 37% at the sixth (Qwen-72B). We can check whether unsupervised silhouette quality degrades at the same addend positions.

Stage two: the stopping rule. Using validated clusters, we steer at layer $l$ along the nearest-cluster direction. For each of four or five candidate strengths, we recompute the forward pass only from $l$ to $l+\Delta$ on the prompt tokens and pick $\alpha^*(x)$ by the equation above. We then generate with that strength held fixed. We sweep $\Delta$ from 0, meaning the same layer, to roughly a quarter of model depth.

Stage three: the core falsification test. For a subset of inputs, we brute-force the per-input best strength by generating at every grid strength and scoring with the GPT-judge. The paper behind TruthfulQA reports that this judge agrees with human raters at 90–96%. We then measure the rank correlation between $\alpha^*(x)$ and the brute-force best.

Baselines

The naive reference is the unsteered model. The second reference is standard inference-time intervention with a single mean-difference vector and one global strength, tuned on the development split. This is the setting that produced the 31% refusal rate in IDEEA's Llama2-7B experiments.

The strongest existing method on the direction question is IDEEA with its default of about six clusters and a globally tuned strength. Its reported numbers on Llama2-7B TruthfulQA are 8% refusal and an average 9.9% (up to 23.5%) truth-times-informativeness gain over the best input-independent baseline. We rerun it ourselves on identical prompts, layers and judge.

The strongest existing method on the strength question is the PID controller of Activation Steering with a Feedback Controller. It reports roughly 8.1x toxicity reduction on Gemma-2-2B and a 94.9% attack-success-rate reduction on Llama-3.1-8B. We run it on RealToxicityPrompts with Gemma-2-2B. For GPT-2 Large, the reference points are expected maximum toxicity of 0.759 for the base model and 0.607 for Toxification Reversal, at perplexity 13.77 against 11.85 for the base.

Every method gets the same contrastive data, layer choices and steering vectors. All share the same development-set budget for tuning global hyperparameters, and we report the extra forward-pass cost of each.

We add two ablations that isolate the key ingredient:

  • Fixed count. Our stopping rule with IDEEA's fixed count in place of validated $K(l)$, which tests whether validation matters.
  • Same layer. Our rule with $\Delta = 0$, which tests whether the downstream readout matters for drift.

Beating the field means one of two outcomes. Either a higher truth-times-informativeness score on TruthfulQA than tuned IDEEA at equal or lower refusal rate and no larger MMLU drop. Or, on RealToxicityPrompts, lower expected maximum toxicity than PID at equal perplexity. In addition, $\alpha^*(x)$ must correlate meaningfully with the brute-force per-input best strength.

Why not just…?

Why not just tune the cluster count and strength on a development set? This is the most obvious version of "optimal cluster determination for steering," and it would probably work about as well as validity indices for choosing a global count. That is why we do not make index-chosen counts the headline. Development-set tuning still yields one strength for all inputs. Our claim concerns per-input strength, which a global grid cannot express. The brute-force per-input oracle in stage three measures how much headroom per-input strength has over the best global setting. If that headroom is small, the proposal fails, and we would report it.

Why not just gate steering on a linear probe's confidence? Probes on hidden states detect errors well. LLMs Know More Than They Show reports AUC between 0.85 and 0.95 at exact-answer tokens. A probe gate is therefore a real competitor for deciding whether to steer. The same paper found that probes fail to transfer across task types and that errors split into at least five qualitatively different behaviors. Moreover, a linear probe's score rises without limit along the steering direction, so it cannot signal overshoot. We run a probe-confidence gate as a baseline and plot its score against strength next to the silhouette curve. If the probe gate matches our rule's MMLU preservation, the non-monotonicity argument is wrong.

Why not just use an out-of-distribution distance, such as Mahalanobis or nearest-neighbor distance to positive activations? This is the strongest threat, because it also penalizes overshoot. The difference is that silhouette rewards approach to a positive mode relative to the nearest competing mode, so it distinguishes landing in the right mode from landing anywhere dense. That matters when negative activations are also dense. We run both a Mahalanobis gate and a nearest-neighbor gate with the same grid and readout layer. If either matches silhouette, we report that the cluster structure adds nothing beyond density.

Why not just use the PID controller, which already adapts strength across layers? PID corrects error relative to a target direction and was shown to remove oscillation and steady-state bias. However, its target is still a single direction, which IDEEA's evidence says can sit between modes. We compare against PID directly. We also test a hybrid that uses the silhouette rule to set PID's target strength, to see whether the two signals are complementary.

Decisive Checks

The proposal stands or falls on three measurements:

  • Non-monotone curve. Pointwise silhouette at the readout layer must peak at an intermediate strength on most TruthfulQA and RealToxicityPrompts inputs, rather than rising monotonically. If it rises monotonically, the stopping rule has nothing to stop on.
  • Per-input agreement. The peak must rank-correlate with the brute-force per-input best strength clearly better than probe-confidence and Mahalanobis gates do.
  • Validated count matters. Validated $K(l)$ must beat a fixed count of six in the ablation.

The clustering benchmark's finding that index reliability degrades with dimension and noise is the most likely source of failure. We address it by reporting all four indices and the PCA dimension used. On the addition test bed, a mismatch between where silhouette degrades and where probe accuracy degrades would tell us the geometry is not what the probe sees. No reported result was found on Lacuna for IDEEA on PKU-SafeRLHF or TwinViews, so results there will be new comparisons rather than reproductions.