We analyse the power of graph neural networks (GNNs) in terms of Boolean circuit complexity and descriptive complexity. We prove that the graph queries that can be computed by a polynomial-size bounded-depth family of GNNs are exactly those definable in the guarded fragment GFO+C of first-order logic with counting and with built-in relations. This puts GNNs in the circuit complexity class (non-uniform) $\text{TC}^0$. Remarkably, the GNN families may use arbitrary real weights and a wide class of activation functions that includes the standard ReLU, logistic "sigmoid", and hyperbolic tangent functions. If the GNNs are allowed to use random initialisation and global readout (both standard features of GNNs widely used in practice), they can compute exactly the same queries as bounded depth Boolean circuits with threshold gates, that is, exactly the queries in $\text{TC}^0$. Moreover, we show that queries computable by a single GNN with piecewise linear activations and rational weights are definable in GFO+C without built-in relations. Therefore, they are contained in uniform $\text{TC}^0$.
翻译:本文从布尔电路复杂性和描述复杂性两个角度分析图神经网络(GNN)的计算能力。我们证明,可由多项式规模、有界深度的GNN族计算的图查询,恰好是在带计数及内置关系的一阶逻辑的守护片段GFO+C中可定义的查询。这使GNN归属于电路复杂性类(非均匀)$\text{TC}^0$。值得注意的是,该GNN族可以使用任意实数权重以及一大类激活函数,包括标准的ReLU、逻辑“Sigmoid”和双曲正切函数。如果允许GNN使用随机初始化和全局读出(这两者均是实践中广泛采用的标准GNN特性),则它们能计算的查询恰好与使用阈值门的有界深度布尔电路相同,即恰好是$\text{TC}^0$中的查询。此外,我们证明了由单个使用分段线性激活函数和有理数权重的GNN可计算的查询,可以在不带内置关系的GFO+C中定义。因此,这些查询包含在均匀$\text{TC}^0$中。