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

语义自适应动态引导向量用于大语言模型的激活干预

Semantics-Adaptive Activation Intervention for LLMs via Dynamic Steering Vectors

School of Informatics, University of Edinburgh(爱丁堡大学信息学院);Huawei Technologies Co., Ltd.(华为技术有限公司);School of Engineering, RMIT University(RMIT大学工程学院)

Weixuan Wang, Jingyuan Yang, Wei Peng

AI总结:

提出语义自适应动态干预(SADI),利用对比对激活差异识别关键元素,在推理时动态构建引导向量缩放激活,无需训练即可显著提升大语言模型任务性能,并具良好泛化性。

摘要:

大语言模型(LLMs)在许多任务上取得了显著性能,但使其与期望行为对齐仍然具有挑战性。激活干预已成为一种有效且经济的方法来修改大语言模型的行为。尽管该领域引起了相当大的关注,但当前的干预方法仅使用固定的引导向量来修改模型激活,缺乏对多样输入语义的适应性。为解决这一局限,我们提出了语义自适应动态干预(SADI),一种新颖的方法,在推理时构建动态引导向量来干预模型激活。具体而言,SADI利用对比对中的激活差异来精确识别大语言模型的关键元素(即注意力头、隐藏状态和神经元)以进行针对性干预。在推理过程中,SADI通过基于输入语义方向对元素级激活进行缩放来动态引导模型行为。实验结果表明,SADI在无需训练的情况下,以显著优势超越既有基线,提升了任务性能。SADI的成本效益及其在各种大语言模型骨干和任务上的泛化能力,凸显了其作为一种通用对齐技术的潜力。

英文摘要:

Large language models (LLMs) have achieved remarkable performance across many tasks, yet aligning them with desired behaviors remains challenging. Activation intervention has emerged as an effective and economical method to modify the behavior of LLMs. Despite considerable interest in this area, current intervention methods exclusively employ a fixed steering vector to modify model activations, lacking adaptability to diverse input semantics. To address this limitation, we propose Semantics-Adaptive Dynamic Intervention (SADI), a novel method that constructs a dynamic steering vector to intervene model activations at inference time. More specifically, SADI utilizes activation differences in contrastive pairs to precisely identify critical elements of an LLM (i.e., attention heads, hidden states, and neurons) for targeted intervention. During inference, SADI dynamically steers model behavior by scaling element-wise activations based on the directions of input semantics. Experimental results show that SADI outperforms established baselines by substantial margins, improving task performance without training. SADI's cost-effectiveness and generalizability across various LLM backbones and tasks highlight its potential as a versatile alignment technique.

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

↑