Graphs / Attention
verifiedGraph Attention
A graph convolution treats every neighbour as equally worth listening to. Graph attention learns the weights instead, so a node can lean on the two neighbours that matter and ignore the forty that do not. It is the same idea as attention in a transformer, restricted to the edges the graph actually has.
Attention here is masked by adjacency: scores are computed only for real edges, so cost scales with edges rather than with nodes squared. That restriction is the whole difference from a transformer over nodes, and it is why graph attention stays cheap on sparse graphs and why it inherits the graph's blind spots — a pair with no edge gets no score, however related they are.
α sub uv = softmax sub u (LeakyReLU(a super T [Wh sub v ‖ Wh sub u ])) over u ∈ N(v), then h sub v ' = σ(Σ sub u α sub uv W h sub u ). The softmax runs over the neighbourhood rather than the whole graph, so attention mass a node has to spend is fixed at one and divided among however many neighbours it has — more neighbours means less each, before any learning.
8 queries against 10 keys; a brighter cell means more of that query's attention went to that key. Nothing is masked: every target position can read every source position.
Nodes against the neighbours they attend over, nothing masked within the neighbourhood. Drag the neighbour count up to watch each node's fixed attention budget spread thinner — the softmax sums to one however many arrive.
Reviewed by opendroid · 2026-08-18
- arXiv:1710.10903 — Graph Attention Networks