Exploring Optimal Transport-Based Multi-Grained Alignments for Text-Molecule Retrieval

Zijun Min, Bingshuai Liu, Liang Zhang, Jia Song, Jinsong Su, Song He, Xiaochen Bo

Introduction

In the fields of drug discovery and bioinformatics, the ability to efficiently bridge natural language and chemical structures is paramount. Researchers frequently encounter the text-molecule retrieval task, where they must identify specific molecules based on descriptive textual queries (e.g., "an oxygen hydride consisting of an oxygen atom covalently bonded to two hydrogens").

Overview of the bidirectional text-molecule retrieval task.

The primary challenge lies in the hierarchical nature of molecules. While molecules are composed of atoms, they are often described by humans in terms of functional groups or motifs (e.g., "imidazole ring"). Most existing retrieval models operate either at a global level (entire sentence vs. entire molecule) or a fine-grained atomic level, neglecting the crucial "middle ground" of motifs. This semantic gap often limits the accuracy of cross-modal retrieval.

The ORMA Framework

To address these limitations, the authors propose ORMA (Optimal TRansport-based Multi-grained Alignments). ORMA utilizes a multi-grained approach to align text and molecular representations across three distinct scales.

The ORMA framework architecture, featuring hierarchical encoding and triple-scale contrastive learning.

Hierarchical Encoding

ORMA processes both modalities through specialized encoders:

  • Text Encoding: A SciBERT model generates both token-level and global sentence-level representations.
  • Molecular Encoding: Molecules are represented as hierarchical heterogeneous graphs. These graphs include nodes for individual atoms, motifs (extracted using the BRICS algorithm), and the global molecule. A Graph Convolutional Network (GCN) is then used to process this structure.

Optimal Transport (OT) Alignment

The core innovation of ORMA is the use of Optimal Transport to align text tokens with molecular motifs. By framing the matching process as an OT problem, the model finds the most efficient mapping between the distribution of words in a description and the distribution of motifs in a molecule. The Inexact Proximal Point Method (IPOT) is employed to solve this efficiently, enabling the learning of "multi-token" representations that map directly to specific chemical functional groups.

Triple-Scale Contrastive Learning

The model is trained using three simultaneous alignment losses:

  1. Token-Atom ($L_{ta}$): Matches fine-grained words to specific atoms.
  2. Multitoken-Motif ($L_{mm}$): Matches groups of words to functional chemical groups via OT.
  3. Sentence-Molecule ($L_{sm}$): Matches the overall description to the entire molecular structure.

Experimental Results

ORMA was evaluated on two major benchmarks, demonstrating significant performance gains over previous state-of-the-art (SOTA) methods.

  • ChEBI-20: On this gold-standard dataset of 33,010 molecule-description pairs, ORMA achieved a Hits@1 of 66.5% for text-to-molecule retrieval, representing a 17.1% absolute improvement over the previous best model (AMAN). For molecule-to-text retrieval, it achieved 61.6% Hits@1, a 15.0% lead.
  • PCdes: In tests on the PubChem-based PCdes dataset, ORMA outperformed larger pretrained models like MolCA and Atomas in both zero-shot and fine-tuning scenarios. For instance, it reached 64.8% R@1 in text-to-molecule retrieval, compared to the previous best of 49.1%.

Key Insights

  • Motifs as Semantic Anchors: Motifs represent the natural level at which chemical structures are described. Explicitly modeling them bridges the "vocabulary" gap between chemistry and natural language.
  • OT vs. Attention: Unlike standard attention mechanisms, Optimal Transport provides a mathematically principled way to ensure that every part of a textual description is accounted for within the molecular structure through many-to-many mappings.
  • Multi-Scale Synergy: Ablation studies confirm that the combination of atom, motif, and global alignments is essential; removing any single level degrades retrieval performance.

Limitations and Future Work

While ORMA sets a new benchmark, several avenues for future research remain. The current model is limited to 2D graphs and text; extending it to 3D molecular conformations and other biological modalities (e.g., protein structures, cellular images) is a logical next step. Additionally, while the IPOT method is efficient, the computational overhead of hierarchical graph construction and OT alignment is higher than that of simpler global-only models. Future work may also involve adapting motif-extraction rules for more complex biological entities.

Summary updated

BibTeX
@inproceedings{min2024exploring,
  author = {Zijun Min and Bingshuai Liu and Liang Zhang and Jia Song and Jinsong Su and Song He and Xiaochen Bo},
  title = {{Exploring Optimal Transport-Based Multi-Grained Alignments for Text-Molecule Retrieval}},
  booktitle = {BIBM},
  year = {2024},
  url = {https://openreview.net/forum?id=NAuCkbHVip},
}
Figure