Expressive Power of Graph Transformers via Logic
Veeti Ahvonen, Maurice Funk, Damian Heiman, Antti Kuusisto, Carsten Lutz
Abstract
Transformers are the basis of modern large language models, but relatively little is known about their precise expressive power on graphs. We study the expressive power of graph transformers (GTs) by Dwivedi and Bresson (2020) and GPS-networks by Rampásek et al. ( 2022 ), both under soft-attention and average hard-attention. Our study covers two scenarios: the theoretical setting with real numbers and the more practical case with floats. With reals, we show that in restriction to vertex properties definable in first-order logic (FO), GPS-networks have the same expressive power as graded modal logic (GML) with the global modality. With floats, GPS-networks turn out to be equally expressive as GML with the counting global modality. The latter result is absolute, not restricting to properties definable in a background logic. We also obtain similar characterizations for GTs in terms of propositional logic with the global modality (for reals) and the counting global modality (for floats).
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 7bca289c-fa32-4f12-8d2b-eeafe30590edCited by top-tier papers1
Ask how each one uses itBuilds on13
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Recipe for a General, Powerful, Scalable Graph TransformerLadislav Rampásek, Michael Galkin, Vijay Prakash Dwivedi, Anh Tuan Luu et al.NeurIPS 2022 · 1,216 citations
- Rethinking Graph Transformers with Spectral AttentionDevin Kreuzer, Dominique Beaini, William L. Hamilton, Vincent Létourneau et al.NeurIPS 2021 · 854 citations
- On the Bottleneck of Graph Neural Networks and its Practical ImplicationsUri Alon, Eran YahavICLR 2021 · 90 citations
- A Logic for Expressing Log-Precision TransformersWilliam Merrill, Ashish SabharwalNeurIPS 2023 · 87 citations
Related papers
- Logical characterizations of recurrent graph neural networks with reals and floatsVeeti Ahvonen, Damian Heiman, Antti Kuusisto, Carsten LutzNeurIPS 2024 · 19 citations
- The Correspondence Between Bounded Graph Neural Networks and Fragments of First-Order LogicBernardo Cuenca Grau, Eva Feng, Przemyslaw Andrzej WalegaAAAI 2026 · 4 citations
- The Logical Expressiveness of Temporal GNNs via Two-Dimensional Product LogicsMarco Sälzer, Przemyslaw Andrzej Walega, Martin LangeNeurIPS 2025 · 3 citations
- Distinguished In Uniform: Self-Attention Vs. Virtual NodesEran Rosenbluth, Jan Tönshoff, Martin Ritzert, Berke Kisin et al.ICLR 2024 · 20 citations
- Are Targeted Messages More Effective?Martin Grohe, Eran RosenbluthLICS 2024
