Abstract
Representing molecular structures effectively in chemistry remains a challenging task. Language models and graph-based models are extensively utilized within this domain, consistently achieving state-of-the-art results across an array of tasks. However, the prevailing practice of representing chemical compounds in the SMILES format - used by most data sets and many language models - presents notable limitations as a training data format. In this study, we present a novel approach that decomposes molecules into substructures and computes descriptor-based representations for these fragments, providing more detailed and chemically relevant input for model training. We use this substructure and descriptor data as input for language model and also propose a bimodal architecture that integrates this language model with graph-based models. As LM we use RoBERTa, Graph Isomorphism Networks (GIN), Graph Convolutional Networks (GCN) and Graphormer as graph ones. Our framework shows notable improvements over traditional methods in various tasks such as Quantitative Structure-Activity Relationship (QSAR) prediction.
Introduction
In the field of cheminformatics, the ability of machine learning models to accurately interpret molecular structures is paramount. Historically, the Simplified Molecular Input Line Entry System (SMILES) has been the standard 1D text representation. While SMILES is efficient for storage, it often fails to convey the complex physicochemical properties inherent in a molecule's 3D structure.
Standard Natural Language Processing (NLP) techniques, such as Byte Pair Encoding, often fragment SMILES strings into statistically frequent but chemically nonsensical tokens. Conversely, global molecular descriptors provide a high-level summary but obscure the localized effects of specific functional groups. This paper introduces a bimodal architecture designed to "think like a chemist" by capturing both local physicochemical properties and global structural context.
Methodology
The proposed framework utilizes a bimodal architecture that aligns a Language Model (LM) with a Graph Neural Network (GNN).
Chemically Grounded Tokenization
Instead of relying on statistical text splitting, the model employs the BRICS (Breaking of Retrosynthetically Interesting Chemical Substructures) algorithm. This rule-based approach cleaves molecules at synthetically realistic bonds, ensuring that the resulting fragments are meaningful chemical building blocks.
Substructure Descriptors and SubD-BERT
For each fragment generated by BRICS, a suite of 23 physicochemical and topological descriptors (e.g., atom counts, logP, Wiener index) is calculated. These descriptor arrays serve as "words" in a "sentence" representing the molecule. A RoBERTa-based model, termed SubD-BERT, is then trained on these sequences using masked language modeling.
Bimodal Integration
To account for spatial connectivity, the molecule is also processed as a graph using GNNs such as GCN, GIN, or Graphormer. The LM and GNN are jointly trained using a bimodal contrastive learning strategy (NTXent-Loss). This forces the models to align their representations in a shared latent space, combining the contextual strengths of the LM with the structural precision of the GNN.
Experimental Results
The model was pretrained on 10 million molecules from the PubChem database and evaluated on standard MoleculeNet benchmarks using scaffold splits.
Performance and Efficiency
The bimodal architecture achieved state-of-the-art (SOTA) results across multiple QSAR tasks. Notably, the BERT+GIN combination excelled in classification tasks like BBBP (0.937 ROC-AUC), while BERT+Graphormer led in regression tasks, such as QM9. Remarkably, this performance was achieved using significantly less data and compute time than previous large-scale models like MolFormer-XL, which required over a billion molecules for training.
Robustness in Augmentation
The authors also introduced a more chemically sound graph augmentation technique. Instead of randomly dropping atoms or edges—which can fundamentally alter a molecule's identity—the model masks only the features of atoms and edges, preserving the underlying physical validity of the molecular graph.
Conclusion and Future Work
While the model shows exceptional performance on medium-to-large datasets, it faces challenges with very small samples where simpler models like XGBoost may still prevail. Additionally, the current BRICS-based fragmentation is optimized for organic molecules. Future research will focus on scaling pretraining to over 100 million molecules and expanding the fragmentation rules to include inorganic and polymeric compounds.
Summary updated