Where to Steer: Input-Dependent Layer Selection for Steering Improves LLM Alignment
作者: Soham Gadgil, Chris Lin, Su-In Lee
分类: cs.LG
发布日期: 2026-04-07
💡 一句话要点
提出W2S:输入依赖的层选择策略提升LLM对齐效果
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型对齐 Steering Vectors 输入依赖控制 自适应层选择 模型行为调节
📋 核心要点
- 现有steering vector方法在固定层干预,忽略了不同输入可能需要不同层干预的问题。
- W2S框架通过学习输入嵌入到最佳steering层的映射,自适应地选择干预层。
- 实验表明,W2S在多个LLM和对齐任务上优于固定层方法,提升了模型性能。
📝 摘要(中文)
Steering vectors已成为一种轻量且有效的对齐大型语言模型(LLM)的方法,它通过将LLM表征向目标行为转移来调节模型行为。然而,现有方法通常在全局固定的层应用steering vectors,隐含地假设最佳干预层在不同输入之间是不变的。我们认为这种假设存在根本局限性,因为与目标行为相关的表征可能根据输入编码在不同的层。理论上,我们证明了不同的输入可能需要在不同的层进行steering,以实现与期望模型行为的对齐。我们还提供了经验证据,表明最佳steering层在实践中因输入而异。受这些观察结果的启发,我们引入了Where to Steer (W2S),这是一个自适应地选择干预层的框架,它通过学习从输入嵌入到最佳steering层的映射来实现。在多个LLM和对齐行为中,W2S始终优于固定层基线,在同分布和异分布设置中均有改进。我们的研究结果强调了输入依赖控制在LLM对齐中的重要性,并表明自适应层选择是当前steering vectors方法中缺失的关键设计维度。
🔬 方法详解
问题定义:现有steering vector方法在对齐大型语言模型时,通常选择一个固定的层进行干预。这种方法忽略了不同输入可能在不同层编码了与目标行为相关的表征。因此,对于不同的输入,最佳的steering层可能不同,固定层干预会限制对齐效果。
核心思路:论文的核心思路是根据输入自适应地选择steering vector作用的层。通过学习一个映射函数,将输入嵌入映射到最佳的steering层,从而实现输入依赖的层选择。这样可以更精确地控制模型行为,提高对齐效果。
技术框架:W2S框架包含以下几个主要模块:1) 输入嵌入模块:将输入文本转换为嵌入向量。2) 层选择模块:学习一个映射函数,将输入嵌入映射到最佳的steering层。这个映射函数可以使用神经网络或其他机器学习模型实现。3) Steering模块:在选定的层应用steering vector,调整模型表征。4) LLM推理模块:使用调整后的模型表征进行推理,生成最终输出。
关键创新:W2S的关键创新在于引入了输入依赖的层选择机制。与现有方法不同,W2S能够根据不同的输入,自适应地选择最佳的steering层。这种自适应性使得W2S能够更精确地控制模型行为,提高对齐效果。
关键设计:层选择模块是W2S的关键组成部分。论文中,层选择模块可以使用一个小型神经网络来实现,该网络以输入嵌入作为输入,输出一个表示最佳steering层的概率分布。损失函数可以设计为最大化在最佳层应用steering vector后的模型性能。此外,steering vector本身可以通过监督学习或强化学习等方法进行训练。
🖼️ 关键图片
📊 实验亮点
W2S在多个LLM和对齐行为上进行了实验,结果表明W2S始终优于固定层基线。在同分布和异分布设置中,W2S均取得了显著的性能提升,证明了输入依赖的层选择策略的有效性。具体性能数据未知,但论文强调了W2S的普遍适用性和优越性。
🎯 应用场景
该研究成果可应用于各种需要对齐大型语言模型的场景,例如:安全内容生成、个性化对话系统、特定风格文本生成等。通过自适应地选择steering层,可以更有效地控制LLM的行为,使其更好地符合人类的期望和价值观,从而提升用户体验和安全性。未来,该技术有望在人机交互、智能客服、内容创作等领域发挥重要作用。
📄 摘要(原文)
Steering vectors have emerged as a lightweight and effective approach for aligning large language models (LLMs) at inference time, enabling modulation over model behaviors by shifting LLM representations towards a target behavior. However, existing methods typically apply steering vectors at a globally fixed layer, implicitly assuming that the optimal intervention layer is invariant across inputs. We argue that this assumption is fundamentally limited, as representations relevant to a target behavior can be encoded at different layers depending on the input. Theoretically, we show that different inputs can require steering at different layers to achieve alignment with a desirable model behavior. We also provide empirical evidence that the optimal steering layer varies substantially across inputs in practice. Motivated by these observations, we introduce Where to Steer (W2S), a framework that adaptively selects the intervention layer conditioned on the input, by learning a mapping from input embeddings to optimal steering layers. Across multiple LLMs and alignment behaviors, W2S consistently outperforms fixed-layer baselines, with improvements in both in-distribution and out-of-distribution settings. Our findings highlight the importance of input-dependent control in LLM alignment and demonstrate that adaptive layer selection is a key design dimension missing in the current methodology of steering vectors.