RAW-GNN: RAndom Walk Aggregation based Graph Neural Network

Di Jin, Rui Wang, Meng Ge, Dongxiao He, Xiang Li, Wei Lin, Weixiong Zhang

Introduction

Graph Neural Networks (GNNs) have revolutionized the processing of relational data, yet most architectures rely on a fundamental assumption: homophily. This principle suggests that connected nodes are likely to share similar features or labels. While this holds true for citation networks or social circles, many real-world graphs are heterophilic, where connected nodes are often dissimilar—such as in fraud detection networks or molecular structures.

RAW-GNN (RAndom Walk Aggregation-based Graph Neural Network) addresses this limitation by moving beyond the traditional "sum-and-aggregate" approach. By utilizing dual-strategy random walks and Recurrent Neural Network (RNN) aggregators, RAW-GNN captures complex structural patterns and node sequences that standard Graph Convolutional Networks (GCNs) typically smooth away.

The Problem: The Summation Bottleneck

Standard GCNs update a node's representation by averaging or summing the features of its immediate neighbors. In heterophilic settings, this leads to "information mixing." For instance, if a "fraudster" node is primarily connected to "victim" nodes, a summation operator washes out the distinct features of the fraudster by blending them with the dissimilar features of the victims. The authors argue that this smoothing effect is the primary bottleneck preventing GNNs from generalizing to heterophilic datasets.

The RAW-GNN Architecture

RAW-GNN replaces the standard neighborhood aggregation with a sophisticated four-stage pipeline designed to preserve the identity and sequence of node features:

  1. Random Walk Generator: Instead of a fixed neighborhood, the model generates $k$-hop paths using two distinct strategies inspired by Node2Vec:
  2. Breadth-First Search (BFS): Captures local homophily by staying close to the target node.
  3. Depth-First Search (DFS): Explores further away to capture long-range heterophilic patterns and structural roles.
  4. RNN-based Path Aggregator: This is the core innovation. Rather than summing node features, RAW-GNN treats each path as a sequence and processes it through a Gated Recurrent Unit (GRU). This preserves the specific order of nodes and allows the model to learn complex relational patterns between dissimilar neighbors.
  5. Intra-Strategy Combinator: Since a node may have multiple sampled paths, the model employs multi-head attention to weigh the importance of different paths within the BFS or DFS sets.
  6. Inter-Strategy Combinator: Finally, the model concatenates the BFS-derived and DFS-derived embeddings. By using concatenation rather than summation, RAW-GNN prevents the distinct signals from the two strategies from canceling each other out, allowing the model to adaptively utilize both local and long-range information.

Experimental Evaluation

The model was evaluated against seven real-world datasets with varying levels of homophily, measured by the Label-defined Edge Homophily Ratio (L.H.R) and a proposed Feature Edge Homophily Ratio (F.H.R):

  • Heterophilic Graphs: Texas, Wisconsin, Cornell (webpage networks), and Actor (actor co-occurrence).
  • Homophilic Graphs: Cora, Citeseer, and Pubmed (citation networks).

Key Results

RAW-GNN achieved State-of-the-Art (SOTA) performance on 5 out of the 7 datasets. Its dominance was particularly evident in heterophilic environments:

  • Performance Gains: On the Texas and Wisconsin datasets, RAW-GNN achieved ~85-88% accuracy, significantly outperforming standard GCNs which hovered around ~53-55%.
  • Robustness: It consistently outperformed specialized heterophily models like H2GCN and GPR-GNN, suggesting that the RNN-path approach is more robust than simply adjusting attention weights.
  • Clustering Quality: t-SNE visualizations of the Cora dataset revealed that RAW-GNN produces tighter, more distinct clusters with clearer class boundaries compared to traditional GCNs.

Insights and Discussion

RAW-GNN demonstrates that order matters in graph representation. Traditional GNNs treat neighbors as an unordered set, but the sequence of nodes in a path contains vital structural information. By treating aggregation as a sequence modeling task, RAW-GNN avoids the smoothing trap of summation.

Furthermore, the Dual-Channel Processing (BFS and DFS) allows the model to be flexible. It does not need to be manually tuned to be a "homophily model" or a "heterophily model"; it can adaptively weigh the signals from both channels based on the specific node's context. The research also found that heterophilic graphs benefit from longer path lengths, as the model requires more context to decode the relationships between dissimilar nodes.

Limitations and Future Work

Despite its performance, RAW-GNN introduces higher computational overhead due to the path sampling and GRU processing steps. Training time and scalability to billion-edge graphs remain challenges. Additionally, the model introduces several hyperparameters—such as path length, number of paths, and the $p$ and $q$ parameters for random walks—which may require extensive tuning for new datasets.

Future research may focus on optimizing the efficiency of the RNN aggregator or exploring more scalable sampling techniques to bring the benefits of RAW-GNN to massive industrial-scale graphs.

Summary updated

BibTeX
@inproceedings{jin2022raw,
  author = {Di Jin and Rui Wang and Meng Ge and Dongxiao He and Xiang Li and Wei Lin and Weixiong Zhang},
  title = {{RAW-GNN: RAndom Walk Aggregation based Graph Neural Network}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.24963/ijcai.2022/293},
}
Figure