KGCL: Knowledge-Enhanced Graph Contrastive Learning for Retrosynthesis Prediction Based on Molecular Graph Editing

Fengqin Yang, Dekui Zhao, Haoxuan Qiu, Yifei Li, Zhiguo FuIJCAI 2025 · DOI

TL;DR

This paper introduces KGCL, a novel method for retrosynthesis prediction that enhances molecular graph representations by integrating chemical knowledge from knowledge graphs and employing a graph contrastive learning strategy. KGCL achieves state-of-the-art performance on benchmark datasets, demonstrating its effectiveness in accurately predicting chemical reaction pathways.

What Problem Does This Paper Address?

Retrosynthesis, the process of predicting reactants for a given target molecule, is crucial for drug discovery and chemical synthesis. While molecular graph editing methods have shown promise due to their interpretability, they often overlook the rich chemical knowledge embedded in functional groups. Existing approaches treat atoms independently, limiting their ability to capture the nuanced chemical properties that drive reactions. This paper aims to bridge this gap by explicitly incorporating functional group information and leveraging contrastive learning to improve molecular representations for more accurate and interpretable retrosynthesis prediction.

Methods

The KGCL model introduces two main innovations:

  • Knowledge-based Molecular Graph Enhancement: This module integrates functional group embeddings, retrieved from a chemical knowledge graph, into the atomic embeddings of the product molecule. An attention mechanism is used to weigh the importance of different functional groups for each atom, creating a more informed molecular representation.
  • Molecular Graph Contrastive Learning Based on Edit Sequences: To improve the molecular graph encoder, KGCL employs a contrastive learning strategy. Instead of random augmentations, it uses predicted graph edit sequences (atom modifications, bond deletions/additions) to generate semantically similar positive samples and dissimilar negative samples. This approach ensures that the augmented samples preserve the crucial semantic information of molecular graphs, leading to more robust representations.

The model then uses a directed message passing neural network (D-MPNN) as its molecular graph encoder. The predicted edit sequences are generated autoregressively using MLPs, and the overall loss function combines an edit prediction loss with a contrastive learning loss.

Datasets

The paper uses two public benchmark datasets for evaluation:

  • USPTO-50K: A high-quality dataset of 50,016 reactions with atom mapping.
  • USPTO-FULL: A larger and more diverse dataset containing 1,000,000 unfiltered chemical reactions.

The authors mention that for fair comparisons, they used the same data preprocessing and splitting schemes as previous works.

Key Insights and Ideas

  • Functional groups are critical: Explicitly incorporating knowledge about functional groups significantly improves retrosynthesis prediction accuracy, highlighting their importance beyond individual atom properties.
  • Graph edits as smart augmentations: Using predicted graph edits for contrastive learning is more effective than random perturbations because it preserves semantic information and generates chemically relevant positive and negative samples.
  • Synergy of knowledge and contrastive learning: Combining knowledge-based enhancement with contrastive learning yields superior results compared to using either technique independently, demonstrating their complementary strengths.
  • Interpretability through attention: The attention mechanism used to integrate functional group knowledge provides a degree of interpretability by showing which functional groups are most influential for specific atoms.

Key Results

  • State-of-the-art performance: KGCL achieves state-of-the-art performance among semi-template-based methods on both USPTO-50K and USPTO-FULL datasets.
  • Significant improvements: On USPTO-50K, KGCL surpasses the strong baseline Graph2Edits by 1.6% in top-1 accuracy and 3.2% in top-1 round-trip accuracy.
  • Robustness: The model demonstrates strong performance even on the noisy USPTO-FULL dataset, indicating its robustness.
  • Ablation study confirms contributions: Ablation studies show that both the functional group knowledge and the contrastive learning strategy are crucial for KGCL's success, with their combined effect being greater than the sum of their individual contributions.

Limitations and Future Work

  • Limitations: The paper acknowledges that the current model focuses on functional groups present in the target molecule to reduce noise. It also mentions that the USPTO-FULL dataset contains noise, which might affect performance.
  • Future Work: The authors suggest further improving prediction accuracy by incorporating more domain knowledge, such as electronic effects and steric effects, into the retrosynthesis prediction model. They also plan to explore more sophisticated contrastive learning strategies and graph editing operations.

Summary updated

BibTeX
@inproceedings{yang2025kgcl,
  author = {Fengqin Yang and Dekui Zhao and Haoxuan Qiu and Yifei Li and Zhiguo Fu},
  title = {{KGCL: Knowledge-Enhanced Graph Contrastive Learning for Retrosynthesis Prediction Based on Molecular Graph Editing}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.24963/ijcai.2025/1048},
}
Figure