arXiv:2410.12877cs.CLcs.AI2024-10ICLR被引 156

通过激活向量调控模型,实现指令遵循的精准控制。

Improving Instruction-Following in Language Models through Activation Steering

论文配图:Improving Instruction-Following in Language Models through Activation Steering
图 1 · 摘自论文原文
  • 从激活差异提取指令特异性向量,实现模块化控制。
  • 无需显式指令也能提升格式、长度等约束遵循率。
  • 可跨模型迁移,适合需要精细生成控制的场景。

语言模型的指令遵循能力对实际应用至关重要。本文从语言模型中提取指令特异性向量,基于输入含与不含指令时的激活差异计算,实现对模型的定向引导。该方法支持推理阶段对输出格式、长度、关键词包含等约束的灵活控制。在四个模型上的实验表明,该方法可在无显式指令时提升约束遵循能力,并在有指令时增强性能。我们还验证了多指令同时生效的组合性。此外,由指令微调模型生成的引导向量可迁移至基础模型,显著改善其表现。结果表明,激活引导是一种高效且可扩展的生成控制策略。代码与数据已开源。

原文摘要 · Abstract (English)

The ability to follow instructions is crucial for numerous real-world applications of language models. In pursuit of deeper insights and more powerful capabilities, we derive instruction-specific vector representations from language models and use them to steer models accordingly. These vectors are computed as the difference in activations between inputs with and without instructions, enabling a modular approach to activation steering. We demonstrate how this method can enhance model adherence to constraints such as output format, length, and word inclusion, providing inference-time control over instruction following. Our experiments across four models demonstrate how we can use the activation vectors to guide models to follow constraints even without explicit instructions and to enhance performance when instructions are present. Additionally, we explore the compositionality of activation steering, successfully applying multiple instructions simultaneously. Finally, we demonstrate that steering vectors computed on instruction-tuned models can transfer to improve base models. Our findings demonstrate that activation steering offers a practical and scalable approach for fine-grained control in language generation. Our code and data are available at https://github.com/microsoft/llm-steer-instruct.

指令遵循激活控制生成调控

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。