NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

General Graph Random Features

Isaac Reid, Krzysztof Marcin Choromanski, Eli Berger, Adrian Weller

Abstract

Graph kernels are essential tools for measuring similarity between nodes in a network, powering tasks like clustering, recommendation, and node classification. However, computing these kernels exactly (e.g., the Diffusion or Laplacian kernels) typically requires matrix inversion or multiple matrix-matrix multiplications, resulting in a computationally prohibitive complexity of $O(N^3)$.

To address this bottleneck, the authors propose General Graph Random Features (g-GRFs), a novel random walk-based algorithm for the unbiased estimation of arbitrary functions of a weighted adjacency matrix. By utilizing a "modulation function" to weight walks of different lengths, the framework enables subquadratic time complexity, trivial parallelization, and the ability to "learn" optimal kernels using neural networks.

The Computational Bottleneck of Graph Kernels

For modern graphs with millions of nodes, an $O(N^3)$ scaling factor makes exact kernel evaluation impossible. While "Random Features" have successfully scaled up kernels in continuous Euclidean spaces, adapting them to the discrete, irregular structure of graphs has historically been difficult. Previous attempts were limited to a very narrow family of kernels. This paper seeks a universal, scalable way to approximate any graph kernel defined by a power series of the adjacency matrix, effectively bypassing the need to compute the full $N \times N$ kernel matrix.

Methods: Random Walks and Modulation Functions

The authors propose g-GRFs, which use an ensemble of random walkers to "probe" the graph's structure.

Visual representation of a random walk on a graph alongside its corresponding modulation function.
  1. The Random Walk Mechanism: Walkers start at a node $i$ and move to neighboring nodes. At each step, they deposit a numerical "load" at the current node.
  2. The Modulation Function ($f$): This is the paper's core innovation. The load deposited by a walker is multiplied by $f(k)$, where $k$ is the current walk length. By carefully choosing $f$, the algorithm can represent different Taylor expansion coefficients of the graph's adjacency matrix.
  3. Unbiased Estimation via Convolution: The authors prove that the inner product of these random features approximates the target kernel if the target's coefficients are the discrete convolution of the modulation functions used to build the features. This mathematical bridge turns a graph problem into a signal processing problem.
  4. Neural Modulation Functions: Instead of picking a fixed mathematical function for $f$, the authors parameterize it as a small neural network. This allows them to optimize for variance (learning a modulation function that minimizes approximation error for a fixed number of walkers) or perform implicit kernel learning (training the kernel itself to perform better on a downstream task).

Key Results

The authors evaluated g-GRFs across a diverse set of benchmarks, including synthetic graphs (Erdős-Rényi, binary trees), real-world networks (Karate, Cora, Citeseer), and 3D triangular meshes.

Approximation error (Frobenius norm) versus the number of random walks across various graph topologies and kernels.
  • Scalability: On a graph with ~12,800 nodes, g-GRFs were already 7.8x faster than exact kernel computation. Because g-GRFs scale subquadratically, this computational advantage increases dramatically as the graph size grows.
  • Pointwise Accuracy: As shown in the evaluations, the approximation error (measured by the Frobenius norm) consistently drops as more walkers are added. This proves the estimator is robust across vastly different graph topologies and kernel types.
  • Solving ODEs: The authors successfully used g-GRFs to approximate solutions to non-homogeneous ordinary differential equations on graphs, a task that typically requires expensive heat kernel calculations.
  • Superior Regression: In 3D mesh normal vector prediction, the learned neural modulation function outperformed all standard fixed kernels (like the Diffusion or $p$-step random walk kernels). This demonstrates that "learning the kernel" via random features is a highly viable alternative to manual kernel selection.
  • Embarrassingly Parallel: Because the features are generated by independent random walks, the algorithm can be trivially distributed across thousands of machines without requiring workers to communicate during feature generation.

Limitations and Future Work

While g-GRFs offer a massive leap in scalability, the method relies on the Taylor series of the graph function converging. This usually requires a "regularizer" (scaling down the adjacency matrix), which might dampen long-range dependencies in the graph. Additionally, while time complexity is vastly improved, storing high-dimensional random features for every node still requires significant memory, which could become a bottleneck for graphs with billions of nodes.

Future work may involve applying g-GRFs to larger-scale Graph Neural Networks (GNNs) or exploring more complex "biased" estimators. The authors noted that Neural g-GRFs often learn a slightly biased version of the kernel that performs better in practice by downweighting very long, high-variance walks, leading to a lower overall Mean Squared Error (MSE). Finding the theoretically optimal architecture for $f$ to minimize this variance remains an exciting open question.

Summary updated

BibTeX
@inproceedings{reid2024general,
  author = {Isaac Reid and Krzysztof Marcin Choromanski and Eli Berger and Adrian Weller},
  title = {{General Graph Random Features}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=viftsX50Rt},
}
Figure