Graph transformers extend global self-attention to graph-structured data, achieving notable success in graph learning. Recently, random walk structural encoding (RWSE) has been found to further enhance their predictive power by encoding both structural and positional information into the edge representation. However, RWSE cannot always distinguish between edges that belong to different local graph patterns, which reduces its ability to capture the full structural complexity of graphs. This work introduces Simple Path Structural Encoding (SPSE), a novel method that utilizes simple path counts for edge encoding. We show theoretically and experimentally that SPSE overcomes the limitations of RWSE, providing a richer representation of graph structures, particularly for capturing local cyclic patterns. To make SPSE computationally tractable, we propose an efficient approximate algorithm for simple path counting. SPSE demonstrates significant performance improvements over RWSE on various benchmarks, including molecular and long-range graph datasets, achieving statistically significant gains in discriminative tasks. These results pose SPSE as a powerful edge encoding alternative for enhancing the expressivity of graph transformers.
翻译:图Transformer将全局自注意力机制扩展至图结构数据,在图表征学习中取得了显著成功。近期研究发现,随机游走结构编码(RWSE)通过将结构和位置信息编码至边表示中,能够进一步提升模型的预测能力。然而,RWSE无法始终区分属于不同局部图模式的边,这限制了其捕捉图结构完整复杂性的能力。本研究提出简单路径结构编码(SPSE),这是一种利用简单路径计数进行边编码的新方法。我们从理论和实验上证明,SPSE克服了RWSE的局限性,能够提供更丰富的图结构表示,特别是在捕捉局部循环模式方面。为实现SPSE的计算可行性,我们提出了一种高效的简单路径计数近似算法。在包括分子图和长程图数据集在内的多种基准测试中,SPSE相较于RWSE表现出显著的性能提升,在判别性任务中取得了统计学意义上的显著增益。这些结果表明,SPSE可作为增强图Transformer表达能力的有效边编码替代方案。