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.
翻译:我们分析了图神经网络(GNN)在布尔电路复杂度和描述复杂度方面的能力。我们证明,可由多项式大小有界深度GNN族计算的图查询恰好是那些在带计数和内置关系的一阶逻辑的守卫片段GFO+C中可定义的查询。这将GNN置于电路复杂度类TC^0中。值得注意的是,GNN族可以使用任意实数权重和广泛类别的激活函数,包括标准ReLU、逻辑"Sigmoid"和双曲正切函数。如果允许GNN使用随机初始化和全局读出(两者均为实践中广泛使用的GNN标准特性),则它们恰好能够计算与有界深度带阈值门的布尔电路相同的查询——即恰好是TC^0中的查询。此外,我们证明,使用分段线性激活函数和有理权重的单个GNN可计算的查询可在不带内置关系的GFO+C中定义,因此它们包含于均匀TC^0中。