3D-MoLM:

Towards 3D Molecule-Text Interpretation in Language Models

Sihang Li1*, Zhiyuan Liu2*, Yanchen Luo1, Xiang Wang1†, Xiangnan He1†, Kenji Kawaguchi2, Tat-Seng Chua2, Qi Tian3
1: University of Science and Technology of China, 2: National University of Singapore, 3: Huawei Cloud
*Equal Contribution Correspondence

Abstract

Language Models (LMs) have greatly influenced diverse domains. However, their inherent limitation in comprehending 3D molecular structures has considerably constrained their potential in the biomolecular domain. To bridge this gap, we focus on 3D molecule-text interpretation, and propose 3D-MoLM: 3D-Molecular Language Modeling. Specifically, 3D-MoLM enables an LM to interpret and analyze 3D molecules by equipping the LM with a 3D molecular encoder. This integration is achieved by a 3D molecule-text projector, bridging the 3D molecular encoder's representation space and the LM's input space. Moreover, to enhance 3D-MoLM's ability of cross-modal molecular understanding and instruction following, we meticulously curated a 3D molecule-centric instruction tuning dataset -- 3D-MoIT. Through 3D molecule-text alignment and 3D molecule-centric instruction tuning, 3D-MoLM establishes an integration of 3D molecular encoder and LM. It significantly surpasses existing baselines on downstream tasks, including molecule-text retrieval, molecule captioning, and more challenging open-text molecular QA tasks, especially focusing on 3D-dependent properties.


Framework


Teaser

  • 3D-MoLM is a versatile molecular LM that can be applied for molecule-text retrieval, molecule captioning, and molecule question-answering tasks.
  • 3D-MoLM employs a 3D molecule-text projector to bridge the modality gap between a 3D molecular encoder and an LM, enabling the LM to perceive 3D molecular structures.



Training Pipeline


Teaser

To tackle the two challenges of 3D molecule-text alignment and 3D molecule-centric instruction tuning, we delineate a three-stage training pipeline for 3D-MoLM, including 1) 3D molecule-text representation learning, 2) 3D molecule-text alignment via text generation, and 3) instruction-based fine-tuning.

3D Molecule-Text Alignment
3D Molecule-Text Alignment maps 3D molecular representations into the input textual space where the LM can understand.

  • Data Preparation – PubChem. We collect molecular SMILES-text pairs from PubChem, and further employ GPT-3.5 to enrich the less annotated molecular descriptions. Molecular 3D conformations are obtained by running the MMFF algorithm in RDKit. As a result, 316K 3D molecule-text pairs are obtained for the alignment pretraining and downstream tasks of molecule-text retrieval and molecule captioning.
  • Stage 1: 3D Molecule-Text Representation Learning cultivates Q-Former’s ability to extract molecular features that resonate profoundly with the corresponding text.
  • Stage 2: 3D Molecule-Text Alignment via Generative Learning connect the Q-Former with the LM to leverage the LM’s language generation capability, where the molecular representations extracted by the Q-Former serve as 1D soft prompts comprehensible to the LM.

3D Molecule-centric Instruction Tuning
3D Molecule-centric Instruction Tuning fine-tunes the model to follow human instructions on 3D molecule relevant tasks.

  • Data Preparation – 3D-MoIT. We construct 3D-MoIT by sourcing data from the PubChem and PubChemQC databases, including both computed molecular properties and descriptive texts that characterize molecule properties in numerical values and free texts, respectively.
  • Stage 3: Instruction-based Fine-tuning enhances the ability to follow various instructions and improves the understanding of 3D molecular structures, especially in recognizing 3D-dependent properties

Demonstrations



• Example-1: Molecule Captioning

avatar-user
mol1

Describe the input molecule.

avatar-bot

Globostellatic acid B is a tricyclic triterpenoid with formula C34H48O6, originally isolated from Globostellata. It has a role as a metabolite. It is a tricyclic triterpenoid, a monocarboxylic acid and an acetate ester. Globostellatic acid B is a natural product found in Globostellata with data available.

• Example-2: Open-text QA

avatar-user
mol2

What are the physical properties of beryllium acetate?

avatar-bot

On the physical properties of beryllium acetate, it is a white crystalline solid that is soluble in water. It has a relatively high melting point and boiling point due to the strong intermolecular forces between the beryllium and acetate.

• Example-3: Computed Property QA

avatar-user
mol2

Could you give me the HOMO-LUMO Gap value of this molecule? If uncertain, provide an estimate. Respond with the numerical value only.

avatar-bot

The HOMO-LUMO Gap for the input molecule is 5.762 eV.

Related Links

This work partially draws inspiration from the BLIP family, MolT5, and KV-PLM. This website is inspired by NExT-GPT.