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

Gradformer:具有指数衰减的图Transformer

Gradformer: Graph Transformer with Exponential Decay

School of Computer Science, Wuhan University(武汉大学计算机学院);JD Explore Academy, JD.com(京东探索研究院);School of Computing and Information Systems, The University of Melbourne(墨尔本大学计算与信息系统学院);School of Information and Communication Technology, Griffith University(格里菲斯大学信息与通信技术学院)

Chuang Liu, Zelin Yao, Yibing Zhan, Xueqi Ma, Shirui Pan, Wenbin Hu

AI总结:

本文提出Gradformer,通过在注意力矩阵应用指数衰减掩码融合图归纳偏置,并引入可学习约束使注意力头多样化,在图分类与回归任务中优于基线且有效训练深度模型。

摘要:

Graph Transformers (GTs) 已在广泛的任务中展现出其优势。然而,GTs中的自注意力机制忽略了图的归纳偏置,特别是与结构相关的偏置,而这对于图任务至关重要。尽管一些方法利用位置编码和注意力偏置来建模归纳偏置,但解析地看其有效性仍非最优。因此,本文提出了Gradformer,这是一种通过将指数衰减掩码应用于注意力矩阵,从而创新性地将GT与内在归纳偏置相集成的方法。具体而言,衰减掩码矩阵中的值呈指数递减,这与图结构内节点邻近度的下降相关联。这种设计使Gradformer能够保留其捕获远距离节点信息的能力,同时关注图的局部细节。此外,Gradformer在衰减掩码中引入了可学习约束,允许不同的注意力头学习不同的衰减掩码。这种设计使注意力头多样化,能够更有效地吸收图内多样化的结构信息。在各种基准上的广泛实验表明,Gradformer在各种图分类和回归任务中始终优于Graph Neural Network和GT基线模型。此外,Gradformer已被证明是训练深度GT模型的有效方法,随着网络加深,与浅层模型相比,它能保持甚至提高准确率,而其他GT模型则出现准确率显著下降。代码可在https://github.com/LiuChuang0059/Gradformer获取。

英文摘要:

Graph Transformers (GTs) have demonstrated their advantages across a wide range of tasks. However, the self-attention mechanism in GTs overlooks the graph's inductive biases, particularly biases related to structure, which are crucial for the graph tasks. Although some methods utilize positional encoding and attention bias to model inductive biases, their effectiveness is still suboptimal analytically. Therefore, this paper presents Gradformer, a method innovatively integrating GT with the intrinsic inductive bias by applying an exponential decay mask to the attention matrix. Specifically, the values in the decay mask matrix diminish exponentially, correlating with the decreasing node proximities within the graph structure. This design enables Gradformer to retain its ability to capture information from distant nodes while focusing on the graph's local details. Furthermore, Gradformer introduces a learnable constraint into the decay mask, allowing different attention heads to learn distinct decay masks. Such an design diversifies the attention heads, enabling a more effective assimilation of diverse structural information within the graph. Extensive experiments on various benchmarks demonstrate that Gradformer consistently outperforms the Graph Neural Network and GT baseline models in various graph classification and regression tasks. Additionally, Gradformer has proven to be an effective method for training deep GT models, maintaining or even enhancing accuracy compared to shallow models as the network deepens, in contrast to the significant accuracy drop observed in other GT models.Codes are available at \url{https://github.com/LiuChuang0059/Gradformer}.

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

↑