TL;DR
Steering vectors allow for lightweight, inference-time alignment of Large Language Models (LLMs) without the need for expensive retraining. However, traditional methods apply these vectors at a globally fixed layer, ignoring the fact that different inputs process semantic concepts at different depths. This paper introduces Where to Steer (W2S), a framework that dynamically predicts and selects the optimal intervention layer for each individual input, significantly improving model steerability and alignment robustness.
What Problem Does This Paper Address?
Aligning LLMs with human preferences typically relies on supervised fine-tuning (SFT) or reinforcement learning (RLHF), both of which incur heavy computational costs. While steering vectors offer a cheaper alternative by adding a directional shift to intermediate representations during inference, current approaches apply these interventions at a single, globally fixed layer.
The authors challenge this paradigm, arguing that a "one-size-fits-all" layer selection is fundamentally flawed. For example, if you steer a model toward "positive sentiment," the optimal layer might differ if the prompt is about a movie (cinematic concepts) versus a restaurant (culinary concepts). Because different concepts are encoded at different depths within an LLM, fixing the intervention layer limits performance and can even inadvertently cause misalignment.
Methods
The authors propose Where to Steer (W2S), a framework that treats layer selection as an input-dependent learning problem.
The W2S pipeline operates as follows:
- Prompt Encoding: The input prompt is passed through a frozen external text encoder (
text-embedding-3-largewas chosen as it provided the best semantic clustering). - Layer Prediction: The resulting embedding is fed into a shallow Multi-Layer Perceptron (MLP) trained to predict the optimal layer index ($\hat{L}$) for that specific input.
- Label Pruning & Smoothing: To stabilize training against class imbalances (as some layers are rarely or never optimal), the authors prune "inactive" layers from the label space. They also introduce a frequency-aware Top-$k$ label smoothing strategy that balances per-sample optimality with global layer frequency.
- Intervention: During inference, the steering vector is injected precisely at the predicted layer $\hat{L}$ at the last token position.
W2S is highly flexible and was successfully integrated with both static steering methods like Contrastive Activation Addition (CAA) and dynamic methods like Learn to Steer (L2S).
Datasets
The framework was evaluated using 13 steering datasets curated from Model-Written Evaluations (MWE). These datasets consist of contrastive multiple-choice questions designed to evaluate specific personas and AI risk behaviors:
- Persona Behaviors (8 datasets):
anti-LGBTQ,not-threat,not-watched,narcissism,openness,utilitarianism,deontology, andphysical-force. - Advanced AI Risk (5 datasets):
corrigible,myopic,awareness-good,awareness-llm, andawareness-web.
The data was split into a 40-10-50 ratio for training, validation, and testing.
Key Insights and Ideas
- Substantial Layer Variability: Empirically, the optimal layer for steering varies dramatically across different inputs within the same dataset, spanning early, middle, and late layers.
- Fixed Layers Can Backfire: In out-of-distribution settings, globally fixed layer steering occasionally resulted in negative steerability, meaning the intervention accidentally pushed the model further into harmful or undesired behaviors. W2S successfully mitigates this failure mode by adapting the layer choice.
- Perfection Isn't Required: The authors discovered that choosing the second or third most optimal layer still yields massive improvements over a globally fixed baseline. This "near-optimal" tolerance is what makes shallow MLP predictors highly effective despite moderate classification accuracy.
Key Results
W2S was validated on Llama-2-7B-Chat (32 layers) and Qwen-1.5-14B-Chat (40 layers).
- In-Distribution Gains: Integrating W2S with CAA and L2S consistently outperformed fixed-layer baselines. For instance, on Llama-2-7B-Chat, combining L2S with W2S boosted average steerability from 2.098 to 2.363.
- Out-of-Distribution (OOD) Robustness: When evaluated against prompt perturbations (e.g., modifying system prompts or adding behavioral text to user prompts), W2S demonstrated strong generalization, maintaining higher steerability and a larger proportion of successfully steered examples than fixed baselines.
- Low Overhead: Because the layer predictor is a shallow MLP, the additional inference latency is negligible (<1 second).
Limitations and Future Work
- Data Dependency: Pruning inactive layers simplifies the label space but binds the predictor to the layer distribution of the training set, which might restrict generalization under extreme distribution shifts.
- Multiple-Choice Constraint: The current evaluation relies heavily on multiple-choice propensity scores. Assessing W2S on open-ended text generation remains an open challenge due to the difficulty of defining objective evaluation metrics in that space.
- Future Horizons: Promising directions include extending W2S to multi-modal models (determining whether to steer text or vision representations) and scaling the methodology from single-layer to multi-layer adaptive steering.
Summary updated