Source-linked AI summary

Retrosynthesis Prediction with Conditional Graph Logic Network

Hanjun Dai, Chengtao Li, Connor W. Coley, Bo Dai, Le Song

arXiv:2001.01408v1cs.LGstat.ML

TL;DR

Retrosynthesis asks which reactants can synthesize a specified product, a difficult task because template matching alone does not determine chemical feasibility. The paper introduces Conditional Graph Logic Network with efficient hierarchical sampling, achieving an 8.1% top-1 accuracy improvement over the second-best method when the reaction class is unknown.

  • Problem

    Retrosynthesis must identify reactants for a target product, while existing template rules do not by themselves determine whether a reaction can proceed.

  • Method

    Conditional Graph Logic Network combines probabilistic graphical modeling, chemical template rules, neural graph embeddings, and restricted importance sampling for retrosynthesis prediction.

  • Results

    8.1% higher top-1 accuracy than the second-best method is reported with unknown reaction class, and 8.9% higher accuracy when reaction class is given.

  • Takeaways & Limitations

    The model combines template-based interpretability with neural representations and provides interpretations for predictions while improving benchmark retrosynthesis accuracy.

  • Takeaways & Limitations

    Template specificity remains difficult to decide beforehand, and preprocessing scalability is limited by reliance on subgraph isomorphism.

Abstract

from arXiv · show

Retrosynthesis is one of the fundamental problems in organic chemistry. The task is to identify reactants that can be used to synthesize a specified product molecule. Recently, computer-aided retrosynthesis is finding renewed interest from both chemistry and computer science communities. Most existing approaches rely on template-based models that define subgraph matching rules, but whether or not a chemical reaction can proceed is not defined by hard decision rules. In this work, we propose a new approach to this task using the Conditional Graph Logic Network, a conditional graphical model built upon graph neural networks that learns when rules from reaction templates should be applied, implicitly considering whether the resulting reaction would be both chemically feasible and strategic. We also propose an efficient hierarchical sampling to alleviate the computation cost. While achieving a significant improvement of $8.1\%$ over current state-of-the-art methods on the benchmark dataset, our model also offers interpretations for the prediction.

1 Introduction

Retrosynthesis identifies reactants or reaction sequences for a target product, but its large search space and incomplete or rigid rule systems make the task difficult. The paper proposes GLN to combine template interpretability with neural scalability and reports improved benchmark accuracy.

  • Problem: Retrosynthesis works backward from a target product to identify reactants or reaction sequences that can synthesize it.The task is framed as an abductive reverse problem because the target reactants contain a superset of the product atoms.
  • Problem: The vast number of theoretically possible transformations makes retrosynthesis difficult and dependent on experienced chemists’ skill and creativity.
  • Prior approaches: Rule-based systems offer interpretable chemical transformations but suffer from computational cost, incomplete rule coverage, or reliance on expert-defined rules.
  • Contribution: GLN combines neural embeddings with probabilistic models and chemical rules to learn when retrosynthesis templates should apply while retaining interpretability.
  • Results: 8.1% improvement in top-one accuracy over existing state-of-the-art methods is reported on benchmark datasets.
  • Implication: Improved single-step retrosynthesis may transfer to multi-step retrosynthesis because single-step prediction is used as a subroutine.

2 Background

The paper formalizes single-outcome reactions as transformations from reactant molecules to an outcome molecule and defines retrosynthesis templates as subgraph rewriting rules. One-step retrosynthesis then seeks a reactant set whose structures match the template’s reactant patterns.

  • Reaction representation: A chemical reaction is modeled as a transformation from N reactant molecules to a single outcome molecule O.Multi-outcome reactions can be split into multiple single-outcome reactions in this formulation.
  • Reaction representation: Reaction centers are the atoms changed during a reaction, such as atoms involved in added or deleted bonds.
  • Templates: A retrosynthesis template T is represented as a subgraph pattern rewriting rule from an outcome pattern to reactant patterns.The outcome pattern generally represents the extracted reaction center, while reactant patterns may include neighboring structures.
  • Notation: The notation distinguishes lowercase subgraph patterns, uppercase molecule graphs, and calligraphic sets of molecules, templates, and involved subgraph patterns.
  • Task definition: Given a target molecule O, one-step retrosynthesis seeks a set of reactant molecules R in the power set of all molecules M that can synthesize O.

3 Conditional Graph Logic Network

Conditional Graph Logic Network models retrosynthesis as structured prediction constrained by template and reactant subgraph matching. It assigns learned confidence scores to chemically matched possibilities and uses restricted hierarchical sampling to make inference tractable.

  • Logic constraints: GLN decomposes template application into matching an outcome subgraph to product O and matching reactant subgraphs to a reactant set R.
  • Logic constraints: Reactant matching requires the reactant-set size to equal the template’s number of reactant patterns and permits a permutation aligning each reactant with a pattern.
  • Probabilistic model: Template and reactant score functions model uncertainty that remains even when chemical templates match.The model defines p(T|O) using w1(T,O) and p(R|T,O) using w2(R,T,O), together with matching predicates.
  • Probabilistic model: The joint proposal probability combines learned scores with logic predicates and is nonzero only when the template and reactant matching conditions are satisfied.This restriction creates sparse structures that make abductive reasoning feasible.
  • Extensions: GLN can condition predictions on a specified reaction type by restricting templates to the corresponding subset.
  • Relation to prior models: GLN differs from MLN because its predicates are implemented through subgraph matching while its task is structured prediction.

4 Model Design

The model decomposes retrosynthetic template selection into graph-structured scoring functions and uses graph neural networks to parameterize molecular and subgraph representations. This design preserves template interpretability while enabling efficient hierarchical sampling.

  • Decomposable template model: The model decomposes p(T|O) by first selecting a reaction center and then selecting reactant subgraph patterns.This reduces computation because valid reaction centers and templates per center are much fewer than the full template set.
  • Decomposable template model: The decomposition provides graph-structured parameterization and interpretable prediction components.The design follows the structure of reaction templates and supports interpretation of the model's choices.
  • Graph neuralization: Graph neural networks parameterize energy functions whose inputs are molecule graphs, reaction-center subgraphs, and reactant-subgraph sets.The scoring functions use neural graph embeddings to represent compatibility among these objects.
  • Graph neuralization: Molecular graph embeddings are computed through iterative message passing over node features and averaged node representations.The framework uses structure2vec for message passing, while allowing other nonlinear and order-invariant aggregation choices.
  • Graph neuralization: The framework is compatible with alternative parameterizations, including condensed reaction graphs and chemistry-specialized graph neural networks.The paper points to an ablation study for these design choices.

5 MLE with Efficient Inference

Maximum-likelihood training uses stochastic gradient estimates, while logic-induced sparse support enables importance sampling instead of MCMC over the full reactant-subset space. Hierarchical sampling and beam search further reduce training and inference costs.

  • Maximum-likelihood training: The model is trained by maximum-likelihood estimation over observed outcome molecules, templates, and reactant sets.The parameters of the two energy functions are learned jointly through the likelihood objective.
  • Efficient inference: Importance sampling restricts gradient estimation to templates and reactants that match the product under the logic rules.The resulting gradient approximation is described as unbiased, avoiding MCMC over the full combinatorial space.
  • Efficient inference: The sampling algorithm constructs matched templates, samples templates hierarchically, constructs matched reactants, and samples reactants from the restricted support.This procedure follows the staged algorithm given for stochastic gradient approximation.
  • Efficient inference: In a dataset with 5 × 10^4 reactions, |TO| is about 80 and |RT,O| is roughly 10 on average.These support sizes reduce the actual computational cost to a manageable constant before further sampling accelerations.
  • Efficient inference: Beam search retains the top k reaction-center/template candidates before selecting the highest-scoring reactant set.It exploits sparse support by ranking candidate templates and then searching their corresponding reactant sets.

6 Experiment

Experiments evaluate GLN on USPTO-50k and USPTO-full using top-k exact-match accuracy, showing consistent gains over baselines and interpretable prediction behavior. Analyses also examine scalability, failure cases, reaction-center visualizations, and the rule-based upper bound.

  • Datasets and evaluation: GLN is evaluated on USPTO-50k, a 50k-reaction benchmark spanning 10 reaction types, with the standard 80%/10%/10% splits.
  • Datasets and evaluation: Top-k exact-match accuracy compares predicted and ground-truth reactant sets through canonical SMILES generated by RDKit.
  • Datasets and evaluation: 11,647 unique templates cover 93.3% of the USPTO-50k test set, defining the theoretical upper bound for this rule-based implementation.
  • Main results: 8.1% higher top-1 accuracy with unknown reaction class and 8.9% higher with reaction class given are reported over the second-best method.
  • Main results: GLN outperforms baseline algorithms in all evaluated settings, including comparisons with expertSys and sequence-to-sequence models.
  • Large-scale experiments: Top-50 accuracy approaches the 93.3% rule-based upper bound, while full USPTO experiments show GLN outperforming the two best baselines in top-k accuracy despite greater dataset noisiness.
  • Interpretation and failure analysis: Successful predictions recover reaction cores similar to ground truth, whereas a failed top-three case produces reactants with similar molecule-fingerprint similarity.
  • Interpretation and failure analysis: Reaction-center visualizations use atom–subgraph embedding inner products, with positive scores shown in red and negative scores in blue.

7 Discussion

The discussion identifies benchmark and template-design limitations while contrasting GLN with Markov logic networks and outlining computational improvements.

  • Retrosynthesis evaluation is imperfect because a product can have multiple reasonable single-step syntheses.
  • Template specificity remains difficult to decide beforehand, and preprocessing scalability is limited by subgraph isomorphism.
  • Future work could replace preprocessing subgraph isomorphism with prediction and reduce inference cost through fast inner-product search.
  • GLN explicitly infers templates jointly with reactions, making template predictions more straightforward to interpret than in MLN.
  • Hierarchical sampling avoids the combinatorial-space MCMC generally required by MLN, accelerating model learning.

B Details of setup

The setup describes reaction-type distributions, preprocessing cost, implementation choices, and the representation ablation study on the USPTO data.

  • Dataset information: The benchmark reaction dataset is highly unbalanced across 10 reaction types.
  • Implementation details: Subgraph-isomorphism preprocessing took about 1 hour on 48 CPU cores for 50k reactions.
  • Implementation details: The model uses PyTorch with Adam, a fixed learning rate of 1e-3, and gradient clipping at 5.0.
  • Implementation details: Molecule and subgraph embeddings use size 256 with ReLU activation, while average pooling supports node-level scoring visualization.
  • Ablation study: The appendix includes an ablation study comparing different representations.

C.1 Ablation study of design choices

The ablations examine graph neural network depth, compatibility functions, reaction-category performance, and effects of conditioning on reaction class.

  • GNN representations: Most GNN variants achieve similar performance with enough message-passing steps, motivating faster ECFP-2 on the full USPTO dataset.
  • Compatibility functions: Top-1 accuracy is 52.6 for inner-product, 52.7 for MLP, and 53.5 for bilinear compatibility functions.
  • Reaction categories: GLN outperforms retrosim in most reaction classes, including both common classes 1 and 2 and rare classes 4 and 8.
  • Additional analyses: Appendix analyses also cover beam-size effects and per-category conditional performance.
  • Reaction-class conditioning: Reaction-class conditioning is evaluated separately because the dataset is imbalanced and some classes contain less than 5% of the data.
  • Reaction-class conditioning: With reaction class supplied as prior information, GLN is comparable to retrosim across classes and better than expertSys and seq2seq.

C.4 Effect of beam size

Larger beam sizes improve GLN’s top-k accuracy but increase inference time because template application through RDKit scales with the beam.

  • Top-k accuracy consistently improves as beam size increases across all top-k predictions.
  • About 10% separates top-1 accuracy with beam size 1 from beam size 3.
  • Inference time grows linearly with beam size because the number of RDKit template-application calls grows linearly.
  • Reaction-center prediction reaches 99% top-20 accuracy, making template selection the current performance bottleneck.

C.5 Generalize logic check φO(T)

The logic function φO(T) can be combined with another rule-based system, neuralsym, to reduce template-selection space and improve top-1 accuracy in both reaction-type settings.

  • Generalization: φO(T) further reduces the space of template selection when combined with neuralsym.The modified system is denoted φ-neuralsym.
  • Results: 46.9% top-1 accuracy is achieved by φ-neuralsym in the reaction-type unconditional case.
  • Results: 57.7% top-1 accuracy is achieved by φ-neuralsym in the reaction-type conditional case.
  • Results: The modified system improves over vanilla neuralsym by about 2%.
  • Examples: Examples of successful and failed predictions are provided in Figures 13 and 14.
Loading 2001.01408v1…