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

REAL:在语言模型引导中读取Transformer激活以进行精确定位

REAL: Reading Out Transformer Activations for Precise Localization in Language Model Steering

Li-Ming Zhan, Bo Liu, Chengqiang Xie, Jiannong Cao, Xiao-Ming Wu

AI总结:

研究旨在在不改变LLM参数的情况下引导其响应,核心挑战是识别关键内部模块。提出REAL框架,通过训练VQ - AE划分潜在空间,量化模块行为相关性来指导模块选择与引导强度。实验表明该方法能有效干预,提升真实性引导效果且具零样本泛化能力。

摘要:

推理时引导旨在在不改变大语言模型(LLM)参数的情况下改变其响应,但核心挑战是识别最强烈影响目标行为的内部模块。现有方法常依赖简单线索或临时启发式方法,导致效果不佳或意外影响。我们引入了REAL框架,用于识别Transformer模型中与行为相关的模块(注意力头或层)。对于每个模块,REAL在其隐藏激活上训练向量量化自动编码器(VQ - AE),并使用共享的可学习码本将潜在空间划分为与行为相关和无关的子空间。通过二元分类度量,根据VQ - AE编码区分行为对齐和行为违反响应的能力来量化模块的行为相关性;该分数指导模块选择和引导强度。我们在来自Llama和Qwen家族的八个LLM以及九个数据集上评估了REAL,涵盖真实性增强、知识冲突下的开放域问答和一般对齐任务。REAL实现了更有效的推理时干预,在真实性引导方面比ITI方法平均相对提高了20%(高达81.5%)。此外,REAL选择的模块在跨域真实性引导场景中表现出强大的零样本泛化能力。

英文摘要:

Inference-time steering aims to alter a large language model's (LLM's) responses without changing its parameters, but a central challenge is identifying the internal modules that most strongly govern the target behavior. Existing approaches often rely on simplistic cues or ad hoc heuristics, leading to suboptimal or unintended effects. We introduce REAL, a framework for identifying behavior-relevant modules (attention heads or layers) in Transformer models. For each module, REAL trains a vector-quantized autoencoder (VQ-AE) on its hidden activations and uses a shared, learnable codebook to partition the latent space into behavior-relevant and behavior-irrelevant subspaces. REAL quantifies a module's behavioral relevance by how well its VQ-AE encodings discriminate behavior-aligned from behavior-violating responses via a binary classification metric; this score guides both module selection and steering strength. We evaluate REAL across eight LLMs from the Llama and Qwen families and nine datasets spanning truthfulness enhancement, open-domain QA under knowledge conflicts, and general alignment tasks. REAL enables more effective inference-time interventions, achieving an average relative improvement of 20% (up to 81.5%) over the ITI method on truthfulness steering. In addition, the modules selected by REAL exhibit strong zero-shot generalization in cross-domain truthfulness-steering scenarios.

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

↑