Organizations: School of Computation, Information and Technology, Technical University of Munich · Graduate School of Information Science and Technology, The University of Tokyo
Graph transformers are the state-of-the-art for learning from graph-structured data and are empirically known to avoid several pitfalls of message-passing architectures. However, there is limited theoretical analysis on why these models perform well in practice. In this work, we prove that attention-based architectures have structural benefits over graph convolutional networks in the context of node-level prediction tasks. Specifically, we study the neural network gaussian process limits of graph transformers (GAT, Graphormer, Specformer) with infinite width and infinite heads, and derive the node-level and edge-level kernels across the layers. Our results characterise how the node features and the graph structure propagate through the graph attention layers. As a specific example, we prove that graph transformers structurally preserve community information and maintain discriminative node representations even in deep layers, thereby preventing oversmoothing. We provide empirical evidence on synthetic and real-world graphs that validate our theoretical insights, such as integrating informative priors and positional encoding can improve performance of deep graph transformers.
Figures & tables
Figure 1: Histogram of the output of GAT and Graphormer for different number of heads. The output distribution converges to a Gaussian (red line) fitted with mean and variance of the empirical distribution when both width and number of heads are large. Plots for Specformer is in Appendix F .
Table 1: Summary of the GP kernels for graph transformers. The weight priors are in Table 4 in Appendix B . The table presents both the edge/structural kernels ( Kab(ℓ),E for spatial models or Kλ,ab for Specformer) and the node-level kernels ( Σab(ℓ) ) that describe the propagation of covariance across layers. For GAT-GP and Graphormer-GP, the edge-level kernels capture correlations between attention scores, while the node-level kernels aggregate these correlations. The learned spectral kernel Kλ of Specformer-GP modulates the mapping of node representations in the Laplacian eigenbasis.
Table 2: Closed-form expressions for the node-level Gaussian process (GP) kernels under linear attention and linear activation. These kernels provide an explicit characterization of kernel propagation for each architecture. For comparison, the GCN-GP kernel from [ Niu et al., 2023 ] is included, which does not involve attention.
Table 3: Evolution of the GP kernel K(ℓ)=(xℓ11⊤yℓ11⊤yℓ11⊤xℓ11⊤) under CSBM and conditions for oversmoothing. To preserve community structure, the kernel must maintain a gap between the intra-community ( xℓ ) and inter-community ( yℓ ) values; this discriminative signal is captured by the second term in each expression.The second column indicates whether oversmoothing occurs as ℓ→∞ , i.e., whether the kernel loses its ability to distinguish the two communities. For graph transformers oversmoothing can be avoided, maintaining the discriminative signal across layers.
Figure 2: Oversmoothing behaviour and the impact of positional encodings. Test accuracy of Graphormer-GP on Chameleon (left) and SBM with random features (right) as a function of the number of layers. While accuracy in graph models typically suffers from performance degradation with an increasing number of layers, Graphormer-GP exhibits increasing accuracy with depth when utilizing informative positional encodings, such as Laplacian Eigenvectors (blue) and Spectral Reconstruction (orange). This empirical trend aligns with the theoretical results in Corollary 3 .
Figure 3: Oversmoothing behaviour across various GNN-GP architectures. Test accuracy is shown as a function of depth for the original models (left) and models augmented with Laplacian Eigenvectors (right). In the original configurations, GCN-GP (blue) consistently suffers from a performance drop-off as the number of layers increases . In contrast, GAT-GP (orange) demonstrates resilience to depth , maintaining stable performance as argued in Corollary 2 . The behavior of Specformer-GP and Graphormer-GP depends on the dataset. Notably, upon incorporating Laplacian Eigenvectors (right), the tendency to oversmooth is significantly mitigated across all architectures.
Table 4: Summary of the Gaussian weight priors used for each graph transformer in the GP analysis. These priors define the variance of the initial weights for all linear transformations and attention parameters.
Dataset
GCN
GAT
HAN
GTN
GTN-GP
DBLP
87.30
93.71
92.83
94.18
94.33
ACM
91.60
92.33
90.96
92.68
92.19
IMDB
56.89
58.14
56.77
60.92
60.50
Appendix
Table 5: Node classification accuracy on heterogeneous graphs.
Dataset
Level
Splits
Nodes
Edges
Classes
Features
Homophily
Pubmed
Node
1
19,717
44,338
3
500
0.80
Chameleon
Node
10
2,277
31,421
10
2,325
0.23
Appendix
Table 6: Dataset statistics for node-level classification tasks.
Dataset
Nodes
Edges
Edge type
Features
Training
Validation
Test
DBLP
18405
67946
4
334
800
400
2857
ACM
8994
25922
4
1902
600
300
2125
IMDB
12772
37288
4
1256
300
300
2339
Appendix
Table 7: Datasets for node classification on heterogeneous graphs.
Figure 4: Histogram of the eigenvalue encoding of Specformer for different number of heads. The output distribution converges to a Gaussian (red line) fitted with mean and variance of the empirical distribution when both width and number of heads are large.
Figure 5: Oversmoothing behaviour and the impact of positional encodings. Test accuracy of Graphormer-GP on Pubmed (left) and CSBM (right) as a function of the number of layers.