Expressivity and Generalization: Fragment-Biases for Molecular GNNs
Tom Wollschläger, Niklas Kemper, Leon Hetzel, Johanna Sommer, Stephan Günnemann
TL;DR
This work addresses expressivity and generalization gaps in molecular GNNs by introducing Fragment-WL, a unified test that analyzes fragment-biased models, and FragNet, a message-passing architecture operating on both the molecular graph and a higher-level fragment graph. It establishes a Hierarchy NF-WL < FR-WL < HLG-WL and demonstrates that higher-level fragment abstractions enhance expressivity, aided by an infinite-vocabulary rings-paths fragmentation and an ordinal encoding scheme. Empirically, FragNet achieves state-of-the-art or near-state-of-the-art results on ZINC and Peptides among GNNs, with strong generalization including zero-shot QM9 and robustness to unseen fragments, while maintaining linear time complexity. The approach reduces over-squashing via shortcutting through the fragment graph, showing substantial practical impact for molecular property prediction and related tasks, and suggesting future extensions to orbit information and multi-task learning.
Abstract
Although recent advances in higher-order Graph Neural Networks (GNNs) improve the theoretical expressiveness and molecular property predictive performance, they often fall short of the empirical performance of models that explicitly use fragment information as inductive bias. However, for these approaches, there exists no theoretic expressivity study. In this work, we propose the Fragment-WL test, an extension to the well-known Weisfeiler & Leman (WL) test, which enables the theoretic analysis of these fragment-biased GNNs. Building on the insights gained from the Fragment-WL test, we develop a new GNN architecture and a fragmentation with infinite vocabulary that significantly boosts expressiveness. We show the effectiveness of our model on synthetic and real-world data where we outperform all GNNs on Peptides and have 12% lower error than all GNNs on ZINC and 34% lower error than other fragment-biased models. Furthermore, we show that our model exhibits superior generalization capabilities compared to the latest transformer-based architectures, positioning it as a robust solution for a range of molecular modeling tasks.
