How Expressive Are Graph Neural Networks in the Presence of Node Identifiers?
Arie Soeteman, Michael Benedikt, Martin Grohe, Balder ten Cate
TL;DR
The paper investigates how the presence of unique node identifiers (keys) affects the expressive power of graph neural networks, introducing the notion of key-invariant GNNs and relating their power to order-invariant logics. It establishes a spectrum of results across LocalMax and LocalSum architectures with varying combination functions, showing that key-invariant LocalMax GNNs with continuous or semilinear combos sit below or within order-invariant FO+C, WGML, or modal logic, while key-invariant LocalSum GNNs with arbitrary combinations achieve expressive completeness for strongly local queries. It provides precise collapses (e.g., LocalSum-Continuous collapsing to key-oblivious under certain policies), constructs novel logics (LDDL) and demonstrates their expressive reach and undecidability, and discusses global aggregation, composite keys, and symmetry-group invariances. The findings illuminate how node identifiers can either enhance or limit GNN expressiveness and offer a theoretical framework for understanding invariant learning on graphs with identifiers, with potential practical implications for positional encodings and geometric/finite-precision settings. The work opens avenues for further exploration of key-invariance under different key spaces and symmetry constraints, as well as decidability questions for invariant GNNs.
Abstract
Graph neural networks (GNNs) are a widely used class of machine learning models for graph-structured data, based on local aggregation over neighbors. GNNs have close connections to logic. In particular, their expressive power is linked to that of modal logics and bounded-variable logics with counting. In many practical scenarios, graphs processed by GNNs have node features that act as unique identifiers. In this work, we study how such identifiers affect the expressive power of GNNs. We initiate a study of the key-invariant expressive power of GNNs, inspired by the notion of order-invariant definability in finite model theory: which node queries that depend only on the underlying graph structure can GNNs express on graphs with unique node identifiers? We provide answers for various classes of GNNs with local max- or sum-aggregation.
