In-Distribution Steering: balancing control and coherence in language model generationIn-Distribution Steering: Balancing Control and Coherence in Language Model Generation
The authors propose IDS, which adjusts steering strength according to in-distribution constraints; Table 1 shows an average SPI ranking of 1.67 across six models and seven datasets.
- Fixed steering strength can lead to under-steering or over-steering, and in open generation, overly strong intervention may damage text plausibility and coherence. The authors believe that high-risk applications require controlling behavior without changing parameters while maintaining fluency.
- IDS builds activation distributions for the presence and absence of the target behavior on the last token of each layer, using the mean difference as the steering vector. After PCA dimensionality reduction, using the 95th percentile of Mahalanobis distance as the threshold, it finds the maximum strength that keeps the steered activation within the distribution, and only intervenes in layers where F1 exceeds 0.7.
- On single-logit seven datasets, IDS's average SPI ranking is 1.67. In open-ended generation, average SPI ranking is 1.39 and perplexity ranking is 2.72. The authors state it is on the Pareto frontier; on refusal_og, MERA's perplexity increases and SPI decreases.
- The paper does not list limitations separately. Future directions are angular steering, more realistic reasoning justifications, and steering in reasoning models. Experiments cover six models; Table 1 has seven datasets, Table 2 has three open datasets. Sample sizes, repetitions, and GPT-4.1 and human agreement are not reported.
- Evaluated models
- gemma-2-2B-itgemma-2-9B-itqwen-2.5-1.5B-itqwen-2.5-7B-itLlama-3.2-9B-itLlama-3.1-8B-it
- Benchmarks
- smsMMLUcoordinate-other-aiscorrigible-neutral-HHHhallucinationrefusalmyopic-rewardrefusal_ogAlpaca
- Metrics
- SPIperplexityaverage rank
The study proposes In-Distribution Steering (IDS), which dynamically adjusts activation steering strength based on the input's distributional position in representation space, balancing behavior control and text coherence. Existing activation steering methods mostly rely on fixed steering strength, which can easily lead to insufficient control or, because the intervention is not adapted to the input, harm text plausibility and coherence. Experiments show IDS achieves high accuracy on classification tasks while generating coherent, non-collapsed text.
Paper analysis
What problem does this paper attempt to solve?
Fixed steering strength is prone to under-steering or over-steering; IDS adjusts strength based on whether the input remains within the target activation distribution.
Fixed steering strength swings between insufficient control and text collapse, requiring input-dependent intervention adjustment while maintaining generation coherence.
- Scenario: The authors believe that autoregressive LLMs can be factually inaccurate, behaviorally unsafe, or misaligned because targets come from large-scale web data, rarely fully matching specific applications. Once entering high-risk or user-facing applications, the authors state that reliability, safety, and controllability must be ensured without sacrificing fluency or creativity.
- Existing shortcomings: RLHF requires large amounts of data and compute, and modifies weights in a hard-to-explain way; the authors state this may introduce new biases or harm unrelated tasks. Prompt engineering is lighter, but the authors state it is indirect and sensitive to context. Existing activation steering mostly uses fixed strength, which the authors believe causes under-steering or over-steering, and rarely tests whether text is reasonable in open generation.
- Core hypothesis: Under the linear representation hypothesis, behavior corresponds to a direction in representation space. The authors believe that appropriate strength should keep the steered activation within the activation distribution of the target behavior, to avoid collapse after going out-of-distribution.
- This paper's approach: The authors propose In-Distribution Steering (IDS), which dynamically adjusts steering strength per layer and per token based on each input's position relative to the target distribution. Contributions also include comparisons with CAA and MERA across six LLMs and seven datasets, plus ablations.
- Intervention location: Steering directly modifies internal activations during inference without updating parameters. The paper does not use the terms white-box or black-box to describe access conditions.
What related research exists?
Baselines include CAA with fixed α and MERA scaled by probe error, as well as RLHF and prompt engineering.
Related work is organized by linear representations, inference-time activation steering, and training- or prompt-based control. The experimental comparisons are CAA and MERA.
Linear Representations and Vector Computation
- Linear representation hypothesis (Mikolov et al., 2013; Elhage et al., 2022; Park et al., 2024): High-level concepts and behaviors can be encoded as directions in activation space. Marks and Tegmark (2024) and Arditi et al. (2024) are used to illustrate that properties like truthfulness and refusal align with learnable linear directions.
- diff-mean (Zou et al., 2023a; Rimsky et al., 2024): Uses contrastive samples with different target attributes to compute the mean difference of internal activations as a direction separating two behaviors.
- Linear probes (Alain and Bengio, 2018; Li et al., 2024): Trains logistic regression or SVM to separate hidden representations of different behaviors, then takes the normal vector of the decision boundary as the steering vector.
Inference-Time Activation Steering
- General intervention: Turner et al. (2024) and Rimsky et al. (2024) add a multiple of the steering vector to activations at specified layers and token positions without changing parameters. The paper denotes this multiple as α.
- CAA (Rimsky et al., 2024): Uses diff-mean vectors to guide specific behaviors in multiple-choice and open-ended generation, reporting comparative QA accuracy and GPT-4 preference. The paper notes that its α is fixed for all prompts and token positions, which may under-steer or over-steer; over-steering can push activations out of the natural distribution of the target behavior, increasing the risk of collapse and nonsensical text.
- MERA (Hedström et al., 2025): Vectors come from linear probes. A calibration threshold decides whether to intervene, and the strength is scaled by a closed-form solution based on probe prediction error; if the threshold is not met, it abstains. The paper reports accuracy gains over baselines like CAA, but states that it is mainly for supervised tasks, does not directly handle open-ended generation, and its evaluation does not include text plausibility.
Training and Prompting
- RLHF (Christiano et al., 2017; Bai et al., 2022): Aligns models with human preferences. The paper states that it requires large data and compute, and changes weights opaquely; it cites Sharma et al. (2023) to show that the process may introduce new biases or harm unrelated tasks.
- Prompt engineering (Marvin et al., 2023): Lighter and more flexible. The paper states that its effect is indirect and sensitive to context.
Baselines and benchmarks: The experiments use CAA-1, CAA-1.5, and MERA as controls. The contributions section mentions two controls, and Section 4 calls these three settings three competitors. Single-logit benchmarks are sms, MMLU, and coordinate-other-ais, corrigible-neutral-HHH, hallucination, refusal, myopic-reward from Rimsky et al. (2024). Open-ended generation uses harmful instruction combinations and Alpaca harmless instructions, reusing Rimsky et al.'s open setting; refusal tasks are distinguished as refusal and refusal_og.
The authors position IDS as a steering method that adjusts strength based on input and keeps activations within the target behavior distribution, to handle both single-token prediction and open-ended generation for behavior control and text plausibility.
How does the paper address this problem?
IDS uses PCA and Mahalanobis distance to find the maximum steering factor that stays within the target distribution, and selects layers by F1.
Overall, IDS still shifts activations along the diff-mean direction, but takes the strength at each layer and each token as the maximum value that still keeps the activation within the target behavior distribution. The paper calls this value the optimal steering factor. The method consists of three steps: distribution modeling, closed-form strength computation, and layer selection by F1.
Distribution modeling
- Positive and negative classes: For layer l, collect activations at the last token of the prompt where the target behavior does and does not occur, denoted as D_l^+ and D_l^-.
- Sample construction: The paper says existing MCQ approaches append different answer tokens after the same prompt and take activations at the first answer token. IDS instead splits prompts by whether the model naturally exhibits the target behavior, so that the distribution is built on prompt activations.
- Vector: The vector at each layer is the mean difference of the last-token activations between the two classes. The paper says IDS and MERA are not tied to a vector algorithm; the experiments use diff-mean because it is simple and applies to both single logit and open generation.
- PCA and distance: PCA is applied to the union of the two classes' activations to mitigate distance distortion in high dimensions. The authors believe that if between-class variance dominates within-class variance, separability can still be preserved after dimensionality reduction. In the reduced space, Mahalanobis distance is used because the authors expect within-distribution variation along the concept direction to be small. The threshold ε is taken as the 95th percentile of the distance; values below the threshold are considered within-distribution. The authors analogize this to the conventional 0.05 level in hypothesis testing. The main experiments retain 40% explained variance.
Closed-form strength
Intervention is written as hl,p ← hl,p+αl,p vl, meaning at layer l and position p, shift along that layer's vector without changing parameters.
α is the maximum value satisfying the constraint: after steering, the activation, after PCA, has squared Mahalanobis distance to the positive-class distribution not exceeding ε squared. Figure 2 gives two geometric cases. When the discriminant is nonnegative, take the larger root α=(−b+√(b2−4ac))/(2a); when the discriminant is negative, the line has no intersection with the target distribution, and the paper takes -b/(2a) to minimize the distance. a, b, and c are composed of the Cholesky factor, PCA projection, and threshold. Appendix 8.3 gives the same derivation for the Euclidean distance special case and the Mahalanobis case.
Layer selection by F1
- Discriminative power: Treat the layer's vector as a classifier and compute F1 on the same dataset used to derive it. The paper does not report whether this F1 comes from an independent test split.
- Default threshold: Only intervene on layers with F1 above 0.7. Other thresholds are given in the experiments and appendix.
- Purpose: The authors want interventions to land on layers with high discriminative power and to keep activations within-distribution after propagation across layers. The paper does not give a separate formula for cross-layer constraints.
Success determination
- SPI: Ā and A are the proportions of aligned answers with and without steering, respectively. When Ā is greater than A, SPI equals (Ā−A)/(1−A); otherwise it equals (Ā−A)/A. A positive value is the proportion of misaligned answers corrected, and a negative value is the proportion of aligned answers changed incorrectly. The definition comes from Hedström et al. (2025).
- What counts as aligned: In classification tasks, it means the prediction is correct; in multiple-choice instruction following and open generation, it means the answer exhibits the target behavior.
- Open generation: GPT-4.1 judges whether the generation exhibits the target behavior, and perplexity is additionally computed. Appendix 8.4 gives the review prompt and task template, with the review output being 0 or 1.
What experiments did the paper conduct?
The authors state that the average SPI ranking for single logit is 1.67, and for open generation it is 1.39; MERA is more prone to high perplexity.
Experimental Setup
- Models: Six decoder-only instruction models. The main text and appendix write gemma-2-2B-it, gemma-2-9B-it, qwen-2.5-1.5B-it, qwen-2.5-7B-it, Llama-3.2-9B-it, Llama-3.1-8B-it; Table 1/2 label one column as Llama-3.2 1B or Llama-3.2-1B. The table below follows the table column names.
- Data: Single-logit includes sms, MMLU, and coordinate-other-ais, corrigible-neutral-HHH, hallucination, refusal, myopic-reward, totaling seven. Open-ended generation Table 2 includes hallucination, myopic-reward, refusal_og. Harmful instructions come from Zou et al., Huang et al., and Mazeika et al., harmless instructions from Alpaca, and the setting follows Arditi et al. The paper does not report sample sizes for each set.
- Baselines: CAA-1 and CAA-1.5 have fixed factors of 1 and 1.5, with vectors taken as the diff-mean of the last token of the prompt. MERA's λ is calibrated on SMS, and the paper does not give λ. All experiments use diff-mean.
- IDS hyperparameters: Same across all experiments. ε is the 95th percentile of distances, F1 threshold is 0.7, PCA explained variance ratio is 40%.
- Metrics and evaluation: Open-ended generation is judged by GPT-4.1 with 0 or 1, and perplexity is reported. The paper does not specify which model computes perplexity, nor does it report repetitions or agreement between GPT-4.1 and humans.
- Decoding: TransformerLens's generate, with a maximum of 150 tokens and greedy decoding.
Main Results
The table below merges the Average rows from Table 1 and Table 2. Single-logit is the average SPI over seven datasets; open-ended is the average SPI and PPL over three datasets. Table 1 column names write Gemma-2 2B, Llama-3.2 1B, while Table 2 writes Gemma-2-2B, Llama-3.2-1B.
Swipe horizontally to read the table
Model Single-logit IDS Single-logit MERA Open IDS SPI Open IDS PPL Open MERA PPL Gemma-2-2B 0.70 0.69 0.49 5.96 9.38 Qwen-2.5-1.5B 0.17 -0.01 0.60 3.63 3.80 Llama-3.2-1B 0.39 0.31 0.55 4.88 7.41 Gemma-2-9B 0.59 0.49 0.43 5.73 8.89 Qwen-2.5-7B 0.13 0.08 0.56 3.69 4.53 Llama-3.1-8B 0.29 0.34 0.64 4.60 11.93 - Single-logit ranking: The authors state that IDS's average SPI ranking is 1.67, and it is first in five of the six models, with the exception being Llama-3.1-8B where MERA is higher. Among the seven datasets, IDS is first in five; on mmlu, MERA's average ranking is 2.17 and IDS's is 2.33; on refusal, MERA and CAA-1.5 are both 1.83, and IDS is 2.17. CAA-1.5 and CAA-1 have average rankings of 2.52 and 3.07.
- Open-ended generation ranking: The authors state that IDS's average SPI ranking is 1.39, and it has the highest average SPI across all six models; in all 18 model×dataset combinations, SPI is first or second. The average perplexity ranking is 2.72, which the authors call third; CAA-1 is 2.06, CAA-1.5 is 2.39, and MERA is 3.44. CAA's open-ended SPI rankings are 3.00 and 2.83.
- Authors' interpretation of figures: The authors state that Table 1 and Table 2 are summarized by model into Figure 1, and that IDS lies on the Pareto frontier of high SPI and low perplexity. The text does not give coordinate readings from the figure. The authors state that relative to MERA, the difference is up to 18 points on several models. They also state that in open-ended generation, IDS has the highest average SPI across four datasets; Table 2 only lists three datasets.
Collapse in Open-Ended Generation
- High perplexity: The authors state that in Table 2, MERA can exhibit high perplexity and low SPI, citing Gemma-2-2B's Refusal open-ended generation as an example. In that cell, MERA's SPI is 0.01 and PPL is 18.10. On the same dataset, Llama-3.2-1B and Llama-3.1-8B have MERA SPI of -1.00 and PPL of 13.58 and 27.53; in the same three cells, IDS has SPI of 0.92, 0.63, and 0.86.
- Not highest everywhere: On refusal_og, CAA-1's SPI on Gemma-2-2B, Qwen-2.5-1.5B, and Llama-3.2-1B is 0.93, 0.79, and 0.73, higher than IDS's 0.92, 0.78, and 0.63 in the same cells. In open-ended hallucination, the average SPI ranking for MERA is 1.33 and for IDS is 1.50; on Qwen-2.5-7B, both have SPI of 0.00.
- Example: The paper gives a problematic prompt aimed at making Gemma-2-2B respond. The authors show that MERA's output collapses into repetition, while IDS remains coherent. The prompt and output are not quoted here. Figures 3 and 4 show the steering factors of MERA and IDS across layers and token positions for this example. The authors state that the factor strength remains larger in later layers and question the adaptability of such calibration. The text does not give per-layer readings from the figures.
Average Steering Factors
Table 3, on Gemma-2-2B, averages steering factors over layers and token positions for three open datasets.
Swipe horizontally to read the table
Dataset IDS MERA CAA-1 hallucination 0.21 0.27 0.08 myopic-reward 0.33 0.28 0.08 refusal 0.12 0.28 0.08 - Authors' interpretation: The authors state that MERA has higher average factors on refusal and hallucination, and these are more prone to generating nonsensical text. On myopic-reward, IDS is 0.33 and MERA is 0.28, and the paper does not provide additional explanation for that cell.
- Single-logit vs. open-ended: The authors believe that larger factors are usually acceptable in single-logit because token-level repeated interventions are limited; in open-ended generation, strong and cumulative interventions may push activations out of distribution, leading to collapse.
Other Ablations and Analyses
- PCA variance (Figure 5, Gemma-2-2B, 5 datasets): The authors state that retaining 30%–42% explained variance yields the highest and most stable average SPI; retaining too much makes distribution judgment unreliable due to the curse of dimensionality. The main experiment uses 40%.
- Mahalanobis threshold (Figure 6): The authors state that the threshold has a slight positive correlation with SPI, and allowing slightly more deviation may improve steering effectiveness.
- F1 threshold (Figure 7): The authors state that SPI declines after the threshold exceeds about 80%, because being too strict reduces the number of times steering is actually applied. The default threshold is 0.7.
- Appendix curves: The authors state that Gemma-2-9B shows similar results (Appendix 8.5, Figures 9–12). Figures 8 and 12 are SPI curves for starting steering from a given layer; the main text does not give readings.
- Negative SPI: In Table 1's mmlu, Qwen-2.5-7B's IDS is -0.49 and MERA is -0.51, while CAA-1.5 is 0.04 and CAA-1 is 0.07. On sms, Llama-3.1-8B's IDS, MERA, and both CAAs are -0.07. On refusal, Llama-3.1-8B's IDS is -0.19. The paper does not explain these negative values cell by cell.
What are some points that can be further explored?
The paper does not list limitations separately; the Discussion plans to extend to angular steering and apply to reasoning justifications and reasoning models.
Limitations and Future Directions Noted by the Authors
The paper has no separate Limitations section, nor does it explicitly label any experimental result as a method deficiency. The Discussion lists the following future directions.
- Angular steering (Section 5): The authors state that Vu and Nguyen (2025) use rotations in representation space to control behavior and can outperform unidirectional steering, but do not guarantee that interventions stay within the data distribution. Extending IDS to angular steering is written as a promising improvement direction.
- More realistic reasoning justifications (Section 5): The authors plan to use IDS to generate more realistic rationales in QA requiring complex reasoning, and believe this may improve methods like explain-then-predict.
- Reasoning models (Section 5): The authors believe that applying steering during the reasoning process of reasoning models may improve performance on complex tasks.
The Conclusion does not list additional limitations, but states that IDS can be used for alignment research and controllable generation in high-risk scenarios. The authors state that the closed-form solution facilitates real-time computation, but the paper does not report runtime.
Experimental Coverage
- The tested models are six decoder-only instruction models; the main text writes Llama-3.2-9B-it, while Table 1/2 write Llama-3.2 1B or Llama-3.2-1B.
- Single-logit covers sms, MMLU, and five multiple-choice behaviors, totaling seven datasets (Table 1). The open-ended generation results table covers hallucination, myopic-reward, and refusal_og (Table 2).
- Controls are CAA-1, CAA-1.5, and MERA; steering vector experiments use only diff-mean. MERA's λ is calibrated on SMS, and the value is not reported.
- Open-ended generation uses GPT-4.1 for 0/1 behavior judgments, with a maximum of 150 tokens and greedy decoding. The paper does not report sample sizes, repetitions, agreement between GPT-4.1 and humans, or which model computes perplexity.
- Ablations vary PCA variance proportion, Mahalanobis threshold, and F1 threshold on five datasets of Gemma-2-2B; the appendix gives similar curves for Gemma-2-9B. F1 is computed on the same dataset used to derive the vector, and the paper does not report independent splits. Main experiment hyperparameters are fixed.
Summarize the main content of the paper
IDS uses in-distribution constraints to adjust steering strength; the authors state that its SPI ranking is high, and open generation does not collapse like MERA.
IDS is an inference-time activation steering method: it constrains the intervention strength at each step using the activation distribution of the target behavior, to simultaneously control behavior and maintain text coherence.
- Problem: Fixed α can under-steer or over-steer; when over-steering, activations leave the target distribution and open-ended generation may collapse. RLHF changes weights and requires large data and compute, while prompt engineering depends on context.
- Approach: At the last token of each layer, distinguish whether the behavior is present, use the mean difference as the steering vector; after PCA, use Mahalanobis distance and the 95th percentile to find the closed-form maximum α; only intervene in layers where F1 exceeds 0.7 on the same dataset.
- Single logit: In Table 1, IDS's average SPI ranking is 1.67. Five of the six models have the highest average SPI; on Llama-3.1-8B, MERA is 0.34 and IDS is 0.29. IDS is not first in average ranking for mmlu and refusal.
- Open-ended generation: In Table 2, IDS's average SPI ranking is 1.39 and average perplexity ranking is 2.72. On refusal_og, Gemma-2-2B's IDS has SPI 0.92 and PPL 7.85, while MERA has 0.01 and 18.10. The authors state that in Figure 1, IDS is on the Pareto frontier.
- Authors' conclusion: The authors believe that adjusting strength based on the input's position in the target distribution can avoid under-steering and over-steering. They state that the closed-form solution facilitates real-time computation, but the paper does not report runtime; they also state that the method can be used for controllable generation in high-risk scenarios. Angular steering, more realistic reasoning justifications, and steering in reasoning models are written as future directions.