Molecular multi-step inverse synthesis path planning method and device based on large language model

By using a reinforcement learning method based on a large language model, combined with single-step retrosynthesis and selection operations, the multi-step retrosynthesis path planning of molecules is optimized, solving the problems of high computational complexity and unreliable paths in existing technologies, and realizing efficient and reasonable retrosynthesis path planning.

CN120954565APending Publication Date: 2025-11-14TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511012742.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing multi-step retrosynthetic planning methods for molecules have high computational complexity, cannot guarantee the rationality of retrosynthetic paths, and are inefficient when dealing with complex molecular designs.

Method used

A reinforcement learning method based on a large language model is adopted to plan multi-step retrosynthetic pathways of molecules through a retrosynthetic model. By utilizing single-step retrosynthetic operations and molecular selection operations, and combining the feasibility of the synthetic path with the number of times the planning operation is called, a reward feedback is set to optimize the path planning process.

Benefits of technology

While ensuring chemical rationality, it effectively navigates complex retrosynthetic spaces, improving the efficiency and quality of multi-step retrosynthetic route planning, and increasing the success rate of route planning and the rationality of the generation route.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120954565A_ABST
    Figure CN120954565A_ABST
Patent Text Reader

Abstract

The invention provides a molecular multi-step inverse synthesis path planning method and device based on a large language model. The method comprises the following steps: acquiring character string representation of a target molecule; based on a pre-trained inverse synthesis model, planning an inverse synthesis path of the target molecule according to the character string representation of the target molecule; wherein the inverse synthesis model is obtained through reinforcement learning training on the basis of a large language model, reward feedback is set according to the feasibility of a synthesis path and the calling frequency of planning operation under the synthesis path during training, and the planning operation comprises molecular single-step inverse synthesis operation and molecular selection operation. According to the method, molecular multi-step inverse synthesis path planning is carried out through the inverse synthesis model obtained through reinforcement learning, a complex inverse synthesis space is effectively navigated on the premise of ensuring chemical rationality, and the efficiency and quality of multi-step inverse synthesis path planning are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of molecular retrosynthesis technology, and in particular to a method and apparatus for molecular multi-step retrosynthesis path planning based on a large language model. Background Technology

[0002] Multi-step retrosynthesis is a fundamental and crucial technical task in organic chemistry, widely used in the design of synthetic routes for new drug development, materials science, and fine chemicals. Its core objective is to progressively "deconstruct" a complex target molecule into simpler, commercially available, or easily prepared starting materials through a series of rational chemical reaction steps. This process relies not only on a deep understanding of organic reaction mechanisms but also involves a comprehensive evaluation of multiple factors, including the selectivity of reaction pathways, the compatibility of reaction conditions, and synthetic efficiency.

[0003] With the development of computational chemistry and artificial intelligence technologies, various methods have been proposed to assist chemists in designing multi-step retrosynthetic pathways. These mainly include rule-based methods, template-based methods, graph search-based methods, and, in recent years, machine learning and AI-driven methods. While these methods have improved the capability of automated retrosynthesis to some extent, they still have many limitations in practical applications.

[0004] Rule-based methods primarily rely on expert-summarized chemical reaction logic or heuristic reasoning systems. They determine possible bond-breaking sites and corresponding precursor structures by performing structural analysis on target molecules. These methods emphasize chemical intuition, offer strong path interpretability, and are easily subject to manual review. However, their applicability is limited by the coverage of the rule base, making it difficult to adapt to emerging reaction types. Furthermore, they lack automatic optimization capabilities and have high maintenance costs.

[0005] Template-based methods extract reaction templates from existing chemical reaction databases and generate candidate precursors through structure matching. This approach utilizes real-world reaction data, thus the recommended pathways have high chemical feasibility. However, because template matching is sensitive to structural changes, this type of method performs poorly when dealing with non-standard structures or unseen reactions, and its limited template coverage makes it difficult to comprehensively support diverse retrosynthetic tasks.

[0006] Graph search-based methods represent molecules as graph structures and use graph search algorithms to find feasible paths within the molecular network. These methods offer intuitive structural representations, facilitate path visualization, and allow for the integration of various scoring functions to rank paths. However, due to the vast space of retrosynthesis, the search process is prone to "combinatorial explosion," leading to low computational efficiency, especially when dealing with complex molecules or multi-step paths.

[0007] Machine learning and artificial intelligence-based methods typically employ deep neural network models (such as sequence-to-sequence models and graph neural networks) to directly predict antisynthetic reaction paths, exhibiting a certain degree of generalization ability and automatically learning reaction patterns from large amounts of historical reaction data. Some systems also incorporate reinforcement learning or Monte Carlo tree search mechanisms to simulate long-term inference processes to explore more complex paths. While these methods demonstrate performance close to or even exceeding that of traditional methods on certain test sets, they still face challenges such as strong dependence on training data quality, poor path interpretability, and instability in long path generation, especially when dealing with novel or unconventional reactions, where their effectiveness is limited.

[0008] Overall, existing multi-step retrosynthetic methods still face significant challenges in dealing with large-scale combinatorial search spaces and ensuring path coherence and chemical rationality. On the one hand, each step in the path planning process may generate multiple candidate intermediates, leading to an exponential increase in the overall search space and computational complexity. On the other hand, many methods focus on local optima and lack forward-looking assessments of future steps, easily introducing infeasible paths in the early decision-making stages. Furthermore, existing methods generally suffer from deficiencies in reaction diversity coverage, path practicality, and long-term reasoning capabilities, limiting their widespread application in complex molecular design.

[0009] Therefore, how to solve the problems of high computational complexity and inability to guarantee the rationality of retrosynthetic pathways in existing multi-step retrosynthetic planning methods is an important issue that urgently needs to be addressed in the field of molecular retrosynthesis. Summary of the Invention

[0010] This invention provides a molecular multi-step retrosynthetic path planning method and apparatus based on a large language model, which overcomes the shortcomings of existing molecular multi-step retrosynthetic planning methods, such as high computational complexity and inability to guarantee the rationality of retrosynthetic paths. Under the premise of ensuring chemical rationality, it effectively navigates complex retrosynthetic space and improves the efficiency and quality of multi-step retrosynthetic path planning.

[0011] In a first aspect, the present invention provides a molecular multi-step retrosynthesis path planning method based on a large language model, comprising: obtaining a string representation of a target molecule; planning a retrosynthesis path of the target molecule based on a pre-trained retrosynthesis model and according to the string representation of the target molecule; wherein the retrosynthesis model is obtained by reinforcement learning training based on a large language model, and during training, a reward feedback is set according to the feasibility of the synthesis path and the number of times the planning operation is called under the synthesis path, and the planning operation includes a single-step retrosynthesis operation and a molecule selection operation.

[0012] Furthermore, the inverse synthesis model based on pre-trained data, which plans the inverse synthesis path of the target molecule according to the string representation of the target molecule, includes: constructing a prompt word to be input according to the string representation of the target molecule; inputting the prompt word to be input into the pre-trained inverse synthesis model to obtain the result of the current planning operation; and determining the inverse synthesis path of the target molecule according to the result of the current planning operation.

[0013] Furthermore, the step of constructing the input prompt word based on the string representation of the target molecule includes: determining the planning operations that the inverse synthesis model can perform, the calling method of the planning operations, and the model output format requirements; and concatenating the string representation of the target molecule, the planning operations that the inverse synthesis model can perform, the calling method of the planning operations, and the model output format requirements to obtain the input prompt word.

[0014] Further, the step of inputting the input prompt word into a pre-trained inverse synthesis model to obtain the result of the current planning operation includes: inputting the input prompt word into the pre-trained inverse synthesis model, outputting a single-step inverse synthesis function for the target molecule to be called and a target molecule selection function; obtaining multiple candidate reactions corresponding to the target molecule based on the single-step inverse synthesis function for the target molecule; and analyzing and selecting the multiple candidate reactions based on the target molecule selection function to obtain the result of the current planning operation.

[0015] Further, determining the retrosynthetic path of the target molecule based on the result of the current planning operation includes: determining that there are unobtainable reaction molecules in the result of the current planning operation; placing the unobtainable reaction molecules in an initially empty set of molecules to be synthesized, and taking each molecule in the set of molecules to be synthesized as a molecule to be synthesized; performing multi-step retrosynthetic path planning for each molecule to be synthesized until all molecules in the set of molecules to be synthesized are synthesized, thereby obtaining the retrosynthetic path of the target molecule.

[0016] Furthermore, the inverse synthesis model is trained using reinforcement learning, specifically including: taking molecules from the unsynthesized molecule set as state input, the called planning operation as action output, and the feedback value of the synthesis path as reward feedback, and iteratively optimizing the inverse synthesis model; wherein, if the synthesis path is feasible, the feedback value is determined as the first feedback value; if the synthesis path is not feasible, the feedback value is determined as the second feedback value, and the first feedback value is greater than the second feedback value.

[0017] Furthermore, it also includes: if the synthesis path is feasible, determining the number of planning operations under the synthesis path; if the number of planning operations called under the synthesis path is greater than a set threshold, each planning operation call exceeding the set threshold will further reduce the feedback value of the synthesis path.

[0018] Secondly, the present invention also provides a molecular multi-step retrosynthesis path planning device based on a large language model, comprising: a target molecule string representation acquisition module for acquiring the string representation of the target molecule; and a target molecule retrosynthesis path planning module for planning the retrosynthesis path of the target molecule based on a pre-trained retrosynthesis model and according to the string representation of the target molecule; wherein the retrosynthesis model is obtained by reinforcement learning training based on a large language model, and during training, a reward feedback is set according to the feasibility of the synthesis path and the number of times the planning operation is called under the synthesis path, and the planning operation includes a single-step retrosynthesis operation and a molecule selection operation.

[0019] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the molecular multi-step retrosynthetic path planning method based on any of the above-described methods.

[0020] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the molecular multi-step retrosynthetic path planning method based on a large language model as described above.

[0021] This invention provides a molecular multi-step retrosynthetic path planning method based on a large language model. It obtains the string representation of the target molecule and, based on a pre-trained retrosynthetic model, plans the retrosynthetic path of the target molecule according to this string representation. The retrosynthetic model is trained using reinforcement learning based on a large language model. During training, rewards are assigned based on the feasibility of the synthetic path and the number of times the planning operation is invoked. The planning operations include single-step retrosynthetic operations and molecule selection operations. This method uses a reinforcement learning-based retrosynthetic model for multi-step retrosynthetic path planning, effectively navigating complex retrosynthetic spaces while ensuring chemical rationality, thus improving the efficiency and quality of multi-step retrosynthetic path planning. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0023] Figure 1 This is a schematic flowchart of the molecular multi-step retrosynthetic path planning method based on a large language model provided in an embodiment of the present invention.

[0024] Figure 2 This is a schematic diagram illustrating the invocation of the single-step retrosynthesis function for the target molecule provided in an embodiment of the present invention.

[0025] Figure 3 This is a schematic diagram illustrating the invocation of the target molecule selection function provided in an embodiment of the present invention.

[0026] Figure 4 This is a schematic diagram illustrating the execution result of the single-step retrosynthesis function for the target molecule provided in this embodiment of the invention.

[0027] Figure 5 This is a schematic diagram illustrating the execution result of the target molecule selection function provided in an embodiment of the present invention.

[0028] Figure 6 This is a schematic diagram of the overall process of the molecular multi-step retrosynthetic path planning method based on a large language model provided in the embodiments of the present invention.

[0029] Figure 7 This is one of the schematic diagrams comparing the performance of the molecular multi-step retrosynthesis path planning method based on a large language model provided in this embodiment of the invention with existing retrosynthesis path methods.

[0030] Figure 8 This is the second schematic diagram comparing the performance of the molecular multi-step retrosynthesis path planning method based on a large language model provided in this embodiment of the invention with existing retrosynthesis path methods.

[0031] Figure 9 This is a schematic diagram of the molecular multi-step retrosynthetic path planning device based on a large language model provided in an embodiment of the present invention.

[0032] Figure 10 This is a schematic diagram of the physical structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0034] It should be noted that existing multi-step retrosynthetic methods for molecules still face significant challenges in dealing with large-scale combinatorial search spaces and ensuring path coherence and chemical rationality. On the one hand, each step in the path planning process may generate multiple candidate intermediates, leading to an exponential increase in the overall search space and increasing computational complexity. On the other hand, many methods focus on local optima and lack forward-looking assessments of future steps, easily introducing infeasible paths in the early decision-making stage. Furthermore, existing methods generally have shortcomings in reaction diversity coverage, path practicality, and long-term reasoning capabilities, limiting their widespread application in complex molecular design.

[0035] In view of this, the present invention proposes a molecular multi-step retrosynthetic path planning method based on a large language model, specifically, Figure 1 The diagram shows a flowchart of the molecular multi-step retrosynthetic path planning method based on a large language model provided in an embodiment of the present invention.

[0036] like Figure 1 As shown, the method includes: S110, obtaining the string representation of the target molecule; S120, based on a pre-trained retrosynthesis model, planning the retrosynthesis path of the target molecule according to the string representation of the target molecule; wherein, the retrosynthesis model is obtained by reinforcement learning training based on a large language model, and during training, reward feedback is set according to the feasibility of the synthesis path and the number of planning operations, and the planning operations include single-step retrosynthesis operations and molecule selection operations.

[0037] The following will provide a detailed description of steps S110-S120 and related steps.

[0038] S110, Obtain the string representation of the target molecule.

[0039] It is easy to understand that in molecular multi-step retrosynthetic pathway planning, the first step is to obtain the target molecule in SMILES format, that is, the string representation of the target molecule.

[0040] Among them, SMILES (Simplified Molecular Input Line Entry System) is a standardized text string format for representing the structure of chemical molecules. It encodes the atoms, bonds, and connections between them in a concise and efficient way, enabling computers to understand and process complex molecular information.

[0041] Based on obtaining the string representation of the target molecule in step S110, step S120 is further executed.

[0042] S120, based on a pre-trained retrosynthesis model, the retrosynthesis path of the target molecule is planned according to the string representation of the target molecule; wherein, the retrosynthesis model is obtained by reinforcement learning training based on a large language model, and during training, reward feedback is set according to the feasibility of the synthesis path and the number of times the planning operation is called under the synthesis path, and the planning operation includes single-step retrosynthesis operation and molecule selection operation.

[0043] It is easy to understand that this embodiment pre-trains a retrosynthetic model. When actually planning a multi-step retrosynthetic pathway, one only needs to input the string representation of the target molecule as a prompt word into the pre-trained retrosynthetic model to obtain the final output retrosynthetic pathway. The retrosynthetic pathway includes the target molecule, a series of synthetic reactions and intermediate reactants, as well as starting materials, all represented by SMILES.

[0044] Specifically, in the process of planning a multi-step retrosynthetic pathway for a molecule, the retrosynthetic model calls multiple planning operations. Through these multiple planning operations, the target molecule is gradually traced back to the starting material, thus obtaining the retrosynthetic pathway of the target molecule. Specifically, when calling the planning operation, a single-step retrosynthetic operation is called first, followed by a molecule selection operation.

[0045] Single-step retrosynthesis refers to a single bond-breaking operation performed on a target molecule to derive its direct precursor, yielding several potential precursor molecules. Molecular selection is used to determine which precursor molecule is best suited for designing the actual synthetic route from among several potential precursor molecules.

[0046] The inverse synthesis model is built upon a large language model and trained through reinforcement learning. During reinforcement learning training, molecules from the set of unsynthesized molecules serve as the state input, the invoked planning operations serve as the action output, and the feedback value of the synthesis path serves as the reward feedback.

[0047] The feedback value of a synthesis path is determined based on whether the synthesis path is feasible and the number of times the planning operation is called within the synthesis path. Specifically, the feedback value of a feasible synthesis path is higher than that of an infeasible synthesis path. Furthermore, on a feasible synthesis path, the more times the planning operation is called, the lower the corresponding feedback value will be.

[0048] In this embodiment, by obtaining the string representation of the target molecule and based on a pre-trained retrosynthetic model, the retrosynthetic path of the target molecule is planned according to the string representation. The retrosynthetic model is trained using reinforcement learning based on a large language model. During training, rewards are set based on the feasibility of the synthetic path and the number of times the planned operations are invoked under the synthetic path. The planned operations include single-step retrosynthetic operations and molecule selection operations. This method uses the retrosynthetic model obtained through reinforcement learning to plan multi-step retrosynthetic paths, effectively navigating the complex retrosynthetic space while ensuring chemical rationality, thus improving the efficiency and quality of multi-step retrosynthetic path planning.

[0049] Based on the above embodiments, the following will further describe in detail the process of molecular multi-step retrosynthetic path planning for the retrosynthetic model.

[0050] Based on a pre-trained inverse synthesis model, the inverse synthesis path of the target molecule is planned according to the string representation of the target molecule, including: constructing input prompts based on the string representation of the target molecule; inputting the input prompts into the pre-trained inverse synthesis model to obtain the result of the current planning operation; and determining the inverse synthesis path of the target molecule based on the result of the current planning operation.

[0051] The process is straightforward: first, based on the string representation of the target molecule, a prompt word is constructed for input. Specifically, by determining the planning operations that the retrosynthesis model can perform, the methods for invoking these operations, and the required model output format, and then concatenating the string representation of the target molecule, the planning operations that the retrosynthesis model can perform, the methods for invoking these operations, and the required model output format, the prompt word for input can be obtained. The planning operations that the retrosynthesis model can perform include single-step retrosynthesis operations and molecule selection operations.

[0052] Then, the input prompt is fed into the pre-trained inverse synthesis model to obtain the result of the current planning operation, including: inputting the input prompt into the pre-trained inverse synthesis model, outputting the target molecule single-step inverse synthesis function and the target molecule selection function to be called; obtaining multiple candidate reactions corresponding to the target molecule according to the target molecule single-step inverse synthesis function; and analyzing and selecting the multiple candidate reactions according to the target molecule selection function to obtain the result of the current planning operation.

[0053] Specifically, the retrosynthesis model outputs the single-step retrosynthesis function and target molecule selection function of the target molecule to be invoked based on the input prompt, as well as the thought process, which can be found in [reference needed]. Figure 2 and Figure 3 , Figure 2 This diagram illustrates the invocation of the single-step retrosynthesis function for the target molecule provided in an embodiment of the present invention. Figure 3 A schematic diagram illustrating the invocation of the target molecule selection function provided in an embodiment of the present invention is shown.

[0054] exist Figure 2-3 In this context, Agent represents the inverse synthetic model. <think> ……< / think> Indicates the thought process.<tool_call> ...< / tool_call> Indicates a tool / operation call.

[0055] exist Figure 2 In this context, the thought process implies that "the molecules with the highest synthesis difficulty are 7-1 and 7-2, so the tool 'CALL' should be used to synthesize molecule 7-1, as it is the more challenging one." The tool call includes the name of the single-step retrosynthesis function for the target molecule and the corresponding parameters (such as the name of the synthesized molecule).

[0056] exist Figure 3 In this context, the meaning of the thought process is that "for synthetic reactions 1-1-5 and 1-1-6, either the reactants already exist or they are easy to synthesize, so the tool / operation 'SELECT' should be used to select the best reaction." The tool call includes the name of the target molecule selection function and the corresponding parameters (e.g., the name of the candidate reaction).

[0057] After determining the target molecule single-step retrosynthesis function and the target molecule selection function to be invoked, calling and executing the target molecule single-step retrosynthesis function will yield multiple candidate reactions corresponding to the target molecule, along with a judgment on the availability of each candidate reaction. See details in [link to documentation]. Figure 4 , Figure 4 The diagram shows the execution result of the single-step retrosynthesis function of the target molecule provided in the embodiment of the present invention.

[0058] exist Figure 4 In the synthesis of molecule 9-1, candidate reactions include 9-1-1 and 9-1-2. In candidate reaction 9-1-1, the molecule “CC[C@H](CCC1CCCCC1)N1C[C@]2(CO)C=CC[C@H]2C1=O” is unavailable. In candidate reaction 9-1-2, the molecule “CCCO(=O)(=O)[C@@]12C=CC[C@H]1C(=O)N([C@H](CC)c1ccccc1)C2” is also unavailable.

[0059] Subsequently, the target molecule selection function is called and executed to select the optimal reaction from multiple candidate reactions, and the result of judging whether the reaction molecules in the optimal reaction are available can be found. For details, please refer to [link to relevant documentation]. Figure 5 , Figure 5 The diagram illustrates the execution result of the target molecule selection function provided in an embodiment of the present invention.

[0060] exist Figure 5 In the process, candidate reaction 9-1-1 is selected to synthesize molecule “N#C[C@@]1(CO)C=CC[C@@H]1C(=O)O”. Molecule “N#C[C@@]1(CO)C=CC[C@@H]1C(=O)O” is unavailable. Molecule 8-1 is the precursor molecule of molecule “N#C[C@@]1(CO)C=CC[C@@H]1C(=O)O”. The target molecule can be synthesized from molecule 8-1 through 7 steps of reaction.

[0061] Based on the execution results of the single-step retrosynthesis function and the target molecule selection function, the result of the current planning operation can be obtained. The result of the current planning operation includes the selected candidate reactions and the determination of whether the reactant molecules in those candidate reactions are available. Each selected candidate reaction may introduce zero, one, or more unavailable reactant molecules, causing a change in the initially empty set of molecules to be synthesized.

[0062] After obtaining the result of the current planning operation, the retrosynthetic pathway of the target molecule is determined based on the result. Specifically, if there are unavailable reaction molecules in the current planning operation, these unavailable reaction molecules are placed in an initially empty set of molecules to be synthesized. Each molecule in the set of molecules to be synthesized is then treated as a molecule to be synthesized. Multi-step retrosynthetic pathway planning is performed on each molecule to be synthesized. Through multiple rounds of planning operations, the molecules in the set of molecules to be synthesized are continuously updated until all molecules in the set of molecules to be synthesized are synthesized or available, thus obtaining the retrosynthetic pathway of the target molecule.

[0063] The process of planning a multi-step retrosynthetic pathway for each molecule to be synthesized is the same as the process of planning a multi-step retrosynthetic pathway for the target molecule in the above embodiment, and will not be elaborated here.

[0064] In this embodiment, a prompt word is constructed based on the string representation of the target molecule, and this prompt word is input into a pre-trained retrosynthetic model to obtain the result of the current planning operation. Then, based on the result of the current planning operation, the retrosynthetic path of the target molecule is determined. This method uses a retrosynthetic model obtained through reinforcement learning to plan multi-step retrosynthetic paths for molecules. While ensuring chemical rationality, it effectively navigates the complex retrosynthetic space, improving the efficiency and quality of multi-step retrosynthetic path planning.

[0065] Based on the above embodiments, the training and optimization process of the inverse synthesis model will be described in detail below.

[0066] The retrosynthesis model is trained using reinforcement learning, specifically by using molecules from the unsynthesized molecule set as state input, the called planning operation as action output, and the feedback value of the synthesis path as reward feedback, to iteratively optimize the retrosynthesis model; wherein, if the synthesis path is feasible, the feedback value is determined as the first feedback value; if the synthesis path is not feasible, the feedback value is determined as the second feedback value, and the first feedback value is greater than the second feedback value.

[0067] It's easy to understand that the set of molecules to be synthesized is denoted as the set of unsynthesized molecules, distinguishing it from the set of molecules to be synthesized mentioned above. During reinforcement learning training of the retrosynthetic model, the molecules in the set of unsynthesized molecules are used as state input, the called planning operations (single-step retrosynthetic operation and molecule selection operation) are used as action output, and the feedback value of the synthesized path is used as reward feedback. This allows the retrosynthetic model to learn how to rationally and effectively plan multi-step retrosynthetic paths for the target molecules.

[0068] The feedback value for a synthesis path can be determined based on the feasibility of the synthesis path and the number of times the planned operation is called. Specifically, for a synthesis path that is successfully synthesized (feasible), the feedback value of that synthesis path is set as the first feedback value; for a synthesis path that fails to synthesize (infeasible), the feedback value of that synthesis path is set as the second feedback value. The first and second feedback values ​​can be set according to actual needs, but the first feedback value is higher than the second feedback value.

[0069] Furthermore, in feasible synthesis paths, this embodiment also sets a penalty for the number of times the planning operation is called. Specifically, when a synthesis path is feasible, the number of times the planning operation is called under that synthesis path is first obtained. If the number of planning operations under the synthesis path is greater than a set threshold, then each planning operation call exceeding the set threshold will further reduce the feedback value of the synthesis path. The set threshold can be set according to the actual situation and is not specifically limited here.

[0070] For example, in one specific embodiment, for a composition path that successfully completes the composition (feasible), the feedback value for that composition path is set to 0.9; for a composition path that fails to complete the composition, the feedback value for that composition path is set to -1.0. Furthermore, on a composition path that successfully completes the composition, after the number of planning operations calls exceeds 40, each additional call to the planning operation will reduce the feedback value by 0.02 from 0.9.

[0071] In this embodiment, the retrosynthetic model is iteratively optimized by using molecules from the unsynthesized molecule set as state input, the invoked planning operation as action output, and the feedback value of the synthesis path as reward feedback. Then, based on the pre-trained retrosynthetic model, the retrosynthetic path of the target molecule is planned according to its string representation. This method uses a retrosynthetic model obtained through reinforcement learning to plan multi-step retrosynthetic paths, effectively navigating the complex retrosynthetic space while ensuring chemical rationality, thus improving the efficiency and quality of multi-step retrosynthetic path planning.

[0072] In some embodiments, Figure 6 This diagram illustrates the overall flow of the molecular multi-step retrosynthetic path planning method based on a large language model provided in an embodiment of the present invention. Figure 6 As shown, firstly, Figure 6 (a) shows the overall framework of the molecular multi-step retrosynthesis path planning method based on a large language model (Retro-R1). The Agent is the retrosynthesis model, which takes the prompt word constructed based on the target molecule as input and the planning operation to be called (Action: target molecule single-step retrosynthesis function and target molecule selection function) as output. Then, the target molecule single-step retrosynthesis function and the target molecule selection function (i.e., Figure 6 The tool uses the "Tool Use" function to obtain the result of the current planning operation. It then repeats this process until all molecules in the retrosynthetic path have been synthesized or are available, resulting in the final output retrosynthetic path.

[0073] Figure 6 (b) in the diagram illustrates some action checks before calling the target molecule single-step retrosynthesis function and the target molecule selection function, such as whether the format meets the requirements, whether the planning operation / tool ​​can be called, and whether the parameters of the planning operation are appropriate.

[0074] Figure 6 (c) in the diagram illustrates the process of determining whether the reactant molecules in a candidate reaction are available (whether they are usable) (Molecule Query). Figure 6 (d) in the diagram shows the results of calling and executing the single-step retrosynthesis function and the target molecule selection function (Response Organize, including CALL Response and SELECT Response). CALL Response represents the result of calling and executing the single-step retrosynthesis function and SELECT Response represents the result of calling and executing the target molecule selection function.

[0075] Figure 6(e) illustrates the entire loop process of multi-step retrosynthetic path planning in the retrosynthetic model: For the target molecule, the single-step retrosynthetic model (CALL) is first called to generate a series of reaction candidates. Then, the SELECT function is called to select the best candidate reaction from the series of candidate reactions. It is then determined whether each reaction molecule in the best candidate reaction is available. Unavailable molecules are placed in the initially empty set of molecules to be synthesized. The above steps are then repeated for the molecules in the set of molecules to be synthesized, and the set of molecules to be synthesized is continuously updated until all molecules in the set of molecules to be synthesized are synthesized or all are available.

[0076] In some other embodiments, Figure 7 This illustration shows one of the performance comparison diagrams between the molecular multi-step retrosynthesis path planning method based on a large language model provided in this embodiment of the invention and existing retrosynthesis path methods. It compares the performance of the present invention (RETRO-R1) with various retrosynthesis methods on two datasets (…). The performance on (-190 and ChEMBL-1000) mainly reflects the success rate of different inverse synthesis methods under a given iteration limit and their ability to generate shorter paths.

[0077] according to Figure 7 It can be seen that RETRO-R1 achieves a very high success rate in a single sampling. Specifically, in In the dataset, when the number of iterations is 50, RETRO-R1 achieves a success rate of 55.79%, significantly higher than other inverse synthesis methods. As the number of iterations increases to 500, its success rate reaches 86.95% ± 0.52, maintaining its leading position. Similarly, in the ChEMBL-1000 dataset, RETRO-R1 exhibits the highest success rate across all iteration limits, for example, reaching 83.72% ± 0.17 when N=500. Furthermore, RETRO-R1 also demonstrates an advantage in generating shorter paths. For example, in... In the dataset, RETRO-R1 generated 72.3 ± 1.0 shorter routes, while in the ChEMBL-1000 dataset, RETRO-R1 generated 83.28 ± 0.25 shorter paths.

[0078] Figure 8 This is the second illustration comparing the performance of the molecular multi-step retrosynthesis path planning method based on a large language model provided in this embodiment of the invention with existing retrosynthesis path methods. It demonstrates the performance of the present invention (RETRO-R1) and various retrosynthesis methods on two datasets (…). Performance comparison on ChEMBL-1000 and ChEMBL-190, especially the success rate when the number of iterations is limited to 500.

[0079] according to Figure 8 It is evident that RETRO-R1 demonstrates outstanding generalization ability across different data domains. Specifically, in On the -190 dataset, RETRO-R1 achieved a success rate of 92.10%, while on the ChEMBL-1000 dataset, its success rate was 86.95%. This demonstrates that RETRO-R1 not only performs well on specific datasets but also exhibits strong generalization ability across different datasets. In contrast, other methods such as , -0、 The significant difference in performance between the two datasets indicates that their generalization ability is relatively weak.

[0080] Corresponding to the molecular multi-step retrosynthetic path planning method based on a large language model described in the above embodiments, the present invention also provides a molecular multi-step retrosynthetic path planning device based on a large language model.

[0081] Specifically, Figure 9 A schematic diagram of the molecular multi-step retrosynthetic path planning device based on a large language model provided in an embodiment of the present invention is shown.

[0082] like Figure 9 As shown, the device includes: a target molecule string representation acquisition module 910, used to acquire the string representation of the target molecule; and a target molecule retrosynthesis path planning module 920, used to plan the retrosynthesis path of the target molecule based on a pre-trained retrosynthesis model and according to the string representation of the target molecule; wherein, the retrosynthesis model is obtained by reinforcement learning training based on a large language model, and during training, reward feedback is set according to the feasibility of the synthesis path and the number of times the planning operation is called under the synthesis path, and the planning operation includes a single-step retrosynthesis operation and a molecule selection operation.

[0083] In this embodiment, the target molecule string representation is obtained by the target molecule string representation acquisition module 910. The target molecule retrosynthetic path planning module 920 plans the retrosynthetic path of the target molecule based on the string representation of the target molecule, using a pre-trained retrosynthetic model. The retrosynthetic model is trained using reinforcement learning based on a large language model. During training, rewards are set based on the feasibility of the synthetic path and the number of times the planned operations are called under the synthetic path. The planned operations include single-step retrosynthetic operations and molecule selection operations. This device performs multi-step retrosynthetic path planning using the retrosynthetic model obtained through reinforcement learning, effectively navigating the complex retrosynthetic space while ensuring chemical rationality, thus improving the efficiency and quality of multi-step retrosynthetic path planning.

[0084] It should be noted that the molecular multi-step retrosynthetic path planning device based on a large language model provided in this embodiment of the invention can be referred to in correspondence with the molecular multi-step retrosynthetic path planning method based on a large language model described in the above embodiments, and will not be repeated here.

[0085] Figure 10 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 10 As shown, the electronic device may include a processor 1010, a communications interface 1020, a memory 1030, and a communication bus 1040. The processor 1010, communications interface 1020, and memory 1030 communicate with each other via the communication bus 1040. The processor 1010 can call logical instructions in the memory 1030 to execute a molecular multi-step retrosynthesis path planning method based on a large language model. This method includes: obtaining a string representation of a target molecule; and planning a retrosynthesis path for the target molecule based on a pre-trained retrosynthesis model and the string representation of the target molecule. The retrosynthesis model is trained using reinforcement learning based on a large language model. During training, a reward feedback is set based on the feasibility of the synthesis path and the number of times the planning operation is called under the synthesis path. The planning operation includes a single-step retrosynthesis operation and a molecule selection operation.

[0086] Furthermore, the logical instructions in the aforementioned memory 1030 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0087] On the other hand, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a molecular multi-step retrosynthesis path planning method based on a large language model provided by the above methods. The method includes: obtaining a string representation of a target molecule; planning a retrosynthesis path of the target molecule based on the string representation of the target molecule according to a pre-trained retrosynthesis model; wherein the retrosynthesis model is obtained by reinforcement learning training based on a large language model, and during training, a reward feedback is set according to the feasibility of the synthesis path and the number of times the planning operation is called under the synthesis path. The planning operation includes a molecular single-step retrosynthesis operation and a molecular selection operation.

[0088] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0089] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A molecular multi-step retrosynthetic pathway planning method based on a large language model, characterized in that, include: Obtain the string representation of the target molecule; Based on a pre-trained retrosynthesis model, the retrosynthesis path of the target molecule is planned according to the string representation of the target molecule; The retrosynthesis model is trained using reinforcement learning based on a large language model. During training, reward feedback is set according to the feasibility of the synthesis path and the number of times the planned operation is called under the synthesis path. The planned operation includes molecular single-step retrosynthesis operation and molecular selection operation.

2. The molecular multi-step retrosynthetic path planning method based on a large language model according to claim 1, characterized in that, The pre-trained inverse synthesis model plans the inverse synthesis path of the target molecule based on the string representation of the target molecule, including: Based on the string representation of the target molecule, construct the input prompt word; The input prompt is fed into a pre-trained inverse synthesis model to obtain the result of the current planning operation; Based on the results of the current planning operation, the retrosynthetic route of the target molecule is determined.

3. The molecular multi-step retrosynthetic path planning method based on a large language model according to claim 2, characterized in that, The step of constructing input prompt words based on the string representation of the target molecule includes: Determine the planning operations that the inverse synthesis model can perform, the calling method of the planning operations, and the model output format requirements; The string representation of the target molecule, the planning operations that the inverse synthesis model can perform, the calling method of the planning operations, and the model output format requirements are concatenated to obtain the input prompt word.

4. The molecular multi-step retrosynthetic path planning method based on a large language model according to claim 2, characterized in that, The step of inputting the prompt word to be input into a pre-trained inverse synthesis model to obtain the result of the current planning operation includes: The input prompt is fed into a pre-trained inverse synthesis model, which outputs the single-step inverse synthesis function of the target molecule and the target molecule selection function to be called. Based on the single-step retrosynthetic function of the target molecule, multiple candidate reactions corresponding to the target molecule are obtained; Based on the target molecule selection function, the multiple candidate reactions are analyzed and selected to obtain the result of the current planning operation.

5. The molecular multi-step retrosynthetic pathway planning method based on a large language model according to claim 2, characterized in that, Determining the retrosynthetic pathway of the target molecule based on the result of the current planning operation includes: It has been determined that the current planning operation results in the presence of unobtainable reactive molecules; Unobtainable reactive molecules are placed in an initially empty set of molecules to be synthesized, and each molecule in the set of molecules to be synthesized is taken as a molecule to be synthesized. For each of the molecules to be synthesized, a multi-step retrosynthetic pathway is planned until all molecules in the set of molecules to be synthesized are synthesized, thereby obtaining the retrosynthetic pathway of the target molecule.

6. The molecular multi-step retrosynthetic pathway planning method based on a large language model according to any one of claims 1-5, characterized in that, The inverse synthesis model is trained using reinforcement learning, specifically including: The inverse synthesis model is iteratively optimized by taking molecules from the unsynthesized molecule set as state input, the called planning operation as action output, and the feedback value of the synthesis path as reward feedback. If the synthesis path is feasible, the feedback value is determined as the first feedback value; if the synthesis path is not feasible, the feedback value is determined as the second feedback value, wherein the first feedback value is greater than the second feedback value.

7. The molecular multi-step retrosynthetic path planning method based on a large language model according to claim 6, characterized in that, Also includes: If the synthesis path is feasible, determine the number of planning operations under the synthesis path; If the number of planning operations called under the synthesis path exceeds a set threshold, each planning operation call exceeding the set threshold will further reduce the feedback value of the synthesis path.

8. A molecular multi-step retrosynthetic pathway planning device based on a large language model, characterized in that, include: The target molecule string representation acquisition module is used to acquire the string representation of the target molecule; The target molecule retrosynthesis path planning module is used to plan the retrosynthesis path of the target molecule based on the string representation of the target molecule and a pre-trained retrosynthesis model. The retrosynthesis model is trained using reinforcement learning based on a large language model. During training, reward feedback is set according to the feasibility of the synthesis path and the number of times the planned operation is called under the synthesis path. The planned operation includes molecular single-step retrosynthesis operation and molecular selection operation.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the molecular multi-step retrosynthetic path planning method based on a large language model as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the molecular multi-step retrosynthetic path planning method based on a large language model as described in any one of claims 1 to 7.