Improving the accuracy and generalizability of molecular property regression models with a substructure-substitution-rule-informed framework

Xiaoyu Fan, Lin Guo, Ruizhen Jia, Yang Tian, Zhihao Yang, Boxue TianarXiv 2025 · DOI · arXiv

Abstract

Deep learning models for molecular property prediction often struggle with activity cliffs and out-of-distribution (OOD) generalization due to their "knowledge-poor" nature. We present MolRuleLoss, a framework that integrates chemical domain knowledge—specifically substructure substitution rules (SSRs)—directly into the model's loss function. By enforcing constraints based on empirical rules derived from Matched Molecular Pair Analysis (MMPA), MolRuleLoss improves local accuracy and significantly enhances OOD performance across various benchmark datasets.

Introduction

Deep learning architectures like Graph Neural Networks (GNNs) and Transformers have achieved state-of-the-art performance in molecular property prediction. However, two persistent challenges remain: the presence of "activity cliffs," where minor structural changes lead to disproportionate property shifts, and poor generalization to molecules outside the training distribution. These models often fail to capture the heuristic "rules of thumb" used by medicinal chemists, such as how replacing a specific functional group predictably alters lipophilicity or solubility. The authors argue that while these models are data-hungry, they remain knowledge-poor, lacking the grounded logic necessary for robust extrapolation.

Methodology

The MolRuleLoss framework addresses these issues by treating chemical knowledge as a differentiable constraint during training. It is designed as a "bolt-on" module that can be integrated into existing high-performance architectures like Geometry-Enhanced Molecular GNN (GEM) or UniMol without altering their internal structure.

Overview of the MolRuleLoss framework and Matched Molecular Pair Analysis (MMPA) examples.

The framework consists of several key components:

  1. Rule Extraction via MMPA: The system identifies pairs of molecules in the training set that differ by a single fragment. It calculates the average change in property ($\Delta P$) for these substitutions to establish Substructure Substitution Rules (SSRs).
  2. MolRuleLoss Objective: Inspired by Physics-Informed Neural Networks (PINNs), the training objective is modified. A new loss term, $LOSS_{SSR}$, forces the model's partial derivatives (the gradient of the output with respect to substructure counts) to align with the empirical SSRs.
  3. Adaptive Units: To account for the chemical context of a substitution, learnable "adaptive units" allow the rules to vary based on the surrounding molecular environment.

Key Insights and Theoretical Contributions

A significant theoretical contribution of this work is the Tian Conjecture, which mathematically relates rule quality to model error. The authors prove that the upper bound of a model's prediction error is positively correlated with the variance ($STD_{max}$) of the substitution rules. Furthermore, the framework demonstrates Rule Transferability, where rules extracted from large datasets (e.g., Melting Point) can improve models trained on smaller datasets for the same property, effectively addressing data scarcity.

Results and Discussion

The framework was validated across several benchmark datasets, including MoleculeNet (Lipophilicity, ESOL, FreeSolv), OChem (Melting Point), and ChEMBL.

  • Predictive Accuracy: On the GEM architecture, MolRuleLoss improved RMSE by 2.6% to 33.3% across various tasks. Even for the highly optimized UniMol model, performance gains ranged from 1.9% to 12.6%.
  • OOD Generalization: In a deterministic Molecular Weight (MW) task designed to test extreme OOD scenarios, standard GEM models exhibited a catastrophic RMSE of 29.507. The addition of MolRuleLoss reduced this error to 0.007, demonstrating near-perfect rule-based extrapolation.
  • Activity Cliff Resolution: The framework specifically improved performance on challenging "activity cliff" pairs in lipophilicity prediction, reducing RMSE from 0.674 to 0.627.

Conclusion

MolRuleLoss demonstrates that explicitly encoding chemical logic into deep learning models can overcome fundamental limitations in molecular property regression. By grounding model gradients in empirical substitution rules, the framework achieves superior accuracy and robust generalization. Future work may explore more complex multi-substructure rules and the integration of rules derived from quantum chemistry simulations or expert knowledge.

Summary updated

BibTeX
@misc{fan2025improving,
  author = {Xiaoyu Fan and Lin Guo and Ruizhen Jia and Yang Tian and Zhihao Yang and Boxue Tian},
  title = {{Improving the accuracy and generalizability of molecular property regression models with a substructure-substitution-rule-informed framework}},
  year = {2025},
  eprint = {2511.08314},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.08314},
}
Figure