Abstract
Most current molecule-text models rely on global alignment, treating a molecule and its description as single, monolithic entities. This approach often fails to capture fine-grained details, such as the relationship between a specific functional group and the phrase describing it. We present Atomas, a hierarchical cross-modal framework that aligns molecular structures (SMILES) with textual descriptions across three semantic levels: atoms, fragments, and whole molecules. By automatically discovering fine-grained correspondences without explicit labels, Atomas achieves state-of-the-art performance in both molecular understanding (retrieval and property prediction) and generation (captioning and de novo design).
Introduction
The integration of chemical informatics and natural language processing has led to significant advances in molecular understanding. However, the prevailing reliance on global alignment leads to two major issues: sensitivity and data scarcity. Models often struggle to distinguish between subtle structural differences, such as enantiomers (e.g., D-glutamate vs. L-glutamate), and creating datasets with manual annotations of every fragment-to-phrase correspondence is prohibitively expensive. Atomas aims to bridge this gap by automatically learning these local correspondences in an end-to-end, unsupervised manner, allowing for more robust and granular molecular representations.
Methods
The core of Atomas is the Hierarchical Adaptive Alignment (HAA) model, which operates alongside a unified encoder and a conditional decoder.
Key components of the architecture include:
- Unified Encoder: Instead of separate encoders for text and SMILES, Atomas uses a single transformer-based encoder (initialized from MolT5), treating SMILES as a specialized chemical language. This unified approach is particularly advantageous in data-scarce scenarios.
- Adaptive Polymerization Module (APM): This module uses a density peak-based clustering algorithm (DPC-KNN) to group low-level tokens (atoms or words) into higher-level "fragments" (functional groups or phrases).
- Weighted Alignment Module (WAM): This module calculates the similarity between these learned fragments across modalities in a set-wise manner.
- Three-Level Alignment: The process iterates through three stages: aligning individual atoms to words, functional groups to phrases, and finally the entire SMILES string to the full paragraph.
By jointly optimizing global alignment, hierarchical alignment, and language modeling losses, the model learns a representation that is both structurally grounded and semantically rich.
Results and Discussion
Atomas was evaluated across 12 different tasks using gold-standard datasets such as PCdes for retrieval, ChEBI-20 for generation and captioning, and MoleculeNet for property prediction.
Retrieval Performance
On the PCdes dataset, Atomas-large achieved a Text-to-Molecule R@1 of 49.08, a significant jump over the previous state-of-the-art model, MolCA (35.09). This performance highlights the model's superior ability to map textual descriptions to precise molecular structures.
Generation and Captioning
In de novo molecule generation, Atomas-large reached a BLEU score of 0.874 and an Exact Match rate of 0.387, outperforming even much larger models like MolReGPT (based on GPT-4). For molecule captioning, Atomas-base (271M parameters) outperformed MolT5-large (783M parameters) while using only 35% of the parameters, demonstrating the efficiency of the hierarchical approach.
Key Insights
- Alignment Before Generation: Performing cross-modal alignment before feeding representations into a decoder significantly improves the quality of generated molecules and captions.
- Emergent Chemical Knowledge: Without explicit supervision, the APM's clustering naturally groups atoms that form recognized chemical functional groups, as validated by human experts.
- Solving the Enantiomer Problem: By analyzing fine-grained fragments, Atomas can distinguish between stereoisomers that global-only models often confuse.
Conclusion
Atomas introduces a powerful hierarchical alignment strategy that significantly improves the granularity and accuracy of molecule-text models. While the model shows robust generalization, future work could involve extending this approach to 3D molecular structures or integrating biological knowledge graphs more deeply into the alignment process. Scaling to even larger datasets and model sizes remains a standard frontier for future exploration.
Summary updated