CS224W-Machine Learning with Graph-Theory

How powerful are GNNs?

A single GNN layer\text{A single GNN layer}

Node Colors (节点染色)

We use node same/different colors to represent nodes with same/different features. (相同的颜色代表相同的特征或者说相同的意义,用颜色区分不同的feature)

Local Neighborhood Structures

We specifically consider local neighborhood structures around each node in a graph.

We need to understand how a GNN captures local neighborhood structures. (Computational Graph)

Computational Graph\text{Computational Graph}

GNN won’t be able to distinguish nodes 1 and 2

Note: GNN does not care about node ids, it just aggregates features vectors of different nodes.

In general, different local neighborhoods define different computational graphs.

Computational graphs are identical to rooted subtree structures around each node.

Recall: Injective Function\text{Recall: Injective Function}

How Expressive is a GNN?

Key observation: Subtrees of the same depth can be recursively characterized from the leaf nodes to the root nodes.

Expressive Power of GNNs

Key observation: Expressive power of GNNs can be characterized by that of neighbor aggregation functions they use.

  • A more expressive aggregation function leads to a more expressive GNN.
  • Injective aggregation function leads to the most expressive GNN

Theoretically analyze expressive power of aggregation functions

We analyze aggregation functions of two popular GNN models

Neighbor Aggregation: Case Study

Summary GCN 和 GraphSAGE的问题

Designing Most Expressive GNNs

Injective Multi-Set Function

Universal Approximation Theorem

Injective Multi-Set Function

MLPΦ(xSMLPf(x))\text{MLP}_{\Phi} \left( \sum_{x\in S} \text{MLP}_{f}(x)\right)

Most Expressive GNN\text{Most Expressive GNN}

Graph Isomorphism Network (GIN)

MLPΦ(xSMLPf(x))\text{MLP}_{\Phi} \left( \sum_{x\in S} \text{MLP}_{f}(x)\right)

We now describe the full model of GIN by relating it to WL graph kernel (traditional way of obtaining graph-level features).

Recall: Color refinement algorithm in WL kernel.

Color Refinement Algorithm\text{Color Refinement Algorithm}

Example of color refinement given two graphs

逗号后面1的个数就是这个节点相连接的节点(个数)

The Complete GIN Model\text{The Complete GIN Model}
c(k+1)(v)=HASH(c(k)(v),{c(k)(u)}uN(v))c^{(k+1)}(v) = \text{HASH} \left( c^{(k)}(v),\{c^{(k)}(u)\}_{u\in N(v)}\right)
(c(k)(v),{c(k)(u)}uN(v))(c^{(k)}(v), \{c^{(k)}(u)\}_{u \in N(v)})

can be modeled as

MLPΦ((1+ϵ)MLPf(c(k)(v))+uN(v)MLPf(c(k)(u)))\text{MLP}_{\Phi}\left((1+\epsilon) \cdot \text{MLP}_f (c^{(k)}(v)) + \sum_{u \in N(v)} \text{MLP}_f(c^{(k)}(u))\right)

where ϵ\epsilon is a learnable scalar.

GIN vs WL Graph Kernel\text{GIN vs WL Graph Kernel}

GIN can be understood as differentiable neural version of the WL graph Kernel:

Update targetUpdate function
WL Graph KernelNode colors (one-hot)HASH
GINNode embeddings (low-dim vectors)GINConv

Advantages of GIN over the WL graph kernel are:

Because of the relation between GIN and the WL graph kernel, their expressive is exactly the same.

How powerful is this?

Improving GNNs’ Power

Can the expressive power of GNNs be improved?