Skip to content

Supercharging Graph Transformers with Advective Diffusion

Conference: ICML 2025
arXiv: 2310.06417
Code: GitHub
Area: Computational Biology
Keywords: Graph Transformer, Advective Diffusion Equation, Topological Distribution Shift, Generalization Theory, PDE-inspired Architecture

TL;DR

Proposes Advective Diffusion Transformer (AdvDIFFormer), a physics-inspired Graph Transformer model. By combining non-local diffusion (global attention) and advection (local message passing) mechanisms, it achieves provable generalization error bounds under topological distribution shifts, outperforming GNNs that solely rely on local diffusion.

Background & Motivation

Background

Background: Generalization challenges in graph learning: Most existing GNNs and Graph Transformers are studied under the closed-world assumption, where training and testing graph topologies are drawn from the same distribution.

Limitations of Prior Work

Limitations of Prior Work: Topological distribution shift: In real-world scenarios (such as molecular structures of different drug similarities, or social networks in different geographic regions), the graph topologies in training and testing phases may come from different distributions.

Key Challenge

Key Challenge: GNN = Local Diffusion: GNNs can be viewed as the discretization of local diffusion equations on graphs. Their node representations change exponentially with topological changes, causing the generalization error bound to blow up exponentially with topological shifts.

Core Idea

Core Idea: Graph Transformer = Non-local Diffusion: Global attention corresponds to non-local diffusion on a complete graph, which is insensitive to topology but overlooks useful structural information.

Supplementary Notes

Core Problem: Can a model be designed to leverage observed topological information while remaining robust to topological distribution shifts?

Physical Intuition: The evolution of salt concentration in a river is jointly determined by diffusion (driven by concentration gradients, intrinsic property) and advection (driven by flow direction, external environment). Analogously on graphs, diffusion captures intrinsic latent interactions, whereas advection utilizes the observed graph structure.

Method

Overall Architecture

The model is based on the advective diffusion equation on graphs:

\[\frac{\partial \mathbf{Z}(t)}{\partial t} = [\mathbf{C} + \beta\mathbf{V} - \mathbf{I}]\mathbf{Z}(t), \quad 0 \le t \le T\]

where: - \(\mathbf{Z}(0) = \phi_{enc}(\mathbf{X})\): initial node features encoded by an MLP - \(\mathbf{C}\): global attention matrix (non-local diffusion term) that learns latent interactions - \(\mathbf{V} = \mathbf{D}^{-1/2}\mathbf{A}\mathbf{D}^{-1/2}\): normalized adjacency matrix (advection term) that encodes observed topology - \(\beta \in [0,1]\): advection weight hyperparameter - Closed-form solution: \(\mathbf{Z}(t) = e^{-(\mathbf{I}-\mathbf{C}-\beta\mathbf{V})t}\mathbf{Z}(0)\)

Key Designs

1. Non-local Diffusion \(\rightarrow\) Global Attention

\[c_{uv} = \frac{\eta(\mathbf{z}_u(0), \mathbf{z}_v(0))}{\sum_{w \in \mathcal{V}} \eta(\mathbf{z}_u(0), \mathbf{z}_w(0))}\]
  • \(\eta\): learnable pairwise similarity function
  • Defines gradient/divergence operators on a complete graph, allowing information flow between any pair of nodes
  • Physical analogy: The molecular diffusion coefficient remains invariant across different environments

2. Advection \(\rightarrow\) Local Message Passing

  • The velocity field \(\mathbf{V}\) directly employs the normalized adjacency matrix
  • Physical analogy: Water flow direction depends on the specific environment (the river), analogous to the environment-dependent graph topology

3. Two Efficient Implementations

  • AdvDIFFormer-i (based on Padé-Chebyshev theory): Approximates the matrix exponential by solving a linear system \(\mathbf{L}_h^{-1}\mathbf{Z}(0)\), parallelized across multiple heads
  • AdvDIFFormer-s (based on geometric series expansion): Aggregates \(K\)-step propagation results \([\mathbf{Z}(0), \mathbf{P}_h\mathbf{Z}(0), ..., \mathbf{P}_h^K\mathbf{Z}(0)]\), enjoying linear complexity and suitability for large-scale graphs

Loss & Training

  • Standard cross-entropy/MSE loss (depending on downstream tasks)
  • Hyperparameter \(\beta\) controls advection intensity, and \(\theta\) controls linear system regularization
  • In AdvDIFFormer-s, \(K\) is the propagation step (similar to the number of GNN layers)

Key Experimental Results

Main Results

Synthetic Data (Theory Verification): - Graphs generated by stochastic block models to simulate three types of topological shifts: homophily shift, density shift, and block-number shift - Test errors of local diffusion models (GCN-like) grow superlinearly with \(\|\Delta\tilde{\mathbf{A}}\|_2\) - Test error of AdvDIFFormer remains virtually constant

Information Networks:

Method Arxiv(2018) Arxiv(2019) Arxiv(2020) Twitch(avg)
GCN 50.14 48.06 46.46 59.76
GraphGPS 51.11 48.91 46.46 62.13
DIFFormer 50.45 47.37 44.30 62.11
AdvDIFFormer-s 53.41 51.53 49.64 62.51
  • Achieves roughly 1-3% accuracy gain compared to the best baseline on the Arxiv dataset

Protein-Protein Interaction Networks (Node Regression):

Method Test Average RMSE Test Worst RMSE
MLP 0.672 0.768
DIFFormer 0.637 0.710
AdvDIFFormer-s 0.574 0.644

Ablation Study

  • \(\beta\) Analysis: On Arxiv, the optimal \(\beta \in [0.7, 1.0]\) (graph structure is useful); on DPPIN node regression, the optimal \(\beta=0\) (graph structure is uninformative)
  • A value of \(\beta\) that is too large (\(>2.0\)) leads to degraded generalization—over-relying on the environment-dependent topology
  • This demonstrates that the model can flexibly adjust the utilization level of structural information

Key Findings

  • In molecular mapping operator generation tasks, when extrapolating from small to large molecules, AdvDIFFormer-s significantly outperforms GCN/GAT in segmentation accuracy.
  • Non-local diffusion models (Diff-NonLocal) are stable but lack expressiveness, validating the necessity of the advection term.

Highlights & Insights

  1. Outstanding Theoretical Contribution: Proves that the advective diffusion model bounds the generalization error to an arbitrary polynomial order of the topological shift (Theorem 3.2), whereas the upper bound of local diffusion models grows exponentially (Prop 3.4).
  2. Elegant Physical Intuition: Elegantly maps the physical concepts of diffusion (environment-invariant intrinsic interactions) and advection (environment-dependent external driving forces) to graph learning.
  3. Large-scale Scalability: The linear complexity of AdvDIFFormer-s makes it suitable for large graphs with 0.2M nodes.
  4. Unified Perspective: Unifies GNNs (local diffusion) and Graph Transformers (non-local diffusion) under the framework of advective diffusion equations.

Limitations & Future Work

  • The current analysis is targeted at linear diffusion equations (fixed \(\mathbf{C}\)); the theoretical analysis of non-linear, time-varying \(\mathbf{C}(\mathbf{Z}(t))\) is left for future work.
  • \(\beta\) needs to be hand-tuned, lacking an adaptive mechanism.
  • The experiments only consider node-level tasks; generalization analysis for graph-level tasks (e.g., molecular property prediction) has not yet been addressed.
  • Experimental setups for density and homophily shifts are relatively simplified; real-world topological shifts may be more complex.
  • Theoretical guarantees rely on data generation assumptions (the graphon model), and their applicability to real-world data requires further validation.
  • Chamberlain et al. (2021a/b): The GRAND series, which interprets GNNs as diffusion equations; ours extends this to advective diffusion.
  • Wu et al. (2023): DIFFormer, utilizing non-local diffusion as a Graph Transformer, which is a special "no-advection" case of ours.
  • Bodnar et al. (2022): Investigates the expressiveness of GNNs using PDEs.
  • Kipf & Welling (2017): GCN, corresponding to the discretization of local diffusion.
  • Di Giovanni et al. (2022): PDE-guided architecture design for graph neural networks.

Insights: The PDE framework provides a powerful theoretical tool for understanding the capabilities and limitations of graph learning models. The introduction of the advective diffusion equation opens up new avenues for enhancing generalization via physical priors.

Rating

  • Novelty: ⭐⭐⭐⭐⭐ — First to unify GNNs and Graph Transformers from the perspective of advective diffusion equations, providing provable generalization guarantees.
  • Experimental Thoroughness: ⭐⭐⭐⭐ — Synthetic + multi-domain real-world data (social, protein, molecular), but lacks graph classification tasks.
  • Writing Quality: ⭐⭐⭐⭐⭐ — Perfect integration of theory and intuition, with physical analogies explained in a simple and accessible manner.
  • Value: ⭐⭐⭐⭐⭐ — Provides a theoretical foundation and practical model for generalization under distribution shifts in graph learning.