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 TC^0. Remarkably, the GNN families may use arbitrary real weights and a wide class of activation functions that includes the standard ReLU, logistic "sigmod", 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 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 TC^0.
翻译:我们分析了图神经网络(GNNs)在布尔电路复杂性和描述复杂性方面的能力。我们证明,由多项式有界深度的GNN族可计算的图查询恰好是在带计数和内置关系的一阶逻辑的受保护片段GFO+C中可定义的。这使GNNs归于电路复杂性类TC^0。值得注意的是,这些GNN族可使用任意实数权重以及包括标准ReLU、逻辑"S型"和双曲正切函数在内的广泛激活函数类。若允许GNNs使用随机初始化和全局读出(两者均为实际应用中广泛使用的GNN标准特征),则它们可精确计算与具有阈值门的有界深度布尔电路相同的查询,即恰好是TC^0中的查询。此外,我们证明使用分段线性激活函数和有理权重的单个GNN可计算的查询可在无内置关系的GFO+C中定义。因此,它们包含在均匀TC^0中。