TL;DR
NTFormer introduces Node2Par, a novel token generator that describes each node as a "paragraph" composed of multiple types of token sequences (local vs. global, structural vs. attribute-based). By adaptively fusing these diverse perspectives, NTFormer achieves state-of-the-art performance on node classification across both homophilic and heterophilic graphs without requiring custom, graph-specific modifications to the Transformer architecture.
What Problem Does This Paper Address?
Graph Neural Networks (GNNs) are the standard for node classification, but they suffer from "over-smoothing" (representations becoming indistinguishable) and "over-squashing" (information bottlenecks) when dealing with long-range dependencies.
Graph Transformers have emerged as a solution, but the authors identify a significant gap: most existing models rely on single-type token generation. They might only look at a node's immediate neighbors or only at nodes with similar features. Because these models only see a partial view of the graph, researchers often have to "hack" the Transformer architecture with complex structural biases or positional encodings to make them work. This makes the models less flexible when switching between different types of graphs—for example, moving from a citation network (where neighbors are similar) to a web link graph (where neighbors might be very different).
Methods
The authors propose NTFormer, which shifts the "graph intelligence" from the Transformer layers into a sophisticated token generation process called Node2Par.
- Node2Par (The "Paragraph" Generator): Instead of one sequence, it generates four distinct types of token sequences for every node:
- Neighborhood-Topology: Captures local structure using the adjacency matrix.
- Neighborhood-Attribute: Captures local feature patterns using feature similarity.
- Node-Topology: Captures global/long-range structural relevance using Personalized PageRank (PPR).
- Node-Attribute: Captures global feature similarity using Cosine Similarity.
- Standard Transformer Backbone: Because the tokens are so rich in information, NTFormer can use a "vanilla" Transformer backbone. It doesn't need the specialized attention biases or complex encodings required by other models.
- Adaptive Feature Fusion: Since different graphs prioritize different types of information, the model includes a learnable fusion module. This module automatically weights the importance of the four token sequences to produce the final node representation.
Datasets
The model was evaluated on 12 benchmark datasets spanning various domains and graph characteristics:
- Research Papers: Pubmed, Citeseer, Corafull, UAI2010.
- Purchase Actions: Photo, Computer, Amazon2M (Large-scale).
- Social Relations: BlogCatalog, Flickr, Reddit (Large-scale).
- Web Pages/Words: Squirrel (Heterophily), Roman-empire (Heterophily).
These datasets were specifically chosen to test the model's ability to handle both homophily (connected nodes share labels) and heterophily (connected nodes have different labels).
Key Insights and Ideas
- The "Paragraph" Analogy: The authors argue that a node is best described not by a single "sentence" of neighbors, but by a "paragraph" of different contexts. One context might explain who its neighbors are, while another explains who its "twins" are elsewhere in the graph.
- Topology vs. Attribute Views: A major "aha" moment is that structural proximity (topology) and feature similarity (attribute) often disagree. By providing both views to the model, NTFormer can resolve these conflicts adaptively.
- Handling Heterophily: The results show that for heterophilic graphs (like Squirrel), neighborhood-based tokens are often misleading. NTFormer succeeds here because its Node-based tokens allow it to find similar nodes across the graph, bypassing the "noisy" immediate neighbors.
- Simplicity is Power: By putting the complexity into the data representation (the tokens), the learning architecture can remain simple and universal.
Key Results
- Small-scale Superiority: NTFormer achieved the highest accuracy on 11 out of 12 small-scale datasets, outperforming both classic GNNs (like GCN) and advanced Transformers (like NodeFormer and ANS-GT).
- Heterophily Performance: On the highly heterophilic Roman-empire dataset, NTFormer reached 78.39% accuracy, significantly beating the next best Transformer (STAGNN at 76.71%).
- Large-scale Scalability: On the massive Amazon2M and Reddit datasets, NTFormer consistently outperformed other scalable Graph Transformers, proving it can handle real-world data sizes.
- Ablation Success: The authors proved that using all four token types is better than any single type, and that their Adaptive Fusion is superior to simple averaging or concatenation.
Limitations and Future Work
- Hyperparameter Tuning: The model's performance is sensitive to the maximum neighborhood range ($K$) and the number of sampled nodes ($n_k$). Finding the optimal balance for a new graph requires some trial and error.
- Computational Overhead: While the Transformer backbone is standard, generating four different types of token sequences per node adds a preprocessing step that could be optimized further.
- Future Directions: The authors suggest that the Node2Par framework could be extended with even more types of "sentences," such as those based on edge features or higher-order graph motifs.
Summary updated