arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.18674cs.CLcs.AI
收藏

从关系特定头到共享干预:语言模型中的语境夹带现象

From Relation-Specific Heads to Shared Interventions: Contextual Entrainment in Language Models

McGill University(麦吉尔大学);Dalian University of Technology(大连理工大学)

Jinghan Zheng, Jiajun Shi

AI总结:

本研究针对语言模型的语境夹带问题,发现其机制存在跨关系共享的注意力头,提出用异构攻击提示揭示共享干预目标,可减少有害复制并保留模型常规能力。

摘要:

大型语言模型依赖提示语境进行语境内学习、遵循格式并适配局部证据,但这一能力也引发了鲁棒性问题:模型在回答后续查询时可能复用早期语境中的无关标记。已有研究将该行为定义为语境夹带,并发现对其进行消融可减少该现象的注意力头,认为这些头大多是任务或关系特定的。但语境夹带背后的机制真的按关系隔离,还是按关系条件搜索能恢复跨关系共享的可复用组件?本研究使用涵盖19个词汇-语义亚型的事实-干扰项关系补全提示,识别出消融后可减少夹带的注意力头,并测试所得头集在精确关系、语义家族及混合关系分布间的迁移恢复能力。结果显示:同家族迁移优于不同家族;移除全局共享头后,家族残差减弱;亚型特定搜索反复重新发现许多全局头。清洁补全与语境使用探针进一步表明,这种共享干预可减少有害复制,同时保留常规关系补全与简单语境内能力。本研究为语境夹带及其缓解提供了更精准的视角:有害语境跟随问题的最佳解决方式并非搜索孤立的关系特定回路,而是使用异构攻击提示揭示可复用的干预目标,其效果受语义关系结构塑造。

英文摘要:

Large language models rely on prompt context to perform in-context learning, follow formats, and adapt to local evidence. This ability, however, also raises a robustness concern: models may reuse irrelevant tokens from earlier context when answering a later query. Prior work identifies this behavior as contextual entrainment and finds attention heads whose ablation reduces it, arguing that these heads are largely task- or relation-specific. But are the mechanisms behind contextual entrainment truly isolated by relation, or do relation-conditioned searches recover reusable components shared across relations? Using factual-distractor relation-completion prompts across 19 lexical-semantic subtypes, we identify attention heads whose ablation reduces entrainment and test how the resulting head sets transfer recovery ability across exact relations, semantic families, and mixed relation distributions. Same-family transfer exceeds different-family transfer, family residuals weaken once globally shared heads are removed, and subtype-specific searches repeatedly rediscover many global heads. Clean-completion and context-use probes further suggest that this shared intervention can reduce harmful copying while preserving ordinary relation completion and simple in-context abilities. Our findings provide a more precise perspective on contextual entrainment and its mitigation: harmful context following is not best addressed by searching for isolated relation-specific circuits, but by using heterogeneous attack prompts to reveal reusable intervention targets whose effects are shaped by semantic relation structure.

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

↑