Transformers are effective at inferring the latent task from context via two inference modes: recognizing a task seen during training, and adapting to a novel one. Recent interpretability studies have identified from middle-layer representations task-specific directions, or task vectors, that steer model behavior. However, a lack of rigorous foundations hinders connecting internal representations to external model behavior: existing work fails to explain how task-vector geometry is shaped by the training distribution, and what geometry enables out-of-distribution (OOD) generalization. In this paper, we study these questions in a controlled synthetic setting by training small transformers from scratch on latent-task sequence distributions, which allows a principled mathematical characterization. We show that two inference modes can coexist within a single model. In-distribution behavior is governed by Bayesian task retrieval, implemented internally through convex combinations of learned task vectors. OOD behavior, by contrast, arises through extrapolative task learning, whose representations occupy a subspace nearly orthogonal to the task-vector subspace. Taken together, our results suggest that task-vector geometry, training distributions, and generalization behaviors are closely related.


翻译:Transformer能够通过两种推理模式从上下文中推断潜在任务:识别训练中见过的任务,以及适应全新任务。近期可解释性研究从中层表征中识别出任务特定方向(即任务向量),这些向量操控模型行为。然而,由于缺乏严格的理论基础,内部表征与外部模型行为之间的关联仍不清晰:现有工作未能解释训练分布如何塑造任务向量几何,以及何种几何结构支持分布外泛化。本文在受控合成场景下,通过从头训练小型Transformer处理隐式任务序列分布来研究这些问题,从而允许进行原理性的数学刻画。我们证明两种推理模式可共存于单一模型中。分布内行为由贝叶斯任务检索主导,其内部实现通过已习得任务向量的凸组合完成。相比之下,分布外行为通过外推式任务学习产生,其表征占据近乎正交于任务向量子空间的子空间。综合来看,我们的结果表明任务向量几何、训练分布与泛化行为之间存在紧密关联。

0
下载
关闭预览

相关内容

结构保持图transformer综述
专知会员服务
42+阅读 · 2024年2月19日
144页ppt!《Transformers》全面讲解,附视频
专知会员服务
119+阅读 · 2023年1月1日
IJCAI 2022 | 端到端的几何transformer:用于分子属性预测
专知会员服务
13+阅读 · 2022年12月26日
【Google】高效Transformer综述,Efficient Transformers: A Survey
专知会员服务
66+阅读 · 2022年3月17日
Transformer模型-深度学习自然语言处理,17页ppt
专知会员服务
108+阅读 · 2020年8月30日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
从头开始了解Transformer
AI科技评论
25+阅读 · 2019年8月28日
多图带你读懂 Transformers 的工作原理
AI研习社
10+阅读 · 2019年3月18日
BERT大火却不懂Transformer?读这一篇就够了
大数据文摘
12+阅读 · 2019年1月8日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 5月12日
Arxiv
35+阅读 · 2022年3月14日
Arxiv
11+阅读 · 2021年10月26日
VIP会员
最新内容
《通过小型无人机系统将情报能力“作战化”》
消耗优势:美军的“精确规模化”概念
专知会员服务
8+阅读 · 6月15日
《离线语言支持系统:面向空战战术决策》
专知会员服务
9+阅读 · 6月15日
相关VIP内容
结构保持图transformer综述
专知会员服务
42+阅读 · 2024年2月19日
144页ppt!《Transformers》全面讲解,附视频
专知会员服务
119+阅读 · 2023年1月1日
IJCAI 2022 | 端到端的几何transformer:用于分子属性预测
专知会员服务
13+阅读 · 2022年12月26日
【Google】高效Transformer综述,Efficient Transformers: A Survey
专知会员服务
66+阅读 · 2022年3月17日
Transformer模型-深度学习自然语言处理,17页ppt
专知会员服务
108+阅读 · 2020年8月30日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员