Molecular Graph Representation Learning Integrating Large Language Models with Domain-specific Small Models

Tianyu Zhang, Yuxiang Ren, Chengbin Hou, Hairong Lv, Xuegong Zhang

TL;DR

This paper introduces MolGraph-LarDo, a novel framework for molecular representation learning that bridges the gap between general-purpose Large Language Models (LLMs) and specialized Domain-Specific Models (DSMs). By employing a two-stage prompting strategy and multi-modal graph-text alignment, MolGraph-LarDo significantly improves molecular property prediction accuracy while reducing the reliance on costly expert knowledge.

What Problem Does This Paper Address?

Predicting molecular properties is a cornerstone of drug discovery, enabling tasks like identifying potential drug candidates and optimizing molecular structures. Deep learning, particularly Graph Neural Networks (GNNs), has shown great promise in this area. However, achieving high performance often requires incorporating domain-specific knowledge, which is typically gathered through time-consuming and expensive manual efforts by biochemical experts. While LLMs can efficiently access and generate general knowledge, they often struggle with precision and can "hallucinate" domain-specific information. Conversely, DSMs (like RDKit) are accurate for specific calculations but lack the broad knowledge needed for comprehensive representation learning. This paper addresses the challenge of effectively integrating the broad knowledge of LLMs with the precise, domain-specific knowledge of DSMs to create more accurate and efficient molecular representations without the heavy burden of expert curation.

Methods

The core of MolGraph-LarDo lies in its two-stage prompt strategy and molecular graph-text alignment.

  1. Two-Stage Prompt Strategy:
    • Stage 1: Dataset-Specific Prompt for MD-Template Generation: This stage uses a prompt that includes dataset-specific information (e.g., dataset name, description, task type) to guide an LLM in generating a "Molecular Description Template" (MD-Template). This template outlines relevant molecular properties for the given task and dataset. This process is akin to Retrieval Augmented Generation (RAG) to mitigate LLM hallucinations.
  2. Stage 2: Sample-Specific Prompt for MD-Text Generation: The MD-Template from Stage 1, along with actual molecular data (SMILES, and crucially, domain-specific metrics calculated by a DSM), is fed into a second prompt. This prompt instructs the LLM to generate a "Molecular Description Text" (MD-Text) that provides precise, calibrated information about the molecule's properties. The DSM (e.g., RDKit) is used here to calibrate the LLM's output, ensuring accuracy for metrics like molecular weight or LogP.
  3. Molecular Graph-Text Alignment: This stage leverages the generated MD-Texts and the molecular graphs themselves. Inspired by models like CLIP, it uses a graph encoder (e.g., GIN) to generate graph embeddings and a text encoder (e.g., Sentence-BERT) to generate text embeddings. A contrastive learning approach is then used to maximize the agreement between the graph and text embeddings of the same molecule, effectively injecting the rich, domain-specific knowledge from the MD-Texts into the molecular graph representations. This alignment guides the pre-training of molecular representations.

Datasets

The paper evaluates MolGraph-LarDo on seven benchmark datasets from MoleculeNet [26]:

  • Classification Datasets: BBBP, BACE, SIDER
  • Regression Datasets: FreeSolv, ESOL, Lipo, QM7

These datasets cover various molecular property prediction tasks, including binary classification and regression.

Key Insights and Ideas

  • Bridging the LLM-DSM Gap: The paper elegantly demonstrates how to combine the broad knowledge of LLMs with the precise, calculable knowledge of DSMs. This is crucial because LLMs alone can be inaccurate for domain-specific tasks, while DSMs are too narrow.
  • Two-Stage Prompting for Precision: The two-stage prompting strategy is key. Stage 1 ensures relevance to the task/dataset, and Stage 2, with DSM calibration, ensures accuracy of the generated molecular descriptions.
  • MD-Text as Data Augmentation: The generated MD-Texts act as a form of data augmentation, providing rich textual context that complements the molecular graph structure.
  • Graph-Text Alignment for Knowledge Injection: Aligning graph and text embeddings is a powerful way to transfer knowledge from textual descriptions (derived from LLMs and DSMs) into the molecular graph representations, enhancing their expressiveness.
  • Reducing Expert Dependency: The framework significantly reduces the need for manual expert curation of domain knowledge, making the process more scalable and cost-effective.

Key Results

  • Superior Performance: MolGraph-LarDo consistently outperforms several baseline methods, including classic GNNs and other pre-training approaches, across all seven tested datasets. For example, on the BBBP classification task, it achieves an ROC-AUC of 0.7317±0.0152, outperforming baselines like GIN (0.7204±0.0096) and MolCLR-GIN (0.7154±0.0092).
  • Effectiveness of Components: Ablation studies confirm the effectiveness of both the two-stage prompt strategy and the DSM calibration. Removing either component leads to a noticeable drop in performance.
  • Accurate MD-Text Generation: Case studies show that MolGraph-LarDo, with both TPS and DSM, generates more accurate and relevant molecular descriptions compared to versions using only LLMs or LLMs with dataset-specific prompts but without DSM calibration. For instance, it correctly calibrates a molecular weight from an incorrect 152.15 g/mol to the accurate 108.1 g/mol.
  • Graph-Text Alignment Benefits: Experiments show that the graph-text alignment mechanism consistently improves performance across various tasks.

Limitations and Future Work

  • LLM Hallucinations: While the framework aims to mitigate hallucinations, the paper acknowledges that LLMs can still occasionally produce inaccurate domain-specific information, which is why DSM calibration is critical.
  • Computational Cost: While reducing expert labor, the pre-training process still involves LLM inference and graph-text alignment, which can be computationally intensive.
  • Future Work: The authors suggest that this approach could benefit other LLM-related applications in broader research areas, implying potential for generalization beyond molecular tasks. Further exploration of different LLM and DSM combinations, as well as more sophisticated alignment strategies, could be future directions.

Summary updated

BibTeX
@inproceedings{zhang2024molecular,
  author = {Tianyu Zhang and Yuxiang Ren and Chengbin Hou and Hairong Lv and Xuegong Zhang},
  title = {{Molecular Graph Representation Learning Integrating Large Language Models with Domain-specific Small Models}},
  booktitle = {BIBM},
  year = {2024},
  url = {https://openreview.net/forum?id=njO87t1zzy},
}
Figure