无需额外模型,直接操控大模型隐藏状态实现精准语义干预。
Inference Time Causal Probing in LLMs

- 用梯度驱动隐藏状态,不依赖外部分类器进行因果干预。
- 在多个数据集上可靠度超越现有方法,关键属性改变且无关属性不变。
- 适合需要可控文本生成的场景,如内容编辑与风格控制。
因果探针旨在测试并控制内部表示如何影响生成模型的行为。在因果探针中,通过干预隐藏状态使某一属性取不同值。现有方法通常需训练辅助探测分类器,受限于特定任务或模型,且可能与模型预测几何结构不一致。本文提出无探测器、基于梯度的隐藏状态驱动边际干预(HDMI),直接利用模型原生输出调控隐藏状态。HDMI采用边际目标,提升目标续写概率,降低源续写概率,无需探测分类器。我们进一步引入前瞻变体(LA-HDMI),通过softmax嵌入反向传播,修改当前隐藏状态,使用户指定词元在后续生成中的可能性增加,同时保持语言流畅性。为评估干预效果,我们测量完整性(目标属性是否按预期改变)和选择性(无关属性是否保留),并以两者的调和平均作为整体可靠性指标。HDMI在LGD一致语料库和CausalGym基准上,对Meta-Llama-3-8B-Instruct与Pythia-70M均表现更优。
原文摘要 · Abstract (English)
Causal probing methods aim to test and control how internal representations influence the behavior of generative models. In causal probing, an intervention modifies hidden states so that a property takes on a different value. Most existing approaches define such interventions by training an auxiliary probe classifier, which ties the method to a specific task or model and risks misalignment with the model's predictive geometry. We propose Hidden-state Driven Margin Intervention (HDMI), a probe-free, gradient-based technique that directly steers hidden states using the model's native output. HDMI applies a margin objective that increases the probability of a target continuation while decreasing that of the source, without relying on probe classifiers. We further introduce a lookahead variant (LA-HDMI) for text editing that backpropagates through the softmax embeddings, modifying the current hidden state so that the likelihood of user-specified tokens increases in next token generations while preserving fluency. To evaluate interventions, we measure completeness (whether the targeted property changes as intended) and selectivity (whether unrelated properties are preserved), and report their harmonic mean as an overall measure of reliability. HDMI consistently achieves higher reliability than prior methods on the LGD agreement corpus and the CausalGym benchmark, across Meta-Llama-3-8B-Instruct, and Pythia-70M.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。