A Survey of Graph Transformers: Architectures, Theories and Applications

Chaohao Yuan, Kangfei Zhao, Ercan Engin Kuruoglu, Liang Wang, Tingyang Xu, Wenbing Huang, Deli Zhao, Hong Cheng, Yu Rong · DOI

TL;DR

This paper provides a comprehensive survey of Graph Transformers (GTs), a powerful class of models that extend the Transformer architecture to graph-structured data. It categorizes GT architectures, explores their theoretical underpinnings, and reviews their diverse applications across various domains, highlighting their ability to overcome limitations of traditional Graph Neural Networks.

What Problem Does This Paper Address?

Graph Neural Networks (GNNs) have been successful in modeling graph data, but they suffer from intrinsic limitations like over-smoothing and over-squashing, hindering their ability to capture long-range dependencies. The Transformer architecture, on the other hand, excels at capturing long-range dependencies but traditionally operates on sequential data. Graph Transformers (GTs) aim to bridge this gap by adapting the Transformer's self-attention mechanism to effectively model graph structures, thereby addressing the limitations of GNNs and unlocking new possibilities for graph-based machine learning.

Methods

The survey categorizes GT architectures based on how they incorporate structural information into the Transformer framework:

  • Multi-level Graph Tokenization: This involves representing graph components (nodes, edges, subgraphs, k-hop neighborhoods) as tokens that the Transformer can process. Different levels of granularity are explored, from node-level to subgraph-level.
  • Structural Positional Encoding: Traditional positional encodings are adapted to capture the structural relationships between nodes in a graph, going beyond simple sequential order. This includes Laplacian PE, SVD PE, and Random Walk PE.
  • Structure-aware Attention Mechanisms: The self-attention mechanism is modified to directly incorporate graph structure. This is achieved through attention bias (adding structural information to attention scores), attention masks (filtering attention based on graph connectivity), and edge-level tokenization where edges themselves become part of the attention computation.
  • Model Ensemble between GNNs and Transformers: This approach combines the strengths of both GNNs (for local feature extraction) and Transformers (for global context modeling) through sequential, interleaved, or parallel architectures.

The paper also discusses theoretical aspects like the expressivity of GTs and their relationship with other graph learning methods, as well as practical considerations like scalability and equivariance.

Datasets

The paper reviews applications across various domains, utilizing numerous established datasets. Some examples include:

  • Molecules: MoleculeNet, OGB, QM7, QM8, QM9, ESOL, Lipophilicity, FreeSolv.
  • Proteins: FLIP, DeepLoc, DeepFRI, PEER, TAPE.
  • Text: LDC2015E86, LDC2017T10, WMT16 translation task datasets, AGENDA, WebNLG, FreebaseQA, WebQuestionsSP, WN18RR, FB15K-237, NELL-995, UMLS.
  • Vision: Human3.6M, 3DPW, FreiHAND, 3DSSG.
  • Brain Networks: ABIDE, ABCD, REST-meta-MDD, ANDI, UK Biobank.
  • Materials: Materials Project, Jarvis, OMat24.
  • Traffic: ETH, HOTEL, UCY, NGSIM, KITTI, Xiamen dataset, PeMS dataset.
  • Social Networks: Cora, Citeseer, PubMed, ogbn-arxiv, Actor, Squirrel, Chameleon.

No new benchmarks are introduced in this survey paper.

Key Insights and Ideas

  • Bridging the Gap: GTs effectively combine the strengths of Transformers (long-range dependencies) and GNNs (structural awareness), overcoming limitations of each.
  • Structural Information is Key: The core innovation in GTs lies in how they inject graph structure into the Transformer architecture, primarily through tokenization, positional encoding, and attention mechanisms.
  • Diverse Tokenization Strategies: From treating individual nodes as tokens to encoding entire k-hop subgraphs, various tokenization methods offer different trade-offs in capturing local vs. global graph information.
  • Attention as a Flexible Tool: Modifying the attention mechanism (bias, masking) provides a direct and powerful way to imbue Transformers with graph inductive biases.
  • GNN-Transformer Hybrids are Powerful: Ensembling GNNs and Transformers offers a robust approach, leveraging the complementary strengths of both architectures.
  • Theoretical Understanding is Crucial: Examining the expressivity of GTs and their connection to established graph learning theories (like WL test) is vital for understanding their capabilities and limitations.
  • Broad Applicability: GTs have demonstrated remarkable success across a wide array of domains, from molecular science to social networks and computer vision.

Key Results

The paper is a survey, so it doesn't present new experimental results. Instead, it synthesizes findings from numerous existing studies. The key "results" are the insights derived from this synthesis:

  • GTs consistently outperform traditional GNNs on tasks requiring long-range dependency modeling.
  • Different architectural choices (tokenization level, PE type, attention modification) lead to varying performance depending on the specific graph structure and task.
  • Ensemble models often achieve state-of-the-art results by combining local and global reasoning.
  • The theoretical expressivity of GTs is being actively investigated, with connections to the Weisfeiler-Lehman test providing valuable insights.

Limitations and Future Work

  • Scalability: The quadratic complexity of self-attention remains a challenge for very large graphs, though linear attention mechanisms and efficient architectures are being explored.
  • Data Constraints: Scaling GTs in domains with limited graph-structured data is an ongoing obstacle.
  • Equivariance: Ensuring models are invariant or equivariant to certain transformations (e.g., rotations, translations) is crucial for geometric graph tasks.
  • Future Directions:
    • Graph Foundational Models: Developing large-scale, pre-trained GT models analogous to LLMs for various graph-based tasks.
  • Scaling GTs: Further research into efficient architectures and training strategies for massive graphs.
  • Cross-modal GTs: Integrating GTs with other modalities (e.g., language, vision) for richer representations.
  • Alternative Architectures: Exploring models that deviate from self-attention to capture global interactions more efficiently, potentially inspired by recent advancements like Graph Mamba.

Summary updated

BibTeX
@misc{yuan2025survey,
  author = {Chaohao Yuan and Kangfei Zhao and Ercan Engin Kuruoglu and Liang Wang and Tingyang Xu and Wenbing Huang and Deli Zhao and Hong Cheng and Yu Rong},
  title = {{A Survey of Graph Transformers: Architectures, Theories and Applications}},
  year = {2025},
  eprint = {2502.16533},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.16533},
}
Figure