Original: L EARNING TO M AKE G ENERALIZABLE AND D IVERSE P REDICTIONS FOR R ETROSYNTHESIS
Revised: L EARNING TO M AKE G ENERALIZABLE AND D IVERSE P REDICTIONS FOR R ETROSYNTHESIS

Original: Anonymous authors
Revised: Anonymous authors

Original: Paper under double-blind review
Revised: Paper under double-blind review

Original: A BSTRACT
Revised: A BSTRACT

Original: We propose a new model for making generalizable and diverse retrosynthetic reaction predictions.
Revised: We propose a new model for making generalizable and diverse retrosynthetic reaction predictions.

Original: Given a target compound, the task is to predict the likely chemical reactants to produce the target.
Revised: Given a target compound, the task is to predict the likely chemical reactants to produce the target.

Original: This generative task can be framed as a sequence-to-sequence problem by using the SMILES representations of the molecules.
Revised: This generative task can be framed as a sequence-to-sequence problem by using the SMILES representations of the molecules.

Original: Building on top of the popular Transformer architecture, we propose two novel pre-training methods that construct relevant auxiliary tasks (plausible reactions) for our problem.
Revised: Building on top of the popular Transformer architecture, we propose two novel pre-training methods that construct relevant auxiliary tasks (plausible reactions) for our problem.

Original: Furthermore, we incorporate a discrete latent variable model into the architecture to encourage the model to produce a diverse set of alternative predictions.
Revised: Furthermore, we incorporate a discrete latent variable model into the architecture to encourage the model to produce a diverse set of alternative predictions.

Original: On the 50k subset of reaction examples from the United
Revised: On the 50k subset of reaction examples from the United

Original: States patent literature (USPTO-50k) benchmark dataset, our model greatly improves performance over the baseline, while also generating predictions that are more diverse.
Revised: States patent literature (USPTO-50k) benchmark dataset, our model greatly improves performance over the baseline, while also generating predictions that are more diverse.

Original:  I NTRODUCTION
Revised:  I NTRODUCTION

Original: This paper proposes a novel approach for one-step retrosynthesis.
Revised: This paper proposes a novel approach for one-step retrosynthesis.

Original: This task is crucial for material and drug manufacturing (Corey & Wipke, 1969; Corey, 1991) and aims to predict which reactants are needed to generate a given target molecule as the main product.
Revised: This task is crucial for material and drug manufacturing (Corey & Wipke, 1969; Corey, 1991) and aims to predict which reactants are needed to generate a given target molecule as the main product.

Original: For instance, Figure 1 demonstrates that the input molecule “[N-]=[N+]=NCc1ccc(SCCl)cc1”, expressed here as a SMILES string (Weininger, 1988), can be generated using reactants “CSc1ccc(CN=[N+]=[N-])cc1” and “ClCCl”.
Revised: For instance, Figure 1 demonstrates that the input molecule “[N-]=[N+]=NCc1ccc(SCCl)cc1”, expressed here as a SMILES string (Weininger, 1988), can be generated using reactants “CSc1ccc(CN=[N+]=[N-])cc1” and “ClCCl”.

Original: For decades, this task has been solved using template-based approaches (Gelernter et al., 1990;
Revised: For decades, this task has been solved using template-based approaches (Gelernter et al., 1990;

Original: Satoh & Funatsu, 1999).
Revised: Satoh & Funatsu, 1999).

Original: Templates encode transformation rules as regular expressions operating on SMILES strings and are typically extracted directly from the available training reactions.
Revised: Templates encode transformation rules as regular expressions operating on SMILES strings and are typically extracted directly from the available training reactions.

Original: The primary limitation of such templates is coverage, i.e., it is possible that none of the templates applies to a test molecule.
Revised: The primary limitation of such templates is coverage, i.e., it is possible that none of the templates applies to a test molecule.

Original: In order to better generalize to newer or broader chemical spaces, recently developed template-free approaches cast the problem as a sequence-to-sequence prediction task.
Revised: In order to better generalize to newer or broader chemical spaces, recently developed template-free approaches cast the problem as a sequence-to-sequence prediction task.

Original: These approaches were ﬁrst explored by Liu et al.
Revised: These approaches were ﬁrst explored by Liu et al.

Original: (2017) using LSTM models; the current state-of-the-art performance on this task uses Transformer models (Lin et al., 2019; Karpov et al., 2019).
Revised: (2017) using LSTM models; the current state-of-the-art performance on this task uses Transformer models (Lin et al., 2019; Karpov et al., 2019).

Original: Out-of-the-box Transformers nevertheless do not effectively generalize to rare reactions.
Revised: Out-of-the-box Transformers nevertheless do not effectively generalize to rare reactions.

Original: For instance, model accuracy drops by 25% on reactions with 10 or fewer representative instances in the training set.
Revised: For instance, model accuracy drops by 25% on reactions with 10 or fewer representative instances in the training set.

Original: Another key issue is diversity.
Revised: Another key issue is diversity.

Original: Manufacturing processes involve a number of additional criteria — such as green chemistry (having low detrimental effects on the environment).
Revised: Manufacturing processes involve a number of additional criteria — such as green chemistry (having low detrimental effects on the environment).

Original: It is therefore helpful to generate a diverse collection of alternative ways of synthesizing the given target molecule.
Revised: It is therefore helpful to generate a diverse collection of alternative ways of synthesizing the given target molecule.

Original: However, predicted reactions are unlikely to encompass multiple reaction classes (see Figure 2) without additional guidance.
Revised: However, predicted reactions are unlikely to encompass multiple reaction classes (see Figure 2) without additional guidance.

Original: This is because the training data only provides a single reactant set for each input target, even if this is not the only valid reaction to synthesize the target.
Revised: This is because the training data only provides a single reactant set for each input target, even if this is not the only valid reaction to synthesize the target.

Original: We extend molecular Transformers to address both of these challenges.
Revised: We extend molecular Transformers to address both of these challenges.

Original: First, we propose a novel pre-training approach to drive molecular representations to better retain alternative reaction possibilities.
Revised: First, we propose a novel pre-training approach to drive molecular representations to better retain alternative reaction possibilities.

Original: Our approach is reminiscent of successful pre-training schemes in natural language processing (NLP) applications (Devlin et al., 2018).
Revised: Our approach is reminiscent of successful pre-training schemes in natural language processing (NLP) applications (Devlin et al., 2018).

Original: However, rather than using conventional token masking methods, we adopt chemically-relevant auxiliary tasks.
Revised: However, rather than using conventional token masking methods, we adopt chemically-relevant auxiliary tasks.

Original: Each training instance presents a single way to decompose a target molecule into its reactants.
Revised: Each training instance presents a single way to decompose a target molecule into its reactants.

Original: Here, we add alternative proxy decompositions for each target molecule by either 1) randomly removing bond types that can possibly break during reactions, or 2) transforming the target based on templates.
Revised: Here, we add alternative proxy decompositions for each target molecule by either 1) randomly removing bond types that can possibly break during reactions, or 2) transforming the target based on templates.

Original: While neither of these two auxiliary tasks are guaranteed to construct valid chemical reactions, they are closely related to the task of interest.
Revised: While neither of these two auxiliary tasks are guaranteed to construct valid chemical reactions, they are closely related to the task of interest.

Original: Indeed, representations trained in this manner provide useful initializations for the actual retrosynthesis problem.
Revised: Indeed, representations trained in this manner provide useful initializations for the actual retrosynthesis problem.

Original: To improve the diversity of predicted reactions, we incorporate latent variables into the generation process.
Revised: To improve the diversity of predicted reactions, we incorporate latent variables into the generation process.

Original: Speciﬁcally, we merge the Transformer architecture with a discrete mixture over reactions.
Revised: Speciﬁcally, we merge the Transformer architecture with a discrete mixture over reactions.

Original: The role of the latent variable is to encode distinct modes that can be related to underlying reaction classes.
Revised: The role of the latent variable is to encode distinct modes that can be related to underlying reaction classes.

Original: Even though the training data only presents one reaction for each target molecule, our model learns to associate each reaction with a latent class, and in the process covers multiple reaction classes across the training set.
Revised: Even though the training data only presents one reaction for each target molecule, our model learns to associate each reaction with a latent class, and in the process covers multiple reaction classes across the training set.

Original: At test time, a diverse collection of reactions is then obtained by collecting together predictions resulting from conditioning on each latent class.
Revised: At test time, a diverse collection of reactions is then obtained by collecting together predictions resulting from conditioning on each latent class.

Original: Analogous mixture models have shown promise in generating diverse predictions in natural language translation tasks (He et al., 2018;
Revised: Analogous mixture models have shown promise in generating diverse predictions in natural language translation tasks (He et al., 2018;

Original: Shen et al., 2019).
Revised: Shen et al., 2019).

Original: We demonstrate similar gains in the chemical context.
Revised: We demonstrate similar gains in the chemical context.

Original: We evaluate our model on the benchmark USPTO-50k dataset, and compare it against state-ofthe-art template-free baselines using the Transformer model.
Revised: We evaluate our model on the benchmark USPTO-50k dataset, and compare it against state-ofthe-art template-free baselines using the Transformer model.

Original: We focus our evaluation on topaccuracy, because there are many equally valuable reaction transformations for each input target, though only one is presented in the data.
Revised: We focus our evaluation on topaccuracy, because there are many equally valuable reaction transformations for each input target, though only one is presented in the data.

Original: Compared to the baseline, we achieve better performance overall, with over 13% increase in top-10 accuracy for our best model.
Revised: Compared to the baseline, we achieve better performance overall, with over 13% increase in top-10 accuracy for our best model.

Original: When we create a split of the data based on different reaction templates (a task that any template-based model would fail on), we similarly observe a performance increase for our model.
Revised: When we create a split of the data based on different reaction templates (a task that any template-based model would fail on), we similarly observe a performance increase for our model.

Original: Additionally, we demonstrate that our model outputs exhibit signiﬁcant diversity through both quantitative and human evaluations.
Revised: Additionally, we demonstrate that our model outputs exhibit signiﬁcant diversity through both quantitative and human evaluations.

Original:  R ELATED W ORK
Revised:  R ELATED W ORK

Original: Template-based Models Traditional methods for retrosynthetic reaction prediction use templatebased models.
Revised: Template-based Models Traditional methods for retrosynthetic reaction prediction use templatebased models.

Original: Templates, or rules, denote the exact atom and bond changes for a chemical reaction.
Revised: Templates, or rules, denote the exact atom and bond changes for a chemical reaction.

Original: Coley et al.
Revised: Coley et al.

Original: (2018) applies these templates for a given target compound based on similar reactions in the dataset.
Revised: (2018) applies these templates for a given target compound based on similar reactions in the dataset.

Original: Going one step further, Segler & Waller (2017) learns the associations between molecules and templates through a neural network.
Revised: Going one step further, Segler & Waller (2017) learns the associations between molecules and templates through a neural network.

Original: Baylon et al.
Revised: Baylon et al.

Original: (2019) uses a hierarchical network to ﬁrst predict the reaction group and then the correct template for that group.
Revised: (2019) uses a hierarchical network to ﬁrst predict the reaction group and then the correct template for that group.

Original: However, to have the ﬂexibility to generalize beyond extracted rules, we explore template-free generative models.
Revised: However, to have the ﬂexibility to generalize beyond extracted rules, we explore template-free generative models.

Original: Molecule Generation There are two different approaches to generative tasks for molecules, demonstrated through graph and SMILES representations.
Revised: Molecule Generation There are two different approaches to generative tasks for molecules, demonstrated through graph and SMILES representations.

Original: The graph-generation problem has been explored in Li et al.
Revised: The graph-generation problem has been explored in Li et al.

Original: as a node-by-node generation algorithm,
Revised: as a node-by-node generation algorithm,

Original: but this model does not guarantee the validity of the output chemical graph.
Revised: but this model does not guarantee the validity of the output chemical graph.

Original: Jin et al.
Revised: Jin et al.

Original: (2018a;b) improves upon this method using a junction-tree encoder-decoder that forces the outputs to be constrained in the valid chemical space; however, these models require complex, structured decoders.
Revised: (2018a;b) improves upon this method using a junction-tree encoder-decoder that forces the outputs to be constrained in the valid chemical space; however, these models require complex, structured decoders.

Original: We focus on the generative task of
Revised: We focus on the generative task of

Original: SMILES string representations of the molecules, which has been explored in Kusner et al.
Revised: SMILES string representations of the molecules, which has been explored in Kusner et al.

Original: and G´omez-Bombarelli et al.
Revised: and G´omez-Bombarelli et al.

Original: Pre-training Pre-training methods have been shown to vastly improve the performance of Transformer models in NLP tasks without additional data supervision.
Revised: Pre-training Pre-training methods have been shown to vastly improve the performance of Transformer models in NLP tasks without additional data supervision.

Original: Devlin et al.
Revised: Devlin et al.

Original: (2018) use a masked language modeling objective to help their model learn effective representations for downstream tasks.
Revised: (2018) use a masked language modeling objective to help their model learn effective representations for downstream tasks.

Original: Similar pre-training methods on molecules have been explored by Hu et al.
Revised: Similar pre-training methods on molecules have been explored by Hu et al.

Original: (2019), where they mask out atoms in molecular graphs.
Revised: (2019), where they mask out atoms in molecular graphs.

Original: Meanwhile, our work does not use a masked objective, but instead creates pre-training tasks that are relevant to the retrosynthesis prediction problem.
Revised: Meanwhile, our work does not use a masked objective, but instead creates pre-training tasks that are relevant to the retrosynthesis prediction problem.

Original:  B ACKGROUND
Revised:  B ACKGROUND

Original: Given an input target molecule, the task of retrosynthetic reaction prediction is to output likely reactants that can form the target product.
Revised: Given an input target molecule, the task of retrosynthetic reaction prediction is to output likely reactants that can form the target product.

Original: Formally, we express a molecule as a text string via its
Revised: Formally, we express a molecule as a text string via its

Original: SMILES representation, and cast our task into a sequence-to-sequence (seq2seq) prediction problem (example shown in Figure 1).
Revised: SMILES representation, and cast our task into a sequence-to-sequence (seq2seq) prediction problem (example shown in Figure 1).

Original: For this task, the input target is always a single molecule, while the output predictions are usually a set of more than one molecule concatenated by separators “.”.
Revised: For this task, the input target is always a single molecule, while the output predictions are usually a set of more than one molecule concatenated by separators “.”.

Original: To provide more intuition for this generative task, we describe some properties of SMILES strings.
Revised: To provide more intuition for this generative task, we describe some properties of SMILES strings.

Original: Each SMILES string is 1-D encoding of a 2-D molecular graph.
Revised: Each SMILES string is 1-D encoding of a 2-D molecular graph.

Original: If the predicted SMILES does not adhere to the SMILES grammar, then a valid molecular graph cannot be reconstructed.
Revised: If the predicted SMILES does not adhere to the SMILES grammar, then a valid molecular graph cannot be reconstructed.

Original: Moreover, each molecule has many equivalent SMILES representations, as a single instance of its SMILES is just a graph traversal starting at some arbitrary node.
Revised: Moreover, each molecule has many equivalent SMILES representations, as a single instance of its SMILES is just a graph traversal starting at some arbitrary node.

Original: Therefore, two very different SMILES string can encode the same molecule (see Appendix B), and the model needs to be robust to the given input.
Revised: Therefore, two very different SMILES string can encode the same molecule (see Appendix B), and the model needs to be robust to the given input.

Original: One method, proposed by Schwaller et al.
Revised: One method, proposed by Schwaller et al.

Original: (2019), augments the input data with different
Revised: (2019), augments the input data with different

Original: SMILES strings of the same input target molecule.
Revised: SMILES strings of the same input target molecule.

Original: For our model architecture, we apply a Transformer model for the seq2seq task, which has an encoder-decoder structure (Vaswani et al., 2017; Schwaller et al., 2019).
Revised: For our model architecture, we apply a Transformer model for the seq2seq task, which has an encoder-decoder structure (Vaswani et al., 2017; Schwaller et al., 2019).

Original: The encoder maps an input sequence of tokens (from the SMILES string) to a sequence of continuous representations, which are then fed to the decoder to generate an output sequence of tokens one element at a time, auto-regressively.
Revised: The encoder maps an input sequence of tokens (from the SMILES string) to a sequence of continuous representations, which are then fed to the decoder to generate an output sequence of tokens one element at a time, auto-regressively.

Original: Once the model is trained, a beam search procedure is used at inference time to ﬁnd likely output sequences.
Revised: Once the model is trained, a beam search procedure is used at inference time to ﬁnd likely output sequences.

Original: The main building block of the Transformer architecture lies in its global self-attention layers, which are well-suited for predictions of the latent graph structure of SMILES strings.
Revised: The main building block of the Transformer architecture lies in its global self-attention layers, which are well-suited for predictions of the latent graph structure of SMILES strings.

Original: For example, two tokens that are far apart in the SMILES string could be close together topologically in the corresponding molecular graph.
Revised: For example, two tokens that are far apart in the SMILES string could be close together topologically in the corresponding molecular graph.

Original: The global connectivity of the Transformer model allows it to better leverage this information.
Revised: The global connectivity of the Transformer model allows it to better leverage this information.

Original: Additionally, since SMILES follow a rigid grammar requiring long rangedependencies, these dependencies can be more easily learned through global attention layers (see
Revised: Additionally, since SMILES follow a rigid grammar requiring long rangedependencies, these dependencies can be more easily learned through global attention layers (see

Original: Appendix B).
Revised: Appendix B).

Original:  A PPROACH
Revised:  A PPROACH

Original: Despite the ﬂexible architecture of Transformer models, we recognize that there are ways to improve model generalization.
Revised: Despite the ﬂexible architecture of Transformer models, we recognize that there are ways to improve model generalization.

Original: Additionally, there is no inductive bias for proposing diverse outputs.
Revised: Additionally, there is no inductive bias for proposing diverse outputs.

Original: We propose two techniques to enhance the base molecular Transformer model, which we describe now.
Revised: We propose two techniques to enhance the base molecular Transformer model, which we describe now.

Original: 4. P RE - TRAINING
Revised: 4. P RE - TRAINING

Original: In the data, each input target molecule is associated with a single reaction transformation — though there are many equally good chemical reactions.
Revised: In the data, each input target molecule is associated with a single reaction transformation — though there are many equally good chemical reactions.

Original: Therefore, for each input target, we construct several new prediction examples that are chemically meaningful, and pre-train the model on these auxiliary examples.
Revised: Therefore, for each input target, we construct several new prediction examples that are chemically meaningful, and pre-train the model on these auxiliary examples.

Original: We do so without requiring additionally data, or data supervision.
Revised: We do so without requiring additionally data, or data supervision.

Original: The two variants of our method are described in detail below, with examples shown in Figure 3.
Revised: The two variants of our method are described in detail below, with examples shown in Figure 3.

Original: Random pre-training For each input target molecule, we generate new examples by selecting a random bond to break.
Revised: Random pre-training For each input target molecule, we generate new examples by selecting a random bond to break.

Original: The types of bonds that we consider are acyclic single bonds, because these are the bonds most commonly broken in chemical reactions.
Revised: The types of bonds that we consider are acyclic single bonds, because these are the bonds most commonly broken in chemical reactions.

Original: As we break an acyclic bond, the input molecule is necessarily broken up into two output molecules, each being a subgraph of the input molecule.
Revised: As we break an acyclic bond, the input molecule is necessarily broken up into two output molecules, each being a subgraph of the input molecule.

Original: Although the examples generated by this method do not cover the entire space of chemical reactions (for instance some reactions do not break any bonds at all), these examples are easy to generate and cover a diverse range of transformations.
Revised: Although the examples generated by this method do not cover the entire space of chemical reactions (for instance some reactions do not break any bonds at all), these examples are easy to generate and cover a diverse range of transformations.

Original: Template-based pre
Revised: Template-based pre

Original: -training Instead of randomly breaking bonds, we can also use the templates extracted from the training data to create reaction examples.
Revised: -training Instead of randomly breaking bonds, we can also use the templates extracted from the training data to create reaction examples.

Original: An example of a template is shown in Figure 4: each template matches a speciﬁc pattern in the input molecule, and transforms that pattern according to the template speciﬁcations.
Revised: An example of a template is shown in Figure 4: each template matches a speciﬁc pattern in the input molecule, and transforms that pattern according to the template speciﬁcations.

Original: When the matched pattern is a single acyclic bond, this method will generate similar outputs as the random pre-training method, except that templates usually add additional pieces (functional groups) to the output example.
Revised: When the matched pattern is a single acyclic bond, this method will generate similar outputs as the random pre-training method, except that templates usually add additional pieces (functional groups) to the output example.

Original: As shown in Figure 3, both examples are derived from the same bond broken in the input target molecule, but for the template-based example, an additional functional group was added, matching a more realistic reaction context.
Revised: As shown in Figure 3, both examples are derived from the same bond broken in the input target molecule, but for the template-based example, an additional functional group was added, matching a more realistic reaction context.

Original: On average, for a random input molecule, there are 10 different possible examples that can be extracted from the random pre-training method, while there are over 200 different possible examples that can be extracted using the template-based pre-training method.
Revised: On average, for a random input molecule, there are 10 different possible examples that can be extracted from the random pre-training method, while there are over 200 different possible examples that can be extracted using the template-based pre-training method.

Original: However, many of these 200 examples represent similar chemical transformations, only differing in the type of functional group added.
Revised: However, many of these 200 examples represent similar chemical transformations, only differing in the type of functional group added.

Original: More broadly speaking, we can say that the template pre-training method generates more chemically valid reactions compared to the random pre-training method.
Revised: More broadly speaking, we can say that the template pre-training method generates more chemically valid reactions compared to the random pre-training method.

Original: However, the advantage of the random pre-training method is that it can break bonds that are not represented within the templates, thereby perhaps conferring a higher ability to generalize.
Revised: However, the advantage of the random pre-training method is that it can break bonds that are not represented within the templates, thereby perhaps conferring a higher ability to generalize.

Original: As routine, the model is pre-trained on these automatically constructed auxiliary tasks, and then used as initialization to be ﬁne-tuned on the actual retrosynthesis data.
Revised: As routine, the model is pre-trained on these automatically constructed auxiliary tasks, and then used as initialization to be ﬁne-tuned on the actual retrosynthesis data.

Original: 4. M IXTURE M ODEL
Revised: 4. M IXTURE M ODEL

Original: Next, we tackle the problem of generating diverse predictions.
Revised: Next, we tackle the problem of generating diverse predictions.

Original: As mentioned earlier, the retrosynthesis problem is a one-to-many mapping since a target molecule can be formed from different types of reactions.
Revised: As mentioned earlier, the retrosynthesis problem is a one-to-many mapping since a target molecule can be formed from different types of reactions.

Original: We would like the model to produce a diverse set of predictions so that chemists can choose the most feasible and economical one in practice.
Revised: We would like the model to produce a diverse set of predictions so that chemists can choose the most feasible and economical one in practice.

Original: However, hypotheses generated by a vanilla seq2seq model with beam search typically exempliﬁes low diversity with only minor differences in the sufﬁx, see Figure 8 (Vijayakumar et al., 2016).
Revised: However, hypotheses generated by a vanilla seq2seq model with beam search typically exempliﬁes low diversity with only minor differences in the sufﬁx, see Figure 8 (Vijayakumar et al., 2016).

Original: To address this, we use a mixture seq2seq model that has shown sucess in generating diverse machine translations to generate diverse retrosynthesis reaction predictions (He et al., 2018;
Revised: To address this, we use a mixture seq2seq model that has shown sucess in generating diverse machine translations to generate diverse retrosynthesis reaction predictions (He et al., 2018;

Original: Shen et al., 2019).
Revised: Shen et al., 2019).

Original: Speciﬁcally, given a target SMILES string x and reactants SMILES string y , a mixture model introduces a multinomial latent variable z ∈ { 1 , · · · , K } to capture different reaction types, and decomposes the marginal likelihood as:
Revised: Speciﬁcally, given a target SMILES string x and reactants SMILES string y , a mixture model introduces a multinomial latent variable z ∈ { 1 , · · · , K } to capture different reaction types, and decomposes the marginal likelihood as:

Original: [Equation]
Revised: [Equation]

Original: Here, the prior p ( z | x ; θ ) and likelihood p ( y | z, x ; θ ) parameterized by θ are functions to be learned.
Revised: Here, the prior p ( z | x ; θ ) and likelihood p ( y | z, x ; θ ) parameterized by θ are functions to be learned.

Original: We use a uniform prior p ( z | x ; θ ) = 1 /K , which is easy to implement and works well in practice (Shen et al., 2019).
Revised: We use a uniform prior p ( z | x ; θ ) = 1 /K , which is easy to implement and works well in practice (Shen et al., 2019).

Original: For p ( y | z, x ; θ ) , we share the encoder-decoder network among mixture components, and feed the embedding of z as an input to the decoder so that y is conditioned on it.
Revised: For p ( y | z, x ; θ ) , we share the encoder-decoder network among mixture components, and feed the embedding of z as an input to the decoder so that y is conditioned on it.

Original: The increase in the parameters of our model is negligible over the baseline model.
Revised: The increase in the parameters of our model is negligible over the baseline model.

Original: We train the mixture model with the online hard-EM algorithm.
Revised: We train the mixture model with the online hard-EM algorithm.

Original: Taking a mini-batch of training examples { ( x ( i ) , y ( i ) ) } mi =1 , we enumerate all K values of z and compute their loss, − log p ( y ( i ) | z, x ( i ) ; θ ) .
Revised: Taking a mini-batch of training examples { ( x ( i ) , y ( i ) ) } mi =1 , we enumerate all K values of z and compute their loss, − log p ( y ( i ) | z, x ( i ) ; θ ) .

Original: Then, for each ( x ( i ) , y ( i ) ) , we select the value of z that yields the minimum loss: z ( i ) =
Revised: Then, for each ( x ( i ) , y ( i ) ) , we select the value of z that yields the minimum loss: z ( i ) =

Original: arg min z − log p ( y ( i ) | z, x ( i ) ; θ ) , and back-propagate through it, so only one component receives gradients per example.
Revised: arg min z − log p ( y ( i ) | z, x ( i ) ; θ ) , and back-propagate through it, so only one component receives gradients per example.

Original: An important detail for successfully training a mixture model is that dropout is turned off in the forward passes for latent variable selection, and turned back on at back-propagation time for gradient regularization.
Revised: An important detail for successfully training a mixture model is that dropout is turned off in the forward passes for latent variable selection, and turned back on at back-propagation time for gradient regularization.

Original: Otherwise even a small amount of dropout noise will corrupt the optimal value of z , making the selection random and the different latent components will fail to diversify (Shen et al., 2019).
Revised: Otherwise even a small amount of dropout noise will corrupt the optimal value of z , making the selection random and the different latent components will fail to diversify (Shen et al., 2019).

Original: The hard selection of the latent variable forces different components to specialize on different subsets of the data.
Revised: The hard selection of the latent variable forces different components to specialize on different subsets of the data.

Original: As we shall later see in the experimental results, our mixture model can learn to represent different reaction types in the training data and show improved diversity over the baseline.
Revised: As we shall later see in the experimental results, our mixture model can learn to represent different reaction types in the training data and show improved diversity over the baseline.

Original:  E XPERIMENTAL S ETUP 5. D ATA
Revised:  E XPERIMENTAL S ETUP 5. D ATA

Original: The benchmark dataset we use is a subset of the open source patent database of chemical reactions (Lowe, 2012).
Revised: The benchmark dataset we use is a subset of the open source patent database of chemical reactions (Lowe, 2012).

Original: Speciﬁcally, we use the curated 50k subset (USPTO-50k) from Liu et al.
Revised: Speciﬁcally, we use the curated 50k subset (USPTO-50k) from Liu et al.

Original: (2017), including the same data splits.
Revised: (2017), including the same data splits.

Original: Each example reaction in this dataset is labeled with one of ten reaction classes, which describes its transformation type, but we do not use this information in our experiments, similar to Karpov et al.
Revised: Each example reaction in this dataset is labeled with one of ten reaction classes, which describes its transformation type, but we do not use this information in our experiments, similar to Karpov et al.

Original: Since we are only interested in the retrosynthesis prediction problem, the examples are processed to remove any reagent molecules (molecules that do not contribute atoms to the reaction).
Revised: Since we are only interested in the retrosynthesis prediction problem, the examples are processed to remove any reagent molecules (molecules that do not contribute atoms to the reaction).

Original: The reactions are tokenized in the same manner as in Schwaller et al.
Revised: The reactions are tokenized in the same manner as in Schwaller et al.

Original: (2019), with each token being a meaningful subunit of the molecule (i.e., an atom or bond).
Revised: (2019), with each token being a meaningful subunit of the molecule (i.e., an atom or bond).

Original: In addition, we create a separate split of the USPTO-50k data, in which the train and test sets are split by reaction templates.
Revised: In addition, we create a separate split of the USPTO-50k data, in which the train and test sets are split by reaction templates.

Original: Speciﬁcally, we split the data so that no example in the test set can be solved correctly with any templates extracted from training data.
Revised: Speciﬁcally, we split the data so that no example in the test set can be solved correctly with any templates extracted from training data.

Original: We use the template extraction code from Coley et al.
Revised: We use the template extraction code from Coley et al.

Original: (2017), which to the best of our knowledge, is the only publicly available template extraction code.
Revised: (2017), which to the best of our knowledge, is the only publicly available template extraction code.

Original: 5. E VALUATION M ETRICS
Revised: 5. E VALUATION M ETRICS

Original: Accuracy The evaluation of retrosynthesis is challenging, because each input target has many valid syntheses, but only one is given in the data.
Revised: Accuracy The evaluation of retrosynthesis is challenging, because each input target has many valid syntheses, but only one is given in the data.

Original: When the model output does not exactly match the single solution in the data, the model is not necessarily wrong, but simply giving a plausible alternative.
Revised: When the model output does not exactly match the single solution in the data, the model is not necessarily wrong, but simply giving a plausible alternative.

Original: Therefore, we focus on the top-10 accuracy for our evaluation, but present all results from our experiments.
Revised: Therefore, we focus on the top-10 accuracy for our evaluation, but present all results from our experiments.

Original: We compute the accuracies by matching the canonical SMILES strings of molecule sets.
Revised: We compute the accuracies by matching the canonical SMILES strings of molecule sets.

Original: For the mixture model, we output the top 10 predictions for each latent class, and then combine those results based on likelihoods to get top 10 predictions overall.
Revised: For the mixture model, we output the top 10 predictions for each latent class, and then combine those results based on likelihoods to get top 10 predictions overall.

Original: Diversity To measure diversity, we provide both quantitative and human evaluations.
Revised: Diversity To measure diversity, we provide both quantitative and human evaluations.

Original: For the former, we train a model to predict the reaction class given the input target molecule and the predicted output.
Revised: For the former, we train a model to predict the reaction class given the input target molecule and the predicted output.

Original: We use a typical message-passing graph convolution network (Jin et al., 2017) to embed both the input and output molecules (using weight-sharing) and compute the reaction embedding as a difference of the two embeddings.
Revised: We use a typical message-passing graph convolution network (Jin et al., 2017) to embed both the input and output molecules (using weight-sharing) and compute the reaction embedding as a difference of the two embeddings.

Original: This predictor is trained on the 10 reaction class labels in the
Revised: This predictor is trained on the 10 reaction class labels in the

Original: USPTO-50k dataset, and achieves 99% accuracy on the test set, so we can be fairly conﬁdent in its ability to predict the reaction class in-domain.
Revised: USPTO-50k dataset, and achieves 99% accuracy on the test set, so we can be fairly conﬁdent in its ability to predict the reaction class in-domain.

Original: 5. B ASELINES
Revised: 5. B ASELINES

Original: In addition to our experiments, we include a template-based approach from Coley et al.

Original: ( Template Sim ).

Original: Our main baseline is the SMILES transformer ( Base ), adapted from Schwaller et al.
Revised: Our main baseline is the SMILES transformer ( Base ), adapted from Schwaller et al.

Original: We run the same model as other recent works for this task (Lin et al., 2019; Karpov et al., 2019), and we build on top of the Transformer implementation from OpenNMT (Klein et al., 2017).
Revised: We run the same model as other recent works for this task (Lin et al., 2019; Karpov et al., 2019), and we build on top of the Transformer implementation from OpenNMT (Klein et al., 2017).

Original: We run ablation experiments for pre-training and different mixture models to show the impact of each approach.
Revised: We run ablation experiments for pre-training and different mixture models to show the impact of each approach.

Original: Random pre-training is referred to as Pre-train (R) , while templatebased pre-training is referred to as Pre-train (T) .
Revised: Random pre-training is referred to as Pre-train (R) , while template-based pre-training is referred to as Pre-train (T) .

Original: For each example, we construct up to 10 new auxiliary examples, and pre-train the model on these examples.
Revised: For each example, we construct up to 10 new auxiliary examples, and pre-train the model on these examples.

Original: Additionally, following Schwaller et al.
Revised: Additionally, following Schwaller et al.

Original: (2019), we also augment the training data with variations of the input SMILES string, referred to as Aug .
Revised: (2019), we also augment the training data with variations of the input SMILES string, referred to as Aug .

Original: That is, for each training example, we add an extra example using a different input SMILES string, which is trained to predict the same output reactants.
Revised: That is, for each training example, we add an extra example using a different input SMILES string, which is trained to predict the same output reactants.

Original: This helps the model learn representations robust to the permutation of the input SMILES string.
Revised: This helps the model learn representations robust to the permutation of the input SMILES string.

Revised: In addition to our experiments, we include a templatebased approach from Coley et al.

Revised: (2018), and a template-free approach from Zheng et al.

Revised: (2019) that adds a syntax predictor on top of the transformer model.

Original:  R ESULTS
Revised:  R ESULTS

Original: Accuracy The accuracy results of our model is shown in Table 1.
Revised: Accuracy The accuracy results of our model is shown in Table 1.

Original: We observe that both pre-training tasks improve over the baseline, and more so when combined with data augmentation.
Revised: We observe that both pre-training tasks improve over the baseline, and more so when combined with data augmentation.

Original: This shows that our pre-training tasks help the model learn the chemical reaction representational space, and are useful for the retrosynthesis prediction problem.
Revised: This shows that our pre-training tasks help the model learn the chemical reaction representational space, and are useful for the retrosynthesis prediction problem.

Original: However, interestingly, there seem to be marginal differences between the two pre-training methods.
Revised: However, interestingly, there seem to be marginal differences between the two pre-training methods.

Original: We attribute this to the fact that both pre-training methods usually generate very similar sets of examples.
Revised: We attribute this to the fact that both pre-training methods usually generate very similar sets of examples.

Original: Previously shown in Figure 3, one of the main differences of template-based pre-training is just that it adds additional functional groups.
Revised: Previously shown in Figure 3, one of the main differences of template-based pre-training is just that it adds additional functional groups.

Original: But since these generated examples are not always chemically valid, having this extra information may not prove to be very valuable.
Revised: But since these generated examples are not always chemically valid, having this extra information may not prove to be very valuable.

Original: We do note, however, that constructing additional decompositions of the input targets does actually matter for the pre-training task.
Revised: We do note, however, that constructing additional decompositions of the input targets does actually matter for the pre-training task.

Original: We had also experimented with pretraining methods that only used variations of the input SMILES strings as pre-training output targets (because each molecule has many different SMILES representations).
Revised: We had also experimented with pretraining methods that only used variations of the input SMILES strings as pre-training output targets (because each molecule has many different SMILES representations).

Original: However, these methods did not result in the same performance gains, because these pre-training targets do not contain much useful information for the actual task.
Revised: However, these methods did not result in the same performance gains, because these pre-training targets do not contain much useful information for the actual task.

Original: [Table]
Revised: [Table]

Original: Our original motivation for using a mixture model was to improve diversity, but we observe that it also leads to an increase in performance.
Revised: Our original motivation for using a mixture model was to improve diversity, but we observe that it also leads to an increase in performance.

Original: We try N = { 1 , 2 , 5 } for the number of discrete latent classes, and we see that more latent classes generally leads to higher accuracies.
Revised: We try N = { 1 , 2 , 5 } for the number of discrete latent classes [Table] and we see that more latent classes generally leads to higher accuracies.

Original: The top-1 accuracy does decrease slightly as the number of latent classes increases, but we observe much higher accuracies at top-10 (increase of 7-8%).
Revised: The top-1 accuracy does decrease slightly as the number of latent classes increases, but we observe much higher accuracies at top-10 (increase of 7-8%).

Original: Importantly, we note that our method of combining outputs from different latent classes is not perfect, as the likelihoods from different latent classes are not totally comparable.
Revised: Importantly, we note that our method of combining outputs from different latent classes is not perfect, as the likelihoods from different latent classes are not totally comparable.

Original: That is likely the cause of the decrease in top-1 accuracy; yet as we mentioned in Section 5.2, top-10 accuracies are signiﬁcantly more meaningful for our problem.
Revised: That is likely the cause of the decrease in top-1 accuracy; yet as we mentioned in Section 5.2, top-10 accuracies are signiﬁcantly more meaningful for our problem.

Original: [Table]
Revised: [Table]

Original: We see that our template-free methods can still generalize to this test set.

Original: Next, we show our results on a different split of the data, which is more challenging to generalize.
Revised: Next, we show our results on a different split of the data, which is more challenging to generalize.

Original: Using the dataset split on templates described in Section 5.1, we explore the performance of our best mixture model with pre-training compared to the baseline with no pre-training.
Revised: Using the dataset split on templates described in Section 5.1, we explore the performance of our best mixture model with pre-training compared to the baseline with no pre-training.

Original: As mentioned earlier, template-free models confer advantages over template-based models, as template-based models lack the ability to generalize outside of extracted rules.
Revised: As mentioned earlier, template-free models confer advantages over template-based models, as template-based models lack the ability to generalize outside of extracted rules.

Original: For this dataset, any template-based model would necessarily achieve 0% accuracy based on construction.
Revised: For this dataset, any template-based model would necessarily achieve 0% accuracy based on construction.

Original: Table 2 compares the performance of the different models and we see that, although the task is challenging, we can attain substantial accuracy of 26.6% at top-10 compared to 20.6% of the baseline.
Revised: Table 2 compares the performance of the different models and we see that, although the task is challenging, we can attain substantial accuracy of 26.6% at top-10 compared to 20.6% of the baseline.

Original: Even on this difﬁcult task, we show that our model offers generalizability on the test set.
Revised: Even on this difﬁcult task, we show that our model offers generalizability on the test set.

Original: Diversity We now look at evaluations of diversity for our model.

Original: Using the reaction class model described in Section 5.2, we predict the reaction class for every output of our models.

Original: Then, we

Original: [Figure]
Revised: [Figure]

Original: [Table]

Original: [Table]

Original: [Table]
Revised: [Table]

Original: Here, we use a mixture model with 5 latent classes, and there are 10 reaction classes of interest for this data set.
Revised: Here, we use a mixture model with 5 latent classes, and there are 10 reaction classes of interest for this data set.

Original: The reaction classes are determined by a pre-trained model described in Section 5.
Revised: The reaction classes are determined by a pre-trained model described in Section 5.

Revised: Diversity We now look at evaluations of diversity for our model.

Revised: Using the reaction class model described in Section 5.2, we predict the reaction class for every output of our models.

Original:  compute the average number of unique reaction classes, holding all other factors constant besides varying the number of latent classes (results shown in Table 3).
Revised: Then, we compute the average number of unique reaction classes, holding all other factors constant besides varying the number of latent classes (results shown in Table 3).

Original: The number of unique reaction classes is 3.32 for the mixture model compared to the 2.66 for the base model, suggesting that the mixture model predicts a more diverse cast of outputs.
Revised: The number of unique reaction classes is 3.32 for the mixture model compared to the 2.66 for the base model, suggesting that the mixture model predicts a more diverse cast of outputs.

Original: The diversity of the predictions can also be examined from an interpretability standpoint for the latent classes of the mixture model.
Revised: The diversity of the predictions can also be examined from an interpretability standpoint for the latent classes of the mixture model.

Original: Using the reaction class model, we take the 10 top predictions from each latent class, and count the number of occurrences for each reaction class.
Revised: Using the reaction class model, we take the 10 top predictions from each latent class, and count the number of occurrences for each reaction class.

Original: Normalizing across reaction classes, we can see from Figure 6 that each latent class learns to predict a different distribution of reaction classes.
Revised: Normalizing across reaction classes, we can see from Figure 6 that each latent class learns to predict a different distribution of reaction classes.

Original: We also supplement our diversity results with human evaluation.
Revised: We also supplement our diversity results with human evaluation.

Original: To make the problem tractable for a human chemist, we randomly select 100 different reactions from the test set and present the toppredicted outputs from both the base and mixture model, where the the task is to determine diversity based on number of different types of reactions.
Revised: To make the problem tractable for a human chemist, we randomly select 100 different reactions from the test set and present the toppredicted outputs from both the base and mixture model, where the the task is to determine diversity based on number of different types of reactions.

Original: The human chemist is asked to choose which of the two output sets is more diverse, or neither if the two sets do not differ in diversity.
Revised: The human chemist is asked to choose which of the two output sets is more diverse, or neither if the two sets do not differ in diversity (see Appendix

Original:  For this task, the human chemist chose the mixture model more than twice as often as the base model (43 times vs 21), see Table 3.
Revised: C). For this task, the human chemist chose the mixture model more than twice as often as the base model (43 times vs 21), see Table 3.

Original: Although not perfect, these results exemplify that our model does generate more diverse outputs than the baseline.
Revised: Although not perfect, these results exemplify that our model does generate more diverse outputs than the baseline.

Original:  CONCLUSION
Revised:  CONCLUSION

Original: We explored the problem of making one-step retrosynthesis reaction predictions, dealing with the issues of generalizability and making diverse predictions.
Revised: We explored the problem of making one-step retrosynthesis reaction predictions, dealing with the issues of generalizability and making diverse predictions.

Original: Through pre-training and use of mixture models, we show that our model beats state-of-the-art methods in terms of accuracy and generates more diverse predictions.
Revised: Through pre-training and use of mixture models, we show that our model beats state-of-the-art methods in terms of accuracy and generates more diverse predictions.

Original: Even on a challenging task, for which any template-based models would fail, our model still is able to generalize to the test set.
Revised: Even on a challenging task, for which any template-based models would fail, our model still is able to generalize to the test set.

Original: A R ARE R EACTIONS
Revised: A R ARE R EACTIONS

Original: To compute a subset of the data with only rare reactions, we extracted all the templates from the entire USPTO-50k dataset, and selected the templates that occurs at most 10 times.
Revised: To compute a subset of the data with only rare reactions, we extracted all the templates from the entire USPTO-50k dataset, and selected the templates that occurs at most 10 times.

Original: The reactions in the test set that have these templates constitute the rare reaction subset, which is aroundexamples.
Revised: The reactions in the test set that have these templates constitute the rare reaction subset, which is aroundexamples.

Original: The results for this rare reaction subset can be found in Table 4.
Revised: The results for this rare reaction subset can be found in Table 4.

Original: From this table, we can see that the top-1 accuracy for the baseline model is only 18.6% which is roughly 25% drop from the 42% in Table 1.
Revised: From this table, we can see that the top-1 accuracy for the baseline model is only 18.6% which is roughly 25% drop from the 42% in Table 1.

Original: We also mention that our new models improve over this baseline, showing more generalizability.
Revised: We also mention that our new models improve over this baseline, showing more generalizability.

Original: [Table]
Revised: [Table]

Original: B SMILES REPRESENTATIONS
Revised: B SMILES REPRESENTATIONS

Original: Each molecule has many different SMILES representation, because each different SMILES string is just a different graph traversal over the molecule (see Figure 7).
Revised: Each molecule has many different SMILES representation, because each different SMILES string is just a different graph traversal over the molecule (see Figure 7).

Original: Although there is often some canonical SMILES string which is consistent, it is still completely arbitrary.
Revised: Although there is often some canonical SMILES string which is consistent, it is still completely arbitrary.

Original: [Figure]
Revised: [Figure]

Original: Additionally, because SMILES is a 1-D encoding of the 2-D molecular graph, two atoms that are close in the graph may be far apart in the SMILES string, shown in Figure 8.
Revised: Additionally, because SMILES is a 1-D encoding of the 2-D molecular graph, two atoms that are close in the graph may be far apart in the SMILES string, shown in Figure 8.

Original: To correctly decode a
Revised: To correctly decode a

Original: SMILES string, the decoder has to be aware of long-range dependencies.
Revised: SMILES string, the decoder has to be aware of long-range dependencies.

Original: For instance, numbers in the SMILES string indicate the start and end of a cycle.
Revised: For instance, numbers in the SMILES string indicate the start and end of a cycle.

Original: The decoder has to close all cycles that it starts, and at the or elsethe output SMILES will be invalid
Revised: The decoder has to close all cycles that it , and at the or else SMILES will be invalid.

Revised: C H UMAN E VALUATION ON D IVERSITY

Revised: For human evaluation of diversity, we asked a senior (5+ years) PhD chemistry student to compare the outputs of the base model versus the mixture model.

Revised: The human is given the top 5 outputs of each model and asked to rate which set is more diverse by comparing the number of reactions that differ in reaction type or location of reaction on molecule.

Revised: Reactions that used slightly different precursors were considered identical, and therefore does not contribute to diversity (for example, protection reactions with different protection groups are considered as one type).

Revised: Lastly, the evaluation was done with the correctness of the overall reaction in mind.