arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.19324cs.LG
收藏

图Transformer为何不关注相同的 token?

Why don't Graph Transformers attend to the same token?

University of Oxford(牛津大学)

Alexandre Bismuth

AI总结:

该研究发现图Transformer GRIT 与LLMs注意力汇趋势相反,注意力汇是点积注意力的属性,替换GRIT的注意力评分函数可显著改变汇率。

摘要:

在大型语言模型(LLMs)中,注意力会高度集中在第一个 token 上,这种“注意力汇”被认为能保护深度模型避免过度混合。尽管图Transformer面临相关压力,但我们发现,当前最优(SoTA)图模型 GRIT 在分子上很少形成注意力汇,且在更大的图上训练时其汇的数量更少,这与 LLMs 的趋势相反。原则上,图可阻止注意力汇:我们通过理论证明和实验表明,图的对称性与局部性限制了任意节点可接收到的注意力。然而在分子中,由于原子可区分且存在全局注意力,上述两种限制均无法阻止注意力汇;阻止汇形成的关键在于模型本身。我们发现注意力评分函数是主要原因:将 GRIT 的门控 logit 替换为点积后,其在相同图上的汇率从 0.09 提升至 0.68。在使用点积注意力的图Transformer中,移除注意力汇节点带来的误差与移除随机节点的误差相近,而 GRIT 中被最关注的节点对其预测至关重要。因此,注意力汇是点积注意力的属性,而非 Transformer 的属性;在实验中,当点积评分存在可区分的节点可供集中关注时,注意力汇便会形成。

英文摘要:

In large language models (LLMs), attention concentrates heavily on the first token. This 'attention sink' is believed to protect deep models against over-mixing. Even though graph transformers face a related pressure, we find that a SoTA graph transformer, GRIT, rarely forms sinks on molecules, and that it sinks less when trained on larger graphs, the opposite of the trend in LLMs. In principle, a graph can prevent sinks: we prove and show empirically that its symmetry and locality limit the attention any node can receive. On molecules, however, with distinguishable atoms and global attention, neither limit prevents sinks; what stops them lies in the model. We find that the attention scoring function is the main cause. Replacing GRIT's gated logit with a dot product raises its sink rate from 0.09 to 0.68 on identical graphs. In Graph Transformers using dot-product attention, removing the sink gives about the same error as removing a random node, while GRIT's most-attended nodes matter to its predictions. Attention sinks are therefore a property of dot-product attention rather than of Transformers. In our experiments, they form when dot-product scoring has a distinguishable node to concentrate on.

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

↑