[Paper Review] NAGphormer: A Tokenized Graph Transformer for Node Classification in Large Graphs
NAGphormer introduces Hop2Token to tokenize multi-hop neighborhood information, enabling mini-batch training of graph Transformers and improving node classification on large graphs over existing graph Transformers and GNNs.
The graph Transformer emerges as a new architecture and has shown superior performance on various graph mining tasks. In this work, we observe that existing graph Transformers treat nodes as independent tokens and construct a single long sequence composed of all node tokens so as to train the Transformer model, causing it hard to scale to large graphs due to the quadratic complexity on the number of nodes for the self-attention computation. To this end, we propose a Neighborhood Aggregation Graph Transformer (NAGphormer) that treats each node as a sequence containing a series of tokens constructed by our proposed Hop2Token module. For each node, Hop2Token aggregates the neighborhood features from different hops into different representations and thereby produces a sequence of token vectors as one input. In this way, NAGphormer could be trained in a mini-batch manner and thus could scale to large graphs. Moreover, we mathematically show that as compared to a category of advanced Graph Neural Networks (GNNs), the decoupled Graph Convolutional Network, NAGphormer could learn more informative node representations from the multi-hop neighborhoods. Extensive experiments on benchmark datasets from small to large are conducted to demonstrate that NAGphormer consistently outperforms existing graph Transformers and mainstream GNNs. Code is available at https://github.com/JHL-HUST/NAGphormer.
Motivation & Objective
- Motivate scalable node classification on large graphs with graph Transformers.
- Propose Hop2Token to convert multi-hop neighborhoods into per-node token sequences.
- Integrate Hop2Token with a Transformer backbone and an adaptive hop-wise readout.
- Provide theoretical analysis comparing NAGphormer to decoupled GCN.
- Demonstrate superior performance on small and large graph benchmarks.
Proposed method
- Introduce Hop2Token to aggregate k-hop neighborhoods into a per-node sequence of tokens.
- Construct per-node input as a sequence of x_v^k representations for k in [0, K] and project to Transformer dimension.
- Use a Transformer encoder with LayerNorm, MSA and FFN to learn node representations from the token sequences.
- Apply an attention-based readout to adaptively weight different-hop contributions for final node embedding.
- Incorporate structural encoding by concatenating Laplacian eigenvectors to node features; use an attention-based readout for aggregation.
- Provide complexity analysis and theoretical comparison to decoupled GCN to show potential expressiveness gains.
Experimental results
Research questions
- RQ1Can Hop2Token enable scalable training of graph Transformers on large graphs by treating each node as a sequence of multi-hop tokens?
- RQ2Does the attention-based readout effectively weigh different-hop neighborhoods to improve node representations?
- RQ3How does NAGphormer compare to decoupled GCN and other graph Transformers on small and large datasets?
- RQ4What is the impact of structural encoding and readout choices on performance?
Key findings
- NAGphormer consistently outperforms baselines on small-scale datasets across multiple metrics.
- On large-scale datasets, NAGphormer outperforms scalable GNNs like PPRGo, GraphSAINT, and GRAND+ on AMiner-CS, Reddit, and Amazon2M.
- Incorporating structural encoding yields accuracy gains across datasets, with gains varying by graph structure.
- An attention-based readout across multi-hop tokens outperforms simple SIN or SUM readouts, especially on small graphs.
- The model demonstrates scalability with mini-batch training and favorable training cost on large graphs.
- Theoretical analysis shows NAGphormer can learn more expressive multi-hop neighborhood representations than decoupled GCN via self-attention.
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.