Original: Human-in-the-loop for a Disconnection Aware RetrosynthesisAnonymous (s)
Revised: Human-in-the-loop for a Disconnection Aware Retrosynthesis

Original: AfﬁliationAddress

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 downand analyzed by considering the bonds to be changed as well as the functionalgroup 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, thepredictions 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 theremay be some beneﬁt to the decision being guided byto 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, theretrosynthesis task can be further explored by giving chemists the option to explorespeciﬁ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 optionto those carrying out retrosynthetic analysis by adapting a transformer-based modelfor 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 thecorrect 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 forwardprediction model shows that 76% of the predictions are chemically correct, with14.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 fordeveloping novel compound synthesis involves breaking existing atom-to-atom bonds and formingnew 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 moleculeinto commercially available precursors by way of potential disconnections (bond breakages) andfunctional 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 structureof 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 ofsynthetic strategy development, the search space for all potential disconnections is so large that evenprofessionals ﬁ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 retrosyntheticroutes 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 possibledisconnections as a translation task, relying on the use of the Transformer architecture [5] andthe 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 targetmolecule, these approaches suggest the best set of precursors (i.e. reactants, and possibly otherreagents) 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. [Figure] [Table]

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: [Figure] [Table] [Figure] 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: Inthis work, we extend transformer-based models for single-step retrosynthesis in order to enhance thecontrol 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: We developed a ’human-in-the-loop’ component that combines expert knowledge and experience withthe 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 strategiesthat statistical and machine learning algorithms can’t yet encode due to a lack of relevant trainingdata 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. 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).
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 order to encode the desired disconnection into theinput SMILES string, we exploit the atom mapping notation of SMILES: all the atoms involved inthe 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 .

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 toproduce the target molecule butanol, with SMILES string CCCCO , from a transformation involvingthe alcohol bond, the input SMILES string (before tokenization) would be CCC[CH2:1][OH:1] .
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 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 thereactions 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 productatoms with different neighboring atoms or bonds than the precursors.
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 then assignedan atom map number of 1 , while the atom mapping information is removed from all the other productatoms.
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 testsets 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 was implemented using the OpenNMT-py library [14, 15]. As in [11], the hyperparameters used during training were
Revised: The model architecture and training are detailed in Appendix B.

Original: Figure 1 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 chemicaltransformation 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 endup being marked during the dataset generation.
Revised: Accordingly, those are the atoms that end up being marked during the dataset generation.

Original: Figure 2  shows the chemical equation after preprocessing, where the atom mapping information has been removed, and the target molecule containsan 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 wereidentical to the ground truth after having canonicalized with RDKit [16] and sorted the suggestedprecursors.
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: It was found that 14.1% of the reactions produced by the model were identical tothe 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 suggestingprecursors 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 severalways to synthesize the same molecule [11],  this statistic, which corresponds to the top-1 accuracy ofthe single-step retrosynthesis model, isn’t very useful.
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 correctdisconnections 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 predictedprecursors 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 thepredicted 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 chemicalcorrectness of the predictions by determining the round-trip accuracy on the predictions, which isobtained by comparing the product predicted by a forward reaction prediction model with the initialtarget 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 setof 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: The results produced by the model were also analyzedwith respect to the number oftagged atoms in the target molecules, which is illustrated in Table 1.
Revised: Figure 3 illustrates some predictions of the model. [Table]

Original: [Table]
Revised: [Table]

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 presentalready in the precursors, sometimes with a different stereochemistry (which was ignored during thegeneration 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 numberof tagged atoms.
Revised: Table 1 shows that the disconnection accuracy decreases with the number of tagged atoms.

Original: For single atoms tags, the bond accuracy produced was 99.1%.

Original: From this it can beconcluded that the simpler changes in a reaction, the more precise the prediction was.

Original: An example ofthis could be a reaction where there is only one or two tagged atoms in the input.

Original: This is consistentwith the difﬁculty of this task for a chemist: it is easy to suggest reactions with one or two transformedatoms, 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: The chemical correctness of the predictions is highest for transformations involving one or two atoms. When more atoms are involved in the transformation, this value decreases rapidly, which is consistentwith the difﬁculty of suggesting precursors for complex reactions transforming many atoms.
Revised: [Figure]

Original: Figure 3 shows an example with six tagged atoms, where the prediction is different from the groundtruth. In this case, the predicted precursors are actually a subset of the ground truth precursors.
Revised: [Table] [Figure]

Original:  Conclusion
Revised:  Conclusion

Original: In this work, we developed a ‘human-in-the-loop’ scheme in a Transformer-based model for singlestep retrosynthesisthat 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 workgives 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 transformationduring 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 amodel 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 thepredictions 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 result was signiﬁcant as there are oftenmultiple precursors that could be used to synthesize the same target molecule and provides a new wayto 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 furtherincrease the accuracy and ability to predict the disconnections in the desired location, improving theoverall 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 atomsinvolved 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 subsetsof 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.

Revised: A Determination of atoms involved in the reaction

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

Revised: Input:

Revised: 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: 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: B Model implementation and training

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

Revised: It was trained with the following command:

Revised: onmt_train -data

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

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 noam -warmup_steps

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: {+-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: \ -position_encoding -share_embeddings -global_attention general \ -global_attention_function softmax -self_attn_type scaled-dot \ -heads 8 -transformer_ff

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

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