Abstract
Graph Transformers (GTs) have demonstrated significant potential in graph representation learning but face scalability challenges due to the quadratic complexity of global attention. Mini-batch Graph Transformers (MGTs) mitigate this by processing subgraphs, yet they often suffer from "information squashing" and "local bias." We propose LGMformer, a novel MGT that incorporates a two-stage interaction augmentation strategy. The first stage, Local Interaction Augmentation (LIA), utilizes a Neighbor-Target Interaction Transformer (NTIformer) to capture fine-grained local structures by explicitly modeling node synthesis and differentiation. The second stage, Global Interaction Augmentation (GIA), employs Global Prototypes updated via Exponential Moving Average (EMA) clustering to provide a graph-wide perspective. Our extensive evaluations on ten benchmark datasets, including large-scale graphs like Pokec, demonstrate that LGMformer achieves state-of-the-art performance, particularly on heterophilic graphs.
Introduction
The application of Graph Transformers to large-scale datasets is primarily limited by their computational overhead. While mini-batching offers a path to scalability, it typically results in two main drawbacks: information squashing, where local neighborhood details are lost during aggregation, and local bias, where the model's receptive field is restricted to the sampled mini-batch. LGMformer is designed to address these limitations by enhancing both local and global interactions within the mini-batch framework.
Methodology
LGMformer introduces two key components to augment node representations:
- Local Interaction Augmentation (LIA): Standard MGTs often use simple mean or sum operations for neighborhood aggregation. In contrast, LGMformer employs the NTIformer, which uses cross-attention between target nodes and their neighbors. By incorporating synthesis ($t_{s_i} - t_{s_j}$) and differentiation ($t_{s_i} + t_{s_j}$) tokens, the model can more effectively distinguish between nodes, which is particularly beneficial for heterophilic graphs.
- Global Interaction Augmentation (GIA): To overcome the local bias inherent in mini-batching, LGMformer maintains a set of Global Prototypes. These prototypes represent the global feature distribution of the entire graph and are updated throughout the training process using EMA clustering. Nodes within each mini-batch perform cross-attention with these prototypes, allowing them to incorporate global context that would otherwise be inaccessible.
Results and Discussion
LGMformer was benchmarked against various GNNs and GTs across ten datasets. The model showed significant improvements, especially on large-scale and heterophilic datasets. For instance, on the Pokec dataset (1.6M nodes), LGMformer outperformed the next best model by 4.73%.
A critical insight from our experiments concerns the receptive field. By varying the number of hops (token list length), we observed that performance does not always improve with increased distance. As illustrated in Figure 2, accuracy and ROC AUC often peak at a specific hop count before fluctuating or declining, indicating that distant nodes may introduce noise that outweighs their contextual benefit.
Ablation studies further confirmed the importance of both LIA and GIA. Removing the global prototypes led to a consistent drop in performance across all datasets, validating the role of GIA in providing necessary global context.
Conclusion
LGMformer addresses the fundamental limitations of Mini-batch Graph Transformers through a two-stage interaction augmentation strategy. By refining local interactions and integrating global context, LGMformer achieves superior performance on diverse graph learning tasks. Future research will focus on optimizing the computational efficiency of the attention mechanisms and exploring more robust structural encoding techniques.
Summary updated