What Is a Graph Transformer?
A graph transformer applies transformer-style self-attention to graph data, letting every node attend to many or all other nodes instead of only its immediate neighbours. Because attention alone ignores graph structure, graph transformers add it back through positional and structural encodings, such as Laplacian eigenvectors, node centrality and shortest-path distances in Graphormer, or by combining attention with local message passing as in the GPS recipe. Global attention helps with long-range dependencies and the over-squashing limit of message passing, but its quadratic cost on large graphs has driven sparse and linear variants such as Exphormer, NodeFormer and SGFormer. Graph transformers are also a building block for graph foundation models and for connecting graphs to large language models.
Foundational Models
5 entriesThe architectures that established graph transformers.
Scalable Graph Transformers
3 entriesWays to cut the quadratic cost of global attention.
Graph Foundation Models & LLMs
2 entriesWhere graph transformers meet pretraining and language models.
Surveys & Courses
3 entriesOverviews and a course for background.
Benchmarks & Code
7 entriesBenchmarks and reference implementations.
Related Pages
5 entriesRelated research directories on this site.
Frequently Asked Questions
What is a graph transformer?
A graph transformer applies transformer self-attention to graph data so nodes can attend to many or all other nodes. Positional and structural encodings, or a hybrid with message passing, give the model the graph's structure.
How do graph transformers differ from message-passing GNNs?
Message-passing GNNs update each node from its neighbours over several layers, which limits how far information travels. Graph transformers let nodes attend globally in one layer, which helps with long-range dependencies but costs more computation.
Why do graph transformers need positional encodings?
Self-attention treats its input as a set and ignores edges. Encodings such as Laplacian eigenvectors, shortest-path distances or node centrality inject structure so attention can use it.
How do graph transformers scale to large graphs?
Sparse and linear-attention designs such as Exphormer, NodeFormer and SGFormer reduce the quadratic cost of global attention, and hybrids like GPS combine cheap local message passing with limited global attention.
What are graph foundation models?
Pretrained models intended to transfer across graphs and tasks. Many build on transformer architectures, and recent work also links graph encoders to large language models, as in GraphGPT.