Generating retrosynthesis trees using reaction modeling neural networks

The retrosynthesis system uses a reaction modeling neural network to iteratively generate and extend retrosynthesis trees, addressing inefficiencies in existing methods by providing feasible synthesis pathways for target molecules, thereby accelerating drug discovery and optimizing synthetic routes.

WO2025140829A1PCT designated stage expired Publication Date: 2025-07-03ISOMORPHIC LABS LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/EP2024/084567
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-15
Filing Date
2024-12-03
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

Existing retrosynthesis methods struggle to efficiently generate comprehensive synthesis pathways for target molecules, particularly in pharmaceutical and material science research, due to limitations in identifying key chemical bonds and optimizing synthetic routes.

Method used

A retrosynthesis system utilizing a reaction modeling neural network iteratively generates a collection of retrosynthesis trees by selecting leaf nodes, processing data to score chemical reactions, and extending trees with reactant molecules, allowing for the generation of multiple synthesis pathways.

Benefits of technology

The system effectively identifies feasible synthesis pathways for target molecules, reducing computational resources and accelerating drug discovery by filtering impractical pathways, thus enhancing the efficiency of molecule synthesis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure EP2024084567_03072025_PF_FP_ABST
    Figure EP2024084567_03072025_PF_FP_ABST
Patent Text Reader

Abstract

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for generating a retrosynthesis tree for a target molecule In one aspect, there is provided a method comprising: selecting a leaf node that is included in one or more retrosynthesis trees in a collection of retrosynthesis trees; processing data defining the respective molecule represented by the selected leaf node, using a reaction modeling neural network, to generate a score distribution over a set of chemical reactions that produce the respective molecule represented by the selected leaf node; selecting one or more chemical reactions from the set of chemical reactions using the score distribution over the set of chemical reactions; and generating one or more new retrosynthesis trees that each extend a respective retrosynthesis tree that includes the selected leaf node based on the one or more chemical reactions selected from the set of chemical reactions.
Need to check novelty before this filing date? Find Prior Art

Description

GENERATING RETROSYNTHESIS TREES USING REACTION MODELINGNEURAL NETWORKSCROSS-REFERENCE TO RELATED APPLICATION

[0001] This application claims priority to U.S. Provisional Application No. 63 / 616,353, filed on December 29, 2023, and to U.S. Provisional Application No. 63 / 565,854, filed on March 15, 2024. The disclosure of the prior applications is considered part of and is incorporated by reference in the disclosure of this application.BACKGROUND

[0002] This specification relates to generating a collection of retrosynthesis trees for a target molecule using a reaction modeling neural network.

[0003] Machine learning models receive an input and generate an output, e.g., a predicted output, based on the received input. Some machine learning models are parametric models and generate the output based on the received input and on values of the parameters of the model. Some machine learning models are deep models that employ multiple layers of models to generate an output for a received input. For example, a deep neural network is a deep machine learning model that includes an output layer and one or more hidden layers that each apply a non-linear transformation to a received input to generate an output.

[0004] Retrosynthesis describes an approach for deconstructing a target molecule into simpler precursor molecules. Retrosynthesis methods have extensive application in the discovery and synthesis of novel molecules, e.g., within the realms of pharmaceutical and material science research. Retrosynthesis involves a reverse-engineered analysis of a target molecule, focusing on the identification of key chemical bonds suitable for strategic disconnection, thereby reducing molecular complexity. This sequential deconstruction paves the way for formulating efficient synthetic routes, originating from basic, e.g. commercially available starting materials such as molecules.SUMMARY

[0005] This specification describes a retrosynthesis system and method implemented as computer programs on one or more computers in one or more locations that can generate a collection of retrosynthesis trees for a target molecule.

[0006] In implementations the method involves generating a collection of retrosynthesis trees for a target molecule that each define a respective synthesis pathway for the target molecule.

[0007] In general each retrosynthesis tree comprises a plurality of nodes that each represent a respective molecule. The plurality of nodes comprise a plurality of non-leaf nodes, including a root node representing the target molecule, and a plurality of leaf nodes. Each non-leaf node in each retrosynthesis tree has one or more child nodes that each represent a respective reactant molecule involved in a chemical reaction that produces the respective molecule represented by the non-leaf node.

[0008] In implementations generating the collection of retrosynthesis trees involves initializing the collection of retrosynthesis trees, e.g. so that at least one of the retrosynthesis trees includes a root node representing the target molecule, and iteratively updating the collection of retrosynthesis trees.

[0009] In implementations the updating involves, at each of a plurality of iterations, selecting a leaf node that is included in one or more retrosynthesis trees in the collection of retrosynthesis trees, e.g. based on a likelihood of a molecule represented by the leaf node. Data defining the respective molecule represented by the selected leaf node can be processed, using a reaction modeling neural network, to generate a score distribution over a set of chemical reactions that produce the respective molecule represented by the selected leaf node selecting one or more chemical reactions from the set of chemical reactions using the score distribution over the set of chemical reactions, and generating one or more new retrosynthesis trees that each extend a respective retrosynthesis tree that includes the selected leaf node based on the one or more chemical reactions selected from the set of chemical reactions.

[0010] The system can be used to determine a synthesis pathway for a target molecule defined by a retrosynthesis tree included in the collection of retrosynthesis trees, more particularly by a set of leaf nodes of the retrosynthesis tree each representing a respective starting material, e.g. molecule, and a root node of the retrosynthesis tree that represents the target molecule to be synthesized (and where chemical reactions that traverse the tree are represented by connections between the nodes). The retrosynthesis tree can be selected from the collection in any convenient manner, e.g. based upon the starting materials needed, the chemical reactions needed, and so forth. The target molecule can be synthesized manually and / or automatically, e.g. by a robot.

[0011] The system can also be used to determine select a target molecule from a collection of target molecules that each represents a drug that achieves a therapeutic effects in a patient effect (e.g. an agonist or antagonist of a receptor or enzyme), in particular to identify one or more target molecules that can be synthesized according to a retrosynthesis tree included inthe collection of retrosynthesis trees. The target molecule can be synthesized manually and / or automatically, e.g. by a robot.

[0012] According to one aspect, there is provided a method performed by one or more computers, the method comprising: generating a collection of retrosynthesis trees for a target molecule that each define a respective synthesis pathway for the target molecule, wherein: each retrosynthesis tree comprises a plurality of nodes that each represent a respective molecule, wherein the plurality of nodes comprise: (i) a plurality of non-leaf nodes, including a root node representing the target molecule, and (ii) a plurality of leaf nodes; and each nonleaf node in each retrosynthesis tree has one or more child nodes that each represent a respective reactant molecule involved in a chemical reaction that produces the respective molecule represented by the non-leaf node; wherein generating the collection of retrosynthesis trees comprises: initializing the collection of retrosynthesis trees; iteratively updating the collection of retrosynthesis trees, comprising, at each of a plurality of iterations: selecting a leaf node that is included in one or more retrosynthesis trees in the collection of retrosynthesis trees; processing data defining the respective molecule represented by the selected leaf node, using a reaction modeling neural network, to generate a score distribution over a set of chemical reactions that produce the respective molecule represented by the selected leaf node; selecting one or more chemical reactions from the set of chemical reactions using the score distribution over the set of chemical reactions; and generating one or more new retrosynthesis trees that each extend a respective retrosynthesis tree that includes the selected leaf node based on the one or more chemical reactions selected from the set of chemical reactions.

[0013] In some implementations, each chemical reaction in the set of chemical reactions specifies: (i) a type of the chemical reaction, and (ii) a location in the molecule represented by the selected leaf node where the chemical reaction occurs.

[0014] In some implementations, the set of chemical reactions includes one or more chemical reactions specifying a two-to-one type chemical reaction that involves two reactant molecules bonding to form the molecule represented by the selected leaf node.

[0015] In some implementations, the set of chemical reactions includes one or more chemical reactions specifying a removal type chemical reaction that involves removing a group from an atom in the molecule represented by the selected leaf node.

[0016] In some implementations, the group is an atom, or a ring, or a functional group, or a substituent group, or a side chain.

[0017] In some implementations, the set of chemical reactions includes one or more chemical reactions specifying a ring formation type chemical reaction wherein two atoms bond to form a ring in the molecule represented by the selected leaf node.

[0018] In some implementations, the set of chemical reactions includes one or more chemical reactions specifying a bond degree change chemical reaction wherein a degree of a bond between atoms in the molecule represented by the selected leaf node increases or decreases.

[0019] In some implementations, for each of one or more chemical reactions in the set of chemical reactions, the location in the molecule represented by the selected leaf node where the chemical reaction occurs comprises an atom in the molecule or a bond in the molecule.

[0020] In some implementations, selecting one or more chemical reactions from the set of chemical reactions using the score distribution over the set of chemical reactions comprises selecting one or more chemical reactions associated with highest scores under the score distribution over the set of chemical reactions.

[0021] In some implementations, generating one or more new retrosynthesis trees that each extend the selected retrosynthesis tree based on the one or more chemical reactions selected from the set of chemical reactions comprises: identifying, for each selected chemical reaction, a respective set of one or more reactant molecules that form a product comprising the molecule represented by the selected leaf node upon undergoing the selected chemical reaction; and generating the one or more new retrosynthesis trees based on the sets of reactant molecules.

[0022] In some implementations, the collection of retrosynthesis trees is represented as a combined tree, wherein: each non-leaf node in the combined tree represents a respective molecule and has one or more alternative sets of child nodes; and each retrosynthesis tree in the collection of retrosynthesis trees is defined by selecting a particular choice for a set of child nodes, from a respective set of one or more alternative sets of child nodes, for each nonleaf node in the combined tree; and generating the one or more new retrosynthesis trees based on the sets of reactant molecules comprises, for each set of reactant molecules augmenting the combined tree to include a set of nodes representing the set of reactant molecules as an alternative set of child nodes of the selected leaf node.

[0023] In some implementations, the one or more chemical reactions selected from the set of chemical reactions includes a two-to-one type chemical reaction that involves two reactant molecules bonding to form the molecule represented by the selected leaf node; and identifying the set of one or more reactant molecules for the two-to-one type chemical reaction comprises: partitioning the molecule represented by the selected leaf node into a firstsynthon molecule and a second synthon molecule; generating, using a reactant modeling neural network, a score distribution over a set of reactant generation operations, wherein each reactant generation operation specifies: (i) a first modification to be applied to the first synthon molecule, and (ii) a second modification to be applied to the second synthon molecule; and identifying the set of one or more reactant molecules for the two-to-one type chemical reaction using the score distribution over the set of reactant generation operations.

[0024] In some implementations, identifying the set of one or more reactant molecules for the two-to-one type chemical reaction using the score distribution over the set of reactant generation operations comprises: selecting one or more reactant generation operations from the set of reactant generation operations using the score distribution over the set of reactant generation operations; and generating, for each selected reactant generation operation, a corresponding set of reactant molecules.

[0025] In some implementations, for each selected reactant generation operation, generating the corresponding set of reactant molecules comprises: generating a first reactant molecule by applying a first modification specified by the selected reactant generation operation to the first synthon molecule; and generating a second reactant molecule by applying a second modification specified by the selected reactant generation operation to the second synthon molecule.

[0026] In some implementations, processing the data defining the respective molecule represented by the selected leaf node, using the reaction modeling neural network, to generate the score distribution over the set of chemical reactions comprises: generating a sequence of embeddings representing the molecule; sequentially processing the sequence of embeddings representing the molecule using a encoder block of the reaction modeling neural network, wherein the encoder block comprises a recurrent neural network layer; identifying a hidden state of the recurrent neural network layer of the encoder block, after processing a final embedding in the sequence of embeddings, as a combined embedding representing the molecule; and processing the combined embedding representing the molecule using a decoder block of the reaction modeling neural network to generate the score distribution over the set of chemical reactions.

[0027] In some implementations, the decoder block of the reaction modeling neural network comprises a recurrent neural network layer; and processing the combined embedding representing the molecule using the decoder block of the reaction modeling neural network to generate the score distribution over the set of chemical reactions comprises: generating a respective decoder output for each output position in a sequence of output positions;where the decoder outputs for the output positions in the sequence of output positions collectively define the score distribution over the set of chemical reactions.

[0028] In some implementations, each output position corresponds to a respective atom or ring in the molecule represented by the selected leaf node.

[0029] In some implementations, for each output position in the sequence of output positions, the decoder output for the output position comprises a respective score for each of one or more chemical reactions that involve an atom or bond in the molecule that is associated with the output position.

[0030] In some implementations, for a first output position in the sequence of output positions, generating the decoder output for the output position comprises processing the combined embedding representing the molecule to update a hidden state of recurrent neural network layer of the decoder block and to generate the decoder output for the first output position.

[0031] In some implementations, for each output position after a first output position in the sequence of output positions, generating the decoder output for the output position comprises: processing an input comprising a decoder output for a preceding output position to update a hidden state of the recurrent neural network of the decoder block and to generate the decoder output for the output position.

[0032] In some implementations, selecting a leaf node that is included in one or more retrosynthesis trees from the collection of retrosynthesis trees comprises selecting a leaf node representing a molecule that is not included in a library of precursor molecules.

[0033] In some implementations, selecting a leaf node representing a molecule that is not included in a library of precursor molecules comprises: determining an overall likelihood score for the leaf node based at least in part on a likelihood of the molecule represented by the leaf node; and selecting the leaf node based on the overall likelihood score for the leaf node.

[0034] In some implementations, initializing the set of retrosynthesis trees comprises initializing the set of retrosynthesis trees to include a retrosynthesis tree that includes only a root node representing the target molecule.

[0035] In some implementations, the method further comprises synthesizing the target molecule in accordance with a synthesis pathway defined by a retrosynthesis tree included in the collection of retrosynthesis trees.

[0036] In some implementations, the method further comprises determining, based at least in part on the collection of retrosynthesis trees, whether to synthesize the target molecule.

[0037] In some implementations, determining, based at least in part on the collection of retrosynthesis trees, whether to synthesize the target molecule comprises: determining that the collection of retrosynthesis trees comprises at least one retrosynthesis tree wherein each leaf node of the retrosynthesis tree represents a respective molecule that is included in a library of precursor molecules; and in response, determining that the target molecule should be synthesized.

[0038] In some implementations, the method further comprises synthesizing the target molecule.

[0039] In some implementations, synthesizing the target molecule comprises synthesizing the target molecule in accordance with a synthesis pathway defined by a retrosynthesis tree included in the collection of retrosynthesis trees.

[0040] In some implementations, determining, based at least in part on the collection of retrosynthesis trees, whether to synthesize the target molecule comprises: filtering the collection of retrosynthesis trees based on a set of one or more filtering criteria, comprising: determining, for each retrosynthesis tree in the collection of retrosynthesis trees, whether the retrosynthesis tree satisfies each filtering criterion in the set of filtering criteria; and removing, from the collection of retrosynthesis trees, any retrosynthesis tree that satisfies one or more of the filtering criteria; and determining whether to synthesize the target molecule based on the filtered collection of retrosynthesis trees.

[0041] In some implementations, the set of filtering criteria comprises a filtering criterion that is satisfied by a retrosynthesis tree if the retrosynthesis tree includes a leaf node representing a molecule that is not included in a predefined library of precursor molecules.

[0042] In some implementations, the set of filtering criteria comprises a filtering criterion that is satisfied by a retrosynthesis tree if the retrosynthesis tree includes a node representing a molecule that: has a reactivity above a reactivity threshold; or has a stability that is below a stability threshold; or has a toxicity that is above a toxicity threshold.

[0043] In some implementations, the set of filtering criteria comprises a filtering criterion that is satisfied by a retrosynthesis tree if the retrosynthesis tree defines a synthesis pathway that requires performing a chemical reaction under reaction conditions that fall outside a range of tolerable reaction conditions.

[0044] In some implementations, determining whether to synthesize the target molecule based on the filtered collection of retrosynthesis trees comprises: determining that the target molecule should be synthesized only if the filtered collection of retrosynthesis trees includes at least a threshold number of retrosynthesis trees.

[0045] In some implementations, the method further comprises synthesizing the target molecule in response to determining, based on the filtered collection of retrosynthesis trees, that the target molecule should be synthesized.

[0046] According to another aspect there are provided one or more non-transitory computer storage media storing instructions that when executed by one or more computers cause the one or more computers to perform operations of the methods described herein.

[0047] According to another aspect there is provided a system comprising: one or more computers; and one or more storage devices communicatively coupled to the one or more computers, wherein the one or more storage devices store instructions that, when executed by the one or more computers, cause the one or more computers to perform operations of the methods described herein.

[0048] Throughout this specification, a “molecule” can refer to a collection of atoms which are bonded together through chemical bonds. A molecule can be represented in any of a variety of possible ways, e.g., as a sequence of characters, e.g., a Simplified Molecular Input Line Entry System (SMILES) string.

[0049] A “ring” in a molecule can refer to an arrangement of some or all of the atoms in the molecule in a cyclic configuration, where a series of atoms are connected by chemical bonds in a closed loop.

[0050] A “tree” (e.g., a retrosynthesis tree) can refer to a hierarchical data structure that includes a set of nodes and a set of branches. The set of nodes includes a single, designated “root” node, from which all other nodes descend. Each branch connects a “parent” node to one or more respective “child” nodes in the tree. Each node in the tree, except for the root node, is connected by exactly one branch to a unique parent node, thereby forming a parentchild relationship. A “leaf’ node in a tree refers to a node without any child nodes. A tree is acyclic, i.e., does not include any cycles or closed loops within its structure.

[0051] A “retrosynthesis tree” for a target molecule can refer to a tree that defines a synthesis pathway for the target molecule. More specifically, each node in the retrosynthesis tree can represent a respective molecule, with the root node representing the target molecule. Each non-leaf node has one or more child nodes that each represent a respective reactant molecule involved in a chemical reaction that produces the molecule represented by the non-leaf node.

[0052] A “complete” retrosynthesis tree can refer to a retrosynthesis tree where each leaf node of the retrosynthesis tree represents a respective molecule that is included in a predefined library of precursor molecules. An “incomplete” retrosynthesis tree can refer to aretrosynthesis tree that is not complete, i.e., that includes at least one leaf node representing a molecule that is not included in the predefined library of precursor molecules.

[0053] A “library of precursor molecules” can refer to any predefined set of molecules. In some cases, the library of precursor molecules can be a set of molecules that each have desirable manufacturability properties, e.g., that are each known to be manufacturable within a defined budget.

[0054] An “embedding” refers to an ordered collection of numerical values, e.g., a vector, matrix, or other tensor of numerical values.

[0055] An “intermediate output” of a neural network refers to an output generated by one or more hidden layers of the neural network.

[0056] Each neural network described in this specification (e.g., including the reaction modeling neural network and the reactant modeling neural networks) can have any appropriate neural network architecture that enables the neural network to perform its described functions. In particular, each neural network can include any appropriate types of neural network layers (e.g., fully connected layers, recurrent layers, convolutional layers, attention layers, and so forth) in any appropriate number (e.g., 5 layers, or 50 layers, or 100 layers) and connected in any appropriate configuration (e.g., as a directed graph of layers). Particular example architectures of the reaction modeling neural network and the reactant modeling neural networks are described throughout the specification.

[0057] Particular embodiments of the subject matter described in this specification can be implemented so as to realize one or more of the following advantages.

[0058] The retrosynthesis system described in this specification can generate a collection of retrosynthesis trees for a target molecule. The collection of retrosynthesis trees can be used to determine whether the target molecule can be synthesized from precursor molecules in a library of precursor molecules, as will be described in more detail below. The retrosynthesis system can thus be used to filter a set of candidate molecules to remove molecules that do not admit a practical synthesis pathway, e.g., from precursor molecules in the library of precursor molecules, and can thus accelerate the process of drug discovery by narrowing the set of candidate molecules under consideration as potential drug molecules.

[0059] The retrosynthesis system can generate a retrosynthesis tree for a target molecule by iteratively extending an initial retrosynthesis tree (e.g., that may include only a root node representing the target molecule) using a reaction modeling neural network. In particular, the retrosynthesis system can use the reaction modeling neural network to iteratively extend one node at a time in a current retrosynthesis tree. The reaction modeling neural network can thushave a significantly less complex neural network architecture than would be required, e.g., for a neural network that generates an entire retrosynthesis tree by one forward pass through the neural network. As a result of the reaction modeling neural network having a less complex neural network architecture, the retrosynthesis system can train the reaction modeling neural network to achieve an acceptable performance using less training data, fewer training iterations, or both, thus reducing consumption of computational resources (e.g., memory and computing power) during training.

[0060] Storing and iteratively updating a large collection of retrosynthesis trees can improve performance of the retrosynthesis system, e.g., by enabling the retrosynthesis system to explore a larger fraction of the space of possible retrosynthesis trees and thus increasing the likelihood that the retrosynthesis system will identify complete retrosynthesis trees with desirable properties. However, storing large numbers of retrosynthesis trees can consume significant memory resources. To address this issue without sacrificing performance, the retrosynthesis system can represent a collection of retrosynthesis trees as a single combined tree, where each non-leaf node in the combined tree has one or more alternative sets of child nodes. In particular, one or more non-leaf nodes in the combined tree can have multiple alternative sets of child nodes. Each alternative set of child nodes for a non-leaf node represents a possible choice of child nodes for the non-leaf node. The combined tree thus represents a collection of retrosynthesis trees, where each individual retrosynthesis tree in the collection of retrosynthesis tree corresponds to selecting a particular set of child nodes, from one or more respective alternative sets of child nodes, for each non-leaf node in the combined tree. The combined tree can compactly represent an exponentially large number of individual retrosynthesis trees, and in particular, can represent a number of retrosynthesis trees that would be impractical to represent and store individually as separate trees.

[0061] The details of one or more embodiments of the subject matter of this specification are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the subject matter will become apparent from the description, the drawings, and the claims.BRIEF DESCRIPTION OF THE DRAWINGS

[0062] FIG. 1 shows an example retrosynthesis system.

[0063] FIG. 2 is a flow diagram of an example process for generating a collection of retrosynthesis trees for a target molecule.

[0064] FIG. 3 is a flow diagram of an example process for generating one or more alternative sets of child nodes for a selected leaf node included in one or more retrosynthesis trees.

[0065] FIG. 4 is a flow diagram of an example process by which a reaction modeling neural network can process data defining a molecule to generate a score distribution over a set of chemical reactions.

[0066] FIG. 5 is a flow diagram of an example process for processing two synthon molecules associated with a two-to-one type chemical reaction to generate one or more sets of reactant molecules using a reactant modeling neural network.

[0067] FIG. 6 is a flow diagram of an example process for generating one or more reactant molecules for a removal type chemical reaction associated with an atom in a molecule.

[0068] FIG. 7 is a flow diagram of an example process for training a reaction modeling neural network and a respective reactant modeling neural network associated with each of one or more chemical reactions, e.g., a two-to-one type chemical reaction or a removal type chemical reaction.

[0069] FIG. 8 illustrates an example of operations that can be performed by the retrosynthesis system.

[0070] FIG. 9 illustrates an example of a combined tree that stores a collection of retrosynthesis trees.

[0071] Like reference numbers and designations in the various drawings indicate like elements.DETAILED DESCRIPTION

[0072] FIG. 1 shows an example retrosynthesis system 100. The retrosynthesis system 100 is an example of a system implemented as computer programs on one or more computers in one or more locations in which the systems, components, and techniques described below are implemented.

[0073] The system 100 is configured to process data defining a target molecule 102 to generate a set of one or more retrosynthesis trees 114 for the target molecule 102. The target molecule 102 can be any appropriate molecule, e.g., an organic molecule, an inorganic molecule, a small molecule (e.g. molecular weight equal to or less than 1000 daltons), a synthetic molecule (e.g. a molecule that has not previously been synthesized), and so forth. The set of retrosynthesis trees 114 can include any appropriate number of retrosynthesis trees, e.g., 1, 10, 100, 1000, or 10,000, or 100,000 retrosynthesis trees. In some implementations, the set of retrosynthesis trees can be represented as a single combined tree, where each non-leaf node in the combined tree has one or more alternative sets of child nodes, as will be described in more detail below.

[0074] The system 100 can receive the data defining the target molecule 102 from any appropriate source, e.g., from a user or from another system, by way of an appropriate interface, e.g., an application programming interface (API) or a user interface (e.g., a graphical user interface). After generating the retrosynthesis trees 114, the system 100 can, e.g., store data defining the retrosynthesis trees 114 in a memory, or transmit data defining the retrosynthesis trees 114 over a data communication network, or provide data defining the retrosynthesis trees 114 directly to a downstream system that performs downstream processing based on the retrosynthesis trees 114.

[0075] In some implementations, a user can input data defining a target molecule 102 into a user interface made available on a user device by the system 100. The user device can be, e.g., a personal computer or a tablet or a smartphone. The user interface by which the user inputs the target molecule 102 can be presented to the user, on the user device, as part of an application running on the user device. The target molecule input into the user interface of the user device can be transmitted to the system 100, e.g., by transmission over an appropriate data communications network, e.g., the internet. The system 100 can process the target molecule to generate a set of retrosynthesis trees for the target molecule, and then output data identifying the retrosynthesis trees for the target molecule. For instance, the system 100 can transmit the data identifying the retrosynthesis trees for the target molecule back to the user device, e.g., over a data communications network, and a user can access the retrosynthesis trees by way of the user device, e.g., by viewing data characterizing the retrosynthesis trees using an application running on the user device.

[0076] Retrosynthesis trees generated by the retrosynthesis system 100 can be used in any of a variety of possible downstream applications. A few examples use cases for retrosynthesis trees generated by the system 100 are described next.

[0077] In some cases, a downstream system can use the retrosynthesis system as part of determining whether a candidate molecule should be physically synthesized (e.g. determining that a candidate molecule can be physically synthesized, or that it is feasible to synthesize the molecule given the starting materials needed). In particular, the downstream system can generate a set of retrosynthesis trees for the candidate molecule using the retrosynthesis system 100, and then apply one or more filtering criteria to the set of retrosynthesis trees, e.g., to remove retrosynthesis trees that satisfy one or more of the filtering criteria. The downstream system can determine that the candidate molecule should be (will be) physicallysynthesized, e.g., only if at least a threshold number of retrosynthesis trees remain in the set of retrosynthesis trees following the filtering operations. The threshold number can any appropriate positive integer value, e.g., 1 or 5 or 10.

[0078] The downstream system can apply any appropriate filtering criteria to a set of retrosynthesis trees for a candidate molecule. A few examples of possible filtering criteria are described next.

[0079] In one example, a filtering criterion can specify that a retrosynthesis tree should be removed from the set of retrosynthesis trees for the candidate molecule if the retrosynthesis tree is incomplete. Applying the filtering criterion can thus remove retrosynthesis trees that define synthesis pathways that are impractical because they require initial reactants that are not readily manufacturable (or otherwise available).

[0080] In another example, a filtering criterion can specify that a retrosynthesis tree should be removed from the set of retrosynthesis trees for the candidate molecule if the retrosynthesis tree includes one or more nodes that represent molecules having specified (undesirable) properties, e.g., being highly reactive (more specifically: have a reactivity above a defined threshold), or being highly unstable (more specifically: having a stability that is below a defined threshold), or being highly toxic (more specifically: having a toxicity that is above a defined threshold). Thus, applying the filtering criterion can remove retrosynthesis trees that define synthesis pathways with undesirable intermediate products.

[0081] In another example, a filtering criterion can specify that a retrosynthesis tree should be removed from the set of retrosynthesis trees for the candidate molecule if the retrosynthesis tree defines a synthesis pathway that requires performing one or more chemical reactions under reaction conditions that are outside a range of tolerable (e.g. defined) reaction conditions. The reaction conditions can include, e.g., heat, or temperature, or pressure, and so forth. Thus, applying the filtering criterion can remove retrosynthesis trees that define synthesis pathways with extreme (or otherwise undesirable) reaction conditions.

[0082] In response to determining that a candidate molecule should be physically synthesized, e.g., as described above, one or more instances of the candidate molecule can be physically synthesized. The synthesized molecule can be, e.g., experimentally tested to evaluate one or more properties of the molecule (e.g., absorption, distribution, metabolism, excretion, or toxicity properties), or can be included in a drug administered to a subject (e.g., an animal or human subject) to assess the effect of the drug (e.g., the existence of any therapeutic effect and / or any undesirable side effects).

[0083] In some cases, a downstream system can use the retrosynthesis system 100 to filter a set of candidate molecules. The set of candidate molecules can be, e.g., candidate drug molecules, e.g., candidate molecules that are predicted to have a therapeutic effect when administered to a subject, e.g., by binding to a target protein. In particular, for each candidate molecule in the set of candidate molecules, the downstream system can use the retrosynthesis system 100 as part of determining whether the candidate molecule should be (will be) physically synthesized (as described above). The downstream system can then filter the set of candidate molecules to remove any molecule that is not selected for physical synthesis. One or more of the candidate molecules remaining in the set of candidate molecules following the filtering operation can then be physically synthesized, e.g., as described above.

[0084] The system 100 can generate a set of retrosynthesis trees 114 for a target molecule 102 using an initialization engine 104 and a node extension engine 110, which are each described in more detail next (and throughout this specification).

[0085] The initialization engine 104 is configured to initialize a collection of retrosynthesis trees 106. In particular, the initialization engine 104 can “seed” the collection of retrosynthesis trees by including one or more initial retrosynthesis trees in the collection of retrosynthesis trees, i.e., prior to the system iteratively updating the collection of retrosynthesis trees, as will be described in more detail below. In some implementations, the initialization engine 104 initializes the collection of retrosynthesis trees 106 to include a single retrosynthesis tree that includes only a root node representing the target molecule 102. In some implementations, the initialization engine 104 initializes the collection of retrosynthesis trees with multiple initial retrosynthesis trees, e.g., that have been determined manually (e.g., by a chemist) or by an upstream system.

[0086] In some implementations, the system represents the collection of retrosynthesis trees 106 in the form of a single combined tree, where each non-leaf node in the combined tree has one or more alternative sets of child nodes. In particular, one or more non-leaf nodes in the combined tree can have multiple alternative sets of child nodes. Each alternative set of child nodes for a non-leaf node represents a possible choice of child nodes for the non-leaf node. The combined tree thus represents a collection of retrosynthesis trees, where each individual retrosynthesis tree in the collection of retrosynthesis trees corresponds to selecting a particular set of child nodes, from one or more respective alternative sets of child nodes, for each non-leaf node in the combined tree.

[0087] The system 100 uses the node extension engine 110 to iteratively update the collection of retrosynthesis trees 106. More specifically, at each update iteration in asequence of update iterations, the node extension engine 110 can select a leaf node 108 that is included in one or more retrosynthesis trees in current collection of retrosynthesis trees 106, and then generate one or more alternative sets of child nodes 112 for the leaf node 108.

[0088] The node extension engine 110 can process data defining the molecule represented by the leaf node 108 using a reaction modeling neural network to generate a score distribution over a set of chemical reactions that produce the molecule. (The set of chemical reactions that produce the molecule can be defined, for any molecule, in accordance with a predefined set of rules, as will be described in more detail below with reference to FIG. 3 and FIG. 4; for instance, each location (e.g., atom or bond) in a molecule can be associated with a set of types of chemical reactions that can occur at the position).

[0089] The node extension engine 110 can select one or more chemical reactions from the set of chemical reactions using the score distribution over the set of chemical reactions, and then generate the one or more alternative sets of child nodes 112 based on the selected chemical reactions. Each alternative set of child nodes can represent a set one or more reactant molecules that can chemically react, in accordance with one of the chemical reactions selected using the reaction modeling neural network, to generate the molecule represented by the leaf node 108.

[0090] In particular, in implementations where the collection of retrosynthesis trees 106 is represented by a single combined tree (as described above), the node extension engine 110 can generate, for each selected chemical reaction, one or more alternative sets of child nodes for the leaf node 108. Each alternative set of child nodes can represent a set of one or more reactant molecules that can chemically react, in accordance with one of the chemical reactions selected using the reaction modeling neural network, to generate the molecule represented by the leaf node 108. The system can then augment the combined tree by adding each alternative set of child nodes of the leaf node 108 to the combined tree. The addition of the alternative sets of child nodes to the combined tree causes the combined tree to represent extended retrosynthesis trees 112, e.g., that each include one of the alternative sets of child nodes of the leaf node 108.

[0091] An example process for generating one or more alternative sets of child nodes for a leaf node using a reaction modeling neural network is described in more detail with reference to FIG. 3.

[0092] The system 100 can generate one or more new retrosynthesis trees that each extend respective retrosynthesis trees that includes the leaf node 108 using the one or more alternative sets of child nodes, and adds each new retrosynthesis tree to the collection ofretrosynthesis trees 106. For instance, in implementations where the collection of retrosynthesis trees is represented as a combined tree (as described above), the system can add the one or more alternative sets of child nodes 112 of the leaf node 108 to the combined tree.

[0093] The system 100 can thus iteratively update the collection of retrosynthesis trees 106, starting from the one or more initial retrosynthesis trees seeded by the initialization engine 104, by repeatedly extending the retrosynthesis trees included in the collection of retrosynthesis trees 106 using the node extension engine 110. In particular, in implementations, where the collection of retrosynthesis trees is represented by a combined tree with alternative sets of child nodes, the system 100 can iteratively update the combined tree by adding alternative sets of child nodes to the leaf nodes of the combined tree. The system 100 can continue updating the collection of retrosynthesis trees 106 until a termination criterion is satisfied, and can then output the current collection of retrosynthesis trees 106 (i.e., as of the last update iteration) as the output set of retrosynthesis trees 114.

[0094] The system can represent a combined tree that stores a collection of retrosynthesis trees, as described, using any appropriate data structure. For instance, the system can represent the combined tree as a tree data structure where, for each non-leaf node that has multiple alternative sets of child nodes, the edge connecting the non-leaf node to each child node is associate with an index that identifies the alternative set of child nodes that includes the particular child node. In some cases, each non-leaf node in the combined tree can be associated with a type that indicates whether the child nodes represent alternative reactions or the set of reactants required for a single alternative reaction.

[0095] In some implementations, the retrosynthesis system 100 includes multiple node extension engines 110 that operate in parallel to iteratively update the collection of retrosynthesis trees 106. The multiple node extension engines 110 can operate independently and asynchronously. Updating the collection of retrosynthesis trees 106 using multiple node extension engines 110 can enable the system 100 to generate the output set of retrosynthesis trees 114 faster than would be possible using a single node extension engine 110.

[0096] FIG. 2 is a flow diagram of an example process 200 for generating a collection of retrosynthesis trees for a target molecule. For convenience, the process 200 will be described as being performed by a system of one or more computers located in one or more locations. For example, a retrosynthesis system, e.g., the retrosynthesis system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 200.

[0097] The system initializes a collection of retrosynthesis trees for the target molecule (202). For instance, the system can initialize the collection of retrosynthesis trees to consist of a single retrosynthesis tree that includes only a root node representing the target molecule. As another example, the system can initialize the collection of retrosynthesis trees to include multiple initial retrosynthesis trees, e.g., that have been determined manually (e.g., by a chemist) or by an upstream system.

[0098] Optionally, as part of initializing the collection of retrosynthesis trees, the system can assign a likelihood score to each node in each retrosynthesis tree in the collection of retrosynthesis trees. In particular, in implementations where the collection of retrosynthesis trees is represented as a combined tree (as described above), the system can assign a likelihood score to each node in the combined tree. For instance, the system can assign a default likelihood score (e.g., a likelihood score of 1) to each node in each retrosynthesis tree in the collection of retrosynthesis trees. Throughout the process of iteratively updating the collection of retrosynthesis trees, the system can use the likelihood scores associated with the nodes to determine which leaf nodes to extend at each update iteration, as will be described in more detail below.

[0099] The system performs the steps 204-210 at each iteration in a sequence of update iterations.

[0100] The system selects a leaf node that is included in one or more retrosynthesis trees in the collection of retrosynthesis trees (206). For instance, in implementations where the collection of retrosynthesis trees is represented as a single combined tree, the system selects a leaf node from the combined tree.

[0101] The system can select a leaf node that represents a molecule that is not included in the library of precursor molecules in any appropriate way. A few examples of techniques for selecting a leaf node are described next.

[0102] In one example, for each “eligible” leaf node that: (i) is included in one or more retrosynthesis trees in the collection of retrosynthesis trees, and (ii) represents a molecule that is not included in the library of precursor molecules, the system can determine an overall likelihood score for the leaf node. The system can determine an overall likelihood score for a leaf node as a combination (e.g., a sum or product) of respective likelihood scores for: (i) the leaf node, and (ii) any additional nodes included in a path from the leaf node to root node of a combined tree representing the collection of retrosynthesis trees.

[0103] The system can then select an eligible leaf node using the likelihood scores for the eligible leaf nodes. For instance, the system can select an eligible leaf node that is associatedwith a highest likelihood score from among the set of eligible leaf nodes. As another example, the system can generate a probability distribution over the set of eligible leaf nodes using the likelihood scores, e.g., by processing the likelihood scores using a soft-max function, and then sample an eligible leaf node in accordance with the probability distribution.

[0104] As another example, the system can select a leaf node by randomly sampling a leaf node from among the collection of eligible leaf nodes.

[0105] The system generates one or more alternative sets of child nodes for the selected leaf node (206). Each alternative set of child nodes can represent a set one or more reactant molecules that can chemically react to generate the molecule represented by the selected leaf node. Optionally, as part of generating the alternative sets of child nodes, the system can generate a respective likelihood score for each node in each of the alternative sets of child nodes.

[0106] An example process for generating one or more alternative sets of child nodes for a leaf node, and for generating a respective likelihood score for each node in each of the alternative sets of child nodes, is described with reference to FIG. 3.

[0107] The system updates the collection of retrosynthesis trees by adding one or more new retrosynthesis trees that each extend one or more existing retrosynthesis trees in the collection of retrosynthesis trees (208). More specifically, the system can generate each new retrosynthesis tree by, for each existing retrosynthesis tree that includes the selected leaf node and for each alternative set of child nodes of the selected leaf node, adding the alternative set of child nodes to the leaf node of the existing retrosynthesis tree. For instance, in an implementation where the collection of retrosynthesis trees is represented by a combined tree (as described above), the system can update the collection of retrosynthesis trees by adding each of the one or more alternative sets of child nodes of the selected leaf node to the combined tree.

[0108] Optionally, the system can refrain from using an alternative set of child nodes to update the collection of retrosynthesis trees if the likelihood score for the nodes in the alternative set of nodes tree fails to satisfy (e.g., falls below) a threshold.

[0109] The system determines whether a termination criterion is satisfied (212). In one example, the termination criterion can be that the system has performed a predefined number of iterations of steps 204 - 210. As another example, the termination criterion can be that the current collection of retrosynthesis trees includes at least a threshold number of complete retrosynthesis trees. As another example, the termination criterion can be that at least athreshold proportion of the retrosynthesis trees in the collection of retrosynthesis trees are complete retrosynthesis trees. As another example, the termination criterion can be that a predetermined number of node expansions have been performed. As another example, the termination criterion can be that at least a predetermined number of node expansions have been performed without at least a threshold number (e.g., one) complete retrosynthesis tree having been generated. As another example, the termination criterion can be that the collection of retrosynthesis trees includes at least a predefined number of complete retrosynthesis trees having respective “quality scores” that are lower than a threshold quality score. A quality score for a retrosynthesis tree can based, e.g., on a combination (e.g., product or sum) of likelihood scores associated with the leaf nodes in the retrosynthesis tree. Example techniques for determining likelihood scores for leaf nodes in a retrosynthesis tree are described with reference to FIG. 3.

[0110] In response to determining that a termination criterion is not satisfied, the system returns to step 204 and repeats steps 204 - 210 to again update the current collection of retrosynthesis trees.[OHl] In response to determining that a termination criterion is satisfied, the system outputs the current collection of retrosynthesis trees (i.e., as of the final iteration of steps 204 - 210) as the output set of retrosynthesis trees for the target molecule (214). The output set of retrosynthesis trees can be used in any of a variety of downstream applications, e.g., as part of determining whether the target molecule should be physically synthesized, as described in detail with reference to FIG. 1.

[0112] FIG. 3 is a flow diagram of an example process 300 for generating one or more alternative sets of child nodes for a leaf node included in a retrosynthesis tree. For convenience, the process 300 will be described as being performed by a system of one or more computers located in one or more locations. For example, a retrosynthesis system, e.g., the retrosynthesis system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 300.

[0113] The system receives data identifying a selected leaf node that is included in one or more retrosynthesis trees from a current collection of retrosynthesis trees (302). An example process for selecting a leaf node is described with reference to step 204 of FIG. 2.

[0114] The system processes data defining the molecule represented by the selected leaf node, using a reaction modeling neural network, to generate a score distribution over a set of chemical reactions that produce the molecule represented by the selected leaf node (304). Thescore distribution can assign a respective score to each chemical reaction in the set of chemical reactions that produce the molecule represented by the selected leaf node.

[0115] Each chemical reaction in the set of chemical reactions can be specified by data including: (i) a type of the chemical reaction, and (ii) a location on the molecule where the reaction occurs. A few examples of types and locations of chemical reactions that can be included in the set of chemical reactions are described next.

[0116] In some implementations, the set of chemical reactions includes “two-to-one” type chemical reactions, where two reactant molecules bond to form the molecule represented by the selected leaf node.

[0117] For instance, the set of chemical reactions can include “two-to-one” type chemical reactions, where two reactant molecules bond by way of one bond (e.g., a one single bond, or one double bond, or one triple bond, etc.) to form the molecule represented by the selected leaf node. The location of a two-to-one type chemical reaction identifies the position of the bond in the molecule that was formed in order to combine the two reactants.

[0118] In some implementations, the set of chemical reactions includes “three-to-one” type chemical reactions, where two reactant molecules both bond to a third reactant molecule to form the molecule represented by the selected leaf node. The location of a three-to-one type chemical reaction identifies a respective position of each of the bonds formed in order to combine the three reactants.

[0119] In some implementations, the set of chemical reactions includes a “removal” type chemical reaction, where a “group” (e.g., an atom, ring, functional group, substituent group, side chain, and so forth) is removed from an atom in the molecule represented by the selected leaf node. (“Removing” the group from the atom can refer to breaking one or more bonds between the group and the atom). The location of a removal type chemical reaction identifies the atom in the molecule represented by the selected leaf node from which the group is removed.

[0120] In some implementations, the set of chemical reactions includes a “ring formation” type chemical reaction, where two atoms bond to form a ring in the molecule represented by the selected leaf node. The location of a ring formation chemical reaction identifies the bond in the molecule that was formed in order to create the ring in the molecule. The set of chemical reactions can include multiple types of ring formation reactions, e.g., ring formation reactions that involve creating one bond within a single reactant molecule, and ring formation reactions that involve creating two bonds between two reactant molecules.

[0121] In some implementations, the set of chemical reactions can include a “rearrangement” chemical reaction, where two or more atoms change their respective positions. The location of a rearrangement type chemical reaction identifies the atoms that change their respective positions.

[0122] In some implementations, the set of chemical reactions includes a “bond degree change” chemical reaction, where the degree of a bond in the molecule represented by the selected leaf node increases or decreases. The location of a bond degree change chemical reaction identifies the bond in the molecule that undergoes the degree change. A bond degree change type chemical reaction is further specified by data identifying whether the degree of the bond increased or decreased, and the amount by which the degree of the bond increased or decreased.

[0123] An example of a process by which a reaction modeling neural network can process data defining a molecule to generate a score distribution over a set of chemical reactions is described with reference to FIG. 4.

[0124] The reaction modeling neural network can be trained on a set of training examples that are extracted from a set of training retrosynthesis graphs. Some or all of the training retrosynthesis graphs can be complete retrosynthesis graphs, and thus the score generated by the reaction modeling neural network for a chemical reaction can reflect a likelihood that, in a complete retrosynthesis tree, the selected leaf node is extended based on the chemical reaction. An example process for training a reaction modeling neural network is described with reference to FIG. 7.

[0125] The system selects one or more chemical reactions from the set of chemical reactions using the score distribution over the set of chemical reactions (306).

[0126] For instance, the system can select a predefined number of chemical reactions having the highest scores under the score distribution over the set of chemical reactions.

[0127] As another example, the system can select each chemical reaction having a score, under the score distribution over the set of chemical reactions, that exceeds a threshold.

[0128] As another example, the system can generate a probability distribution over the set of chemical reactions based on the score distribution over the set of chemical reactions (e.g., by processing the score distribution using a soft-max function), and then sample a predefined number of chemical reactions in accordance with the probability distribution.

[0129] For each selected chemical reaction, the system identifies one or more sets of reactant molecules that each, upon undergoing the selected chemical reaction, can generate the molecule represented by the selected leaf node (308).

[0130] Optionally, as part of generating the sets of reactant molecules, the system can generate a respective likelihood score for each set of reactant molecules. The system can use the likelihood scores for the sets of reactant molecules as part of determining a respective likelihood score for each node in each alternative set of child nodes, as will be described in more detail below.

[0131] A few example techniques by which the system can identify one or more sets of reactant molecules for various chemical reactions are described next.

[0132] In one example, the chemical reaction can be a two-to-one type chemical reaction associated with a set of one or more bonds between two atoms in the molecule where, as described above, two reactant molecules bond to generate the molecule. To identify the set of reactant molecules, the system can partition the molecule into two so-called “synthon” molecules by removing the one or more bonds associated with the chemical reaction. However, the synthon molecules may not directly define a set of reactant molecules, e.g., because the synthon molecules may be unstable, or unreactive, or both.

[0133] An example process by which the system can further process the set of synthon molecules to generate one or more sets of reactant molecules (and a respective likelihood score for each set of reactant molecules) is described with reference to FIG. 5.

[0134] Similarity, for a three-to-one type chemical reaction, the system can partition the molecule into three synthon molecules by removing the bonds associated with the chemical reaction.

[0135] In another example, the chemical reaction can be a removal type chemical reaction associated with an atom in the molecule. An example process for generating one or more sets of reactant molecules (and a respective likelihood score for each set of reactant molecules) for a removal type chemical reaction is described with reference to FIG. 6.

[0136] In another example, the chemical reaction can be a ring formation type chemical reaction associated with a set of one or more bonds between two atoms in the molecule. In this example, the system can identify a reactant molecule as the molecule resulting from removing the one or more bonds associated with the ring formation type chemical reaction. The system can generate a likelihood score for the reactant molecule as the score assigned to the chemical reaction under the score distribution over the set of chemical reactions.

[0137] In another example, the chemical reaction can be a bond degree change type chemical reaction associated with a set of one or more bonds between two atoms in the molecule. In this example, the system can identify a reactant molecule as a modified version of the molecule where the number of bonds between the two atoms differs by an amount specifiedby the bond degree change type chemical reaction. The system can generate a likelihood score for the reactant molecule as the score assigned to the chemical reaction under the score distribution over the set of chemical reactions.

[0138] Optionally, the system can update the likelihood score associated with each set of reactant molecules using a reaction likelihood neural network (310).

[0139] More specifically, the reaction likelihood neural network is configured to process an input that characterizes: (i) one or more reactant molecules, and (ii) one or more product molecules, to generate an output defining a reaction likelihood, i.e., a likelihood that the one or more reactant molecules will undergo a chemical reaction to form the one or more product molecules. As an example, the reaction likelihood neural network can have an architecture that is similar to the reaction modeling neural network. For example the reaction likelihood neural network can comprise an encoder block implemented as a recurrent neural network, to process an input sequence to generate an input embedding after processing a sequence representing the input; and a decoder block to process the input embedding to generate the output defining the reaction likelihood.

[0140] For each set of reactant molecules, the system, e.g. the reaction likelihood neural network, can process data defining: (i) the set of reactant molecules, and (ii) the molecule represented by the selected leaf node, to generate a reaction likelihood defining a likelihood that the reactant molecules will chemically react to form the molecule represented by the selected leaf node.

[0141] The system can update the likelihood score for a set of reactant molecules by combining (e.g., summing or multiplying) the likelihood score for the set of reactant molecules with the reaction likelihood for the set of reactant molecules.

[0142] The system can train the reaction likelihood neural network on a set of training examples. Each training example can include: (i) a training input that specifies one or more reactant molecules and one or more product molecules, and (ii) a target reaction likelihood that characterizes whether the reactant molecules react to generate the product molecules. The target reaction likelihood can be, e.g., a 0 / 1 binary value indicating whether the reaction occurs with a least a threshold probability or with at least a minimum yield. The target reaction likelihoods can be experimentally determined.

[0143] The system outputs one or more alternative sets of child nodes for the selected leaf node (310). Each alternative set of child nodes represents a respective set of reactant molecules, e.g., as determined at step 308. In particular, for each alternative set of childnodes, each node in the alternative set of child nodes represents a respective reactant molecule in the corresponding set of reactant molecules.

[0144] The system can determine likelihood scores for each node in each alternative set of child nodes based on the likelihood scores for the sets of reactant molecules. In particular, for each child node in each alternative set of child nodes, the system can define the likelihood score for the child node as being the likelihood score for the set of reactant molecules that includes the reactant molecule represented by the child node.

[0145] FIG. 4 is a flow diagram of an example process 400 by which a reaction modeling neural network can process data defining a molecule to generate a score distribution over a set of chemical reactions. For convenience, the process 400 will be described as being performed by a system of one or more computers located in one or more locations. For example, a retrosynthesis system, e.g., the retrosynthesis system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 400.

[0146] The system receives data identifying a molecule (402). The data identifying the molecule can be represented in any appropriate format, e.g., as a SMILES string.

[0147] The system generates a representation of the molecule as a sequence of embeddings, where each embedding represents a respective atom or ring in the molecule (404).

[0148] In particular, the system can initially generate data that defines a representation of the molecule as a tree, where each node in the tree represents a respective atom or ring in the molecule. For example, to generate the representation of the molecule as a tree, the system can parse the SMILES string representation of the molecule, where each character or set of characters in the SMILES string represents atoms, bonds, branches, or rings. For example, in SMILES, atoms are represented by their element symbols, and branches or rings are represented using parentheses or numbers. The system can create an initial tree data structure, typically with nodes representing atoms and edges representing bonds. The system can start with the root node as the first atom in the SMILES string. The system can add atoms and bonds to the tree sequentially, in particular, by traversing the SMILES string left to right. For each atom encountered, the system can add a new node to the tree and link it with an edge to the previous atom node according to the specified bond type (single, double, triple, etc.). When encountering branching symbols (parentheses), the system can create child nodes for the current atom node. This involves tracking the depth of branches and ensuring that each branch reconnects correctly to the main structure as specified in SMILES. For each ring identifier in the SMILES string, the system can locate the first occurrence of the number to mark the start of a ring, then link the current atom node back to this earlier node in the treewhen the number appears again. The system can generate the representation of the molecule as a tree, e.g., by calling appropriate functions from software libraries such as RDKit or Open Babel.

[0149] The system can then represent the tree as a sequence of embeddings, where each embedding corresponds to a respective node in the tree and identifies: (i) the entity (e.g., atom or ring) represented by the node, and (ii) any parent nodes of the node in the tree.

[0150] The system processes the sequence of embeddings representing the molecule using an encoder block of the reaction modeling neural network to generate a “combined” embedding representing the molecule (406). The encoder block can be implemented as a recurrent neural network (e.g., a long short-term memory (LSTM) recurrent neural network) that sequentially processes the sequence of embeddings representing the molecule, starting from the first embedding in the sequence of embeddings, over a sequence of steps referred to for convenience as “time” steps.

[0151] At each time step, the encoder block processes a corresponding embedding from the sequence of embeddings representing the molecule to update a current hidden state of the recurrent neural network. (For an encoder block implemented as an LSTM, the hidden state of the recurrent neural network can refer to, e.g., the cell state of the LSTM). The system can designate the hidden state of the recurrent neural network, after processing the final embedding in the sequence of embeddings representing the molecule, as the combined embedding representing the molecule.

[0152] The system processes the combined embedding representing the molecule using a decoder block of the reaction modeling neural network to generate the score distribution over the set of chemical reactions (408).

[0153] The decoder block can be implemented as a recurrent neural network (e.g., an LSTM) that sequentially generates a respective decoder output for each position in a sequence of output positions. Each output position can represent a respective atom or ring in the molecule, and the output positions can be ordered, i.e. trained to be ordered, according to the same ordering as the sequence of embeddings representing the molecule (as described at step 404).

[0154] The decoder block can process an input including the combined embedding of the molecule to update a hidden state of the decoder block and to generate a decoder output corresponding to the first position in the sequence of output positions. For each output position after the first output position, the decoder block can process an input that includes the output generated by the decoder block for the preceding output position (and optionallythe combined embedding of the molecule) to update the hidden state of the decoder block and to generate a decoder output corresponding to the output position.

[0155] The decoder outputs for the output positions in the sequence of output positions collectively define the score distribution over the set of chemical reactions. A few examples of how the decoder outputs can collectively define the score distribution over the set of chemical reactions are described next.

[0156] In one example, for each output position, the decoder output for the output position can include a score for a two-to-one type chemical reaction associated with a single bond connected to an atom associated with the output position.

[0157] As another example, for each output position, the decoder output for the output position can include a score for a two-to-one type chemical reaction for a pair of bonds connected to an atom associated with the output position.

[0158] As another example, for each output position, the decoder output for the output position can include a score for a removal type chemical reaction involving removing a group from an atom associated with the output position.

[0159] As another example, for each output position, the decoder output for the output position can include a score for a ring formation type chemical reaction for a bond connected to an atom associated with the output position.

[0160] As another example, for each output position, the decoder output for the output position can include one or more scores for bond degree change type chemical reaction for a bond connected to an atom associated with the output position.

[0161] Thus, as described above, the decoder block can generate a decoder output that includes respective scores corresponding to each of one or more chemical reactions for each output position in the sequence of output positions. The scores generated for each output position collectively define the score distribution over the set of chemical reactions. Optionally, the system can process the score distribution over the set of chemical reactions using a soft-max function, or any other appropriate normalization function. For example the decoder block can have an output head per score or just one output head that generates all the scores (and then runs a soft-max over them).

[0162] The process 400 is described with reference to a particular example architecture of the reaction modeling neural network (e.g., involving recurrent neural network layers), but (as noted earlier in this document) the reaction modeling neural network can have any of a variety of possible neural network architectures. For instance, the encoder block, the decoder block, or both can be implemented using self-attention neural network layers, orconvolutional neural network layers (e.g., masked convolutional layers), or graph neural network layers, or bidirectional recurrent neural network layers (e.g., implemented using long short-term memory (LSTM) neural network layers), or any other appropriate types or configurations of neural network layer. For example the reaction modeling neural network can have a sequence-to sequence architecture that is configured to process an input sequence, i.e. the sequence of embeddings representing the molecule, to generate an output sequence, i.e. an output for each position in the sequence of output positions.

[0163] FIG. 5 is a flow diagram of an example process 500 for processing two synthon molecules associated with a two-to-one type chemical reaction to generate one or more sets of reactant molecules using a reactant modeling neural network. For convenience, the process 500 will be described as being performed by a system of one or more computers located in one or more locations. For example, a retrosynthesis system, e.g., the retrosynthesis system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 500.

[0164] The system receives two synthon molecules associated with a two-to-one type chemical reaction (502). An example of generating two synthon molecules associated with a two-to-one type chemical reaction is described with reference to step 308 of FIG. 3.

[0165] The system generates a respective embedding of each synthon molecule (504). The system can generate an embedding of a synthon molecule, e.g., by processing the synthon molecule using a reaction modeling neural network (as described with reference to FIG. 4), and identifying an intermediate output produced by the reaction modeling neural network during processing of the synthon molecule as the embedding of the synthon molecule. For instance, the system can define an embedding of the synthon molecule as an output generated by an encoder block of the reaction modeling neural network described with reference to FIG. 4.

[0166] The system combines the embeddings of the synthon molecules to generate a combined embedding of the synthon molecules (506). For instance, the system can concatenate, sum, average, or otherwise combine the embeddings of the synthon molecules in any appropriate way.

[0167] The system processes the combined embedding of the synthon molecules using a reactant modeling neural network (associated with the two-to-one type chemical reaction) to generate a score distribution over a set of reactant generation operations (508). The reactant modeling neural network can have any appropriate neural network architecture, e.g., a multilayer perceptron (MLP) architecture.

[0168] Each reactant generation operation specifies: (i) a first modification to be applied to the first synthon molecule, and (ii) a second modification to be applied to the second synthon molecule. That is, the reactant modeling neural network can generate the score distribution over a (predefined) set of reactant generation operations, each specifying a first modification and a second modification.

[0169] The first modification and the second modification are both included in a set of possible modifications.

[0170] The set of possible modifications that can be applied to a synthon molecule can include, e.g., adding one or more functional groups to the synthon molecule, e.g., adding one or more nitro, carbonyl, alkyl, hydrogen, halogen (e.g., fluorine, chlorine, bromine, or iodine), or alkoxy groups to the synthon molecule. Optionally, the set of possible modifications can include a “null” modification that does not modify the synthon molecule.

[0171] The system selects one or more reactant generation operations from the set of reactant generation operations using the score distribution over the set of reactant generation operations (510).

[0172] For instance, the system can select a predefined number of reactant generation operations having the highest scores under the score distribution over the set of reactant generation operations.

[0173] As another example, the system can select each reactant generation operation having a score, under the score distribution over the set of reactant generation operations, that exceeds a threshold.

[0174] As another example, the system generate a probability distribution over the set of reactant generation operations based on the score distribution over the set of reactant generation operations (e.g., by processing the score distribution using a soft-max function), and then sample a predefined number of reactant generation operations in accordance with the probability distribution.

[0175] The system generates, for each selected reactant generation operation, a corresponding set of reactant molecules (512). In particular, for each selected reactant generation operation, the system: (i) applies the first molecule modification specified by the reactant generation operation to the first synthon molecule to generate a first reactant molecule, and (ii) applies the second molecule modification specified by the reactant generation operation to the second synthon molecule to generate a second reactant molecule. The first reactant molecule and the second reactant molecule then collectively define the set of reactant molecules corresponding to the selected reactant generation operation. The systemcan apply the first molecule modification specified by the reactant generation to the first synthon molecule, e.g., at a location on the first synthon molecule that is defined by the bond that was broken in splitting the product molecule into the synthons. Similarly, the system can apply the second molecule modification specified by the reactant generation to the second synthon molecule, e.g., at a location on the second synthon molecule that is defined by the bond that was broken in splitting the product molecule into the synthons.

[0176] Optionally, the system generates a likelihood score for each set of reactant molecules (514). The system can generate a likelihood score for a set of reactant molecules as a combination (e.g., a product or sum) of (i) the score for the two-to-one type chemical reaction under a score distribution over a set of chemical reactions generated at step 304 of the process described in FIG. 3, and (ii) the score for the reactant generation operation used to generate the set of reactant molecules under the score distribution over the set of reactant generation operations generated at step 508.

[0177] The system outputs the one or more sets of reactant molecules (and, optionally, the respective likelihood score for each set of reactant molecules) (516).

[0178] FIG. 6 is a flow diagram of an example process 600 for generating one or more reactant molecules for a removal type chemical reaction associated with an atom in a molecule. For convenience, the process 600 will be described as being performed by a system of one or more computers located in one or more locations. For example, a retrosynthesis system, e.g., the retrosynthesis system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 600.

[0179] The system receives data identifying an atom in a molecule, where the atom is the site of a removal type chemical reaction, i.e., where a group is removed from the atom (602).

[0180] The system generates a score distribution over a set of groups using a reactant modeling neural network (604). Each group in the set of groups defines a group that can be removed from the atom at the site of the removal operation. The set of groups can include, e.g., atoms, rings, functional groups, substituent groups, side chains, and so forth.

[0181] The reactant modeling neural network can process an input that includes data identifying: (i) the molecule, and (ii) the atom that is the site of the removal operation. For instance, the input to the reactant modeling neural network can include a sequence of embeddings that includes a respective embedding representing each atom and each ring in the molecule, where each embedding in the sequence of embeddings includes one or more flags indicating whether the embedding is associated with the atom that is the site of the removaloperation. An example of generating a representation of a molecule as a sequence of embeddings is described with reference to step 404 of FIG. 4.

[0182] The reactant modeling neural network associated with the removal type chemical reaction can have any appropriate network architecture. For instance, the reactant modeling neural network can include an encoder block that processes the network input to generate an embedding, and a projection block that processes the embedding to generate the score distribution over the set of groups. The encoder block can have the architecture of the encoder block of the reaction modeling neural network, as described with reference to step 406 of FIG. 4. The projection block can be implemented, e.g., by a sequence of one or more fully connected neural network layers.

[0183] The system selects one or more groups from the set of groups using the score distribution over the set of groups (606).

[0184] For instance, the system can select a predefined number of groups having the highest scores under the score distribution over the set of groups.

[0185] As another example, the system can select each group having a score, under the score distribution over the set of groups, that exceeds a threshold.

[0186] As another example, the system can generate a probability distribution over the set of groups based on the score distribution over the set of groups (e.g., by processing the score distribution using a soft-max function), and then sample a predefined number of groups in accordance with the probability distribution.

[0187] The system generates, for each selected group, a corresponding reactant molecule (608). In particular, for each selected group, the system can generate a reactant molecule that includes: (i) the molecule, and (ii) the selected group, where the selected group is bonded to the atom that is the site of the removal operation.

[0188] Optionally, the system generates a likelihood score for each reactant molecule (610). The system can generate the likelihood score for a reactant molecule as a combination (e.g., a product or sum) of: (i) the score for the removal type chemical reaction under a score distribution over a set of chemical reactions generated at step 304 of the process described in FIG. 3, and (ii) the score for the group used to generate the reactant molecule under the score distribution over the set of groups generated at step 604.

[0189] The system outputs the one or more reactant molecules (and, optionally, the respective likelihood score for each reactant molecule) (612).

[0190] FIG. 7 is a flow diagram of an example process 700 for training a reaction modeling neural network and a respective reactant modeling neural network associated with each ofone or more chemical reactions, e.g., a two-to-one type chemical reaction or a removal type chemical reaction. For convenience, the process 700 will be described as being performed by a system of one or more computers located in one or more locations. For example, a retrosynthesis system, e.g., the retrosynthesis system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 700.

[0191] The system receives a set of training examples for training the reaction modeling neural network and the one or more reactant modeling neural networks (702). Each training example can include data identifying: (i) a “base” molecule, (ii) a chemical reaction, and in some cases, (iii) a set of one or more reactant molecules that, when involved in the chemical reaction, generate the base molecule as a product of the chemical reaction.

[0192] Each training example can be extracted from a training retrosynthesis graph in a database of training retrosynthesis graphs. In particular, each non-leaf node in a training retrosynthesis graph can provide a respective training example, where the molecule represented by the non-leaf node defines the base molecule of the training example, the one or more molecules represented by the one or more child nodes of the non-leaf node define the reactant molecules of the training example, and the chemical reaction required to generate the base molecule from the one or more reactant molecules defines the chemical reaction of the training example. The database of training retrosynthesis graphs can be obtained from any of a variety of sources, e.g., from the Reaxys database, or from the CAS Reactions from the American Chemical Society database, or by manually or automatically mining retrosynthesis graphs from patent filings or academic / scientific literature.

[0193] Some or all of the training retrosynthesis graphs can be complete retrosynthesis graphs. Training the reaction modeling neural network and the one or more reactant modeling neural networks on training examples derived from complete retrosynthesis graphs can increase the likelihood that the retrosynthesis system will generate complete retrosynthesis graphs.

[0194] The system trains the reaction modeling neural network and the one or more reactant modeling neural networks on the set of training examples (704).

[0195] In particular, for each training example, the system can process the base molecule specified by the training example using the reaction modeling neural network to generate a score distribution over a set of chemical reactions. The system can train the reaction modeling neural network to optimize an objective function that measures an error, e.g., a cross-entropy error, between: (i) the distribution over the set of chemical reactions that isgenerated by the reaction modeling neural network, and (ii) the chemical reaction specified by the training example.

[0196] Each training example for a two-to-one type chemical reaction can specify a set of one or more reactant molecules. The system can train the reactant modeling neural network associated with the two-to-one type chemical reaction on the training examples for two-to- one type chemical reactions.

[0197] In particular, for each two-to-one type chemical reaction training example, the system can process an embedding representing a pair of synthons derived from the base molecule to generate a score distribution over a set of reactant generation operations using the reactant modeling neural network associated with the two-to-one type chemical reaction, e.g., as described with reference to FIG. 5. The system can further identify a target reactant generation operation that, when applied to the pair of synthons derived from the base molecule, generates the set of reactant molecules specified by the training example.

[0198] The system can train the reactant modeling neural network to optimize an objective function that measures an error, e.g., a cross-entropy error, between: (i) the distribution over the set of reactant generation operations as generated by the reactant modeling neural network, and (ii) the target reactant generation operation.

[0199] Each training example for a removal type chemical reaction can specify a reactant molecule. The system can train the reactant modeling neural network associated with the removal type chemical reaction on the training examples for removal type chemical reactions.

[0200] In particular, for each removal type chemical reaction training example, the system can process data identifying the base molecule and the atom that is the site of the removal type chemical reaction to generate a score distribution over a set of groups using the reactant modeling neural network associated with the removal type chemical reaction, e.g., as described with reference to FIG. 6. The system can further identify a target group, from the set of groups, as the group that is removed from the atom that is the site of the removal operation in the reactant molecule specified by the training example to generate the base molecule specified by the training example.

[0201] The system can train the reactant modeling neural network to optimize an objective function that measures an error, e.g., a cross-entropy error, between: (i) the distribution over the set of groups as generated by the reactant modeling neural network, and (ii) the target group.

[0202] Training a neural network (e.g., the reaction modeling neural network or a reactant modeling neural network) to optimize an objective function can include determininggradients of the objective function with respect to the parameters of the neural network, and then using the gradients to update the parameter values of the neural network. The system can determine the gradients of the objective function with respect to the parameters of the neural network, e.g., using backpropagation. The system can use the gradients to update the parameter values of the neural network using the update rule of an appropriate gradient descent optimization algorithm, e.g., RMSprop or Adam.

[0203] Optionally, in addition to training the reaction modeling neural network to generate score distributions over a set of chemical reactions, as described above, the system can further train the reaction modeling neural network to perform an auto-encoding task (706). More specifically, the system can train the reaction modeling neural network to generate an output that, in addition to a score distribution over a set chemical reactions, further includes a predicted reconstruction of the input to the reaction modeling neural network. That is, the reaction modeling neural network can have the same architecture as previously described, with an additional output that is trained to be a reconstruction of the input. The input to the reaction modeling neural network defines a molecule, e.g., by way of a sequence of embeddings, as described with reference to FIG. 4.

[0204] Training the reaction modeling neural network to perform the auto-encoding task can improve the performance of the reaction modeling neural network on the reaction modeling task, e.g., by refining the parameters of the reaction modeling neural network to encode an understanding of molecular structure. Further, training examples for the auto-encoding task are plentiful (e.g., because any molecule can provide a training example for the autoencoding task) and do not require labeling (e.g., with a label that defines the target output, because the molecule itself defines the target output for the auto-encoding task).

[0205] FIG. 8 illustrates an example of operations that can be performed by the retrosynthesis system described in this specification.

[0206] The retrosynthesis system can iteratively update a collection of retrosynthesis trees 802 for a target molecule. The retrosynthesis system can represent the collection of retrosynthesis trees, e.g., by way of a single combined tree with alternative sets of child nodes, as described above.

[0207] At each of multiple update iterations, the retrosynthesis system can select a leaf node 806 that is included in one or more retrosynthesis trees in the collection of retrosynthesis trees, e.g., that is included in the retrosynthesis tree 804. The retrosynthesis system can then use a reaction modeling neural network 808 (and, in some cases, a reactant modeling neural network 808) to generate one or more sets of reactant molecules 810. Each set of reactantmolecules can chemically react to produce the molecule represented by the leaf node 806. Each set of reactant molecules 810 can represent a respective alternative set of child nodes for the selected leaf node 806.

[0208] The retrosynthesis system can generate one or more extended retrosynthesis trees 816 using the one or more sets of reactant molecules. Each extended retrosynthesis tree 816 extends one or more respective retrosynthesis trees included in the collection of retrosynthesis trees, e.g., by adding one or more child nodes (e.g., 812 and 814), representing a set of reactant molecules 810, to the selected leaf node of an existing retrosynthesis tree. More specifically, the retrosynthesis system can, for instance, generate the extended retrosynthesis trees and add the extended retrosynthesis trees to the collection of retrosynthesis trees 802 by adding each alternative set of child nodes of the selected leaf node (each representing a respective set of reactant molecules that react to generate the molecule represented by the selected leaf node) to a combined tree representing the collection of retrosynthesis trees 802.

[0209] FIG. 9 illustrates an example of a combined tree that stores a collection of retrosynthesis trees. In this example, the combined tree 902 has a root node A with two alternative sets of child nodes: {B, C, D} and {E, F}. Node C has two alternative sets of child nodes: {G, H, 1} and {J}. The combined tree 902 thus represents three individual retrosynthesis trees 904, 906, and 908. It will be appreciated that the trees shown in FIG. 9 are simplified illustrations, and that the retrosynthesis system can generate collections of retrosynthesis trees that include over 1000, or over 10,000, or over 100,000 trees as part of exploring the space of retrosynthesis trees for a target molecule. Storing a collection of retrosynthesis trees as a single combined tree with alternative sets of child nodes can significantly reduce consumption of memory resources and facilitate broad exploration of the space of retrosynthesis trees for a molecule, as described throughout this specification.

[0210] This specification uses the term “configured” in connection with systems and computer program components. For a system of one or more computers to be configured to perform particular operations or actions means that the system has installed on it software, firmware, hardware, or a combination of them that in operation cause the system to perform the operations or actions. For one or more computer programs to be configured to perform particular operations or actions means that the one or more programs include instructions that, when executed by data processing apparatus, cause the apparatus to perform the operations or actions.

[0211] Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangibly-embodied computer software or firmware, in computer hardware, including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible non-transitory storage medium for execution by, or to control the operation of, data processing apparatus. The computer storage medium can be a machine- readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them. Alternatively or in addition, the program instructions can be encoded on an artificially-generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to suitable receiver apparatus for execution by a data processing apparatus.

[0212] The term “data processing apparatus” refers to data processing hardware and encompasses all kinds of apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, or multiple processors or computers. The apparatus can also be, or further include, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). The apparatus can optionally include, in addition to hardware, code that creates an execution environment for computer programs, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.

[0213] A computer program, which may also be referred to or described as a program, software, a software application, an app, a module, a software module, a script, or code, can be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages; and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A program may, but need not, correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data, e.g., one or more scripts stored in a markup language document, in a single file dedicated to the program in question, or in multiple coordinated files, e.g., files that store one or more modules, sub-programs, or portions of code. A computer program can be deployed tobe executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a data communication network.

[0214] In this specification the term “engine” is used broadly to refer to a software-based system, subsystem, or process that is programmed to perform one or more specific functions. Generally, an engine will be implemented as one or more software modules or components, installed on one or more computers in one or more locations. In some cases, one or more computers will be dedicated to a particular engine; in other cases, multiple engines can be installed and running on the same computer or computers.

[0215] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuitry, e.g., an FPGA or an ASIC, or by a combination of special purpose logic circuitry and one or more programmed computers.

[0216] Computers suitable for the execution of a computer program can be based on general or special purpose microprocessors or both, or any other kind of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory or a random access memory or both. The essential elements of a computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and data. The central processing unit and the memory can be supplemented by, or incorporated in, special purpose logic circuitry. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer need not have such devices. Moreover, a computer can be embedded in another device, e.g., a mobile telephone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device, e.g., a universal serial bus (USB) flash drive, to name just a few.

[0217] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks.

[0218] To provide for interaction with a user, embodiments of the subject matter described in this specification can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to theuser and a keyboard and a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input. In addition, a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user’s device in response to requests received from the web browser. Also, a computer can interact with a user by sending text messages or other forms of message to a personal device, e.g., a smartphone that is running a messaging application, and receiving responsive messages from the user in return.

[0219] Data processing apparatus for implementing machine learning models can also include, for example, special-purpose hardware accelerator units for processing common and compute-intensive parts of machine learning training or production, i.e., inference, workloads.

[0220] Machine learning models can be implemented and deployed using a machine learning framework, e.g., a TensorFlow framework, or a Jax framework.

[0221] Embodiments of the subject matter described in this specification can be implemented in a computing system that includes a back-end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front-end component, e.g., a client computer having a graphical user interface, a web browser, or an app through which a user can interact with an implementation of the subject matter described in this specification, or any combination of one or more such back-end, middleware, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN) and a wide area network (WAN), e.g., the Internet.

[0222] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. In some embodiments, a server transmits data, e.g., an HTML page, to a user device, e.g., for purposes of displaying data to and receiving user input from a user interacting with thedevice, which acts as a client. Data generated at the user device, e.g., a result of the user interaction, can be received at the server from the device.

[0223] While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or on the scope of what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.Moreover, although features may be described above as acting in certain combinations and even initially be claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.

[0224] Similarly, while operations are depicted in the drawings and recited in the claims in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.

[0225] Particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results. As one example, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous.

Claims

CLAIMS1. A method performed by one or more computers, the method comprising: generating a collection of retrosynthesis trees for a target molecule that each define a respective synthesis pathway for the target molecule, wherein: each retrosynthesis tree comprises a plurality of nodes that each represent a respective molecule, wherein the plurality of nodes comprise: (i) a plurality of non-leaf nodes, including a root node representing the target molecule, and (ii) a plurality of leaf nodes; and each non-leaf node in each retrosynthesis tree has one or more child nodes that each represent a respective reactant molecule involved in a chemical reaction that produces the respective molecule represented by the non-leaf node; wherein generating the collection of retrosynthesis trees comprises: initializing the collection of retrosynthesis trees; iteratively updating the collection of retrosynthesis trees, comprising, at each of a plurality of iterations: selecting a leaf node that is included in one or more retrosynthesis trees in the collection of retrosynthesis trees; processing data defining the respective molecule represented by the selected leaf node, using a reaction modeling neural network, to generate a score distribution over a set of chemical reactions that produce the respective molecule represented by the selected leaf node; selecting one or more chemical reactions from the set of chemical reactions using the score distribution over the set of chemical reactions; and generating one or more new retrosynthesis trees that each extend a respective retrosynthesis tree that includes the selected leaf node based on the one or more chemical reactions selected from the set of chemical reactions.

2. The method of claim 1, wherein each chemical reaction in the set of chemical reactions specifies: (i) a type of the chemical reaction, and (ii) a location in the molecule represented by the selected leaf node where the chemical reaction occurs.

3. The method of claim 2, wherein the set of chemical reactions includes one or more chemical reactions specifying a two-to-one type chemical reaction that involves two reactantmolecules bonding to form the molecule represented by the selected leaf node.

4. The method of any one of claims 2-3, wherein the set of chemical reactions includes one or more chemical reactions specifying a removal type chemical reaction that involves removing a group from an atom in the molecule represented by the selected leaf node.

5. The method of claim 4, wherein the group is an atom, or a ring, or a functional group, or a substituent group, or a side chain.

6. The method of any one of claims 2-5, wherein the set of chemical reactions includes one or more chemical reactions specifying a ring formation type chemical reaction wherein two atoms bond to form a ring in the molecule represented by the selected leaf node.

7. The method of any one of claims 2-6, wherein the set of chemical reactions includes one or more chemical reactions specifying a bond degree change chemical reaction wherein a degree of a bond between atoms in the molecule represented by the selected leaf node increases or decreases.

8. The method of any one of claims 2-7, wherein for each of one or more chemical reactions in the set of chemical reactions, the location in the molecule represented by the selected leaf node where the chemical reaction occurs comprises an atom in the molecule or a bond in the molecule.

9. The method of any preceding claim, wherein selecting one or more chemical reactions from the set of chemical reactions using the score distribution over the set of chemical reactions comprises: selecting one or more chemical reactions associated with highest scores under the score distribution over the set of chemical reactions.

10. The method of any preceding claim, wherein generating one or more new retrosynthesis trees that each extend the selected retrosynthesis tree based on the one or more chemical reactions selected from the set of chemical reactions comprises: identifying, for each selected chemical reaction, a respective set of one or more reactant molecules that form a product comprising the molecule represented by the selectedleaf node upon undergoing the selected chemical reaction; and generating the one or more new retrosynthesis trees based on the sets of reactant molecules.

11. The method of claim 10, wherein the collection of retrosynthesis trees is represented as a combined tree, wherein: each non-leaf node in the combined tree represents a respective molecule and has one or more alternative sets of child nodes; and each retrosynthesis tree in the collection of retrosynthesis trees is defined by selecting a particular choice for a set of child nodes, from a respective set of one or more alternative sets of child nodes, for each non-leaf node in the combined tree; and wherein generating the one or more new retrosynthesis trees based on the sets of reactant molecules comprises, for each set of reactant molecules: augmenting the combined tree to include a set of nodes representing the set of reactant molecules as an alternative set of child nodes of the selected leaf node.

12. The method of any one of claims 10-11, wherein the one or more chemical reactions selected from the set of chemical reactions includes a two-to-one type chemical reaction that involves two reactant molecules bonding to form the molecule represented by the selected leaf node; and wherein identifying the set of one or more reactant molecules for the two-to-one type chemical reaction comprises: partitioning the molecule represented by the selected leaf node into a first synthon molecule and a second synthon molecule; generating, using a reactant modeling neural network, a score distribution over a set of reactant generation operations, wherein each reactant generation operation specifies: (i) a first modification to be applied to the first synthon molecule, and (ii) a second modification to be applied to the second synthon molecule; and identifying the set of one or more reactant molecules for the two-to-one type chemical reaction using the score distribution over the set of reactant generation operations.

13. The method of claim 12, wherein identifying the set of one or more reactant molecules for the two-to-one type chemical reaction using the score distribution over the set of reactant generation operations comprises:selecting one or more reactant generation operations from the set of reactant generation operations using the score distribution over the set of reactant generation operations; and generating, for each selected reactant generation operation, a corresponding set of reactant molecules.

14. The method of claim 13, wherein for each selected reactant generation operation, generating the corresponding set of reactant molecules comprises: generating a first reactant molecule by applying a first modification specified by the selected reactant generation operation to the first synthon molecule; and generating a second reactant molecule by applying a second modification specified by the selected reactant generation operation to the second synthon molecule.

15. The method of any preceding claim, wherein processing the data defining the respective molecule represented by the selected leaf node, using the reaction modeling neural network, to generate the score distribution over the set of chemical reactions comprises: generating a sequence of embeddings representing the molecule; sequentially processing the sequence of embeddings representing the molecule using a encoder block of the reaction modeling neural network, wherein the encoder block comprises a recurrent neural network layer; identifying a hidden state of the recurrent neural network layer of the encoder block, after processing a final embedding in the sequence of embeddings, as a combined embedding representing the molecule; and processing the combined embedding representing the molecule using a decoder block of the reaction modeling neural network to generate the score distribution over the set of chemical reactions.

16. The method of claim 15, wherein the decoder block of the reaction modeling neural network comprises a recurrent neural network layer; and wherein processing the combined embedding representing the molecule using the decoder block of the reaction modeling neural network to generate the score distribution over the set of chemical reactions comprises: generating a respective decoder output for each output position in a sequence of output positions;wherein the decoder outputs for the output positions in the sequence of output positions collectively define the score distribution over the set of chemical reactions.

17. The method of claim 16, wherein each output position corresponds to a respective atom or ring in the molecule represented by the selected leaf node.

18. The method of any one of claims 15-17, wherein for each output position in the sequence of output positions, the decoder output for the output position comprises a respective score for each of one or more chemical reactions that involve an atom or bond in the molecule that is associated with the output position.

19. The method of any one of claims 15-18, wherein for a first output position in the sequence of output positions, generating the decoder output for the output position comprises: processing the combined embedding representing the molecule to update a hidden state of recurrent neural network layer of the decoder block and to generate the decoder output for the first output position.

20. The method of any one of claims 15-19, wherein for each output position after a first output position in the sequence of output positions, generating the decoder output for the output position comprises: processing an input comprising a decoder output for a preceding output position to update a hidden state of the recurrent neural network of the decoder block and to generate the decoder output for the output position.

21. The method of any preceding claim, wherein selecting a leaf node that is included in one or more retrosynthesis trees from the collection of retrosynthesis trees comprises: selecting a leaf node representing a molecule that is not included in a library of precursor molecules.

22. The method of any preceding claim, wherein selecting a leaf node representing a molecule that is not included in a library of precursor molecules comprises: determining an overall likelihood score for the leaf node based at least in part on a likelihood of the molecule represented by the leaf node; andselecting the leaf node based on the overall likelihood score for the leaf node.

23. The method of any preceding claim, wherein initializing the set of retrosynthesis trees comprises: initializing the set of retrosynthesis trees to include a retrosynthesis tree that includes only a root node representing the target molecule.

24. The method of any preceding claim, further comprising synthesizing the target molecule in accordance with a synthesis pathway defined by a retrosynthesis tree included in the collection of retrosynthesis trees.

25. The method of any one of claims 1-23, further comprising: determining, based at least in part on the collection of retrosynthesis trees, whether to synthesize the target molecule.

26. The method of claim 25, wherein determining, based at least in part on the collection of retrosynthesis trees, whether to synthesize the target molecule comprises: determining that the collection of retrosynthesis trees comprises at least one retrosynthesis tree wherein each leaf node of the retrosynthesis tree represents a respective molecule that is included in a library of precursor molecules; and in response, determining that the target molecule should be synthesized.

27. The method of claim 26, further comprising synthesizing the target molecule.

28. The method of claim 27, wherein synthesizing the target molecule comprises: synthesizing the target molecule in accordance with a synthesis pathway defined by a retrosynthesis tree included in the collection of retrosynthesis trees.

29. The method of claim 25, wherein determining, based at least in part on the collection of retrosynthesis trees, whether to synthesize the target molecule comprises: filtering the collection of retrosynthesis trees based on a set of one or more filtering criteria, comprising: determining, for each retrosynthesis tree in the collection of retrosynthesis trees, whether the retrosynthesis tree satisfies each filtering criterion in the set of filteringcriteria; and removing, from the collection of retrosynthesis trees, any retrosynthesis tree that satisfies one or more of the filtering criteria; and determining whether to synthesize the target molecule based on the filtered collection of retrosynthesis trees.

30. The method of claim 29, wherein the set of filtering criteria comprises a filtering criterion that is satisfied by a retrosynthesis tree if the retrosynthesis tree includes a leaf node representing a molecule that is not included in a predefined library of precursor molecules.

31. The method of any one of claims 29-30, wherein the set of filtering criteria comprises a filtering criterion that is satisfied by a retrosynthesis tree if the retrosynthesis tree includes a node representing a molecule that: has a reactivity above a reactivity threshold; or has a stability that is below a stability threshold; or has a toxicity that is above a toxicity threshold.

32. The method of any one of claims 29-31, wherein the set of filtering criteria comprises a filtering criterion that is satisfied by a retrosynthesis tree if the retrosynthesis tree defines a synthesis pathway that requires performing a chemical reaction under reaction conditions that fall outside a range of tolerable reaction conditions.

33. The method of any one of claims 29-32, wherein determining whether to synthesize the target molecule based on the filtered collection of retrosynthesis trees comprises: determining that the target molecule should be synthesized only if the filtered collection of retrosynthesis trees includes at least a threshold number of retrosynthesis trees.

34. The method of any one of claims 29-33, further comprising: synthesizing the target molecule in response to determining, based on the filtered collection of retrosynthesis trees, that the target molecule should be synthesized.

35. One or more non-transitory computer storage media storing instructions that when executed by one or more computers cause the one or more computers to perform operations of the respective method of any one of claims 1-23, 25-26, or 29-33.

36. A system comprising: one or more computers; and one or more storage devices communicatively coupled to the one or more computers, wherein the one or more storage devices store instructions that, when executed by the one or more computers, cause the one or more computers to perform operations of the respective method of any one of claims 1-23, 25-26, or 29-33.

37. A molecule that has been synthesized by performing the method of any one of claims 24, 27-28, or 34.

38. One or more non-transitory computer storage media storing data defining a collection of retrosynthesis trees for a target molecule, wherein the collection of retrosynthesis trees have been generated by performing operations of the respective method of any one of claims 1-23.

Citation Information

Patent Citations

  • Retrosynthesis systems and methods

    US20220172802A1

  • Method for predicting retrosynthesis of a compound molecule and related apparatus

    US20230043540A1

  • Retrosynthesis using neural networks

    WO2021263238A1

  • Retrosynthesis prediction system and method using graph generative models

    WO2023239443A1