Introduction
Graph Neural Networks (GNNs) have revolutionized tasks like node classification and link prediction. However, most existing architectures rely on the "homophily assumption"—the belief that connected nodes share similar attributes. While this holds true for citation networks, many real-world graphs exhibit heterophily, where "opposites attract." PathNet is a novel GNN architecture designed to excel in both environments by aggregating structural paths rather than just immediate neighbors.
The Challenge of Heterophily
Standard GNNs like GCN and GAT use message passing to smooth features across a neighborhood. In a homophilous graph, this works well. However, in heterophilous graphs—such as protein-protein interactions or dating networks—edges often connect nodes with different labels.
When a standard GNN aggregates these diverse neighbors, the resulting representation becomes "washed out" noise. As shown in the figure above, the aggregation process mixes distinct features (represented by colors), making it impossible for the model to distinguish the underlying structural patterns that define the graph.
The PathNet Architecture: Moving Beyond Neighbors
PathNet addresses this by treating the neighborhood not as a set of neighbors, but as a collection of informative sequences or paths. This allows the model to capture the order and distance of connections, which are crucial for understanding complex topologies.
1. Maximal Entropy Path Sampling
Instead of simple random walks, PathNet employs Maximal Entropy Random Walks (MERW). This strategy uses eigenvector centrality to sample paths that are structurally diverse and informative, avoiding the trap of over-sampling high-degree "hub" nodes that can dilute local context.
2. Structure-aware Recurrent Encoding
PathNet processes each sampled path using a recurrent cell (similar to an LSTM). Unlike standard RNNs, this cell is distance-aware: it uses specific parameters ($U_d$) for nodes at different distances from the target. This explicit modeling of distance allows the network to learn how the influence of a node decays or changes as one moves further away.
3. Path Attention Mechanism
To handle the variety of paths, an attention mechanism learns to weight each sequence. This allows PathNet to adaptively focus on immediate neighbors when homophily is present or on higher-order structural motifs when dealing with heterophily.
Key Results and Insights
The authors evaluated PathNet across seven real-world datasets, including citation networks (homophily) and web/social networks (heterophily).
- Dominance in Heterophily: PathNet achieved an average improvement of 9.96% over traditional GNNs on heterophily datasets like Cornell and BGP.
- Robustness in Homophily: Unlike many specialized models, PathNet remains highly competitive on standard benchmarks like Cora and Pubmed, proving it is a general-purpose solution.
- Expressive Power: Synthetic tests showed that PathNet is significantly more capable of identifying specific graph substructures than popular models like GIN or GAT, effectively surpassing the limitations of the standard Weisfeiler-Lehman test.
Conclusion
By shifting the focus from neighborhood sets to structural paths, PathNet overcomes the "homophily trap." Its ability to maintain high-resolution node representations through distance-aware recurrent encoding makes it a powerful tool for analyzing the diverse and complex graphs found in the real world.
Summary updated