summaries:  This paper presents GraphRetro, a single-step retrosynthesis model that represents an advance from last years' NeurIPS state of the art model on semi-template-based modeling of the USPTO-50k dataset. GraphRetro uses a graph neural network that predicts edits to transform a target into synthons and then expands the synthons into full molecules by attaching leaving groups (with the synthons and leaving groups learned from the training set). The authors compare the predictions on the USPTO-50k to existing baselines, and show examples of predictions, including wrong ones. Because of the particular construction of the model, the authors can decompose the sources of errors as wrong edit predictions or wrong synthon completions.  ## Summary.  The authors propose a new method for single-step retrosynthesis prediction. Their method first predicts graph edits using a message passing network yielding synthons which are then completed by adding leaving groups. The leaving groups are chosen from a fixed set using another MPN.  This paper deals with molecular graph generation via synthon, incomplete molecular graphs.  Unlike existing works, this paper formulates the completion of incomplete molecular graphs not as a generation problem but as a classification problem to select one of a set of pre-computed leaving groups fragments. The training and evaluation are performed using the standard dataset USPTO-50k. The proposed model has high retrosynthesis performance, covering a large number of responses with a small set of leaving groups. This paper proposes a new retrosynthetic prediction model using neural networks. The algorithm proposed to make the prediction based on breaking the target product into synthons and adding leaving groups to the synthons. The main difference of the proposed algorithm to the existing synthon-based retrosynthetic model is on introducing the vocabulary of leaving groups to complete the synthons in an efficient way.  Extensive evaluation verifies that the proposed method is competitive with the existing algorithms, and each algorithmic component plays a meaningful role. This paper proposes a new strategy for reactants generation for the retrosynthesis prediction. Motivated by the fact that the graph topology of precursor molecules is largely unchanged during the chemical reaction, the authors propose to expand intermediate synthons into reactants by selecting and attaching leaving groups (molecule sub-graphs extracted from training data) to the synthons. The product molecule is transformed into synthons through graph edits. The proposed method achieves 53.7% top-1 accuracy.
abstractText: Retrosynthesis prediction is a fundamental problem in organic synthesis, where the task is to identify precursor molecules that can be used to synthesize a target molecule. A key consideration in building neural models for this task is aligning model design with strategies adopted by chemists. Building on this viewpoint, this paper introduces a graph-based approach that capitalizes on the idea that the graph topology of precursor molecules is largely unaltered during a chemical reaction. The model first predicts the set of graph edits transforming the target into incomplete molecules called synthons. Next, the model learns to expand synthons into complete molecules by attaching relevant leaving groups. This decomposition simplifies the architecture, making its predictions more interpretable, and also amenable to manual correction. Our model achieves a top-1 accuracy of 53.7%, outperforming previous template-free and semi-template-based methods.
authors.name: Vignesh Ram Somnath
authors.name: Charlotte Bunne
authors.name: Connor W. Coley
authors.name: Andreas Krause
authors.name: Regina Barzilay
references.authors: B. Chen T. Shen T.S. Jaakkola R. Barzilay
references.title: Learning to Make Generalizable and Diverse Predictions for Retrosynthesis
references.venue: In Submission,
references.authors: C.W. Coley R. Barzilay T.S. Jaakkola W.H. Green K.F. Jensen
references.title: Prediction of Organic Reaction Outcomes Using Machine Learning
references.venue: In ACS Central Science. ACS Publications,
references.authors: C.W. Coley L. Rogers W.H. Green K.F. Jensen
references.title: Computer-Assisted Retrosynthesis Based on Molecular Similarity
references.venue: ACS Central Science,
references.authors: C.W. Coley W. Jin L. Rogers T.F. Jamison T.S. Jaakkola W.H. Green R. Barzilay K.F. Jensen
references.title: A graph-convolutional neural network model for the prediction of chemical reactivity
references.venue: Chemical Science,
references.authors: E. Corey W.T. Wipke
references.title: Computer-assisted design of complex organic syntheses
references.venue: Science,
references.authors: E.J. Corey
references.title: The Logic of Chemical Synthesis: Multistep Synthesis of Complex Carbogenic Molecules (Nobel Lecture)
references.venue: Angewandte Chemie International Edition,
references.authors: H. Dai C. Li C. Coley B. Dai L. Song
references.title: Retrosynthesis Prediction with Conditional Graph Logic Network
references.venue: In Advances in Neural Information Processing Systems (NeurIPS),
references.authors: S. Genheden A. Thakkar V. Chadimová J.-L. Reymond O. Engkvist E. Bjerrum
references.title: Aizynthfinder: a fast, robust and flexible open-source software for retrosynthetic planning
references.venue: Journal of cheminformatics,
references.authors: J. Gilmer S.S. Schoenholz P.F. Riley O. Vinyals G.E. Dahl
references.title: Neural Message Passing for Quantum Chemistry
references.venue: In International Conference on Machine Learning (ICML),
references.authors: M. Hartenfeller M. Eberle P. Meier C. Nieto-Oberhuber K.-H. Altmann G. Schneider E. Jacoby S. Renner
references.title: A Collection of Robust Organic Synthesis Reactions for In Silico Molecule Design
references.venue: In Journal of Chemical Information and Modeling,
references.authors: W. Jin C. Coley R. Barzilay T. Jaakkola
references.title: Predicting Organic Reaction Outcomes with WeisfeilerLehman Network
references.venue: In Advances in Neural Information Processing Systems (NeurIPS),
references.authors: W. Jin R. Barzilay T. Jaakkola
references.title: Junction Tree Variational Autoencoder for Molecular Graph Generation
references.venue: In International Conference on Machine Learning (ICML),
references.authors: W. Jin R. Barzilay T. Jaakkola
references.title: Composing Molecules with Multiple Property Constraints
references.venue: In International Conference on Machine Learning (ICML),
references.authors: J. Law Z. Zsoldos A. Simon D. Reid Y. Liu S.Y. Khew A.P. Johnson S. Major R.A. Wade H.Y. Ando
references.title: Route Designer: A Retrosynthetic Analysis Tool Utilizing Automated Retrosynthetic Rule Generation
references.venue: Journal of Chemical Information and Modeling,
references.authors: B. Liu B. Ramsundar P. Kawthekar J. Shi J. Gomes Q. Luu Nguyen S. Ho J. Sloane P. Wender V. Pande
references.title: Retrosynthetic Reaction Prediction Using Neural Sequence-to-Sequence Models
references.venue: In ACS Central Science,
references.authors: N. Schneider N. Stiefl G.A. Landrum
references.title: What’s What: The (Nearly) Definitive Guide to Reaction Role Assignment
references.venue: In Journal of Chemical Information and Modeling,
references.authors: M.H. Segler M.P. Waller
references.title: Neural-Symbolic Machine Learning for Retrosynthesis and Reaction Prediction
references.venue: Chemistry–A European Journal,
references.authors: C. Shi M. Xu H. Guo M. Zhang J. Tang
references.title: A graph to graphs framework for retrosynthesis prediction, 2020
references.authors: R. Sun H. Dai L. Li S. Kearnes B. Dai
references.title: Energy-based view of retrosynthesis, 2021
references.venue: URL https://openreview.net/forum?id=0Hj3tFCSjUd
references.authors: S. Szymkuć E.P. Gajewska T. Klucznik K. Molga P. Dittwald M. Startek M. Bajczyk B.A. Grzybowski
references.title: Computer-assisted synthetic planning: The end of the beginning
references.venue: Angewandte Chemie International Edition,
references.authors: A. Vaswani N. Shazeer N. Parmar J. Uszkoreit L. Jones A.N. Gomez Ł. Kaiser I. Polosukhin
references.title: Attention is All You Need
references.venue: In Advances in Neural Information Processing Systems (NeurIPS),
references.authors: D. Weininger
references.title: SMILES, a Chemical Language and Information System
references.venue: Journal of Chemical Information and Computer Sciences,
references.authors: R.J. Williams D. Zipser
references.title: A Learning Algorithm for Continually Running Fully Recurrent Neural Networks
references.venue: In Neural Computation,
references.authors: C. Yan Q. Ding P. Zhao S. Zheng J. YANG Y. Yu J. Huang
references.title: Retroxpert: Decompose retrosynthesis prediction like a chemist
references.venue: Advances in Neural Information Processing Systems,
references.authors: S. Zheng J. Rao Z. Zhang J. Xu Y. Yang
references.title: Predicting Retrosynthetic Reactions using SelfCorrected Transformer Neural Networks
references.venue: In Journal of Chemical Information and Modeling. ACS Publications,
sections.text: Retrosynthesis prediction is a fundamental problem in organic synthesis, where the task is to identify precursor molecules that can be used to synthesize a target molecule. A key consideration in building neural models for this task is aligning model design with strategies adopted by chemists. Building on this viewpoint, this paper introduces a graph-based approach that capitalizes on the idea that the graph topology of precursor molecules is largely unaltered during a chemical reaction. The model first predicts the set of graph edits transforming the target into incomplete molecules called synthons. Next, the model learns to expand synthons into complete molecules by attaching relevant leaving groups. This decomposition simplifies the architecture, making its predictions more interpretable, and also amenable to manual correction. Our model achieves a top-1 accuracy of 53.7%, outperforming previous template-free and semi-template-based methods.
sections.heading: 1 Introduction
sections.text: Retrosynthesis prediction, first formalized by E. J. Corey [Corey, 1991] is a fundamental problem in organic synthesis that attempts to identify a series of chemical transformations for synthesizing a target molecule. In the single-step formulation, the task is to identify a set of reactant molecules given a target. Beyond simple reactions, many practical tasks involving complex organic molecules are difficult even for expert chemists. As a result, substantial experimental exploration is needed to cover for deficiencies of analytical approaches. This has motivated interest in computer-assisted retrosynthesis [Corey and Wipke, 1969], with a recent surge in machine learning methods [Chen et al., 2019, Coley et al., 2017b, Dai et al., 2019, Zheng et al., 2019, Genheden et al., 2020].
  Computationally, the main challenge is how to explore the combinatorial space of reactions that can yield the target molecule. Largely, previous methods for retrosynthesis prediction can be divided into template-based [Coley et al., 2017b, Dai et al., 2019, Segler and Waller, 2017] and template-free [Chen et al., 2019, Zheng et al., 2019] approaches. Template-based methods match a target molecule against a large set of templates, which are molecular subgraph patterns that highlight changes during a chemical reaction. Despite their interpretability, these methods fail to generalize to new reactions. Template-free methods bypass templates by learning a direct mapping from the SMILES [Weininger, 1988] representations of the product to reactants. Despite their greater generalization potential, these methods generate reactant SMILES character by character, increasing generation complexity.
  35th Conference on Neural Information Processing Systems (NeurIPS 2021).
  Another important consideration in building retrosynthesis models is aligning model design with strategies adopted by expert chemists. These strategies are influenced by fundamental properties of chemical reactions, independent of complexity level: (i.) the product atoms are always a subset of the reactant atoms1, and (ii.) the molecular graph topology is largely unaltered from products to reactants. For example, in the standard retrosynthesis dataset, only 6.3% of the atoms in the product undergo any change in connectivity.
  This consideration has received more attention in recent semi-template-based methods [Shi et al., 2020, Yan et al., 2020], that generate reactants from a product in two stages: (i.) first identify intermediate molecules called synthons, (ii.) and then complete synthons into reactants by sequential generation of atoms or SMILES characters.. Our model GRAPHRETRO also uses a similar workflow. However, we avoid sequential generation for completing synthons by instead selecting subgraphs called leaving groups from a precomputed vocabulary. This vocabulary is constructed during preprocessing by extracting subgraphs that differ between a synthon and the corresponding reactant. The vocabulary has a small size (170 for USPTO-50k) indicating remarkable redundancy, while covering 99.7% of the test set. Operating at the level of these subgraphs greatly reduces the complexity of reactant generation, with improved empirical performance. This formulation also simplifies our architecture, and makes our predictions more transparent, interpretable and amenable to manual correction.
  The benchmark dataset for evaluating retrosynthesis models is USPTO-50k [Schneider et al., 2016], which consists of 50000 reactions across 10 reaction classes. The dataset contains an unexpected shortcut towards predicting the edit, in that the product atom with atom-mapping 1 is part of the edit in 75% of the cases, allowing predictions that depend on the position of the atom to overestimate performance. We canonicalize the product SMILES and remap the existing dataset, thereby removing the shortcut. On this remapped dataset, GRAPHRETRO achieves a top-1 accuracy of 53.7% when the reaction class is not known, outperforming both template-free and semi-template-based methods.
sections.heading: 2 Related Work
sections.text: Retrosynthesis Prediction Existing machine learning methods for retrosynthesis prediction can be divided into template-based, template-free and recent semi-template-based approaches.
  Template-Based: Templates are either hand-crafted by experts [Hartenfeller et al., 2011, Szymkuć et al., 2016], or extracted algorithmically from large databases Coley et al. [2017a], Law et al. [2009]. Exhaustively applying large template sets is expensive due to the involved subgraph
  1ignoring impurities
  matching procedure. Template-based methods therefore utilize different ways of prioritizing templates, by either learning a conditional distribution over the template set [Segler and Waller, 2017], ranking templates based on molecular similarities to precedent reactions [Coley et al., 2017b] or directly modelling the joint distribution of templates and reactants using logic variables [Dai et al., 2019]. Despite their interpretability, these methods fail to generalize outside their rule set.
  Template-Free: Template-free methods [Liu et al., 2017, Zheng et al., 2019, Chen et al., 2019] learn a direct transformation from products to reactants using architectures from neural machine translation and a string based representation of molecules called SMILES [Weininger, 1988]. Linearizing molecules as strings does not utilize the inherently rich chemical structure. In addition, the reactant SMILES are generated from scratch, character by character. Attempts have been made to improve validity by adding a syntax correcter [Zheng et al., 2019] and a mixture model to improve diversity of suggestions [Chen et al., 2019], but the performance remains worse than [Dai et al., 2019] on the standard retrosynthesis dataset. Sun et al. [2021] formulate retrosynthesis using energy-based models, with additional parameterizations and loss terms to enforce the duality between forward (reaction prediction) and backward (retrosynthesis) prediction.
  Semi-Template-Based: Our work is closely related to recently proposed semi-template-based methods [Shi et al., 2020, Yan et al., 2020], which first identify synthons and then expand synthons into reactants through sequential generation using either a graph generative model [Shi et al., 2020] or a Transformer [Yan et al., 2020]. To reduce the complexity of reactant generation, we instead complete synthons using subgraphs called leaving groups selected from a precomputed vocabulary. This allows us to view synthon completion as a classification problem instead of a generative one. We also utilize the dependency graph between possible edits, and update edit predictions using a message passing network (MPN) [Gilmer et al., 2017] on this graph. Both innovations together yield a 4.8% and 3.3% performance improvement respectively over previous semi-template-based methods.
  Reaction Center Identification The reaction center covers a small number of participating atoms involved in the reaction. Our work is also related to models that predict reaction outcomes by learning to rank atom pairs based on their likelihood to be in the reaction center [Coley et al., 2019, Jin et al., 2017]. The task of identifying the reaction center is related to the step of deriving the synthons in our formulation. Our work departs from [Coley et al., 2019, Jin et al., 2017] as we utilize the property that new bond formations occur rarely (~0.1%) from products to synthons, allowing us to predict a score only for existing bonds and atoms and reduce prediction complexity from O(N2) to O(N). We also utilize the dependency graph between possible edits, and update edit predictions using a MPN on this graph.
  Utilizing Substructures Substructures have been utilized in various tasks from sentence generation by fusing phrases to molecule generation and optimization [Jin et al., 2018, 2020]. Our work is closely related to [Jin et al., 2020] which uses precomputed substructures as building blocks for property-conditioned molecule generation. However, instead of precomputing, synthons —analogous building blocks for reactants— are indirectly learnt during training.
sections.heading: 3 Model Design
sections.text: Our approach leverages the property that graph topology is largely unaltered from products to reactants. To achieve this, we first derive suitable building blocks from the product called synthons, and then complete them into valid reactants by adding specific functionalities called leaving groups. These derivations, called edits, are characterized by modifications to bonds or hydrogen counts on atoms. We first train a neural network to predict a score for possible edits (Section 3.1). The edit with the highest score is then applied to the product to obtain synthons. Since the number of unique leaving groups are small, we model leaving group selection as a classification problem over a precomputed vocabulary (Section 3.2). To produce candidate reactants, we attach the predicted leaving group to the corresponding synthon through chemically constrained rules. The overall process is outlined in Figure 1. Before describing the two modules, we introduce relevant preliminaries that set the background for the remainder of the paper.
  Retrosynthesis Prediction A retrosynthesis pair R is described by a pair of molecular graphs (Gp,Gr), where Gp are the products and Gr the reactants. A molecular graph is described as G = (V, E) with atoms V as nodes and bonds E as edges. Prior work has focused on the single product case, while reactants can have multiple connected components, i.e. Gr = {Grc}Cc=1. Retrosynthesis pairs are atom-mapped so that each product atom has a unique corresponding reactant atom. The retrosynthesis task then, is to infer {Grc}Cc=1 given Gp.
  Edits Edits consist of (i.) atom pairs {(ai, aj)} where the bond type changes from products to reactants, and (ii.) atoms {ai} where the number of hydrogens attached to the atom change from products to reactants. We denote the set of edits by E. Since retrosynthesis pairs in the training set are atom-mapped, edits can be automatically identified by comparing the atoms and atom pairs in the product to their corresponding reactant counterparts.
  Synthons and Leaving Groups Applying editsE to the product Gp results in incomplete molecules called synthons. Synthons are analogous to rationales or building blocks, which are expanded into valid reactants by adding specific functionalities called leaving groups that are responsible for its reactivity. We denote synthons by Gs and leaving groups by Gl. We further assume that synthons and leaving groups have the same number of connected components as the reactants, i.e Gs = {Gsc}Cc=1 and Gl = {Glc}Cc=1. This assumption holds for 99.97% reactions in the training set. Formally, our model generates reactants by first predicting the set of edits E that transform Gp into Gs, followed by predicting a leaving group Glc to attach to each synthon Gsc . The model is defined as
  P (Gr|Gp) = ∑ E,Gl P (E|Gp)P (Gl|Gp,Gs), (1)
  where Gs,Gr are deterministic given E,Gl, and Gp.
sections.heading: 3.1 Edit Prediction
sections.text: For a given retrosynthesis pair R = (Gp,Gr), we predict an edit score only for existing bonds and atoms, instead of every atom pair as in [Coley et al., 2019, Jin et al., 2017]. This choice is motivated by the low frequency (~0.1%) of new bond formations in the training set examples. Coupled with the sparsity of molecular graphs, this reduces the prediction complexity from O(N2) to O(N) for a product with N atoms. Our edit prediction model has variants tailored to single and multiple edit prediction. Since 95% of the training set consists of single edit examples, the remainder of this section describes the setup for single edit prediction. A detailed description of our multiple edit prediction model can be found in Appendix ??.
  Each bond (u, v) in Gp is associated with a label yuvk ∈ {0, 1} indicating whether its bond type k has changed from the products to reactants. Each atom u is associated with a label yu ∈ {0, 1} indicating a change in hydrogen count. We predict edit scores using representations that are learnt using a graph encoder.
  Graph Encoder To obtain atom representations, we use a variant of the message passing network (MPN) described in [Gilmer et al., 2017]. Each atom u has a feature vector xu indicating its atom type, degree and other properties. Each bond (u, v) has a feature vector xuv indicating its aromaticity, bond type and ring membership. For simplicity, we denote the encoding process by MPN(·) and describe architectural details in Appendix ??. The MPN computes atom representations {cu|u ∈ G} via
  {cu} = MPN(G, {xu}, {xuv}v∈N (u)), (2)
  where N (u) denotes the neighbors of atom u. The graph representation cG is an aggregation of atom representations, i.e. cG = ∑ u∈V cu. When G has connected components {Gi}, we get a set of graph representations {cGi}. For a bond (u, v), we define its representation cuv = (ABS(cu, cv)||cu+cv), where ABS denotes absolute difference and || refers to concatenation. This ensures our representations are permutation invariant. These representations are then used to predict atom and bond edit scores using corresponding neural networks,
  su = ua T τ(Wacu + b) (3)
  suvk = uk T τ(Wkcuv + bk), (4)
  where τ(·) is the ReLU activation function.
  Updating Bond Edit Scores Unlike a typical classification problem where the labels are independent, edits can have possible dependencies between each other. For example, bonds part of a stable system such as an aromatic ring have a greater tendency to remain unchanged (label 0). We attempt to leverage such dependencies to update initial edit scores. To this end, we build a graph with bonds (u, v) as nodes, and introduce an edge between bonds sharing an atom. We use another MPN(·) on this graph to learn aggregated neighborhood messages muv, and update the edit scores suvk in a manner similar to how LSTMs update representations,
  fuvk = σ(W f kxxuv +W f kmmuv) (5)
  iuvk = σ(W i kxxuv +W i kmmuv) (6)
  m̃uvk = umτ(W m kxxuv +W m kmmuv) (7)
  s̃uvk = fuvk · suvk + iuvk · m̃uvk. (8)
  Training We train by minimizing the cross-entropy loss over possible bond and atom edits
  Le = − ∑
  (Gp,E)  ∑ ((u,v),k)∈E yuvklog(s̃uvk) + ∑ u∈E yulog(su)  . (9) The cross-entropy loss enforces the model to learn a distribution over possible edits instead of reasoning about each edit independently, as with the binary cross entropy loss used in [Jin et al., 2017, Coley et al., 2019].
sections.heading: 3.2 Synthon Completion
sections.text: Synthons are completed into valid reactants by adding specific functionalities called leaving groups. This involves two complementary tasks: (i.) selecting the appropriate leaving group, and (ii.) attaching the leaving group to the synthon. As ground truth leaving groups are not directly provided, we extract the leaving groups and construct a vocabulary X of unique leaving groups during preprocessing. The vocabulary has a limited size (|X | = 170 for a standard dataset with 50, 000 examples, and 72000 synthons) indicating the redundancy of leaving groups used in accomplishing retrosynthetic transformations. This redundancy also allows us to formulate leaving group selection as a classification problem over X , while retaining the ability to generate diverse reactants using different combinations of leaving groups.
  Vocabulary Construction Before constructing the vocabulary, we align connected components of synthon and reactant graphs by comparing atom mapping overlaps. Using aligned pairs Gsc = (Vsc , Esc) and Grc = (Vrc , Erc) as input, the leaving group vocabulary X is constructed by extracting subgraphs Glc = (Vlc , Elc) such that Vlc = Vrc \ Vsc . Atoms {ai} in the leaving groups that attach to synthons are marked with a special symbol. We also add three tokens to X namely START, which indicates the start of synthon completion, END, which indicates that there is no leaving group to add and PAD, which is used to handle variable numbers of synthon components in a minibatch.
  Leaving Group Selection For synthon component c ≤ C, where C is the number of connected components in the synthon graph, we use three inputs for leaving group selection – the product representation cGp , the synthon component representation cGsc , and the leaving group representation for the previous synthon component, elc−1 . The product and synthon representations are learnt using the MPN(·). For each xi ∈ X , representations can be learnt by either training independent embedding vectors (ind) or by treating each xi as a subgraph and using the MPN(·) (shared). In the shared setting, we use the same MPN(·) as the product and synthons.
  The leaving group probabilities are then computed by combining cGp , cGsc and elc−1 via a single layer neural network and softmax function
  q̂lc = softmax ( Uτ ( W1cGp +W2cGsc +W3el(c−1) )) , (10)
  where q̂lc is distribution learnt over X . Using the representation of the previous leaving group elc−1 allows the model to understand combinations of leaving groups that generate the desired product from the reactants. We also include the product representation cGp as the synthon graphs are derived from the product graph.
  Training For step c, given the one hot encoding of the true leaving group qlc , we minimize the cross-entropy loss
  Ls = C∑
  c=1
  L(q̂lc , qlc). (11)
  Training utilizes teacher-forcing [Williams and Zipser, 1989] so that the model makes predictions given correct histories. During inference, at every step, we use the representation of leaving group from the previous step with the highest predicted probability.
  Leaving Group Attachment Attaching leaving groups to synthons is a deterministic process and not learnt during training. The task involves identification of the type of bonds to add between attaching atoms in the leaving group (marked during vocabulary construction), and the atom(s) participating in the edit. These bonds can be inferred by applying the valency constraint, which determines the maximum number of neighbors for each atom. The attachment process does not modify any stereochemistry. Given synthons and leaving groups, the attachment process has a 100% accuracy. The detailed procedure is described in Appendix ??.
sections.heading: 3.3 Inference
sections.text: Inference is performed using beam search with a log-likelihood scoring function. For a beam width n, we select n edits with highest scores and apply them to the product to obtain n synthons, where each synthon can consist of multiple connected components. The synthons form the nodes for beam search. Each node maintains a cumulative score by aggregating the log-likelihoods of the edit and predicted leaving groups. Leaving group inference starts with a connected component for each synthon, and selects n leaving groups with highest log-likelihoods. From the n2 possibilities, we select n nodes with the highest cumulative scores. This process is repeated until all nodes have a leaving group predicted for each synthon component.
sections.heading: 4 Evaluation
sections.text: Evaluating retrosynthesis models is challenging as multiple sets of reactants can be generated from the same product. To deal with this, previous works [Coley et al., 2017b, Dai et al., 2019] evaluate the ability of the model to recover retrosynthetic strategies recorded in the dataset.
  Data We use the benchmark dataset USPTO-50k [Schneider et al., 2016] for all our experiments. The dataset contains 50, 000 atom-mapped reactions across 10 reaction classes. We use the same dataset version and splits as provided by [Dai et al., 2019]. The USPTO-50k dataset contains a shortcut in that the product atom with atom-mapping 1 is part of the edit in ~75% of the cases. If the product SMILES is not canonicalized, predictions utilizing operations that depend on the position of the atom or bond will be able to use the shortcut, and overestimate performance. We canonicalize the product SMILES, and reassign atom-mappings to the reactant atoms based on the canonical ordering, which removes the shortcut. Details on the remapping procedure can be found in Appendix ??.
  Evaluation We use the top-n accuracy (n = 1, 3, 5, 10) as our evaluation metric, defined as the fraction of examples where the recorded reactants are suggested by the model with rank ≤ n. Following prior work [Coley et al., 2017b, Zheng et al., 2019, Dai et al., 2019], we compute the accuracy
  by comparing the canonical SMILES of predicted reactants to the ground truth. Atom-mapping is excluded from this comparison, but stereochemistry, which describes the relative orientation of atoms in the molecule, is retained. The evaluation is carried out for two settings, with the reaction class being known or unknown.
  Baselines For evaluating overall performance, we compare GRAPHRETRO to nine baselines — four template-based, three template-free, and two semi-template-based methods. These include:
  Template-Based: RETROSIM Coley et al. [2017b] ranks templates for a given target molecule by computing molecular similarities to precedent reactions. NEURALSYM [Segler and Waller, 2017] trains a model to rank templates given a target molecule. GLN [Dai et al., 2019] models the joint distribution of templates and reactants in a hierarchical fashion using logic variables. DUALTB [Sun et al., 2021] uses an energy-based model formulation for retrosynthesis, with additional parameterizations and loss terms to enforce the duality between forward (reaction prediction) and backward (retrosynthesis prediction). Inference is carried out using reactant candidates obtained by applying an extracted template set to the products.
  Template-Free: SCROP [Zheng et al., 2019], LV-TRANSFORMER [Chen et al., 2019] and DUALTF [Sun et al., 2021] use the Transformer architecture [Vaswani et al., 2017] to output reactant SMILES given a product SMILES. To improve the validity of their suggestions, SCROP include a second Transformer that functions as a syntax correcter. LV-TRANSFORMER uses a latent variable mixture model to improve diversity of suggestions. DUALTF utilizes additional parameterizations and loss terms to enforce the duality between forward (reaction prediction) and backward (retrosynthesis prediction).
  Semi-Template-Based: G2GS [Shi et al., 2020] and RETROXPERT [Yan et al., 2020] first identify synthons, and then expand the synthons into reactants by either sequential generation of atoms and bonds (G2Gs), or using the Transformer architecture (RETROXPERT). The training dataset for the Transformer in [Yan et al., 2020] is augmented with incorrectly predicted synthons with the goal of learning a correction mechanism.
  Results for NEURALSYM are taken from [Dai et al., 2019]. The authors in [Yan et al., 2020] report their performance being affected by the dataset leakage2. Thus, we use the most recent results from their website on the canonicalized dataset. For remaining baselines, we directly use the values reported in their paper. For the synthon completion module, we use the ind configuration given its better empirical performance.
  2https://github.com/uta-smile/RetroXpert
sections.heading: 4.1 Overall Performance
sections.text: Reaction class unknown As shown in Table 1, when the reaction class is unknown, GRAPHRETRO outperforms G2GS by 4.8% and and RETROXPERT by 3.3% in top-1 accuracy. Performance improvements are also seen for larger n, except for n = 5. Barring DUALTB, the top-1 accuracy is also better than other template-free and template-based methods. For larger n, one reason for lower top-n accuracies than most template-based methods is that templates already contain combinations of leaving group patterns. In contrast, our model learns to discover these during training. A second hypothesis to this end is that simply adding log-likelihood scores from edit prediction and synthon completion models may be suboptimal and bias the beam search in the direction of the more dominating term. We leave it to future work to investigate scoring functions that rank the attachment.
  Reaction class known When the reaction class is known, GRAPHRETRO outperforms G2GS and RETROXPERT by a margin of 3% and 2% respectively in top-1 accuracy. GRAPHRETRO also outperforms all the template-free methods in top-n accuracy. for GRAPHRETRO are also better than most template-based and template-free methods. When the reaction class is known, RETROSIM and GLN restrict template sets corresponding to the reaction class, thus improving performance. The increased edit prediction performance (Section 4.2) for GRAPHRETRO helps outweigh this factor, achieving comparable or better performance till n = 5.
sections.heading: 4.2 Individual Module Performance
sections.text: To gain more insight into the working of GRAPHRETRO, we evaluate the top-n accuracy (n = 1, 2, 3, 5) of edit prediction and synthon completion modules, along with corresponding ablation studies, with results shown in Table 2.
  Edit Prediction For the edit prediction module, we compare the true edit(s) to top-n edits predicted by the model. We also consider two ablation studies, one where we directly use the initial edit scores without updating them, and the other where we predict edits using atom-pairs instead of existing bonds and atoms. Both design choices lead to improvements in performance, as shown in Table 2. We hypothesize that the larger improvement compared to edit prediction using atom-pairs is due to the easier optimization procedure, with lesser imbalance between labels 1 and 0.
  Synthon Completion For evaluating the synthon completion module, we first apply the true edits to obtain synthons, and compare the true leaving groups to top-n leaving groups predicted by the model. We test the performance of both the ind and shared configurations. Both configurations perform similarly, and are able to identify ~ 97% (close to its upper bound of 99.7%) of the true leaving groups in its top-5 choices, when the reaction class is known. The top-1, 3 and 5 accuracies of the synthon completion for unknown reaction classes for G2Gs are 61.1%, 81.5% and 86.7% respectively, while ours are 75.6%, 92.5% and 96.1%, indicating a 10-14% performance improvement using a classification formulation over the generative one adopted by G2Gs.
sections.heading: 4.3 Example Predictions
sections.text: In Figure 2, we visualize the model predictions and the ground truth for three cases. Figure 2a shows an example where the model identifies both the edits and leaving groups correctly. In Figure 2b, the correct edit is identified but the predicted leaving groups are incorrect. We hypothesize this is due to the fact that in the training set, leaving groups attaching to the carbonyl carbon (C=O) are small (e.g. -OH, -NH2, halides). The true leaving group in this example, however, is large. The model is unable to reason about this and predicts the small leaving group -I. In Figure 2c, the model identifies the edit and consequently the leaving group incorrectly. This highlights a limitation of our model. If the edit is predicted incorrectly, the model cannot suggest the true precursors.
sections.heading: 4.4 Limitations
sections.text: The simplified and interpretable construction of GRAPHRETRO comes with certain limitations. First, the overall performance of the model is limited by the performance of the edit prediction step. If the predicted edit is incorrect, the true reactants cannot be salvaged. This limitation is partly remedied by our model design, that allows for user intervention to correct the edit. Second, our method is reliant on atom-mapping for extracting edits and leaving groups. Extracting edits directly based on substructure matching currently suffer from false positives, and heuristics to correct for these result in correct edits in only ~90% of the cases. Third, our formulation assumes that we have as many synthons as reactants, which is violated in some reactions. We leave it to future work to extend the model to realize a single reactant from multiple synthons, and introduce more chemically meaningful edit correction mechanisms.
sections.heading: 5 Conclusion
sections.text: Previous methods for single-step retrosynthesis either restrict prediction to a template set, are insensitive to molecular graph structure or generate molecules from scratch. We address these shortcomings by introducing a graph-based semi-template-based model inspired by a chemist’s
  workflow, enhancing the interpretability of retrosynthesis models. Given a target molecule, we first identify synthetic building blocks (synthons) which are then realized into valid reactants, thus avoiding molecule generation from scratch. Our model outperforms previous semi-template-methods by significant margins on the benchmark dataset. Future work aims to extend the model to realize a single reactant from multiple synthons, and introduce more chemically meaningful components to improve the synergy between such tools for retrosynthesis prediction and a practitioner’s expertise.
sections.heading: Acknowledgements
sections.text: This research was supported by the Machine Learning for Pharmaceutical Discovery and Synthesis Consortium at MIT. V.R.S. was also supported by the Zeno Karl Schindler Foundation. C.B. was supported by the Swiss National Science Foundation under the National Center of Competence in Research (NCCR) Catalysis under grant agreement 51NF40 180544. We thank the Leonhard scientific computing cluster at ETH Zürich for providing computational resources.
title: Learning Graph Models for Retrosynthesis Prediction