Graph Transformers

Graph transformers combine graph-structured inputs with attention-based message mixing. They are a bridge between GNNs and Transformers.

A simple graph-biased attention score is:

where injects edge, distance, or relation information into attention.

For multi-head graph attention:

where can be all nodes, a neighborhood, or a sparse candidate set. The choice of determines both inductive bias and cost.

Key Ideas

  • Attention can connect distant graph nodes without many local message-passing steps.
  • Structural encodings tell the model about edges, distances, paths, centrality, or geometry.
  • Some variants attend over all node pairs; others restrict attention to neighborhoods or sparse patterns.
  • Edge or pair representations often sit beside node representations and carry relation-specific information.
  • Geometry-aware graph transformers connect to geometric deep learning when coordinates, frames, or equivariant features are used.

Structural Biases

BiasEncodesCaveat
adjacency biasgraph connectivitygraph construction becomes part of the model
shortest-path distancetopologyexpensive or ambiguous on disconnected graphs
pair distance3D geometrycoordinate source and unit matter
edge typebond, contact, interaction, relationedge labels may leak post-hoc information
centrality or degreecoarse topologycan overfit graph-size artifacts
relative positionsequence or spatial offsetframe and masking rules must be clear

Cost Boundary

Full node-pair attention is:

for nodes and hidden size . For proteins, complexes, and large graphs, the paper should state whether attention is full, local, sparse, blockwise, or biased by a candidate graph.

Claim Boundary

ClaimCheck
better long-range reasoningcompare against message-passing depth and long-range baselines
better geometric modelingstate coordinate features, symmetry behavior, and frame assumptions
better molecular/protein performanceseparate architecture gain from graph construction and split choice
better efficiencycompare memory, wall time, and node/pair scaling

Practical Checks

  • Identify whether graph edges only bias attention or also carry explicit messages.
  • Check how positional, distance, or relation encodings enter the attention score and value update.
  • Watch quadratic cost in atom, residue, or contact count.
  • For protein-ligand complexes, check whether intra-protein, intra-ligand, and cross interactions are separated or shared.
  • Check whether edge or pair features are updated, only used as bias, or discarded after attention.
  • Verify that graph construction and structural encodings are available at inference.