Graph neural networks (GNN) are deep learning architectures for graphs. Essentially, a GNN is a distributed message passing algorithm, which is controlled by parameters learned from data. It operates on the vertices of a graph: in each iteration, vertices receive a message on each incoming edge, aggregate these messages, and then update their state based on their current state and the aggregated messages. The expressivity of GNNs can be characterised in terms of certain fragments of first-order logic with counting and the Weisfeiler-Lehman algorithm. The core GNN architecture comes in two different versions. In the first version, a message only depends on the state of the source vertex, whereas in the second version it depends on the states of the source and target vertices. In practice, both of these versions are used, but the theory of GNNs so far mostly focused on the first one. On the logical side, the two versions correspond to two fragments of first-order logic with counting that we call modal and guarded. The question whether the two versions differ in their expressivity has been mostly overlooked in the GNN literature and has only been asked recently (Grohe, LICS'23). We answer this question here. It turns out that the answer is not as straightforward as one might expect. By proving that the modal and guarded fragment of first-order logic with counting have the same expressivity over labelled undirected graphs, we show that in a non-uniform setting the two GNN versions have the same expressivity. However, we also prove that in a uniform setting the second version is strictly more expressive.
翻译:图神经网络(GNN)是面向图结构的深度学习架构。本质上,GNN是一种分布式消息传递算法,其行为由从数据中学习到的参数控制。该算法在图顶点上运行:每次迭代中,顶点通过每条入边接收消息,聚合这些消息,然后根据当前状态和聚合结果更新自身状态。GNN的表达能力可通过带计数的一阶逻辑的特定片段与Weisfeiler-Lehman算法来刻画。核心GNN架构存在两种不同版本:第一种版本中,消息仅取决于源顶点状态;而第二种版本中,消息同时取决于源顶点和目标顶点状态。实际应用中两种版本均有使用,但现有GNN理论研究主要关注第一种。从逻辑层面看,两种版本分别对应带计数的一阶逻辑的两个片段——我们称之为模态片段和守卫片段。这两种版本在表达能力上是否存在差异?这一问题在GNN文献中长期被忽视,直至近期才被Grohe(LICS'23)提出。本文对此给出解答。结果表明,答案并非如预期般简单。通过证明带计数的一阶逻辑的模态片段与守卫片段在标注无向图上具有相同表达能力,我们揭示了在非均匀设定下两种GNN版本具有相同的表达能力。然而,我们也证明在均匀设定下第二种版本严格更具表达能力。