TL;DR
Current chemical language models rely heavily on linear SMILES strings, which fail to capture rich physicochemical properties and 3D/topological context. This paper introduces SubD-BERT, a framework that fragments molecules into chemically meaningful building blocks (via retrosynthetic rules), extracts localized physicochemical descriptors for each fragment, and fuses this descriptor-driven language model with graph neural networks using contrastive learning. With just 10 million pretraining molecules, this bimodal approach matches or outperforms state-of-the-art models pretrained on over a billion compounds.
What Problem Does This Paper Address?
Most chemical language models (e.g., ChemBERTa, SmilesBERT) treat molecular SMILES strings like natural language text, using statistical tokenizers such as Byte Pair Encoding (BPE). However, SMILES strings have fundamental limitations:
- Lack of physical grounding: Characters in a string do not convey 3D geometry, electronic effects, or thermodynamic properties.
- Chemically arbitrary tokenization: BPE groups frequently co-occurring text characters rather than synthetically valid functional groups.
- Representation gaps: Certain non-standard compounds (e.g., metal complexes, boron clusters) cannot be represented cleanly in standard SMILES.
While graph neural networks (GNNs) capture explicit molecular topology, they often struggle with long-range interactions across large, flexible molecules.
Methods
The authors propose a bimodal framework integrating a substructure-level language model with a graph neural network:
- BRICS-Based Fragmentation & Additional Substructures: Molecules are split into synthetically valid fragments using 16 retrosynthetic rules from the BRICS algorithm. To preserve connective context across broken bonds, the method introduces additional substructures—composite fragments combining the two substructures that were originally joined across a cleaved bond, with open valences filled by hydrogen atoms.
- Substructure Descriptors as Tokens: Instead of text tokens, each substructure is mapped to a 23-dimensional feature vector encompassing atom counts, bond types, topological indices (Wiener index), ring metrics, binned octanol-water partition coefficients ($\log P$), and Universal Force Field (UFF) conformational strain energies. Descriptors are tokenized in a position-aware manner, separated by special boundary tokens (
!and$), and fed into a RoBERTa architecture (SubD-BERT). - Physically Grounded Graph Masking: For the graph branch (testing GCN, GIN, and Graphormer), 20% of atom and edge features are masked. Unlike standard approaches (e.g., MolCLR) that remove atoms or bonds—which can transform one chemical into completely different real molecules (e.g., cleaving an ester into an alkane and formate)—the authors only mask attribute labels, preserving molecular connectivity.
- Bimodal Contrastive Alignment: Two separate MLP projection heads map the language embedding ($e_{\text{lang}}$) and graph embedding ($e_{\text{graph}}$) into a shared latent space. The network is trained with a combined objective: $$\mathcal{L} = \alpha \mathcal{L}_{\text{lang}} + \beta \mathcal{L}_{\text{graph}} + \gamma \mathcal{L}_{\text{bimodal}}$$ where $\mathcal{L}_{\text{lang}}$ is masked language modeling loss, and $\mathcal{L}_{\text{graph}}$ and $\mathcal{L}_{\text{bimodal}}$ are InfoNCE/NT-Xent contrastive losses.
Datasets
- Pretraining: 10 million molecules curated from PubChem.
- Evaluation Benchmarks (MoleculeNet / QSAR):
- Classification: BBBP, Tox21 (NR-AR), ClinTox (FDA approval and toxicity), BACE, MUV, and HIV (evaluated via ROC-AUC under scaffold splits).
- Regression: QM7, QM8 (E1-CC2), QM9 (energy gap), FreeSolv, ESOL, and Lipophilicity (evaluated via MAE or MSE).
Key Insights and Ideas
- Thinking like a synthetic chemist: Segmenting molecules by retrosynthetically cleavage-compatible bonds aligns representations with human chemical intuition and functional group chemistry, producing more interpretable building blocks than frequency-based subword tokenizers.
- Overcoming naive graph masking: Randomly deleting bonds during graph augmentation often generates disconnected species with entirely different chemical identities. Masking only vertex/edge attributes preserves physical validity during contrastive learning.
- Complementary strengths: The substructure language model handles long-range context across large molecules, while the GNN accurately resolves fine-grained local geometry.
- Model size trade-offs: While BERT+Graphormer shines on complex molecular relationships and large datasets, lighter variants (BERT+GIN / BERT+GCN) perform better on smaller, data-scarce downstream benchmarks where Graphormer tends to overfit.
Key Results
- Efficiency vs. Scale: The models (trained on 10M PubChem molecules for 100–400 GPU hours) consistently surpassed MolFormer-XL, which was pretrained on 1.1 billion molecules (~3,200 GPU hours).
- Classification: On BBBP, BERT+GIN reached an ROC-AUC of 0.937 (vs. MolFormer-XL's 0.917). On ClinTox (FDA Approved), SubD-BERT achieved 0.947 (vs. 0.933 for MolFormer-XL and 0.872 for MolCLR-GIN). On BACE, BERT+Graphormer reached 0.892 (vs. 0.862 for MolFormer-XL).
- Regression: On FreeSolv, BERT+GIN lowered MSE to 0.530 (vs. 0.571 for MolFormer-XL and 1.480 for Uni-Mol). On Lipophilicity, SubD-BERT achieved 0.514 MSE (vs. 0.551 for MolFormer-XL).
Limitations and Future Work
- Very Small Datasets: On datasets with fewer than 200 samples, the deep bimodal architecture tends to overfit and can be outperformed by lightweight classical baselines (e.g., XGBoost, SVR) trained directly on task-specific descriptors.
- Out-of-Domain Chemistries: BRICS fragmentation rules are strictly designed for drug-like organic compounds. They struggle to decompose inorganic molecules, coordination complexes, or polymers without customized fragmentation heuristics.
- Scaling: Pretraining was limited to 10 million molecules due to compute budgets; scaling up to 100M+ entries is left for future investigation.
Summary updated