Task Context Shapes Component Roles in Language Models
作者: Sovesh Mohapatra, Dani S Bassett
分类: cs.CL, cs.AI
发布日期: 2026-10-09
备注: 9 pages, 5 Figs
💡 一句话要点
提出任务上下文视角以解析语言模型组件角色
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 语言模型 任务上下文 注意力机制 图神经网络 模型干预 计算解释 激活编辑
📋 核心要点
- 现有方法未能有效解释语言模型在不同任务中相同组件的不同作用,缺乏对任务上下文的深入理解。
- 论文提出通过网络视角分析语言模型的计算,比较固定组件在不同任务中的表现,测量干预对模型的影响。
- 实验结果显示,任务变化重新分配了影响力,且在Gemma和Qwen模型中,激活编辑显著提高了预测精度,分别减少了53.6%和5.0%的均方误差。
📝 摘要(中文)
大型语言模型在不同任务中重用相同的注意力头,但识别这些共享头并不能解释它们在每个任务中的不同作用。本文借鉴任务依赖的脑区交互,采用网络视角分析语言模型的计算。通过比较固定模型组件在不同任务中的表现,测量干预对注意力头及后续层激活状态的影响,发现任务变化重新分配了影响力。实验结果表明,任务上下文改变了共享组件响应的图事实及其输出对后续计算的影响,提供了对模型共享参数如何执行不同计算的解释。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在不同任务中相同注意力头的不同作用未被充分解释的问题,现有方法缺乏对任务上下文的深入分析。
核心思路:通过借鉴任务依赖的脑区交互,采用网络视角来分析语言模型的计算,比较固定模型组件在不同任务中的表现,测量干预对注意力头及后续层激活状态的影响。
技术框架:整体架构包括固定模型组件的比较、干预实验设计、影响力与重要性的测量,以及线性响应图的构建。主要模块包括任务上下文分析、激活编辑和响应预测。
关键创新:最重要的技术创新在于通过任务上下文的变化,揭示了共享组件如何响应不同的图事实及其输出对后续计算的影响,这为理解模型的计算提供了新的视角。
关键设计:在实验中,采用了相同的图事实进行比较,设计了干预实验以测量影响力和重要性,使用线性响应图来预测后续头的响应,确保了实验的可重复性和结果的可靠性。
🖼️ 关键图片
📊 实验亮点
实验结果显示,在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.