用专家模型生成指令向量,让大模型按需调整输出。
ExpertSteer: Intervening in LLMs through Expert Knowledge
- 用专家模型生成干预向量,跨模型控制大语言模型行为。
- 在15个基准上显著优于现有方法,成本极低。
- 适合需要精准控制大模型输出的研究者和开发者。
大语言模型(LLMs)在多项任务中表现出色,但在推理过程中引导其遵循期望行为仍是挑战。激活干预通过修改模型内部激活来控制生成过程,但现有方法多依赖模型自身生成的干预向量,限制了其能力且无法利用外部专家模型。为此,我们提出ExpertSteer,一种利用任意专业专家模型生成干预向量的新方法,实现对任意LLM的干预。ExpertSteer通过四个步骤完成知识迁移:首先使用自编码器对齐表示维度以实现跨模型传输;然后基于互信息分析确定干预层对;接着利用递归特征机从专家模型生成干预向量;最后在推理时将这些向量应用于目标层,选择性引导目标模型,无需更新参数。我们在三个主流大模型上,针对四个不同领域共15个基准进行了全面实验。结果表明,ExpertSteer在多种任务中显著优于现有基线方法,且开销极小。
原文摘要 · Abstract (English)
Large Language Models (LLMs) exhibit remarkable capabilities across various tasks, yet guiding them to follow desired behaviours during inference remains a significant challenge. Activation steering offers a promising method to control the generation process of LLMs by modifying their internal activations. However, existing methods commonly intervene in the model's behaviour using steering vectors generated by the model itself, which constrains their effectiveness to that specific model and excludes the possibility of leveraging powerful external expert models for steering. To address these limitations, we propose ExpertSteer, a novel approach that leverages arbitrary specialized expert models to generate steering vectors, enabling intervention in any LLMs. ExpertSteer transfers the knowledge from an expert model to a target LLM through a cohesive four-step process: first aligning representation dimensions with auto-encoders to enable cross-model transfer, then identifying intervention layer pairs based on mutual information analysis, next generating steering vectors from the expert model using Recursive Feature Machines, and finally applying these vectors on the identified layers during inference to selectively guide the target LLM without updating model parameters. We conduct comprehensive experiments using three LLMs on 15 popular benchmarks across four distinct domains. Experiments demonstrate that ExpertSteer significantly outperforms established baselines across diverse tasks at minimal cost.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。