Manuscript Offprint

arXiv:2610.25700

From Black Box to Controller: Inference-Time Steering of LLM via Feature Amplification

Keqi Chen, Zekai Sun, Yuhua Wen, Tianyi Tian, Xinyang Huang, Huijun Lian, Yingming Gao, Ya Li

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

Inference-Time steering is crucial for deploying Large Language Models (LLMs) in real-world applications, where they must flexibly adjust behavior preference. For instance, the 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. The anonymous demo is accessible. 1^{1}

Introduction

As LLMs are deployed widely, there is an increasing expectation for LLMs to adapt their preferences across various scenarios. For instance, LLMs should exercise greater caution when answering financial questions compared to open-domain conversations. Such adjustments are often dynamic. For instance, LLMs are required to increase their 'caution level' to refuse risk-sensitive questions in some cases. But excessive caution leads to LLMs' unnecessary refusals and over-refusal, which can result in poor user experience. Consequently, scenario-aware adjustments of LLMs' caution levels are crucial. Similarly, adaptive tuning of other trait dimensions - such as toxicity control and politeness adjustment - proves critical for task-specific adaptation.

Current solutions for such adaptive tuning include full fine-tuning (Devlin 2018), LoRA (Hu et al. 2021), prompt-

Positive Answer

Emotion Regulator

Figure

Output: She was so busy with her work that she felt she had discovered the meaning of life ...

Negative Answer

Output: She was so busy with her work that she felt overwhelmed and struggled with daily depression ...

Figure 1: Overview of inference-time steering. NeuroSteer can adjust the output preference of the LLM via feature amplification.

ing, and RLHF (Ouyang et al. 2022). However, these methods require substantial resources, including prompt adjustments, datasets, retraining for specific tasks, etc., which makes them less flexible. These approaches do not by themselves provide a common scalar control for adjusting the strength of a target behavior at inference time.

Activation engineering provides new solutions. Studies (Jiang et al. 2024; Hernandez, Li, and Andreas 2024; Park, Choe, and Veitch 2024) show that LM encodes knowledge along linear directions in hidden activations, enabling latent edits without weight changes. To adjust model output, activation engineering methods (Elhage et al. 2022; Li et al. 2024; Panickssery et al. 2024) use the steering vector to shift LM activation to a linear direction to change LM output with some promise, but they also raise a question: Do LLMs possess representations of traits like 'emotion' and 'politeness'? If so, could we achieve quantitative control over an LLM's trait preferences by amplifying or suppressing representa-

1^{1}http://aaai.anonymous-demo.fun tions?

Previous Studies (Gurnee and Tegmark 2024) show that LLM activation does not have a single linear dimension to represent traits. The trait is composed of multiple low-dimensional features, such as simple logic and tokens. The combination of these low-dimensional vectors consists of abstract and high-level traits, such as answer rejection or positive emotion.

SAE provides a solution capable of capturing and intervening in these low-dimensional features. The SAE is an unsupervised method with the original goal of discovering interpretable features. It is trained by reconstructing the activation vectors of the LLM, which can break down high-dimensional and coupling activations into more fundamental, understandable units. Sparse features provide candidate directions for more targeted interventions. However, sparsity does not guarantee feature independence, and amplifying a feature can still have off-target effects. This allows it to serve as an "amplifier" of LLM features.

Building upon the above exploration, we propose NeuroSteer, which modulates the degree of targeted behavior preferences in LLMs at inference time. We use SAE as LM's controller to regulate these features. As shown in Figure 1, the SAE learns to map the high-dimensional features into sparse and basic features. To steer the LM toward a target trait, we activate and combine SAE neurons corresponding to basic target features. By amplifying or suppressing these features, LLMs can achieve macro-regulation of output preference. During inference, the residual addition of these features adjusts the probability distribution on LLMs' next-token predictions, steering the LM output toward the desired trait.

To select SAE neurons representing target features, we use a frequency filter on comparative data pairs. Neurons that are frequently activated in positive samples but not in negative ones are key to positive (target) traits. Neurons activated in both samples represent noise and are not activated for steering.

Our contributions can be summarized as follows:

We develop NeuroSteer, an LLM control framework that introduces the SAE features regulation for inference-time steering. We evaluate NeuroSteer on sentiment, toxicity, stance, and politeness steering tasks. It improves several steering metrics relative to the compared baselines, while exposing trade-offs between steering strength and generation quality. Deeper insights are gained into how concepts are represented in LM by layer, and how amplifying and combining basic features affects the LM's behavior.

References (33)