Where Modal Logic Meets Machine Learning: Graph Neural Networks

Antti Kuusisto, Carsten LutzarXiv 2026

TL;DR

Graph Neural Networks (GNNs) are the go-to machine learning models for graph-structured data, but what can they actually compute? This survey maps out a deep, surprising bridge between GNNs and modal logic—the logic of local neighborhoods. By translating GNNs into logical formulas, researchers can precisely pin down what GNNs can and cannot express, verify their safety, explain their predictions, and design architectures that break past their fundamental limits.

What Problem Does This Paper Address?

Standard GNNs work by passing messages between neighboring nodes in a graph. While this makes them great at learning from graph structures, it also limits their vision: message-passing GNNs are no more expressive than the 1-dimensional Weisfeiler–Leman (1-WL) test (a classic graph isomorphism heuristic, also known as color refinement). Because of this, GNNs can't even tell apart a 6-cycle from two disjoint triangles.

To understand these limits—and to systematically build more powerful models—researchers needed a formal yardstick. This survey explores how modal logic (which naturally reasons about graphs from a local node's perspective) provides that exact yardstick, unifying scattered results on GNN expressive power, verification, explainability, and next-generation architectures.

Methods

As a survey, the paper organizes and connects the theoretical frameworks used to bridge GNNs and logic:

  • Uniform Expressive Power: Characterizing what a single GNN can express across graphs of any size, broken down by aggregation function (max, sum, mean), activation function (ReLU, tReLU, sigmoid, Heaviside), and number system (reals, rationals, floating-point).
  • Graded Bisimulation: A game-theoretic tool from modal logic that turns out to be equivalent to color refinement, used to prove what GNNs cannot distinguish.
  • Static Analysis & Verification: Translating GNNs into logical satisfiability problems to check properties like emptiness (does the GNN accept any graph at all?) and safety specifications.
  • Beyond 1-WL: Reviewing how recurrent GNNs, Graph Transformers, Higher-Order GNNs, Hierarchical Ego-GNNs, and Deep Homomorphism Networks map to richer logics.

Datasets

Not discussed in the paper.

Key Insights and Ideas

  • Aggregation shapes logic: The choice of aggregation function directly dictates the corresponding logic. Max-aggregation GNNs match standard Modal Logic (ML). Sum-aggregation GNNs match Graded Modal Logic (GML) (which can count neighbors) on bounded-degree graphs, and Presburger/Modal Sum Logics unconditionally. Mean-aggregation GNNs correspond to Ratio Modal Logic (RML), capable of relative counting (e.g., "at least half of my neighbors satisfy $P$").
  • Floats vs. Reals: Switching from idealized real numbers to practical floating-point arithmetic changes expressive power! For example, floating-point sum-GNNs drop down to exact GML because finite precision caps counting. For Graph Transformers, reals allow relative counting, while floats allow absolute global counting (via underflow effects) but lose relative counting.
  • Global aggregation breaks the mold: Letting nodes aggregate over the entire graph allows sum-GNNs to express properties like linear order—something even two-variable counting first-order logic ($C^2$) cannot do.
  • Explaining GNNs with logic: Monotonic GNNs (which use nonnegative weights) can be constructively translated into human-readable existential modal logic explanations, guaranteeing both soundness and completeness.

Key Results

  • Exact Characterizations:
  • $\text{ML} = \text{Max-AC-GNN}$ with (t)ReLU activation.
  • $\text{GML} = \text{sum-AC-GNN}[\mathbb{F}]$ (floating-point) with (t)ReLU activation.
  • $\text{Presburger-ML}[\mathbb{Q}] = \text{sum-AC-GNN}[\mathbb{Q}]$ with eventually constant activations (like tReLU or Heaviside).
  • Complexity of Emptiness & Verification: Deciding if a max- or sum-AC-GNN with tReLU is empty is PSpace-complete. Switching to unbounded piecewise linear activations (like ReLU) jumps the complexity to coNExpTime-complete.
  • Undecidability: Adding both incoming and global aggregation (or either one with ReLU) makes GNN emptiness undecidable (proved via reductions from Hilbert's tenth problem).
  • Breaking 1-WL: Hierarchical ego-GNNs match graded hybrid logic ($\text{GML}(\downarrow)$), while Deep Homomorphism Networks (DHNs) connect to graded homomorphism modal logic (GHML).

Limitations and Future Work

  • Theory vs. Practice: Many logical characterizations rely on idealized real numbers, specific activation functions, or omit positional encodings (which are crucial for Graph Transformers in practice).
  • Open Questions: It remains open whether sum-AC-GNNs with smooth activations like sigmoid can express all of GML without requiring a strict "gap" between acceptance and rejection outputs.
  • Practical Explainability: While monotonic GNNs guarantee complete logical explanations, extracting them for sum-aggregation is computationally heavy; focusing on short, sound-but-incomplete explanations is a more realistic direction.

Summary updated

BibTeX
@misc{kuusisto2026where,
  author = {Antti Kuusisto and Carsten Lutz},
  title = {{Where Modal Logic Meets Machine Learning: Graph Neural Networks}},
  year = {2026},
  eprint = {2612.02011},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.02011},
}
Figure