arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.25700cs.AI
收藏

从黑箱到控制器:通过特征放大实现推理时的大语言模型(LLM)引导

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

Beijing University of Posts and Telecommunications(北京邮电大学)

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

AI总结:

本研究提出NeuroSteer框架,通过稀疏自编码器分离特征神经元并放大其激活,实现推理时灵活定量调整大语言模型的情感、毒性等特质,效果优于部分基线。

摘要:

推理时引导对于将大语言模型(LLM)部署到实际应用中至关重要,此时模型必须灵活调整行为偏好,例如根据场景风险动态调整谨慎程度,这一需求带来了大语言模型偏好强度调节的挑战:提示工程需要特定任务的提示设计,微调则需要额外的优化和数据,这些需求会导致重复的行为调整成本高昂。为解决该问题,我们提出NeuroSteer,即一种即插即用框架,可在推理时灵活、定量地调整大语言模型的偏好。NeuroSteer采用稀疏自编码器(SAE)作为控制器,通过比较正负样本间的神经元激活频率,分离出对应目标偏好(如礼貌度、积极情感)的“特征神经元”;推理时,在潜在表示中放大所选SAE特征的激活,以引导输出分布,用户可按场景或用户调整引导强度,实现大语言模型的细粒度、可量化特质调节。实验表明,NeuroSteer可在推理时改变情感、毒性、立场和礼貌度,在多种设置下,其目标方向引导分数高于对比基线,生成质量存在任务和强度依赖的权衡。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑