TL;DR
This paper revitalizes Random Walk Neural Networks (RWNNs), a class of models that transform graph structures into sequences via random walks, which are then processed by deep neural networks. The authors provide a principled framework demonstrating that RWNNs can achieve universal approximation and isomorphism invariance—even when using non-symmetric "readers" like Large Language Models (LLMs)—simply by anonymizing the walk records.
The Bottlenecks of Message Passing
Most modern graph learning relies on Message Passing Neural Networks (MPNNs). While highly successful, MPNNs face three fundamental limitations:
- Limited Expressive Power: Their ability to distinguish complex graph structures is theoretically bounded by the 1-Weisfeiler-Lehman (1-WL) isomorphism test.
- Over-smoothing: As layers are added to capture long-range dependencies, node features tend to converge to a uniform value, stripping the model of its discriminative power.
- Over-squashing: Information from an exponentially growing neighborhood is "squashed" into a fixed-size vector at a bottleneck node, leading to significant data loss.
RWNNs offer a compelling alternative: instead of passing messages between neighbors, they "read" the graph sequentially through random walks. However, until now, the field lacked a rigorous understanding of how to make these stochastic machines invariant to graph symmetries or how they compare to MPNNs regarding smoothing and squashing.
How Random Walk Neural Networks Work
The authors formalize RWNNs into three distinct components:
- Random Walk Algorithm: Generates a sequence of vertices. The authors advocate for the Minimum Degree Local Rule (MDLR), which significantly reduces the "cover time" (the steps needed to visit all nodes) compared to uniform random walks.
- Recording Function: Converts the walk into a machine-readable record. Crucially, they employ Anonymization—replacing raw vertex IDs with integers based on their order of discovery (e.g., a walk of $v_a \to v_b \to v_a$ becomes $1 \to 2 \to 1$). This ensures the record remains identical regardless of how the original graph was indexed.
- Reader Neural Network: A standard sequence architecture (like a Transformer, GRU, or even an LLM) processes the record. Because the record itself is anonymized, the reader does not need a specialized equivariant architecture to maintain isomorphism invariance.
Key Theoretical Insights
- Probabilistic Invariance: The paper proves that anonymizing the vertices in a random walk yields a distribution of records that is strictly invariant to graph isomorphism. This "short-circuits" the need for complex equivariant architectures, allowing text-based walks to be fed directly into standard LLMs.
- Universal Approximation: If a walk is long enough to cover the graph, an RWNN with a sufficiently powerful reader can approximate any graph function in probability.
- Over-smoothing is Avoided by Design: In MPNNs, smoothing occurs due to repeated feature averaging. In RWNNs, the reader network sees the raw, un-averaged sequence of the walk, preserving local details even across very long walks.
- Under-reaching vs. Over-squashing: The authors demonstrate that the "bottleneck" problem in RWNNs isn't squashing, but rather the probability of a walk failing to reach a distant node (probabilistic under-reaching). This can be mitigated by increasing walk length or using non-backtracking walks.
Empirical Highlights
The researchers evaluated RWNNs across a diverse set of benchmarks, including synthetic graphs, challenging isomorphism datasets, and real-world citation networks.
- Surpassing WL-Tests: RWNNs using a DeBERTa reader achieved 100% accuracy on the SR25 dataset, a task involving Strongly Regular Graphs where even the 3-WL test fails to distinguish the structures.
- LLMs for Graphs: On the
ogbn-arxivcitation network, an RWNN based on Llama 3 outperformed a wide range of MPNN baselines. By recording the labels of visited nodes during the walk, the model successfully performed "in-context learning" directly on the graph structure. - Resistance to Smoothing and Squashing: As walk lengths increase, MPNN baselines (like SAGE) fail to improve or actively degrade due to over-smoothing and over-squashing. In contrast, the RWNN's error continues to drop as it gathers more structural information.
Limitations and Future Directions
The primary limitation of this approach is computational cost. Using a Large Language Model as a "reader" for every node in a massive graph is significantly slower and more resource-intensive than running a standard Graph Neural Network.
Future directions include developing more efficient "readers" that maintain the expressive benefits of LLMs without the massive overhead, and training a "foundation model for graphs" on a massive pseudocorpus of random walks to enable robust transfer learning across different graph domains.
Summary updated