Sketch-Augmented Features Improve Learning Long-Range Dependencies in Graph Neural Networks

Ryien Hosseini, Filippo Simini, Venkatram Vishwanath, Rebecca Willett, Henry Hoffmann

Introduction

Standard Graph Neural Networks (GNNs) primarily utilize local message passing, where nodes aggregate information from their immediate neighborhood. While computationally efficient, this local focus leads to significant bottlenecks: oversquashing, where long-range information is lost during compression; oversmoothing, where node representations become indistinguishable in deep networks; and limited expressive power, often bounded by the 1-Weisfeiler-Lehman (1-WL) test.

To address these, the authors propose Sketched Random Features (SRF). This method injects global, feature-sensitive signals into every GNN layer, allowing nodes to bypass local constraints and capture long-range dependencies without the $O(N^2)$ complexity of Graph Transformers.

Methodology: Sketched Random Features

The SRF framework is a plug-and-play augmentation that can be integrated into any GNN backbone. As detailed in Algorithm 1, the process involves three key stages:

  1. Kernel Embedding: Node features $X$ are mapped into a high-dimensional random feature space $\Phi = \mathcal{E}(X)$ (e.g., using Random Fourier Features) to approximate complex similarity kernels like RBF or Laplacian.
  2. Cross-Node Sketching: A random projection $Z = \mathcal{S}^{(k)}(\Phi)$ is applied across all nodes. This creates a global summary "sketch" that captures the overall feature distribution of the graph.
  3. Layer-wise Injection: These sketches $\mathbf{z}_i$ are concatenated to the hidden representations $\mathbf{h}_i^{(\ell)}$ at each layer, providing a "global vision" highway.

By utilizing Structured Random Matrices (SRMs), the computational overhead of this global mixing is kept to $O(N \log N)$, ensuring scalability to large graphs.

Algorithm 1: The Sketched Feature GNN framework, illustrating the integration of global sketches into local message passing.

Experimental Evaluation

The effectiveness of SRF was evaluated across synthetic benchmarks (Tree-NeighborsMatch for oversquashing, CSL/EXP for expressivity) and real-world tasks (Reddit for social networks, DrugOOD for molecular OOD prediction, and Peptides-struct for long-range dependencies).

Key Results and Insights

The empirical results demonstrate that SRF effectively mitigates the fundamental limitations of standard GNNs:

  • Mitigating Oversquashing: On the Tree-NeighborsMatch task, SRF maintains significantly higher accuracy as the graph radius increases compared to baseline GNNs, which fail completely at larger distances (see Figure 2a).
  • Curing Oversmoothing: Unlike standard GNNs where Dirichlet energy (a measure of node distinctness) collapses toward zero, SRF-augmented models maintain a stable energy level across many layers, preventing representation collapse (see Figure 2b and 2c).
  • Enhanced Expressivity: SRF-augmented GNNs achieved perfect accuracy on CSL and EXP benchmarks, surpassing the 1-WL limit.
  • Efficiency: SRF is significantly more efficient than competing global methods like PEARL, offering a 3x speedup and using two orders of magnitude less memory on large datasets.
Figure 2: Empirical analysis of (a) oversquashing via accuracy on Tree-NeighborsMatch and (b, c) oversmoothing via Dirichlet energy across layers.

Conclusion

Sketched Random Features provide a robust, topology-agnostic mechanism for GNNs to learn long-range dependencies. By preserving feature-distance sensitivity through randomized sketching, SRF offers a computationally lightweight alternative to dense attention mechanisms, effectively solving the bottlenecks of oversquashing and oversmoothing while boosting expressive power.

Summary updated

BibTeX
@inproceedings{hosseini2025sketch,
  author = {Ryien Hosseini and Filippo Simini and Venkatram Vishwanath and Rebecca Willett and Henry Hoffmann},
  title = {{Sketch-Augmented Features Improve Learning Long-Range Dependencies in Graph Neural Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=gXoMU9YYdY},
}
Figure