[Paper Review] NodeFormer: A Scalable Graph Structure Learning Transformer for Node Classification
NodeFormer introduces an all-pair message passing Transformer with a kernelized Gumbel-Softmax to learn latent graph structures, achieving linear-time complexity per layer and scaling to graphs with millions of nodes for node classification.
Graph neural networks have been extensively studied for learning with inter-connected data. Despite this, recent evidence has revealed GNNs' deficiencies related to over-squashing, heterophily, handling long-range dependencies, edge incompleteness and particularly, the absence of graphs altogether. While a plausible solution is to learn new adaptive topology for message passing, issues concerning quadratic complexity hinder simultaneous guarantees for scalability and precision in large networks. In this paper, we introduce a novel all-pair message passing scheme for efficiently propagating node signals between arbitrary nodes, as an important building block for a pioneering Transformer-style network for node classification on large graphs, dubbed as extsc{NodeFormer}. Specifically, the efficient computation is enabled by a kernerlized Gumbel-Softmax operator that reduces the algorithmic complexity to linearity w.r.t. node numbers for learning latent graph structures from large, potentially fully-connected graphs in a differentiable manner. We also provide accompanying theory as justification for our design. Extensive experiments demonstrate the promising efficacy of the method in various tasks including node classification on graphs (with up to 2M nodes) and graph-enhanced applications (e.g., image classification) where input graphs are missing.
Motivation & Objective
- Motivate learning flexible latent graph structures for node classification beyond fixed input topologies.
- Develop a scalable, differentiable mechanism to infer latent graphs among all node pairs.
- Enable end-to-end training of a Transformer-like architecture for large graphs without input graphs.
- Incorporate input topology when available via relational bias and edge regularization.
- Demonstrate scalability to graphs with up to 2 million nodes and effectiveness on heterophilic and graph-free settings.
Proposed method
- Propose NodeFormer with all-pair message passing over a latent graph learned per layer.
- Use a kernelized Gumbel-Softmax operator to approximate all-pair attention in linear time via random feature mappings.
- Rewrite attention via a kernel function approximated by random features to avoid N^2 computations.
- Apply a differentiable sampling scheme (Gumbel-Softmax with temperature) to obtain a sparse, learnable latent graph.
- Introduce an edge-level regularization loss to align learned edges with observed edges when available.
- Incorporate relational bias from input graphs as additive terms to attention weights when edges exist.

Experimental results
Research questions
- RQ1Can a Transformer-like node classifier learn effective latent graphs for message passing on large-scale graphs without relying on the input topology?
- RQ2How can we achieve scalable all-pair message passing with differentiable optimization for discrete latent structures?
- RQ3What is the impact of latent structure learning on node classification performance across homophilic and heterophilic graphs?
- RQ4What is the trade-off between kernel feature map dimension, temperature, and approximation accuracy in kernelized Gumbel-Softmax?
- RQ5How does NodeFormer compare to existing structure-learning and scalable GNN methods on large datasets (up to millions of nodes)?
Key findings
- NodeFormer attains competitive or superior accuracy/ROC-AUC on standard node-classification benchmarks, including heterophilic graphs.
- On large-scale datasets (OGB-Proteins and Amazon2M), NodeFormer achieves higher metrics than baselines while maintaining feasible memory usage.
- The method scales to graphs with up to 2M nodes with linear per-layer complexity, outperforming prior structure-learning approaches in both speed and memory.
- Kernelized Gumbel-Softmax with random features provides a well-posed approximation whose error is independent of N, enabling scalable latent structure learning.
- Relational bias and edge regularization help leverage existing input topology when available, improving training stability and performance.
- NodeFormer demonstrates applicability to graph-enhanced tasks (image/text classification) where input graphs may be missing.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.