Learning Long Range Dependencies on Graphs via Random Walks

5 Jun 2024  ·  Dexiong Chen, Till Hendrik Schulz, Karsten Borgwardt ·

Message-passing graph neural networks (GNNs) excel at capturing local relationships but struggle with long-range dependencies in graphs. In contrast, graph transformers (GTs) enable global information exchange but often oversimplify the graph structure by representing graphs as sets of fixed-length vectors. This work introduces a novel architecture that overcomes the shortcomings of both approaches by combining the long-range information of random walks with local message passing. By treating random walks as sequences, our architecture leverages recent advances in sequence models to effectively capture long-range dependencies within these walks. Based on this concept, we propose a framework that offers (1) more expressive graph representations through random walk sequences, (2) the ability to utilize any sequence model for capturing long-range dependencies, and (3) the flexibility by integrating various GNN and GT architectures. Our experimental evaluations demonstrate that our approach achieves significant performance improvements on 19 graph and node benchmark datasets, notably outperforming existing methods by up to 13\% on the PascalVoc-SP and COCO-SP datasets. The code is available at https://github.com/BorgwardtLab/NeuralWalker.

PDF Abstract

Results from the Paper


Task Dataset Model Metric Name Metric Value Global Rank Result Benchmark
Graph Classification CIFAR10 100k NeuralWalker Accuracy (%) 80.027 ± 0.185 # 1
Node Classification CLUSTER NeuralWalker Accuracy 78.189 ± 0.188 # 6
Node Classification COCO-SP NeuralWalker macro F1 0.4398 ± 0.0033 # 1
Graph Classification MNIST NeuralWalker Accuracy 98.760 ± 0.079 # 2
Node Classification PascalVOC-SP NeuralWalker macro F1 0.4912 ± 0.0042 # 1
Node Classification PATTERN NeuralWalker Accuracy 86.977 ± 0.012 # 4
Link Prediction PCQM-Contact NeuralWalker MRR-ext-filtered 0.4707 ± 0.0007 # 1
Graph Classification Peptides-func NeuralWalker AP 0.7096 ± 0.0078 # 11
Graph Regression Peptides-struct NeuralWalker MAE 0.2463 ± 0.0005 # 13
Node Classification pokec NeuralWalker Accuracy 86.46 ± 0.09 # 1
Graph Regression ZINC NeuralWalker MAE 0.065 ± 0.001 # 7

Methods