JMLR 2024

Transformers from Diffusion: A Unified Framework for Neural Message Passing

Qitian Wu, David Wipf, Junchi Yan

Main figure for Transformers from Diffusion: A Unified Framework for Neural Message Passing

Abstract

Learning representations for structured data with certain geometries (e.g., observed or unobserved) is a fundamental challenge, wherein message passing neural networks (MPNNs) have become a de facto class of model solutions. In this paper, inspired by physical systems, we propose an energy-constrained diffusion model, which integrates the inductive bias of diffusion on manifolds with layer-wise constraints of energy minimization. We identify that the diffusion operators have a one-to-one correspondence with the energy functions implicitly descended by the diffusion process, and the finite-difference iteration for solving the energy-constrained diffusion system induces the propagation layers of various types of MPNNs operating on observed or latent structures. This leads to a unified mathematical framework for common neural architectures whose computational flows can be cast as message passing (or its special case), including MLPs, GNNs, and Transformers. Building on these insights, we devise a new class of neural message passing models, dubbed diffusion-inspired Transformers (DIFFormer), whose global attention layers are derived from the principled energy-constrained diffusion framework. Across diverse datasets ranging from real-world networks to images, texts, and physical particles, we demonstrate that the new model achieves promising performance in scenarios where the data structures are observed (as a graph), partially observed, or entirely unobserved.

Benchmark Results

Tested on 2 datasets 9 baseline values reported too low

Tables show presented results in global context (best 3 papers + GCN + MLP).

Classic

#ModelAccuracy ↑Paper
1
GraphSAGE+CNA
0.9418 ±0.0033
2
GCN+CNA
0.9366 ±0.0048
3
TransformerConv
0.9350 ±0.0058
21
GCN
actual #21 vs paper #573 552 places worse
0.9004
best reported
actual #21 vs paper #573 552 places worse
paper 0.8150 ±0.0130
paper 0.8150 ±0.0130 Δ at pub 0.0854
39
SAGE
0.8911 ±0.0012
44
GAT
actual #44 vs paper #424 380 places worse
0.8897 ±0.0014
best reported
actual #44 vs paper #424 380 places worse
paper 0.8300 ±0.0070
paper 0.8300 ±0.0070 Δ at pub 0.0590 Δ today 0.0597
68
NodeFormer
actual #68 vs paper #382 314 places worse
0.8848 ±0.0033
best reported
actual #68 vs paper #382 314 places worse
paper 0.8340 ±0.0020
paper 0.8340 ±0.0020 Δ at pub 0.0508
87
GRAND
actual #87 vs paper #389 302 places worse
0.8815
best reported
actual #87 vs paper #389 302 places worse
paper 0.8330 ±0.0130
paper 0.8330 ±0.0130 Δ at pub 0.0485
189
DIFFormer-s
0.8590 ±0.0040
This paper
223
SGC
actual #223 vs paper #606 383 places worse
0.8509 ±0.0648
best reported
actual #223 vs paper #606 383 places worse
paper 0.8100

Difference within reported uncertainty; not counted as underperformance.

paper 0.8100 Δ at pub 0.0409
240
GRAND-l
actual #240 vs paper #340 100 places worse
0.8470 ±0.0060
best reported
actual #240 vs paper #340 100 places worse
paper 0.8360 ±0.0100
best at pub: GRAND: Graph Neural Diffusion (ICML 2021)

Difference within reported uncertainty; not counted as underperformance.

paper 0.8360 ±0.0100 Δ at pub 0.0110
292
DIFFORMER-a
0.8410 ±0.0060
This paper
309
LDS
0.8390 ±0.0060
This paper
314
GraphGPS
actual #314 vs paper #614 300 places worse
0.8387 ±0.0096
best reported
actual #314 vs paper #614 300 places worse
paper 0.8090 ±0.0110
329
GraphHeat
0.8370
This paper
345
GDC
0.8360 ±0.0020
This paper
416
GLCN
0.8310 ±0.0050
This paper
456
Graphormer
actual #456 vs paper #785 329 places worse
0.8262 ±0.0012
best reported
actual #456 vs paper #785 329 places worse
paper 0.7420 ±0.0090
best at pub: Language is All a Graph Needs (2023)
paper 0.7420 ±0.0090 Δ at pub 0.0621 Δ today 0.0842
707
Dense GAT
0.7850 ±0.0250
This paper
724
MLP
actual #724 vs paper #888 164 places worse
0.7768
best reported
actual #724 vs paper #888 164 places worse
paper 0.5610 ±0.0160
paper 0.5610 ±0.0160 Δ at pub 0.2158
789
GAT-kNN
0.7380 ±0.0170
This paper
807
GCN-kNN
0.7220 ±0.0180
This paper
835
LP
0.6820
This paper
875
ManiReg
0.6040 ±0.0080
This paper

LINKX Benchmarks

#ModelAccuracy ↑Paper
1
SAGE
0.8597 ±0.0021
2
Polynormer
0.8595 ±0.0007
3
NID_SAGE
0.8563 ±0.0031
23
GCN
actual #23 vs paper #39 16 places worse
0.7601 ±0.0049
best reported
actual #23 vs paper #39 16 places worse
paper 0.6231 ±0.0113
paper 0.6231 ±0.0113 Δ at pub 0.1370
24
GraphSAGE
0.7576 ±0.0004
28
GAT
actual #28 vs paper #34 6 places worse
0.7177 ±0.0618
best reported
actual #28 vs paper #34 6 places worse
paper 0.6557 ±0.0034

Difference within reported uncertainty; not counted as underperformance.

paper 0.6557 ±0.0034 Δ at pub 0.0620
29
SGC
actual #29 vs paper #43 14 places worse
0.7124 ±0.0046
best reported
actual #29 vs paper #43 14 places worse
paper 0.5203 ±0.0084
paper 0.5203 ±0.0084 Δ at pub 0.1921
31
MLP
actual #31 vs paper #40 9 places worse
0.7048 ±0.0077
best reported
actual #31 vs paper #40 9 places worse
paper 0.6015 ±0.0003
paper 0.6015 ±0.0003 Δ at pub 0.1033
32
DIFFormer-s
0.6924 ±0.0076
This paper
33
NodeFormer
0.6832 ±0.0045
This paper
43
LP
0.5273
This paper
SOTA performance (not significantly different from the best) Proposed method (this paper) Baseline / comparison (this paper) Global context (other papers) Best at pub — reported result worse than the best known when published (best reported in green) Best today — OK at publication; today's leaderboard best is elsewhere