Table of Contents
Fetching ...

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.

How Expressive Are Graph Neural Networks in the Presence of Node Identifiers?

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.
Paper Structure (59 sections, 81 theorems, 62 equations, 4 figures, 4 tables, 1 algorithm)

This paper contains 59 sections, 81 theorems, 62 equations, 4 figures, 4 tables, 1 algorithm.

Key Result

Lemma 1

The semilinear functions are precisely all real-valued functions that can be obtained through composition from (i) affine functions with rational coefficients, and (ii) the ternary function ${\mathsf{ifPos}}\xspace$, where

Figures (4)

  • Figure 1: Combination function classes ordered by increasing expressive power. Here ${\mathsf{sigmoid}}\xspace$ denotes the activation ${\mathsf{sigmoid}}\xspace(x) = \frac{1}{1+e^{-x}}$, and ${\mathsf{H}}\xspace$ is the Heaviside step function.
  • Figure 2: Relative expressive power of key-invariant $\mathsf{LocalMax}$GNNs with varying acceptance policies and combination functions. Key-invariant $(>0/<0)$$\mathsf{LocalMax}$--Continuous GNNs collapse to key-oblivious $\mathsf{LocalMax}$GNNs. $\Diamond^{\geq 2} \top$ and $\Diamond^{\geq 2} p$ are formulas in WGML (Definition \ref{['def:weaklygradedml']}), $\Diamond^{=1} \top$ is a formula in GML (section \ref{['subsec:Logics and key-oblivious']}), and $\langle {\mathsf{step}}\xspace ; {\mathsf{step}}\xspace\rangle^{=1}$ is a formula in $\mathsf{LDDL}$ (section \ref{['sec:uddl']}). $\mathcal{Q}_{C^u_3}$ is the isomorphism type of a triangle with a distinguished node $u$ and uniform labeling. It remains open for key-invariant $\mathsf{LocalMax}$GNNs whether semilinear combination functions have the same expressive power as arbitrary combination functions, and whether they subsume the expressive power of continuous combination functions.
  • Figure 3: Relative expressive power of key-invariant $\mathsf{LocalSum}$GNNs with varying acceptance policies and combination functions. Key-invariant $(\geq 1/\leq 0)$$\mathsf{LocalSum}$--$\mathsf{FFN}$($\mathsf{ReLU}$) GNNs collapse to key-oblivious $\mathsf{LocalSum}$--$\mathsf{FFN}$($\mathsf{ReLU}$) GNNs, and key-invariant $(>0/<0)$$\mathsf{LocalSum}$--Continuous GNNs collapse to key-oblivious $\mathsf{LocalSum}$--Continuous GNNs. $\mathcal{Q}_{G^u_{\triangle p}}$ is the isomorphism type of a rooted triangle with a single $p$ node (see Example \ref{['ex:localsum']} and Theorem \ref{['thm:iso test with local sum']}). It remains open whether key-invariant $\mathsf{LocalSum}$--$\mathsf{FFN}$($\mathsf{ReLU}$) GNNs are more expressive than key-oblivious $\mathsf{LocalSum}$--$\mathsf{FFN}$($\mathsf{ReLU}$) GNNs.
  • Figure 4: Grid-shaped graph used in the undecidability proof. We use unary predicates (i.e., binary node features) $Spy, H_1, H_2, V_1, V_2$, as well as others that are explained in the proof. The spy node is connected to every other node (these edges are not all drawn, to avoid clutter).

Theorems & Definitions (138)

  • Example 1
  • Lemma 1
  • Lemma 1
  • Definition 2: CR-invariant
  • Definition 3: Strongly Local
  • Theorem 3.0
  • Definition 5: Bisimulation
  • Proposition 5
  • Theorem 3.1: schonherr2025logicalbernardowalega
  • Theorem 3.2: barceloetallogical
  • ...and 128 more