Despite the central role of attention heads in Transformers, we lack tools to understand why a model attends to a particular token. To address this, we study the query-key (QK) space -- the bilinear joint embedding space between queries and keys. We present a contrastive covariance method to decompose the QK space into low-rank, human-interpretable components. It is when features in keys and queries align in these low-rank subspaces that high attention scores are produced. We first study our method both analytically and empirically in a simplified setting. We then apply our method to large language models to identify human-interpretable QK subspaces for categorical semantic features and binding features. Finally, we demonstrate how attention scores can be attributed to our identified features.


翻译:尽管注意力头在Transformer中处于核心地位,我们仍缺乏工具来理解模型为何关注特定词元。为此,我们研究了查询-键(QK)空间——即查询向量与键向量之间的双线性联合嵌入空间。我们提出了一种对比协方差方法,将QK空间分解为低秩且人类可解释的组分。当键与查询中的特征在这些低秩子空间中对齐时,就会产生较高的注意力分数。我们首先在简化场景中对所提方法进行了理论分析与实证研究。随后将方法应用于大语言模型,成功识别出针对分类语义特征与绑定特征的人类可解释QK子空间。最后,我们展示了如何将注意力分数归因于所识别的特征。

0
下载
关闭预览

相关内容

【博士论文】大数据相似查询关键技术研究
专知会员服务
24+阅读 · 2021年12月2日
【ICCV2021】多层次对比学习的跨模态检索方法
专知会员服务
23+阅读 · 2021年10月24日
Transformer文本分类代码
专知会员服务
118+阅读 · 2020年2月3日
【深度语义匹配模型】原理篇二:交互篇
AINLP
16+阅读 · 2020年5月18日
论文盘点:CVPR 2019 - 文本检测专题
PaperWeekly
14+阅读 · 2019年5月31日
Seq2seq强化,Pointer Network简介
机器学习算法与Python学习
15+阅读 · 2018年12月8日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
18+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
相关VIP内容
【博士论文】大数据相似查询关键技术研究
专知会员服务
24+阅读 · 2021年12月2日
【ICCV2021】多层次对比学习的跨模态检索方法
专知会员服务
23+阅读 · 2021年10月24日
Transformer文本分类代码
专知会员服务
118+阅读 · 2020年2月3日
相关基金
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
18+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员