In drug discovery, predicting molecular properties such as toxicity, solubility, and metabolism is a critical challenge. While deep learning has advanced significantly using atom-level graphs, these models often struggle to capture the "meaning" of a molecule, which is primarily determined by functional groups (fragments). Atom-level models often miss these higher-level chemical patterns, requiring them to re-learn fundamental chemical concepts for every new task.
FragFormer addresses these limitations by introducing a fragment-based representation learning framework. It treats molecules as assemblies of overlapping functional groups rather than just collections of individual atoms, preserving both chemical priors and topological connectivity.
Methods
The FragFormer framework integrates a novel fragmentation strategy with a hierarchical pre-training objective and a specialized Transformer architecture.
1. DOVE (k-Degree Overlapping Fragmentation)
Traditional fragment-based methods often partition molecules into non-overlapping pieces, which is chemically unrealistic and destroys the topological "connective tissue" between groups. FragFormer introduces DOVE, which utilizes iterative line graph transformations. By applying a "k-order line graph" transformation, the model generates fragments that naturally overlap. This ensures that atoms can belong to multiple functional groups simultaneously, maintaining a map of how these groups are physically linked.
2. Nested Masked Fragment Prediction (MFP)
During pre-training on 2 million unlabeled molecules from the ChEMBL29 database, FragFormer employs a Nested MFP objective. Unlike standard models that predict a single identity for a masked node, FragFormer recognizes the hierarchical nature of chemistry (e.g., a large fragment containing smaller ones). The model is tasked with predicting the existence of all substructures within a masked fragment, forcing it to learn internal chemical hierarchies.
3. Architecture
The FragFormer architecture consists of three main components:
- Subgraph Encoder: A Graph Isomorphism Network (GIN) used to embed individual fragments.
- Knowledge Fusion: A GRU-based layer that integrates traditional chemical descriptors (like ECFP fingerprints) directly into fragment representations.
- Fragment-level Transformer: A specialized Transformer utilizing path and distance attention to model interactions between fragments across the entire molecule.
Key Insights and Results
FragFormer was evaluated against several benchmarks, including PharmaBench (11 ADMET tasks), the Peptides-func long-range biological benchmark, and MoleculeNet.
- State-of-the-Art Performance: FragFormer achieved SOTA results on 8 out of 11 tasks in PharmaBench, outperforming both atom-level and previous fragment-based models.
- Long-Range Modeling: By operating on a "graph of fragments" rather than atoms, the model handles large molecules like peptides more effectively, improving Test AP by over 1% on the Peptides-func benchmark compared to the best baseline.
- Efficient Interpretability: The authors introduced FragCAM (Fragment-level Class Activation Mapping). FragCAM is significantly more accurate at identifying toxic alerts and is orders of magnitude faster than existing methods like SubgraphX (0.024s vs. 11-52s per sample).
Conclusion
FragFormer demonstrates that overlapping fragments are essential for maintaining molecular topology in representation learning. By modeling the hierarchy of chemical groups, the framework achieves superior performance and interpretability. Future work will explore incorporating 3D geometry and more explicit ways to encode the physical connectivity between fragments to further enhance predictive accuracy.
Summary updated