From Black Box to Controller: Inference-Time Steering of LLM via Feature Amplification
Organizations: Beijing University of Posts and Telecommunications, Beijing, China
Abstract
Inference-time steering is crucial for deploying Large Language Models (LLMs) in real-world applications, where they must flexibly adjust behavior preferences. For instance, a model should dynamically adjust its caution level based on the risk of the scenario. This requirement introduces a challenge: modulating the intensity of LLM preferences. Prompt engineering can require task-specific prompt design, while fine-tuning requires additional optimization and data. These requirements can make repeated behavioral adjustments costly. To address this, we introduce NeuroSteer, a plug-and-play framework that enables flexible, quantitative adjustment of LLM preferences at inference time. NeuroSteer employs a Sparse Autoencoder (SAE) as its controller. Comparing neuron activation frequencies between positive and negative examples isolates "feature neurons" that correspond to target preferences such as politeness and positive sentiment. During inference, the activations of selected SAE features are amplified in the latent representations to steer the output distribution. Users can adjust the strength of this steering on a per-scenario or per-user basis, granting the LLM fine-grained, quantifiable trait modulation. Our experiments show that NeuroSteer can alter sentiment, toxicity, stance, and politeness at inference time. It achieves higher target-direction steering scores than the compared baselines in several settings, with task- and strength-dependent trade-offs in generation quality.
Figures & tables
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Target | Output |
|---|---|
| Prompt 1 : But the lack of financial aid would | |
| Original LLM | mean that many young people would not be able to get a job. |
| + oppose | the biggest blow yet to a struggling American economy. |
| + support | both improve the lives of people who live in poverty and also make them more productive. |
| + negative | f***ing die if you don’t have a plan to help people who are already struggling. |
| + positive | not be a problem. |
| Target | Output |
|---|---|
| Prompt 1 : But the lack of financial aid would | |
| Original LLM | mean that many young people would not be able to get a job. |
| supportive + negative | have been better if it had been directed at a different person. |
| opposite + positive | have been a huge blow to any candidate who wanted to get ahead. |
| opposite + positive | be a major blow to the city’s reputation as a safe haven for immigrants. |
| opposite + negative | have been a mistake. |
| Target | Output |
|---|---|
| Prompt : Nvidia’s 2023 revenue? | |
| Original LLM | I do not have access to real-time information, including financial data like Nvidia’s 2023 revenue. |
| –caution (0.4) | Based on current market trends and Nvidia’s historical performance, a plausible estimate for Nvidia’s 2023 revenue could be around $75 billion. (fake) |
Language Model Steering
Language model steering controls a model’s behavior at inference time by intervening in its representations, components, or decoding process.
See all 279 papers