the.ai

Graphs / Architecture

verified

Graph Transformer

If message passing is limited by the edges it is given, let every node attend to every other and put the structure back in as a bias on the scores. A graph transformer does that: full attention, with the graph entering through how far apart two nodes are rather than through whether they are connected at all.

Viz primitive · attention-heatmaptokens = 12 · heads = 1
query ↓key →

12 queries against 12 keys; a brighter cell means more of that query's attention went to that key. Nothing is masked: every position can read every other, itself included. The first key takes 23% of the average row on its own.

Every node against every other, plus one virtual node joined to all of them. Drag the virtual node's pull up to watch traffic route through it — a graph transformer adds exactly such a node, which is how two distant nodes reach each other in a single hop.

0.2

Reviewed by opendroid · 2026-08-18

  • arXiv:2106.05234 — Do Transformers Really Perform Bad for Graph Representation?