LLaMo: Large Language Model-based Molecular Graph Assistant

Jinyoung Park, Minseong Bae, Dohwan Ko, Hyunwoo J. Kim · DOI

TL;DR

This paper introduces LLaMo, a novel large language model (LLM) designed to understand and generate text related to molecular graphs. By integrating a graph encoder with an LLM and a unique multi-level graph projector, LLaMo achieves state-of-the-art performance on tasks like molecular description generation, property prediction, and IUPAC name prediction, bridging the gap between language and molecular data.

What Problem Does This Paper Address?

Molecular machine learning has seen significant advancements, primarily through graph neural networks (GNNs) that effectively represent molecular structures. However, these GNN-based methods often lack interpretability and struggle with multi-modal tasks involving both text and molecules. While recent works have attempted to combine LLMs with molecular graphs, they often fall short in open-ended generation tasks and haven't fully explored the potential of instruction tuning for molecular data. The scarcity of high-quality, instruction-following data for molecular graphs further hinders progress. This paper aims to address these challenges by proposing an end-to-end trained molecular graph-language model that can understand and respond to instructions related to molecules.

Methods

LLaMo is built upon a three-component architecture:

  • Molecular Graph Encoder: This component uses Graph Neural Networks (GNNs) to process the 2D molecular graph and generate node representations.
  • Multi-Level Graph Projector: This novel component is crucial for bridging the gap between the graph encoder and the LLM. It addresses the "over-smoothing" problem in GNNs by abstracting representations from multiple GNN layers and incorporating motif representations. This projector transforms the graph information into a sequence of "graph tokens" that the LLM can understand.
  • Large Language Model (LLM): A pre-trained LLM (like LLaMA-2 or Galactica) is fine-tuned to generate instruction-following responses.

The training process involves two stages:

  1. Graph-Language Alignment: The graph encoder and multi-level graph projector are trained to align molecular graph information with the LLM, using molecule-description pairs.
  2. Instruction Tuning: The LLM is fine-tuned using machine-generated multi-turn conversational data to enhance its instruction-following capabilities for molecular tasks. This stage utilizes LoRA (Low-Rank Adaptation) for efficient fine-tuning.

Datasets

  • Molecule Description Generation: PubChem database [44] (for generalist models) and PubChem324k [3], ChEBI-20 [8] (for specialist models).
  • IUPAC Name Prediction: A dataset derived from [3].
  • Property Prediction: A subset of the QM9 dataset from MoleculeNet [64].
  • Forward Reaction Prediction & Retrosynthesis: Mol-Instructions [48] dataset, derived from USPTO [74].
  • Machine-Generated Instruction-Following Data: The authors generated a novel dataset of 12K unique molecular graph-language instruction-following samples in the form of multi-turn conversations, leveraging GPT-4.

Key Insights and Ideas

  • Multi-Level Graph Projector is Key: The authors found that simply using high-level GNN representations is insufficient due to over-smoothing. Their novel multi-level projector, which aggregates information from all GNN layers and incorporates motif representations, significantly improves performance by capturing richer, multi-scale structural information.
  • Instruction Tuning for Molecules is Under-Explored: While instruction tuning has revolutionized LLMs for text and vision, its application to molecular graphs was limited. LLaMo demonstrates its effectiveness by leveraging GPT-4 generated multi-turn conversations.
  • Bridging Modalities is Crucial: LLaMo successfully integrates 1D SMILES, 2D molecular graphs, and text instructions into a unified framework, enabling a more comprehensive understanding of molecules.
  • GPT-4 as a Data Generator: The paper highlights the utility of large language models like GPT-4 for generating high-quality, instruction-following data, which is crucial for training specialized models in data-scarce domains like molecular science.

Key Results

LLaMo achieved state-of-the-art performance across various tasks:

  • Generalist Models: Outperformed strong baselines like GPT-4 (ICL) by significant margins in molecule description generation (e.g., +11.9 BLEU-4, +14.9 METEOR) and property prediction. It also surpassed Mol-Instructions by a substantial margin.
  • Specialist Models: Consistently achieved the best performance, outperforming models like MolCA by 4.1 BLEU-score and 2.4 METEOR on the PubChem324kV2 dataset for molecule captioning.
  • Ablation Studies: The multi-level graph projector (MGProj) consistently outperformed other projector types (MLP, resampler) across all tasks, demonstrating its effectiveness.

Limitations and Future Work

  • Data Leakage: The authors acknowledge the potential for implicit data leakage due to LLMs being pre-trained on extensive web corpora, which might overlap with molecular benchmark datasets.
  • Computational Cost & Hallucination: LLaMo, being built on LLMs, inherits their high memory and computational requirements, as well as the potential for hallucination (generating incorrect but plausible text).
  • Future Work: The paper suggests further exploration of instruction tuning for molecular graphs and the development of more efficient and interpretable molecular graph-language models. The success of the multi-level graph projector also opens avenues for its application in other multi-modal domains.

Summary updated

BibTeX
@inproceedings{park2024llamo,
  author = {Jinyoung Park and Minseong Bae and Dohwan Ko and Hyunwoo J. Kim},
  title = {{LLaMo: Large Language Model-based Molecular Graph Assistant}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=WKTNdU155n},
}
Figure