Source-linked AI summary

Retrosynthetic reaction prediction using neural sequence-to-sequence models

Bowen Liu, Bharath Ramsundar, Prasad Kawthekar, Jade Shi, Joseph Gomes, Quang Luu Nguyen, Stephen Ho, Jack Sloane, Paul Wender, Vijay Pande

arXiv:1706.01643v1cs.LGq-bio.QMstat.ML

TL;DR

Retrosynthetic reaction prediction must choose among many possible disconnections and reactant sets for a target molecule. The paper treats this as an end-to-end sequence-to-sequence problem and evaluates a neural model against a rule-based baseline. The model performs comparably overall while avoiding several rule-system dependencies, although performance remains weaker for some reaction classes and error types.

  • Problem

    Retrosynthetic prediction is challenging because target molecules permit many possible disconnections and starting-material sets.

  • Method

    A fully data-driven encoder-decoder seq2seq model predicts reactant SMILES from a target molecule and specified reaction type using beam-search decoding.

  • Results

    The seq2seq model performs comparably to the rule-based baseline on the processed patent dataset, while differing across reaction types.

  • Takeaways & Limitations

    The model supports end-to-end training, more efficient scaling to larger datasets, and incorporation of global molecular environments without a rule-based component.

  • Takeaways & Limitations

    Performance is weaker for heterocycle formation, where cyclic and aromatic structures, limited training examples, and grammatical SMILES errors create difficulties.

Abstract

from arXiv · show

We describe a fully data driven model that learns to perform a retrosynthetic reaction prediction task, which is treated as a sequence-to-sequence mapping problem. The end-to-end trained model has an encoder-decoder architecture that consists of two recurrent neural networks, which has previously shown great success in solving other sequence-to-sequence prediction tasks such as machine translation. The model is trained on 50,000 experimental reaction examples from the United States patent literature, which span 10 broad reaction types that are commonly used by medicinal chemists. We find that our model performs comparably with a rule-based expert system baseline model, and also overcomes certain limitations associated with rule-based expert systems and with any machine learning approach that contains a rule-based expert system component. Our model provides an important first step towards solving the challenging problem of computational retrosynthetic analysis.

1 Department of Chemistry, Stanford University, Stanford, CA 94305, USA

Computational retrosynthesis aims to help chemists design routes to target molecules, but existing approaches have limited acceptance and inherit rule-based constraints. This work introduces an end-to-end neural sequence-to-sequence approach for retrosynthetic reaction prediction.

  • Motivation: Retrosynthetic analysis recursively transforms target molecules into simpler precursors to design synthetic routes.The broader planning task seeks routes that minimize steps, cost, time, and waste.
  • Motivation: Computational tools could assist drug discovery, medicinal chemistry, materials science, and natural product synthesis, yet mainstream acceptance has lagged.Earlier approaches were often applicable only to relatively simple targets that expert chemists could analyze unaided.
  • Existing approaches: Deep-learning reaction predictors commonly combine rule-based expert systems with neural networks that rank rules or generated products.These systems remain dependent on the rule-based component.
  • Existing approaches: Rule-dependent approaches inherit limited extrapolation, rule-specificity tradeoffs, local molecular representations, and incomplete stereochemical handling.The rules focus on atoms immediately neighboring reaction centers, and reported examples lacked molecules with stereocenters.
  • Problem: Retrosynthetic prediction is especially challenging because each target-molecule bond can represent a possible disconnection, producing many possible starting-material sets.Compared with forward prediction, the retrosynthetic input contains less information and allows more outputs.
  • Approach: The paper develops a fully data-driven seq2seq model that predicts likely reactants for a target molecule and specified reaction type, trained end-to-end on labelled patent reactions.The authors report comparable performance with a rule-based baseline on relatively simple chemistry.

Problem definition

The retrosynthetic reaction prediction task maps a target molecule and specified reaction type to likely reactants. The study uses a processed patent dataset organized into broad reaction classes.

  • Task: Given a target-molecule SMILES and specified reaction type, the model predicts reactant SMILES that could produce the target.The task is illustrated as a possible retrosynthetic disconnection.
  • Dataset: The processed dataset contains 50,000 atom-mapped reactions classified into 10 broad reaction types.The examples represent reaction types commonly found in a medicinal chemist’s toolkit.
  • Dataset: The dataset distribution across major reaction classes is summarized in Table 1.The supplied table passage identifies the distribution but provides no class counts.

Seq2seq model

The seq2seq system encodes reaction inputs and decodes reactant sequences using recurrent neural networks with attention. Beam search retains high-probability candidate sequences during inference.

  • Architecture: Seq2seq models map one sequence to another through an encoder-decoder architecture built from two recurrent neural networks.An attention mechanism can align target tokens with source tokens.
  • Architecture: The model uses a bidirectional LSTM encoder, LSTM decoder, additive attention, and character-wise sequence processing.LSTM cells are used to learn long-range sequence dependencies.
  • Input and output: The source sequence is the reversed product SMILES preceded by a reaction-type token, while the target sequence contains reactant-SMILES characters.Reaction atom-mapping is removed during training and evaluation.
  • Inference: Beam search retains the top N output sequences by overall sequence log probability at each decoding step.With beam width 5, decoding retains five candidates and stops at a maximum length of 140 characters.

Baseline model

The baseline is a rule-based expert system that extracts retrosynthetic reaction rules from atom-mapped training reactions and applies them to target molecules. Successful outputs are ranked by rule frequency.

  • Rule extraction: The baseline applies reaction rules for a specified reaction type to a target molecule to obtain reactants.The rules are automatically extracted from the training dataset.
  • Rule extraction: Reaction centers are identified from product–reactant connectivity changes, expanded to neighboring atoms, and encoded as reaction SMARTS rules.Each rule is labelled with its corresponding reaction type.
  • Rule extraction: 29,462 valid rules were extracted, providing 73.1% rule coverage in the training dataset.A valid rule can regenerate the product from the corresponding reactants.
  • Inference: At inference, all rules for the relevant reaction type are applied, and successful reactant sets are ranked by observed rule frequency.The baseline is evaluated on the test dataset.

Results

On the test dataset, the seq2seq model performs comparably to the rule-based baseline overall, while showing class-dependent strengths and weaknesses. It exceeds the baseline’s maximum accuracy at top-50 and handles some reaction classes better, but makes more grammatical SMILES errors for heterocycle formation.

  • Overall performance: 69.8% is the baseline model’s maximum possible test accuracy, while the seq2seq model’s top-50 accuracy is higher.The baseline maximum is reached when the ground-truth reactant set appears in any baseline prediction.
  • Overall performance: The seq2seq model performs comparably to the rule-based expert system baseline on top-N accuracy.Top-N accuracy measures whether the ground-truth reactant set appears among the model’s top N predictions.
  • Reaction-class breakdown: Representative correct seq2seq predictions are shown for each reaction class in the retrosynthetic direction.The detailed top-10 results are broken down by reaction class in Table 3.
  • Reaction-class breakdown: The baseline performs significantly better in reaction classes 1 and 2, where many functional groups can support the reaction site and multiple reactant sets are plausible.These classes are heteroatom alkylation and arylation, and acylation and related processes.
  • Reaction-class breakdown: The baseline performs significantly better in reaction class 4, heterocycle formation, where cyclic and aromatic structures create larger reactant–product string differences and training examples are relatively scarce.The passage attributes the seq2seq model’s grammatical SMILES mistakes to these two factors.
  • Reaction-class breakdown: The seq2seq model performs significantly better in reaction classes 5 and 6 because it captures large leaving groups omitted from products.The baseline’s local rules miss leaving-group identities, whereas the seq2seq model uses the global molecular environment of the reaction species.

Error analysis of the seq2seq model

The seq2seq model makes grammatically invalid, chemically implausible, and chemically plausible but non-ground-truth predictions. These errors reflect both fragile SMILES representations and genuine alternative retrosynthetic solutions.

  • Error types: The model makes three kinds of prediction errors: grammatically invalid SMILES, chemically implausible reactions, and plausible reactions that differ from ground truth.The first two error types involve invalid or implausible predicted reactants; the third can represent a chemically viable alternative.
  • Representation errors: Single-character changes can invalidate predicted SMILES or create large molecular differences, contributing to grammatical and chemical errors.The decoder predicts SMILES one character at a time without explicitly modeling their underlying grammar.
  • Alternative solutions: Chemically plausible predictions may differ from ground truth because multiple functional-group combinations or reaction sites can yield the target molecule.Such predictions are likely to react in the specified reaction type to produce the target molecule.

Ranking of the seq2seq model predictions

Beam-search rankings from the seq2seq model correspond well to chemical reactivity and place ground-truth matches at higher ranks more often than the rule-based baseline.

  • Ranked predictions: Higher prediction ranks are more likely to correspond to the ground truth in the top-10 outputs.Figure 9 reports the highest rank assigned to the ground-truth match for each test example.
  • Model comparison: The seq2seq model’s ground-truth rank distribution is more concentrated at the highest ranks than the baseline model’s distribution.The baseline ranks predictions by the number of rule occurrences observed in the training dataset.

Discussion

The seq2seq model performs comparably to the rule-based baseline while offering end-to-end training, better scaling with larger datasets, and access to global molecular context.

  • Overall comparison: The seq2seq model performs comparably to the rule-based baseline on the processed patent dataset, although performance differs across reaction types.It also has stated advantages over the baseline and hybrid approaches combining rule-based systems with neural ranking.
  • End-to-end learning: The model trains end-to-end from reaction data, implicitly learns chemical rules, ranks candidates through beam search, and does not require atom-mapped training examples.Rule-based systems and hybrid approaches require independently configured components, while automatically extracted rules depend on accurate atom mapping.
  • Scalability: The seq2seq model’s inference cost is independent of training-dataset size and depends primarily on beam-search width, unlike exhaustive rule-based inference.Rule-based knowledge bases generally grow with training-data size, increasing the number of rules applied during inference.
  • Scalability: Increasing training-dataset size can improve neural accuracy while also increasing the number of reaction rules to classify, partially offsetting the gain.Removing rare rules reduces knowledge-base size but also reduces coverage, especially for rare reaction types.
  • Molecular context: The seq2seq model uses complete reactant and target SMILES to incorporate global molecular environment, whereas the baseline rules focus on neighboring atoms near reaction centers.This difference reflects the broader molecular information available to the seq2seq model during prediction.

Conclusion

The work presents a data-driven neural sequence-to-sequence model for computational retrosynthetic analysis. It performs comparably to a rule-based expert system while offering end-to-end training, improved scaling, and global molecular context; the study remains an early step because its reactions and molecules are intentionally simple.

  • The data-driven neural sequence-to-sequence model targets computational retrosynthetic reaction prediction.
  • The model performs comparably to the rule-based expert system baseline while avoiding dependence on rule-based components.
  • End-to-end training, more efficient scaling to larger datasets, and incorporation of global molecular environments are identified as fundamental advantages.
  • The approach is an important early step, but the studied reactions and molecules are intentionally simpler than those faced by mainstream synthetic chemists.

Supporting information

The supporting information includes a table listing key hyperparameters of the sequence-to-sequence model.

  • Table S1 lists the key hyperparameters of the sequence-to-sequence model.
Loading 1706.01643v1…