Logical Characterizations of Recurrent Graph Neural Networks with Reals and Floats

Veeti Ahvonen, Damian Heiman, Antti Kuusisto, Carsten Lutz · DOI

Introduction

Theoretical research into Graph Neural Networks (GNNs) has historically relied on the mathematical ideal of infinite-precision real numbers ($\mathbb{R}$). However, practical implementations on modern hardware utilize floating-point numbers ($\mathbb{F}$), which introduce rounding errors and finite representable values. This paper bridges this gap by providing a rigorous logical characterization of recurrent GNNs—models that iterate until convergence or a stopping condition—under both real and floating-point arithmetic.

Addressing the Precision and Depth Gap

Previous landmark studies established that simple GNNs are logically equivalent to First-Order Logic (FO). However, these results were limited by two major assumptions: a fixed number of layers (constant depth) and the use of perfect real numbers.

This work extends the theory to recurrent GNNs, which can iterate an arbitrary number of times. By analyzing these models through the lens of mathematical logic and automata theory, the authors identify the exact languages that describe their expressive power and address the "precision gap" between theoretical models and hardware reality.

Methodology: Logics and Automata

The researchers employ three primary formalisms to map GNN behavior:

  1. Graded Modal Substitution Calculus (GMSC): A rule-based logic capable of counting neighbors, used to characterize GNNs operating on floats.
  2. Infinitary Modal Logic ($\omega$-GML): A logic allowing for infinite disjunctions, reflecting the infinite precision of real numbers.
  3. Counting Message Passing Automata (CMPA): A distributed computing model that serves as a bridge between GNN architectures and logical formulas.

To model floating-point behavior accurately, the authors define a system that accounts for hardware-specific traits like saturation (where adding small values to large ones results in no change) and non-associative addition.

Key Insights: The MSO Equalizer

A central contribution of this research is the identification of the "saturation point" in floating-point systems. Because $\mathbb{F}$ has a finite number of representable values, float-based GNNs exhibit a "boundedness" in their ability to count neighbors.

Despite this limitation, the authors prove a significant convergence in expressive power. Theorem 4.3 (The MSO Equalizer) demonstrates that for graph properties definable in Monadic Second-Order logic (MSO)—a standard language for expressing complex graph properties—GNNs using floats are exactly as powerful as those using reals. This suggests that for most "reasonable" graph tasks, the precision of floating-point math is not a fundamental bottleneck.

Results and Implications

The study establishes several key equivalences, summarized in the table below. Notably, while GNNs using reals are theoretically more powerful in an absolute sense (capable of recognizing even undecidable properties due to infinite precision), this advantage disappears when restricted to MSO-definable properties.

The results also show that "R-simple" GNNs—those using basic ReLU activations and sum-aggregations—are sufficient to reach full expressive power in the recurrent setting. This simplifies the architectural requirements for achieving maximum logical expressivity.

Conclusion and Future Work

This work provides a foundational theoretical framework for understanding how GNNs function in real-world computing environments. By proving that floating-point limitations do not hinder the expression of MSO-definable properties, the authors validate the use of practical hardware for complex graph reasoning.

Future research directions include addressing the "termination problem"—learning when a recurrent GNN should stop—and integrating global readout mechanisms into the logical framework to better model global graph properties.

Summary updated

BibTeX
@inproceedings{ahvonen2024logical,
  author = {Veeti Ahvonen and Damian Heiman and Antti Kuusisto and Carsten Lutz},
  title = {{Logical Characterizations of Recurrent Graph Neural Networks with Reals and Floats}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=atDcnWqG5n},
}
Figure