THE LOGICAL EXPRESSIVENESS OF GRAPH NEURAL NETWORKS

Pablo Barceló, Egor V. Kostylev, Mikaël Monet, Jorge Eduardo Pérez Pérez, Juan L. Reutter, Juan Pablo Silva

TL;DR

This paper bridges the gap between Graph Neural Networks (GNNs) and formal logic, specifically the Weisfeiler-Lehman (WL) test and FOC2 logic. They show that standard GNNs (AC-GNNs) are limited to expressing local graph properties, while extending them with global "readout" mechanisms (ACR-GNNs) allows them to capture a much broader, logically defined set of graph properties. This work provides a theoretical framework for understanding GNN expressiveness and guides the design of more powerful GNN architectures.

What Problem Does This Paper Address?

Graph Neural Networks (GNNs) have shown remarkable success in various tasks involving graph-structured data. However, their theoretical understanding, particularly their expressive power – what kinds of graph properties they can learn – has lagged behind their empirical success. Previous work connected GNNs to the Weisfeiler-Lehman (WL) test, a standard algorithm for distinguishing graphs. This connection revealed that GNNs, like the WL test, are inherently local, meaning their information propagation is limited by the number of layers. This raises a crucial question: can GNNs learn all the properties that the WL test can distinguish, or even more complex logical properties? Specifically, the authors investigate which logical classifiers (properties expressible in first-order logic) can be captured by GNNs and what architectural modifications are needed to capture more complex logical properties, particularly those expressible in FOC2 logic.

Methods

The paper introduces two main GNN architectures:

  • AC-GNNs (Aggregate-Combine GNNs): These are standard GNNs where each node's feature vector is updated by aggregating its neighbors' features and then combining this with its own previous feature vector. This process is repeated for a fixed number of layers.
  • ACR-GNNs (Aggregate-Combine-Readout GNNs): These extend AC-GNNs by introducing a "readout" function at each layer. This readout function computes a global feature vector for the entire graph, which is then incorporated into each node's feature update. This allows ACR-GNNs to access and utilize non-local information.

The authors connect these architectures to formal logic:

  • Graded Modal Logic: This logic captures properties that are "local" in a specific sense, similar to the limitations of AC-GNNs.
  • FOC2 Logic: This is a fragment of first-order logic with two variables that allows for counting quantifiers. It is more expressive than graded modal logic and represents the target expressiveness for ACR-GNNs.

The core of their theoretical contribution lies in proving that AC-GNNs can capture exactly the classifiers expressible in graded modal logic, while ACR-GNNs can capture all FOC2 classifiers.

Datasets

The paper uses synthetic datasets for experiments:

  • Line graphs: These are simple connected graphs where nodes are arranged linearly.
  • Erdös-Renyi (E-R) random graphs: These graphs are generated randomly with a specified number of nodes and edges, allowing for variations in connectivity.
  • PPI (Protein-Protein Interaction) benchmark: A standard benchmark for node classification tasks.

The synthetic datasets were specifically designed to test the expressiveness of different GNN architectures against logical formulas. They were generated with varying graph sizes, connectivities, and node colorings to represent different logical properties.

Key Insights and Ideas

  • GNNs are limited by their "locality": The number of layers in an AC-GNN directly limits the distance over which information can propagate. This means AC-GNNs can only capture properties that are local to a node's neighborhood up to a certain depth.
  • Global readouts unlock non-local reasoning: The introduction of global readout functions in ACR-GNNs is a simple yet powerful architectural change that allows GNNs to overcome their inherent locality and capture non-local graph properties.
  • A direct link between GNNs and logic: The paper establishes a precise correspondence between the expressive power of AC-GNNs and graded modal logic, and between ACR-GNNs and FOC2 logic. This provides a formal way to understand and compare GNN architectures.
  • The PPI benchmark might be too simple: The authors note that on the PPI benchmark, ACR-GNNs did not show an improvement over AC-GNNs, suggesting that this benchmark might not be challenging enough to reveal the theoretical advantages of more expressive GNNs.

Key Results

  • AC-GNNs capture graded modal logic classifiers: The paper proves that AC-GNNs are precisely as expressive as graded modal logic. This means they can learn any property expressible in this logic, and no more.
  • ACR-GNNs capture FOC2 classifiers: The authors demonstrate that by adding global readout functions, ACR-GNNs can capture all classifiers expressible in FOC2 logic, a significantly more expressive logic than graded modal logic.
  • Experimental validation: On synthetic datasets designed to represent FOC2 properties, AC-GNNs struggled to learn the target properties, while ACR-GNNs (even with a single readout) achieved perfect or near-perfect performance, generalizing to unseen graph sizes.
  • AC-FR-GNNs also capture FOC2: The paper shows that even a single final readout layer (AC-FR-GNN) is sufficient to capture all FOC2 classifiers, though the construction is more complex.

Limitations and Future Work

  • Complexity of ACR-GNN construction: While ACR-GNNs are theoretically powerful, the construction of ACR-GNNs to capture complex FOC2 formulas can be intricate. The paper mentions that the proof of Theorem 5.1 involves a construction that might require many layers.
  • Generalization on complex benchmarks: The lack of improvement on the PPI benchmark suggests that more challenging benchmarks are needed to fully evaluate the practical benefits of ACR-GNNs.
  • Exact characterization of ACR-GNNs: The paper leaves open the question of whether ACR-GNNs are exactly as expressive as FOC2 logic, or if they can capture even more.
  • Explaining GNN computations: The authors suggest future work on using their logical framework to extract logical formulas from GNNs, providing explanations for their computations.
  • Exploring different aggregation/combination functions: The paper notes that it would be interesting to investigate if similar constructions can be achieved with different aggregation and combination operators.

Summary updated

BibTeX
@inproceedings{barcelo2020logical,
  author = {Pablo Barceló and Egor V. Kostylev and Mikaël Monet and Jorge Eduardo Pérez Pérez and Juan L. Reutter and Juan Pablo Silva},
  title = {{THE LOGICAL EXPRESSIVENESS OF GRAPH NEURAL NETWORKS}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
  url = {https://openreview.net/forum?id=y6k-0Az-oVy},
}
Figure