[论文解读] Relational Attention: Generalizing Transformers for Graph-Structured Tasks
本文提出了关系注意力(Relational Attention),这是Transformer注意力机制的一种泛化形式,通过在自注意力机制中显式引入边向量,使Transformer能够作为原生模型处理图结构数据。所提出的关联Transformer(Relational Transformer, RT)在CLRS-30基准上取得了最先进性能,在30项多样化的算法推理任务中超越了专用图神经网络,证明了注意力机制中图级别关系归纳偏置的优越性。
Transformers flexibly operate over sets of real-valued vectors representing task-specific entities and their attributes, where each vector might encode one word-piece token and its position in a sequence, or some piece of information that carries no position at all. But as set processors, transformers are at a disadvantage in reasoning over more general graph-structured data where nodes represent entities and edges represent relations between entities. To address this shortcoming, we generalize transformer attention to consider and update edge vectors in each transformer layer. We evaluate this relational transformer on a diverse array of graph-structured tasks, including the large and challenging CLRS Algorithmic Reasoning Benchmark. There, it dramatically outperforms state-of-the-art graph neural networks expressly designed to reason over graph-structured data. Our analysis demonstrates that these gains are attributable to relational attention's inherent ability to leverage the greater expressivity of graphs over sets.
研究动机与目标
- 为解决标准Transformer在处理图结构数据时缺乏显式关系归纳偏置的局限性。
- 通过将边向量作为注意力机制中的第一类组件,将Transformer架构泛化以原生处理图结构数据。
- 在广泛且具有挑战性的算法任务基准上,评估所提出模型的推理能力。
- 证明关系归纳偏置可增强模型在图结构推理问题中的表达能力和性能。
提出的方法
- 提出关系注意力,一种改进的多头自注意力机制,可同时关注图中的节点和边向量。
- 引入一种图到图的Transformer架构——关联Transformer(Relational Transformer, RT),其中每一层通过关系注意力更新节点和边的表示。
- 为节点和边分别定义查询、键和值向量,使注意力机制依赖于实体之间的关系特征。
- 使用残差连接和层归一化以稳定训练,与标准Transformer一致。
- 使用标准优化技术端到端训练模型于图结构化任务。
- 扩展CLRS-30基准,以支持更广泛模型的评估,包括所提出的RT。
实验结果
研究问题
- RQ1能否设计一种原生处理边向量的基于Transformer的模型,在算法推理任务中超越专用图神经网络?
- RQ2通过引入边感知注意力,将关系归纳偏置融入模型,是否能提升图结构学习中的泛化能力和推理能力?
- RQ3在多样且具有挑战性的图结构任务中,关联Transformer与最先进GNN相比表现如何?
- RQ4与基于集合的Transformer相比,边向量的集成在多大程度上增强了模型的表达能力?
主要发现
- 关联Transformer在CLRS-30基准上取得了66.18%的平均测试得分新SOTA,显著优于所有基线GNN模型。
- 在具有挑战性的拓扑排序任务中,RT达到80.62%,远超最佳基线GNN(PGN-m)的64.28%,展现出更强的推理能力。
- 在朴素字符串匹配任务中,RT取得65.01%的准确率,远超次佳模型(PGN-m为83.62%),凸显其在复杂模式匹配任务中的优势。
- 模型表现出强鲁棒性,30项算法任务的性能标准差为29.6%,低于大多数基线,表明性能稳定。
- 在二分查找任务中,RT达到81.48%,显著优于GAT-v2(31.11%)和MPNN(38.00%),证实其在序列推理任务中的优势。
- RT在30项任务中的14项取得最高分,包括戴克斯特拉算法和弗洛伊德-沃舍尔算法等关键算法问题,证明其强大的泛化能力。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。