Abstract
Traditional molecular representations like SMILES strings and standard graphs often lack deep chemical context, treating atoms of the same element identically regardless of their functional roles. We present FARM (Functional Group-Aware Representations for Small Molecules), a foundation model that introduces a "chemical vocabulary" by labeling atoms with their specific functional group roles. By aligning enriched sequence views with structural graph views through contrastive learning, FARM achieves state-of-the-art performance across 11 of 13 MoleculeNet benchmarks, demonstrating superior generalizability and chemical reasoning.
Introduction
In AI-driven drug discovery, molecules are typically represented as SMILES strings (sequences) or molecular graphs (nodes and edges). However, standard SMILES are often "chemically illiterate," failing to distinguish between atoms in different chemical environments—for instance, an oxygen atom in a reactive ketone versus a stable alcohol. Similarly, atom-centric molecular graphs often miss the higher-level interactions of functional groups, which are the primary drivers of biological activity. FARM addresses these limitations by creating a representation that understands the specific chemical environment of every atom, bridging the gap between raw structural data and functional chemical knowledge.
Methodology
FARM introduces three core innovations to enrich molecular representations:
- FG-Aware Tokenization: Atoms are labeled with their functional group context (e.g.,
O_ketoneinstead of justO). This expands the chemical lexicon from dozens to over 14,000 tokens, increasing information density and making the strings more analogous to natural language. - Functional Group Knowledge Graph (KG): A multi-relational graph encoding 101 common functional groups and their properties (solubility, H-bond status, etc.) is used to learn group-level embeddings via the ComplEx model.
- Dual-View Contrastive Learning: The model employs a BERT-style Masked Language Model (MLM) for sequences and a Graph Neural Network (GNN) for structural topology. Contrastive learning aligns these views, ensuring the model captures both local atom-level features and global molecular skeletons.
Experimental Setup
The model was pre-trained on a massive dataset of 20 million molecules from ChEMBL25, ZINC15, and other sources. Evaluation was conducted on the MoleculeNet benchmark, spanning 13 tasks in physiology (e.g., toxicity, BBBP), biophysics, and physical chemistry. Analysis revealed that diverse datasets like ChEMBL25 are crucial for generalizability, as "drug-like" focused sets like ZINC15 can be less representative of broader chemical space.
Results and Discussion
FARM demonstrated state-of-the-art (SOTA) performance on 11 out of 13 MoleculeNet tasks, outperforming models like UniMol, GEM, and GROVER. Notable results include a ROC-AUC of 93.3% on the Blood-Brain Barrier Penetration (BBBP) task and record accuracy in solubility (ESOL) and free energy (FreeSolv) predictions.
Ablation studies confirmed that functional group awareness is the primary driver of success. Furthermore, the model exhibits "chemical logic" in its embedding space. Similar to word analogies in NLP (e.g., "King - Man + Woman = Queen"), FARM’s embedding space can handle chemical analogies. Swapping a hydroxyl group for a carboxyl group produces parallel shifts in the embedding space across different molecules, proving the model captures fundamental chemical logic.
Conclusion
FARM represents a significant step toward "chemically literate" AI. By incorporating functional group context, the model learns more nuanced and transferable representations. While currently limited to 2D structures, future work aims to integrate 3D stereochemistry to better capture the spatial configurations essential for protein-ligand interactions. The ultimate goal is to create a pre-trained atom embedding that is as versatile and nuanced for chemistry as word embeddings are for modern NLP.
Summary updated