任务上下文塑造语言模型内部组件的角色分工 Task Context Shapes Component Roles in Language Models 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-10-09
⬇️ 3 次下载
👁️ 预览文献
💡 AI 中文简介
大模型在不同任务中会复用同一批注意力头,但光找出这些共享组件并不能说明它们在每个任务里具体干了什么。本研究借鉴大脑中共享脑区随任务变化而分工的思路,用相同的图事实(即哪些有向连接存在)在不同任务下对比固定组件,通过干预测量注意力头对后续层激活的影响以及对答案的重要性。结果发现,任务变化会重新分配影响,在Gemma-2-9B和Qwen3-14B中,编辑一个早期激活向量就能让模型读取不同的事实,而指令保持不变。作者为每个提示构建编辑前后的线性响应图,能较好预测后续注意力头的反应。这说明任务上下文同时改变了共享组件响应哪些事实、以及它们如何影响后续计算。
领域大语言模型可解释性 / 神经网络机制分析
适合谁读需要一定专业背景(了解Transformer结构与注意力机制)
核心贡献1. 提出用网络视角比较同一批模型组件在不同任务下的角色差异,区分“影响”与“重要性”两种度量;2. 构建任务条件下的线性响应图,能预测后续注意力头对早期组件变化的响应,为任务依赖的干预提供依据。
关键数据覆盖4个模型家族、5个开放权重模型,参数量1.5–14B;线性响应图相比两图平均,在Gemma中把预测均方误差降低53.6%,在Qwen中降低5.0%。
推荐理由如果你好奇大模型内部同一批“零件”为何能胜任不同任务,这篇用干预实验和响应图给出了可测量的答案,值得一读。
关键词["大语言模型", "注意力头", "任务上下文", "机制可解释性", "组件影响", "线性响应图"]

原文摘要

查看英文原文摘要

Large language models reuse the same attention heads across tasks, but identifying these shared heads does not explain what they do differently in each task. A natural source of inspiration is task-dependent interactions among shared brain regions, which motivate a network view of language-model computation. Here, we compare fixed model components across tasks using identical graph facts, statements specifying which directed connections are present. We measure how interventions affect attention heads and the activation state in later layers (influence), as well as the answer (importance). Task changes redistribute the influence in five open-weight models spanning four families and 1.5-14 billion parameters. In Gemma-2-9B and Qwen3-14B, an activation edit changes an early internal activation vector and switches which fact the model reads while the written instruction stays fixed. The same heads then respond to different graph facts and influence later components differently. For each prompt, we construct two linear response maps, one before the edit and one after it. Each map predicts a later head's response from a measured change in an earlier head. For a separate factual intervention, the map for the corresponding condition reduces mean squared prediction error by 53.6% in Gemma and 5.0% in Qwen compared with the average of the two maps. These findings show that task context changes both which graph facts the shared components respond to and how their outputs affect later computation. A network account may help explain how models use shared parameters to perform different computations. Measurements of task-dependent influence could also guide interventions intended to alter one behavior while preserving others.