Original: Human-in-the-loop for a Disconnection Aware Retrosynthesis
Revised: Human-in-the-loop for a Disconnection Aware Retrosynthesis

Original: Abstract
Revised: Abstract

Original: Retrosynthesis is an approach commonly undertaken when considering the manufacture of novel molecules.
Revised: Retrosynthesis is an approach commonly undertaken when considering the manufacture of novel molecules.

Original: During this process, a target molecule is broken down and analyzed by considering the bonds to be changed as well as the functional group interconversion.
Revised: During this process, a target molecule is broken down and analyzed by considering the bonds to be changed as well as the functional group interconversion.

Original: In modern computer-assisted synthesis planning tools, the predictions of these changes are typically carried out automatically.
Revised: In modern computer-assisted synthesis planning tools, the predictions of these changes are typically carried out automatically.

Original: However there may be some beneﬁt to the decision being guided by those executing the process: typically, chemists have a clear idea where the retrosynthetic change should happen, but not how such a transformation is to be realized.
Revised: However there may be some beneﬁt to the decision being guided by those executing the process: typically, chemists have a clear idea where the retrosynthetic change should happen, but not how such a transformation is to be realized.

Original: Using a data-driven model, the retrosynthesis task can be further explored by giving chemists the option to explore speciﬁc disconnections.
Revised: Using a data-driven model, the retrosynthesis task can be further explored by giving chemists the option to explore speciﬁc disconnections.

Original: In this work, we design an approach to provide this option by adapting a transformer-based model for single-step retrosynthesis.
Revised: In this work, we design an approach to provide this option by adapting a transformer-based model for single-step retrosynthesis.

Original: The model takes as input a product SMILES string, in which the atoms where the transformation should occur are tagged accordingly.
Revised: The model takes as input a product SMILES string, in which the atoms where the transformation should occur are tagged accordingly.

Original: This model predicts precursors corresponding to a disconnection occurring in the correct location in 88.9% of the test set reactions.
Revised: This model predicts precursors corresponding to a disconnection occurring in the correct location in 88.9% of the test set reactions.

Original: The assessment with a forward prediction model shows that 76% of the predictions are chemically correct, with 14.1% perfectly matching the ground truth.
Revised: The assessment with a forward prediction model shows that 76% of the predictions are chemically correct, with 14.1% perfectly matching the ground truth.

Original:  Introduction
Revised:  Introduction

Original: Society relies on the production of novel molecules and materials.
Revised: Society relies on the production of novel molecules and materials.

Original: The most common method for developing novel compound synthesis involves breaking existing atom-to-atom bonds and forming new ones.
Revised: The most common method for developing novel compound synthesis involves breaking existing atom-to-atom bonds and forming new ones.

Original: Retrosynthetic analysis (retrosynthesis) is the practice of analyzing a target molecule into commercially available precursors by way of potential disconnections (bond breakages) and functional group interconversion [1].
Revised: Retrosynthetic analysis (retrosynthesis) is the practice of analyzing a target molecule into commercially available precursors by way of potential disconnections (bond breakages) and functional group interconversion [1].

Original: E. J. Corey, whose primary focus was in studying the structure of organic compounds, was the ﬁrst one to pioneer this concept [2, 3].
Revised: E. J. Corey, whose primary focus was in studying the structure of organic compounds, was the ﬁrst one to pioneer this concept [2, 3].

Original: However, despite 60 years of synthetic strategy development, the search space for all potential disconnections is so large that even professionals ﬁnd it difﬁcult to explore.
Revised: However, despite 60 years of synthetic strategy development, the search space for all potential disconnections is so large that even professionals ﬁnd it difﬁcult to explore.

Original: The fact that compounds can have multiple retrosynthetic routes and that each route is affected by elements such as reaction conditions, availability of reactants, and reaction yields (to mention a few) makes the entire process even more challenging [4].
Revised: The fact that compounds can have multiple retrosynthetic routes and that each route is affected by elements such as reaction conditions, availability of reactants, and reaction yields (to mention a few) makes the entire process even more challenging [4].

Original: Several deep-learning-based approaches to single-step retrosynthesis treat the prediction of possible disconnections as a translation task, relying on the use of the Transformer architecture [5] and the simpliﬁed molecular-input line-entry system (SMILES) [6, 7] notation [8–11].
Revised: Several deep-learning-based approaches to single-step retrosynthesis treat the prediction of possible disconnections as a translation task, relying on the use of the Transformer architecture [5] and the simpliﬁed molecular-input line-entry system (SMILES) [6, 7] notation [8–11].

Original: Given a target molecule, these approaches suggest the best set of precursors (i.e. reactants, and possibly other reagents) as the translation’s outcome, with the possibility to generate multiple such sets.
Revised: Given a target molecule, these approaches suggest the best set of precursors (i.e. reactants, and possibly other reagents) as the translation’s outcome, with the possibility to generate multiple such sets.

Original: [Figure]
Revised: [Figure]

Original: [Table]
Revised: [Table]

Original: [Figure]
Revised: [Figure]

Original: [Table]
Revised: [Table]

Original: [Figure]
Revised: [Figure]

Original: One possible downside of such models is that they provide chemists little control over the disconnections they want to investigate for a given target molecule.
Revised: One possible downside of such models is that they provide chemists little control over the disconnections they want to investigate for a given target molecule.

Original: The recommended precursors are not guaranteed to be consistent with the chemist’s desired disconnections because the single-step retrosynthetic models suggest the precursors thought to be optimal based on the training dataset.
Revised: The recommended precursors are not guaranteed to be consistent with the chemist’s desired disconnections because the single-step retrosynthetic models suggest the precursors thought to be optimal based on the training dataset.

Original: In this work, we extend transformer-based models for single-step retrosynthesis in order to enhance the control by chemists when determining a retrosynthetic route by exploring user-deﬁned disconnections.
Revised: In this work, we extend transformer-based models for single-step retrosynthesis in order to enhance the control by chemists when determining a retrosynthetic route by exploring user-deﬁned disconnections.

Original: In a multi-step retrosynthetis settting, this provides a ’human-in-the-loop’ component that combines expert knowledge and experience with the power of deep learning.
Revised: In a multi-step retrosynthetis settting, this provides a ’human-in-the-loop’ component that combines expert knowledge and experience with the power of deep learning.

Original: We can therefore use human knowledge and decision-making strategies that statistical and machine learning algorithms can’t yet encode due to a lack of relevant training data to provide an enhanced experience in retrosynthetic problems.
Revised: We can therefore use human knowledge and decision-making strategies that statistical and machine learning algorithms can’t yet encode due to a lack of relevant training data to provide an enhanced experience in retrosynthetic problems.

Original: Figure 1 provides an overview for this work.
Revised: Figure 1 provides an overview for this work.

Original:  Method
Revised:  Method

Original: We base our model on the approach by Schwaller et al.
Revised: We base our model on the approach by Schwaller et al.

Original: This model converts a tokenized
Revised: This model converts a tokenized

Original: SMILES string representing a product into a tokenized SMILES string representing a set of precursors (including solvent, reagents, and catalysts), which is achieved with the help of a sequence-to-sequence transformer model.
Revised: SMILES string representing a product into a tokenized SMILES string representing a set of precursors (including solvent, reagents, and catalysts), which is achieved with the help of a sequence-to-sequence transformer model.

Original: In the current work, we encode the desired disconnection into the input SMILES string, we exploit the atom mapping notation of SMILES: all the atoms involved in the transformation are attributed an atom mapping number of 1 .
Revised: In the current work, we encode the desired disconnection into the input SMILES string, we exploit the atom mapping notation of SMILES: all the atoms involved in the transformation are attributed an atom mapping number of 1 .

Original: Note that although we rely on the atom mapping notation to tag the atoms, the produced strings do not carry any information on atom mapping.
Revised: Note that although we rely on the atom mapping notation to tag the atoms, the produced strings do not carry any information on atom mapping.

Original: As a simple example, in order to produce the target molecule butanol, with SMILES string CCCCO , from a transformation involving the alcohol bond, the input SMILES string (before tokenization) would be
Revised: As a simple example, in order to produce the target molecule butanol, with SMILES string CCCCO , from a transformation involving the alcohol bond, the input SMILES string (before tokenization) would be

Original: CCC[CH2:1][OH:1] .
Revised: CCC[CH2:1][OH:1] .

Original: The dataset to train this model can be generated starting from any set of reaction SMILES.
Revised: The dataset to train this model can be generated starting from any set of reaction SMILES.

Original: All the reactions are ﬁrst atom-mapped with RXNMapper [12].
Revised: All the reactions are ﬁrst atom-mapped with RXNMapper [12].

Original: This enables the identiﬁcation of product atoms with different neighboring atoms or bonds than the precursors (see details in Appendix A).
Revised: This enables the identiﬁcation of product atoms with different neighboring atoms or bonds than the precursors (see details in Appendix A).

Original: These atoms are assigned an atom map number of 1 , while the atom mapping information is removed from all the other product atoms.
Revised: These atoms are assigned an atom map number of 1 , while the atom mapping information is removed from all the other product atoms.

Original: The atom mapping information is also removed from all the precursors.
Revised: The atom mapping information is also removed from all the precursors.

Original: For this study, the dataset was generated from Pistachio [13], resulting in training, validation, and test sets of sizes 2,269,560, 10,000, and 126,435, respectively.
Revised: For this study, the dataset was generated from Pistachio [13], resulting in training, validation, and test sets of sizes 2,269,560, 10,000, and 126,435, respectively.

Original: The model architecture and training are detailed in Appendix B.
Revised: The model architecture and training are detailed in Appendix B.

Original: Figure 2 (top) illustrates a chemical reaction from the dataset, with the atom mapping obtained from RXNMapper.
Revised: Figure 2 (top) illustrates a chemical reaction from the dataset, with the atom mapping obtained from RXNMapper.

Original: From the atom mapping, it can be seen that the atoms involved in the chemical transformation are the ones with mappings 2, 3, and 5.
Revised: From the atom mapping, it can be seen that the atoms involved in the chemical transformation are the ones with mappings 2, 3, and 5.

Original: Accordingly, those are the atoms that end up being marked during the dataset generation.
Revised: Accordingly, those are the atoms that end up being marked during the dataset generation.

Original: Figure 2 (bottom) shows the chemical equation after pre-processing, where the atom mapping information has been removed, and the target molecule contains an indication of what atoms are involved in the chemical transformation.
Revised: Figure 2 (bottom) shows the chemical equation after pre-processing, where the atom mapping information has been removed, and the target molecule contains an indication of what atoms are involved in the chemical transformation.

Original:  Results
Revised:  Results

Original: In order to analyze the results produced by the model, we determined how many predictions were identical to the ground truth after canonicalizing with RDKit [14] and sorting the suggested precursors.
Revised: In order to analyze the results produced by the model, we determined how many predictions were identical to the ground truth after canonicalizing with RDKit [14] and sorting the suggested precursors.

Original: We found that 14.1% of the reactions produced by the model were identical to the ground truth.
Revised: We found that 14.1% of the reactions produced by the model were identical to the ground truth.

Original: This value is in line with the accuracy of transformer-based models suggesting precursors including reagents, solvents and catalysts.
Revised: This value is in line with the accuracy of transformer-based models suggesting precursors including reagents, solvents and catalysts.

Original: However, because there are typically several ways to synthesize the same molecule [11], the usefulness of this statistic, which corresponds to the top-1 accuracy of the single-step retrosynthesis model, is limited.
Revised: However, because there are typically several ways to synthesize the same molecule [11], the usefulness of this statistic, which corresponds to the top-1 accuracy of the single-step retrosynthesis model, is limited.

Original: More signiﬁcantly, it is necessary to assess how many predictions involved chemically correct disconnections between the given pair of atoms (disconnection accuracy).
Revised: More signiﬁcantly, it is necessary to assess how many predictions involved chemically correct disconnections between the given pair of atoms (disconnection accuracy).

Original: To do this, the predicted precursors were combined with the target molecules to produce reaction SMILES that were atommapped with RXNMapper [12].
Revised: To do this, the predicted precursors were combined with the target molecules to produce reaction SMILES that were atommapped with RXNMapper [12].

Original: This made it possible to determine if the atoms involved in the predicted transformation are the same as were speciﬁed in the model input.
Revised: This made it possible to determine if the atoms involved in the predicted transformation are the same as were speciﬁed in the model input.

Original: It was found that 88.9% of the reactions had disconnections between the correct atoms.
Revised: It was found that 88.9% of the reactions had disconnections between the correct atoms.

Original: We also evaluated the chemical correctness of the predictions by determining the round-trip accuracy on the predictions, which is obtained by comparing the product predicted by a forward reaction prediction model with the initial target molecule.
Revised: We also evaluated the chemical correctness of the predictions by determining the round-trip accuracy on the predictions, which is obtained by comparing the product predicted by a forward reaction prediction model with the initial target molecule.

Original: This analysis shows that 76% of the predicted disconnections between the given set of atoms are chemically valid disconnections.
Revised: This analysis shows that 76% of the predicted disconnections between the given set of atoms are chemically valid disconnections.

Original: Figure 3 illustrates some predictions of the model.
Revised: Figure 3 illustrates some predictions of the model.

Original: [Table] [Table]
Revised: [Table] [Table]

Original: Table 1 presents all these metrics as a function of the number of tagged atoms in the target molecules.
Revised: Table 1 presents all these metrics as a function of the number of tagged atoms in the target molecules.

Original: The reactions with zero tagged atoms correspond to reactions where the reaction product is present already in the precursors, sometimes with a different stereochemistry (which was ignored during the generation of the dataset).
Revised: The reactions with zero tagged atoms correspond to reactions where the reaction product is present already in the precursors, sometimes with a different stereochemistry (which was ignored during the generation of the dataset).

Original: Table 1 shows that the disconnection accuracy decreases with the number of tagged atoms.
Revised: Table 1 shows that the disconnection accuracy decreases with the number of tagged atoms.

Original: This is consistent with the difﬁculty of this task for a chemist: it is easy to suggest reactions with one or two transformed atoms, while it is much harder to suggest precursors corresponding to ﬁve or more transformed atoms.
Revised: This is consistent with the difﬁculty of this task for a chemist: it is easy to suggest reactions with one or two transformed atoms, while it is much harder to suggest precursors corresponding to ﬁve or more transformed atoms.

Original: [Figure]
Revised: [Figure]

Original: [Table]
Revised: [Table]

Original: [Figure]
Revised: [Figure]

Original:  Conclusion
Revised:  Conclusion

Original: In this work, we developed a ‘human-in-the-loop’ approach for retrosynthesis, where a Transformerbased model for single-step retrosynthesis allows experts to specify where the disconnections should occur.
Revised: In this work, we developed a ‘human-in-the-loop’ approach for retrosynthesis, where a Transformerbased model for single-step retrosynthesis allows experts to specify where the disconnections should occur.

Original: This work gives those performing retrosynthetic analysis the decision of where bonds should be broken.
Revised: This work gives those performing retrosynthetic analysis the decision of where bonds should be broken.

Original: We processed the input training data in such a way that the atoms involved in the chemical transformation during the reaction are marked correspondingly.
Revised: We processed the input training data in such a way that the atoms involved in the chemical transformation during the reaction are marked correspondingly.

Original: By using this approach, we were able to train a model that was able to predict 14.1% of reactions identically to the data inputted.
Revised: By using this approach, we were able to train a model that was able to predict 14.1% of reactions identically to the data inputted.

Original: 88.9% of the predictions made by the model provided disconnections between the speciﬁed atoms, and in 76.0% of these cases, the predictions were chemically correct.
Revised: 88.9% of the predictions made by the model provided disconnections between the speciﬁed atoms, and in 76.0% of these cases, the predictions were chemically correct.

Original: This work provides a new way to exploit human knowledge and decision-making strategies through a ‘human-in-the-loop’ scheme.
Revised: This work provides a new way to exploit human knowledge and decision-making strategies through a ‘human-in-the-loop’ scheme.

Original: Combining additional elements of artiﬁcial intelligence in the current development may further increase the accuracy and ability to predict the disconnections in the desired location, improving the overall performance .
Revised: Combining additional elements of artiﬁcial intelligence in the current development may further increase the accuracy and ability to predict the disconnections in the desired location, improving the overall performance .

Original: In fact, the current model requires chemists to specify exactly all the atoms involved in the change.
Revised: In fact, the current model requires chemists to specify exactly all the atoms involved in the change.

Original: In the future, we plan to train a variant of the model that allows only subsets of transformed atoms to be tagged.
Revised: In the future, we plan to train a variant of the model that allows only subsets of transformed atoms to be tagged.

Original: This will be achieved by generating a new data set where target
Revised: This will be achieved by generating a new data set where target

Original: SMILES are represented multiple times, with different numbers of tagged atoms.
Revised: SMILES are represented multiple times, with different numbers of tagged atoms.

Original: A Determination of atoms involved in the reaction
Revised: A Determination of atoms involved in the reaction

Original: Algorithm 1 sketches the pseudo code used to prepare the training data for the model.
Revised: Algorithm 1 sketches the pseudo code used to prepare the training data for the model.

Original: Input: 
Revised: Input: precursors information

Original: Output: precursors, product: a tuple containing the  molecule objects  precursors  product 1: transformed_atoms ← list() 2: 3: for index ∈ all_atom_map_numbers(product) do 4:
Revised: Output: precursors, product: a tuple containing the new molecule objects for precursors and product 1: transformed_atoms ← list() 2: 3: for index ∈ all_atom_map_numbers(product) do 4:

Original: precursors_atom ← precursors[index] 5: product_atom ← product[index] 6: if neighborhood(precursors_atom) (cid:54) = neighborhood(product_atom) then 7: transformed_atoms.append(product_atom) 8: end if 9: end for 10: 11: for atom ∈ precursors do 12: atom.mapping =13: end for 14: 15: for atom ∈ product do 16: if atom ∈ transformed_atoms then 17: atom.mapping =18: else 19: atom.mapping =20: end if 21: end for
Revised: precursors_atom ← precursors[index] 5: product_atom ← product[index] 6: if neighborhood(precursors_atom) (cid:54) = neighborhood(product_atom) then 7: transformed_atoms.append(product_atom) 8: end if 9: end for 10: 11: for atom ∈ precursors do 12: atom.mapping =13: end for 14: 15: for atom ∈ product do 16: if atom ∈ transformed_atoms then 17: atom.mapping =18: else 19: atom.mapping =20: end if 21: end for

Original: B Model implementation and training
Revised: B Model implementation and training

Original: The model was implemented using the OpenNMT-py library [15, 16] version 1.0.0.
Revised: The model was implemented using the OpenNMT-py library [15, 16] version 1.0.0.

Original: It was trained with the following command:
Revised: It was trained with the following command:

Original: onmt_train -data
Revised: onmt_train -data

Original: $DATA -save_model $SAVE_MODEL -seed 42 -gpu_ranks 0 \ -save_checkpoint_steps 5000 -keep_checkpoint 20 -train_steps 260000 \ -param_init 0 -param_init_glorot -max_generator_batches
Revised: $DATA -save_model $SAVE_MODEL -seed 42 -gpu_ranks 0 \ -save_checkpoint_steps 5000 -keep_checkpoint 20 -train_steps 260000 \ -param_init 0 -param_init_glorot -max_generator_batches

Original: 32 \ -batch_size 6144 -batch_type tokens -normalization tokens \ -max_grad_norm 0 -accum_count 4 -optim adam -adam_beta1 0.9 \ -adam_beta2 0.998 -decay_methodnoam -warmup_steps
Revised: 32 \ -batch_size 6144 -batch_type tokens -normalization tokens \ -max_grad_norm 0 -accum_count 4 -optim adam -adam_beta1 0.9 \ -adam_beta2 0.998 -decay_method

Original:  -learning_rate 2 -label_smoothing 0.0 -report_every\ -valid_batch_size 8 -layers 4 -rnn_size 384 -word_vec_size 384 \ -encoder_type transformer -decoder_type transformer -dropout 0.

Revised: noam -warmup_steps\ -learning_rate 2 -label_smoothing 0.0 -report_every\ -valid_batch_size 8 -layers 4 -rnn_size 384 -word_vec_size 384 \ -encoder_type transformer -decoder_type transformer -dropout 0.

Original: \ -position_encoding -share_embeddings -global_attention general \ -global_attention_function softmax -self_attn_type scaled-dot \ -heads 8 -transformer_ff
Revised: \ -position_encoding -share_embeddings -global_attention general \ -global_attention_function softmax -self_attn_type scaled-dot \ -heads 8 -transformer_ff

Original: This deﬁnes a transformer-based sequence-to-sequence model and trains it by optimizing the negative log-likelihood.
Revised: This deﬁnes a transformer-based sequence-to-sequence model and trains it by optimizing the negative log-likelihood.

Original: The training curves for the cross entropy are shown in Figure 4.
Revised: The training curves for the cross entropy are shown in Figure 4.