What is the general message-passing neural network (MPNN) update for node v, and how do you prove that relabelling nodes with any permutation matrix P makes a node-level GNN layer permutation-equivariant while global sum or mean pooling makes a graph-level readout permutation-invariant?

Deep learning, Graph neural networks
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you know the message-passing abstraction and can prove permutation equivariance and invariance cleanly with permutation matrices.

Key idea

Because the message aggregation ⨁u∈N(v) (such as sum, mean or max) is symmetric in the ordering of neighbours, a GNN layer satisfies f(PAP⊤,PX)=P f(A,X) for any n×n permutation matrix P, where A is the adjacency matrix and X holds node features as rows.

Steps

  1. Write the MPNN layer update at step l: hv(l+1)=ϕ(hv(l),  ⨁u∈N(v)ψ(hv(l),hu(l),euv)), where ψ is the message function, ⨁ is a permutation-invariant aggregator over neighbour set N(v), euv are edge features and ϕ is the node update.
  2. Check matrix-form equivariance (illustrate with f(A,X)=σ(A^XW), where A^ is a symmetrically normalised adjacency derived from A): permuting node order sends X↦PX and A↦PAP⊤ (so A^↦PA^P⊤). Since P⊤P=I and element-wise non-linearities σ commute with row permutations, f(PAP⊤,PX)=σ(PA^P⊤PXW)=P σ(A^XW)=P f(A,X).
  3. Generalise to any MPNN: permuting nodes preserves each node’s multiset of neighbours N(v); because ⨁ is independent of neighbour order, each node receives the exact same updated embedding, merely placed at its new row index.
  4. Show graph-level invariance: global sum pooling computes 1⊤H=∑vhv. Under permutation, 1⊤(PH)=(P⊤1)⊤H=1⊤H (since every row and column of P sums to 1), so the graph representation is unchanged; dividing by the node count n gives the same invariance for global mean pooling.

Common mistakes

How long your answer should be

Half a page; 3–4 minutes.

Read this

Previous in Deep learning: In SimCLR with a mini-batch of N images (giving 2N augmented views), write the NT-Xent (InfoNCE) loss for a positive pair (i,j) with cosine similarity si,j and temperature τ. Why is this a (2N−1)-way cross-entropy loss, and how does τ affect the gradients?
Next in Deep learning: Consider a small ReLU network with input x=[1,−1]⊤, hidden layer z(1)=W(1)x with W(1)=[1−1−12], h=ReLU⁡(z(1)), and scalar output y^=w(2)⊤h with w(2)=[2,−1]⊤ (no biases). For target y=3 and squared loss L=12(y^−y)2, what are the exact gradients ∂L∂w(2) and ∂L∂W(1)?