Chemical reaction large language model training method and synthetic path planning method
By combining a large language model based on Transformer with Monte Carlo tree search, the efficiency and automation issues in chemical synthesis route planning are solved, enabling intelligent planning of multi-step retrosynthetic routes and accurate prediction of reaction conditions, thereby improving the level of intelligence in chemical research and development.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies are inefficient in chemical synthesis route planning, struggle to handle multi-step synthesis of complex molecules, and lack sufficient support for predicting reaction conditions and process parameters, thus failing to achieve automated planning of multi-step retrosynthetic routes.
We employ a large language model based on the Transformer architecture for mask filling self-supervised pre-training, combined with Monte Carlo Tree Search (MCTS) to learn chemical reaction rules, and support molecular property classification, reaction condition regression, and process parameter completion through multi-task fine-tuning.
It significantly improves the accuracy and generalization ability of reaction prediction, synthetic route planning and molecular property identification, enhances the automation and intelligence level of chemical research and development, reduces the cost of AI model migration and deployment, and has broad prospects for industrial application.
Smart Images

Figure CN120954537B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of chemical information artificial intelligence, and particularly relates to a chemical reaction large language model training method and a synthesis path planning method. BACKGROUND
[0002] With the rapid development of chemical informatics and artificial intelligence technology, using computational methods to assist organic synthesis path design has become a core technology in the fields of new drug research and development, material discovery, etc. Traditional chemical synthesis path planning mainly relies on the professional knowledge of chemists and manual design, which is inefficient and difficult to meet the needs of multi-step synthesis of complex molecules. In recent years, methods based on machine learning have been gradually applied to reverse synthesis analysis and reaction prediction, such as models based on molecular fingerprints (such as ECFP) combined with fully connected neural networks. However, these methods have problems such as insufficient modeling of chemical semantics, limited generalization ability, and inability to effectively capture reaction mechanisms when dealing with complex reaction systems. In addition, existing methods are mostly limited to single-step reaction prediction, making it difficult to realize automatic planning of multi-step synthesis paths, and lacking support for prediction of process parameters such as temperature and yield. Therefore, there is an urgent need for an intelligent technical solution that can efficiently model chemical reaction rules, realize multi-step reverse synthesis path planning, and complete process parameters. SUMMARY
[0003] The purpose of the present application is to overcome the shortcomings of the prior art and provide a chemical reaction large language model training method and a synthesis path planning method. A large language model based on the Transformer architecture is used for mask filling self-supervised pre-training to learn chemical reaction rules. The pre-trained model is combined with Monte Carlo tree search (MCTS) to realize multi-step reverse synthesis path planning of target molecules, and through multi-task fine-tuning, it supports molecular property classification, reaction condition regression, and process parameter completion.
[0004] Technical scheme: The chemical reaction large language model training method disclosed by the present application comprises the following steps:
[0005] S1: Construct a chemical reaction dataset, express the chemical reaction as a triple form of "reactant>reagent>product", and use SMILES (Simplified Molecular Input Line Entry System) or SMARTS (SMilesARbitrary Target Specification) language for structured representation, construct a chemical atomic level vocabulary, and perform word segmentation on the chemical reaction triple according to atomic or atomic mapping levels to generate corresponding token sequences;
[0006] S2: constructing a large language model based on a Transformer architecture, using a mask filling method for self-supervised pre-training, randomly masking any one of the reactants, reagents or products in the chemical reaction triplets, and training the large language model to predict the masked part with the complete chemical reaction sentence as the target;
[0007] S3: fine-tuning the pre-trained large language model for downstream tasks, and using the fine-tuned large language model as the final chemical reaction large language model.
[0008] Further improve the above technical solutions, the chemical reaction dataset is derived from at least one of USPTO-full, USPTO-MIT, USPTO-50K and ORD databases, and is subjected to SMILES legality verification, structure standardization, abnormal data removal and data enhancement strategy.
[0009] Further, the chemical atom-level vocabulary corresponds each token to a unique atomic symbol, a structure identifier, a SMILES special character or an atomic mapping identifier; the reaction sentence is in the form of <cls>as a sequence start token, <end>As a sequence end token.
[0010] Further, the large language model comprises an embedding layer, a multi-head self-attention mechanism, an encoder and a decoder.
[0011] Each token is mapped to an embedding vector containing word vector information and position information by the embedding layer.
[0012] The multi-head self-attention mechanism is used to globally model the interaction between all tokens.
[0013] The encoder is used to output molecular or reaction representations containing global contextual semantics.
[0014] The decoder enables dynamic interaction between the input sequence and the generated sequence.
[0015] Further, the fine-tuning adopts a LoRA parameter fine-tuning strategy, which introduces a low-rank matrix to adapt the weights of the large language model to support reaction condition regression tasks, molecular property classification tasks and molecular property regression tasks, wherein the classification task uses cross-entropy loss and the regression task uses mean absolute error loss.
[0016] The chemical reaction large language model trained based on the above method is combined with a Monte Carlo tree search algorithm to perform a chemical synthesis path planning method, comprising the following steps:
[0017] Receiving a target molecule as an initial input;
[0018] Using the Monte Carlo tree search algorithm, the target molecule is used as the root node to explore the synthesis path in the reverse synthesis reaction space;
[0019] During the execution of the Monte Carlo tree search, the chemical reaction large language model is used to predict the strategy function and the value function of each search node, wherein the strategy function outputs the selection strategy probability of each candidate reverse synthesis reaction, and the value function outputs the value estimate of the molecular synthesis difficulty;
[0020] Based on the output result of the Monte Carlo tree search algorithm, at least one reverse synthesis path from the target molecule to a group of reaction precursors is generated.
[0021] Further, the Monte Carlo tree search includes a selection phase, an expansion phase, an evaluation phase and a backtracking update phase, wherein the selection phase recursively selects child nodes according to the strategy probability and the value estimate, the expansion phase is used to generate precursor molecules and child nodes of the precursor molecules, the evaluation phase uses the strategy probability and the value estimate to evaluate the nodes, and the backtracking update phase updates the access frequency and the average value estimate along the path.
[0022] Further, the synthetic path planning further comprises: generating a diverse precursor combination by using a beam search, top-k sampling and top-p sampling mechanism.
[0023] In the expansion phase of the Monte Carlo tree search, at least one of the beam search, top-k sampling or top-p sampling mechanism is used to generate a diverse candidate precursor molecule combination for the current molecule node.
[0024] Further, the method further comprises the step of information completion for the outputted retrosynthetic path:
[0025] For each step reaction in the path, the regression prediction function of the chemical reaction large language model is called to complete the reaction temperature or product yield;
[0026] For the intermediate molecules in the path, the classification prediction function of the chemical reaction large language model is called to evaluate their pharmacological activity, toxicity or solubility.
[0027] Further, it further comprises a reinforcement learning optimization step, which comprises a cold start phase and a bootstrap iteration phase;
[0028] The cold start phase uses the multi-step synthesis path data automatically generated by the programmed retrosynthetic tool to preliminarily supervise the training of the chemical reaction large language model to realize the learning of the strategy function and the value function;
[0029] The bootstrap iteration phase uses the chemical reaction large language model preliminarily trained to jointly generate new synthetic paths with Monte Carlo tree search for continuous optimization.
[0030] Advantages: Compared with the prior art, the advantages of the present application are that the large language model of the present application can automatically learn and store the deep knowledge of chemical reactions, molecular structures and their properties by self-supervised pre-training methods such as mask filling, and realize unified and efficient fine-tuning and application in various downstream chemical tasks. The model not only significantly improves the accuracy and generalization ability of reaction prediction, synthesis path planning, molecular property discrimination and other tasks, but also has good chemical interpretability, which can automatically capture the chemical rules between elements and reaction mechanisms. The system as a whole can significantly improve the automation and intelligence level of chemical research and development, reduce the AI model migration and deployment cost, and has broad industrial application prospects.
[0031] The application significantly improves the knowledge representation ability, prediction accuracy and practicability of large language models in the chemical field through a unified pre-training-fine-tuning-application integrated process. The system technical effects include: greatly reducing the development and migration cost of various chemical AI models, realizing intelligent assistance for the whole process of complex organic reactions and new material synthesis, and meeting the urgent needs of new drug discovery, material research and other industries for high-throughput and intelligent chemical models.
[0032] In the reaction condition prediction (such as temperature, yield regression) task, the system innovatively takes the chemical reaction condition value as the regression prediction target of the model, the input is the structured SMILES reaction expression, and the output is the required predicted temperature or yield value. For the ORD database with large amount of data, the model effectively learns the optimal condition rules of different types of reactions through fine-tuning, and can give reasonable inferences for new reaction types that have not been seen before. The results of multiple rounds of experiments show that the average absolute error (MAE) of the model's temperature regression is at the leading level among similar models, and it can also be compatible with actual literature data with large noise, proving its strong generalization ability.
[0033] In the molecular property classification (such as toxicity, solubility, biological activity, etc.) task, the system is based on the multi-task fine-tuning mechanism, combined with five public molecular property datasets (BBBP, HIV, BACE, Tox21, ClinTox), and introduces LoRA parameter efficient fine-tuning strategy, which greatly reduces the additional parameters and memory consumption. Under the background of the above multi-task training, the model can automatically determine the physical and chemical or pharmacological properties of the target molecule according to the input SMILES sequence. Comparative experiments show that the fine-tuned model has overall better AUC / ACC indicators on the above public datasets than traditional fingerprint methods and various molecular Transformer models (such as Chemformer, ChemBERTa, MolBERT, etc.), and still maintains stable performance when generalized to small sample and new molecule tasks. This ability provides a strong AI foundation for high-throughput screening and prediction of drug lead compounds.
[0034] For multi-step synthesis planning, the system of the present application is deeply integrated with intelligent path algorithms such as MCTS (Monte Carlo Tree Search), and the model not only outputs the prediction results of single-step reactions, but also provides real-time scoring for path search processes in the form of policy / value functions. The specific method is: each search node is predicted by the model to have possible precursor molecules and corresponding reaction conditions, and the probability distribution and value estimate are calculated for each synthesis selection to assist the tree search algorithm in filtering the optimal synthesis route in the huge reaction space. For each complete synthesis path, the system can also automatically complete the reaction conditions and the physicochemical properties of the target molecule, realizing the integrated intelligent optimization of synthesis conditions and performance. Experimental cases show that the model of the present application can generate shorter or more efficient synthesis paths in complex synthesis tasks of more than 15 steps, and the chemical reactions in the recommended route are highly consistent with known literature / patents, which embodies the significant knowledge transfer and innovation combination ability. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 A complete reverse synthesis program function diagram for the present application;
[0036] Figure 2 Algorithm schematic diagram for large language model coding chemical reaction system;
[0037] Figure 3 Algorithm flowchart for fine-tuning of pre-trained large model for downstream classification regression tasks;
[0038] Figure 4 Algorithm flowchart for pre-trained large model combining Monte Carlo tree search and reinforcement learning to obtain policy and value functions. DETAILED DESCRIPTION
[0039] The technical solutions of the present application will be described in detail below with reference to the accompanying drawings, but the protection scope of the present application is not limited to the described embodiments.
[0040] Example 1: The present application adopts a large language model based on the Transformer architecture, which is pre-trained on a large scale on a chemical reaction data set, so that the large language model can store the action rules of the chemical system, thereby efficiently solving various downstream chemical tasks, and ultimately realizing complete organic synthesis scheme design, such as Figure 1 as shown.
[0041] The Transformer architecture is excellent in sequence learning and molecular representation tasks due to its efficient feature extraction and self-attention mechanism. The mathematical principles of the embedding, attention, encoder, and decoder modules in the Transformer architecture used in the invention and their significance in chemical tasks are described in detail below.
[0042] I. Embedding layer
[0043] In the invention, the SMILES chemical reaction expression is first segmented, and the chemical reaction is decomposed into atomic or atomic mapping level tokens. Each token is mapped to a high-dimensional dense vector by the embedding layer :
[0044]
[0045] wherein, is the index of the i-th token, is the lexical embedding, is the position information of the token in the sequence, is the positional embedding, and finally is obtained (e.g., d = 1024). In chemistry, the word vector captures the ontological semantics of chemical symbols (such as element symbols, functional groups, etc.), and the position vector allows the model to identify the relative relationships between reactants, reagents, products, and molecular structures.
[0046] After pre-training, the token distance in the embedding space has actual chemical significance. For example, the invention experimentally demonstrated that halogen elements (such as Cl / Br) and alkali metals (such as Na / K) have a smaller distance in the embedding space, reflecting their similarity in chemical properties such as electronegativity and delocalization characteristics. This indicates that the model's word vector has automatically learned and encoded basic chemical laws.
[0047] II. Self-Attention mechanism
[0048] The core innovation of the Transformer is the self-attention (Self-Attention) module, which can model the global interactions between all tokens in the sequence. Given the input sequence X, its hidden state matrix is represented as:
[0049]
[0050] Each layer of attention first linearly transforms X into Query (Q), Key (K) and Value (V) matrices:
[0051]
[0052]
[0053]
[0054] where, , , are learnable parameters. Then the correlation between tokens (i.e. attention weights) is computed:
[0055]
[0056] where, represents the attention degree of the i-th token to the j-th token, is a scaling factor, and the final output is:
[0057]
[0058] is the new representation of each token, i.e. the weighted sum of all tokens. Multi-Head Attention computes multiple independent attention heads in parallel , each learning different dimensional structural / semantic information:
[0059]
[0060] where, is the output weight matrix. Chemically, this mechanism allows the model to focus on multiple key regions in the chemical reaction expression simultaneously, such as reaction center, functional group, chain length, branch chain, etc. For example, the present invention analyzes the attention matrix and finds that the model can automatically focus on the reaction center (such as the nucleophilic attack site, leaving group, etc.), which reflects its ability to automatically learn the chemical reaction mechanism.
[0061] III. Encoder module
[0062] The encoder of Transformer is composed of multiple layers of sub-modules, each layer including multi-head self-attention and feed forward network (FFN):
[0063]
[0064] FFN is a two-layer fully connected neural network:
[0065]
[0066] where, , and denote the weight matrices of the first and second linear layers in the feed-forward network, respectively, , and denote the bias vectors of the first and second linear layers in the feed-forward network, respectively.
[0067] A residual connection and layer normalization are applied after each layer. After stacking multiple layers, the encoder finally outputs a molecular or reaction representation containing global contextual semantics.
[0068] The chemical significance is that the encoder can automatically aggregate high-order structural information such as molecular structure, functional group adjacency relationship, and spatial configuration in the SMILES sequence into a compact semantic vector, providing strong representation ability for downstream tasks such as molecular classification and reaction condition prediction.
[0069] IV. Decoder module
[0070] The decoder is similar to the encoder in structure, but has an Encoder-Decoder attention module to realize dynamic interaction between the input sequence and the generated sequence. The core calculation is as follows:
[0071]
[0072] where, denotes the decoder output, denotes the encoder output, denotes the interaction within the generated sequence Y, denotes the interaction between the generated sequence Y and the encoder output.
[0073] The decoder has the ability of "conditional generation". For example, given the reactant and reagent SMILES, the decoder can generate the product SMILES step by step; or fill in the partial reaction information mask to realize reverse reasoning. The output of the decoder depends on the generated token and the overall input context, and can accurately predict the "unknown part" in the chemical reaction.
[0074] In the design of the present application, the bidirectional encoder and autoregressive decoder of the BART architecture are integrated, enabling the model to efficiently understand the input molecular structure (using the encoder) and flexibly generate complex SMILES sequences (using the decoder), greatly improving the applicability and expressiveness of tasks such as chemical reaction prediction and multi-step path planning.
[0075] V. Special significance in chemical tasks
[0076] The embedding space reflects chemical properties: the distance between elements reflects the similarity of their physical / chemical properties, supporting "parameter interpretability".
[0077] Attention focuses on reaction centers and functional groups: high attention weights between key tokens are mapped to reaction mechanisms (such as electrophilic / nucleophilic sites, bond breaking / bond forming positions, etc.).
[0078] The encoder captures high-order structural features: complex structures such as long chains, branches, and aromatic rings can be globally encoded, providing a foundation for property prediction and reaction modeling.
[0079] The decoder realizes conditional generation and reverse reasoning: supports advanced tasks such as automatically inferring reactants given products and automatically completing reactions given partial information.
[0080] The experiments of the present application further show that the above-mentioned modules work together, not only greatly improving the efficient modeling capability of chemical information, but also laying a solid foundation for the chemical meaning interpretation of model parameters and the integrated implementation of downstream AI chemical tasks.
[0081] Example 2: In the implementation process of the present application, how to efficiently and accurately convert chemical reaction data into digital sequences readable by large language models is the key foundation for automatic learning of chemical knowledge by the model. The present application designs a special tokenization mechanism for the complex structure of chemical reactions and the diversity of SMILES expression, and accordingly completes the digitization coding of large-scale chemical reaction data, providing a unified input format and semantic basis for subsequent self-supervised pre-training and downstream multi-task fine-tuning, as shown in Figure 2 .
[0082] I. Tokenizer and digitization process of chemical reaction SMILES expression
[0083] 1. Structured definition of reaction sentence
[0084] The present invention defines each chemical reaction as a "reaction sentence" in the standard form of "reactant > reagent > product" (reactant > reagent > product), all expressed in SMILES strings. Unlike a single SMILES of a molecular monomer, a reaction sentence is split by the ">" symbol, with the "." concatenation of all reactant SMILES on the left, the reaction reagent SMILES in the middle, and the product SMILES on the right. Examples:
[0085] <cls>CC(=O)O c1ccccc1C(=O)O. OCCN(CC)CC > NaOH > CC(=O)O. c1ccccc1C(=O)O <end>
[0086] wherein, <cls>start token for the sequence, <end>To end token.
[0087] 2. Construction of a specialized chemical vocabulary
[0088] To ensure the high correspondence between the model input token (word source) and the chemical structure, the invention designs a vocabulary with "atom / atom mapping" as the basic unit, each token corresponds to a unique atom symbol (such as C, O, N, Cl) or a structure identifier (such as the beginning and end of a ring, the beginning and end of a branch, the beginning and end of a free ion), and special characters of SMILES (">", ".", "=", etc.). All atoms and structure tokens with a frequency greater than a threshold value are included in the vocabulary, and rare or novel tokens are marked with special symbols <unk>Unknown) representation. In addition, related tokens are reserved in the vocabulary for compatibility with SMARTS expressions and subsequent extensions.
[0089] 3. Tokenization and numerical sequence mapping
[0090] For each reaction sentence, the token sequence is first split by matching each word in the vocabulary, and then mapped to a unique numerical index by looking up the table. For example, the SMILES "CC(=O)O" is broken down into [C, C, (, =, O, ), O], each of which is mapped to a unique index in the vocabulary. After the entire reaction sentence is converted into a numerical sequence, the beginning and end of the sequence are supplemented with <cls>and <end>. As shown below:
[0091] SMILES:
[0092] <cls>c1ccccc1C(C)(C)(C).ClCl>[Fe+3].[Cl-].[Cl-].[Cl-]>c1cc(Cl)ccc1C(C)(C)(C) <end>
[0093] Example of a numerical sequence: [1, 108, 19, 108, 108,... 3]
[0094] The tokenizer has the following advantages: (1) atomic-level segmentation ensures that each token has actual chemical semantics, facilitating model learning of chemical laws; (2) numerical sequence input efficiently adapts to GPU and other large model hardware training; (3) compatible with SMARTS and SMILES expression, conducive to unified cross-grammar tasks.
[0095] II. Pre-training method and mask filling process
[0096] 1. Self-supervised mask filling mechanism
[0097] In the pre-training phase, the invention adopts a self-supervised mask filling task: randomly mask any part from the "reactant > reagent > product" triplet, such as masking the product, and taking the remaining two parts as input, guiding the model to restore the masked part through the autoregressive decoding of the BART architecture. Mask filling can be a complete segment or a local mask chemical formula fragment, compatible with complete reaction prediction and complex substructure prediction. This design forces the model not only to learn SMILES grammar rules, but also to deeply mine chemical knowledge such as reaction mechanism, conditions, and functional group transformation between reactants and products.
[0098] 2. Model structure and training process
[0099] The input numerical sequence is first embedded in a high-dimensional space (such as 1024 dimensions), global features are extracted through multiple layers of Transformer Encoder, and the target token sequence is gradually restored through Decoder. The loss function uses cross-entropy (Cross Entropy Loss), the optimizer uses AdamW ( , , weight decay 1e-4, learning rate 1e-5), and the batch size is 256. The training process uses GPU high-performance hardware distributed acceleration, the total parameter quantity of the model is about 400 million, supports the longest 1024 token input, and can cover most organic synthesis reactions.
[0100] 3. Innovation points and chemical advantages
[0101] The mask filling of the application not only supports the modeling of single reaction type, but also is compatible with the unified learning of multiple reaction centers and complex molecular types. Through data enhancement, diversified mask strategy and large-scale training, the model has the ability of "transfer learning", which can quickly fine-tune in the scene of small sample new reaction type or new molecule and keep accurate prediction. This provides a solid technical foundation for high-throughput applications such as material discovery and new drug research.
[0102] III. Sources and characteristics of pre-training data set
[0103] 1. Main data set
[0104] USPTO-full: USPTO (USPTO) published organic chemical reaction database, containing about 1.5 million actual synthesis reactions, covering common substitution, addition, condensation, oxidation-reduction, protection / deprotection and other mainstream reaction types. The original reaction is stored in SMILES format.
[0105] USPTO-MIT: After high-quality screening and format standardization of USPTO-full, the refined subset removes incomplete structures, product and reactant cannot be automatically checked and other abnormal data, suitable for high requirement reaction task modeling.
[0106] USPTO-50K: Standard reaction task test set, containing 50,000 common reactions, widely used in reverse synthesis, reaction prediction and other benchmarks.
[0107] ORD database: used for reaction condition (temperature, yield, etc.) regression, including reaction data with experimental parameters in literature.
[0108] 2. Data processing and cleaning process
[0109] For the public reaction database, first perform automatic SMILES legality verification and structure standardization (such as using RDKit, OpenBabel, etc.), remove abnormal and duplicate reactions; perform atomic mapping and alignment on products and reactants to ensure that the correspondence between reactants and products is clear. Complete or specially mark missing and ambiguous tokens. Through high-quality data filtering, ensure that the training data maximally covers mainstream reaction types and has structural rigor, effectively reducing the noise and bias of pre-training.
[0110] 3. Data enhancement strategy
[0111] To improve the model's generalization ability and robustness, various data augmentation techniques are used, including: reaction direction random switching, functional group label disturbance, molecular fragment shuffle, mask multi-level strategy, etc., so that the model can adapt to complex molecules and diverse reaction environments. In addition, some experiments also use special sampling of molecular chirality, isomers, and rare functional groups to expand the model's ability to capture edge cases.
[0112] 4. Cross-grammar compatibility
[0113] Since the tokenizer and vocabulary of the present application are compatible with the SMARTS extended grammar, the model has seamless migration capability between multiple molecular / reaction description systems such as SMILES and SMARTS, providing an algorithmic foundation for subsequent unified modeling of chemical intelligence tasks such as structure search and reaction screening.
[0114] Four, effects and practical applications
[0115] After pre-training on large-scale chemical reaction data, the model shows high knowledge transfer ability in reaction prediction, molecular property classification, conditional regression, and synthesis path planning. The model automatically internalizes various chemical information such as molecular structure, electronegativity, and reaction mechanism in the parameter space, greatly improving the learning efficiency and prediction accuracy of subsequent downstream tasks.
[0116] In the practical application of the present application, given the SMILES expression of a target product molecule, the model can efficiently predict its potential reaction precursors (i.e. reactants and reagents). Since the pre-training task actually includes predicting reaction precursors, by inputting the SMILES sequence of the target product and using the model's learned chemical reaction rules and molecular structure semantics, the model can automatically search for the most likely precursor combination in high-dimensional space. To improve the diversity and practicality of the prediction, the present application uses three search algorithms: beam search, top-k, and top-p. In the beam search algorithm, not only the most probable prediction result is retained at each step, but also multiple high-probability branches (i.e. beam width) are tracked in parallel, and finally the top-k optimal precursor SMILES combinations are output.
[0117] The beam search mechanism significantly improves the precursor prediction ability of the model: on the one hand, it avoids the dilemma that the greedy solution may fall into local optimization, so that the model can explore more potential solutions in a complex reaction space; on the other hand, by scoring and deduplicating each candidate precursor combination in real time (such as SMILES normalization, structure validity check, etc.), it can effectively eliminate chemical invalid or duplicate solutions and output high-credibility multi-precursor schemes. Experimental results show that the model combined with beam search has reached the advanced level of the industry in terms of top-k precursor prediction accuracy on public datasets such as USPTO-50K, and in actual retrosynthesis applications, it can provide chemists with diverse and feasible synthetic route suggestions, greatly improving the intelligence and practicality of automated synthesis design.
[0118] In addition, in order to further improve the diversity of the model's predicted precursors, the application also introduces two probability sampling mechanisms, top-k and top-p (nucleus), which complement the beam search and form a multi-dimensional generation control system.
[0119] During the generation process, the candidate tokens are first sorted according to the probability distribution, and then:
[0120] top-k sampling: only the top k candidate tokens with the highest probability are retained, which are then renormalized and sampled. This strategy effectively filters low-probability noise, avoiding the generation of chemically unreasonable or semantically broken fragments, while adjusting the k value can flexibly balance between "conservative accuracy" and "open diversity". For example, when k = 5, the model tends to output high-confidence mainstream reaction paths; when k = 50, it may explore more marginal but novel synthesis strategies.
[0121] top-p (nucleus) sampling: dynamically select the smallest token set (nucleus) whose cumulative probability exceeds the threshold p, and then renormalize and sample within the set. Unlike the fixed number of top-k, top-p can adaptively adjust the size of the candidate set - when the probability distribution is sharp (such as high-deterministic reaction sites), only a few high-probability tokens are retained, while when the distribution is flat (such as multiple substitution sites competing), the candidate range is automatically expanded. This allows the model to better handle the inherent uncertainty and multi-path characteristics of chemical reactions while ensuring the reasonableness of the generated results.
[0122] The experimental results show that the single-step selection path can be increased to effectively reduce the reaction steps of the multi-step synthesis after improving the precursor diversity. By organically combining the path global optimization ability of the beam search, the candidate set size control ability of the top-k, and the probability mass self-adaptive ability of the top-p, the application constructs a hierarchical and configurable precursor generation engine. Users can flexibly combine parameters (such as beam_width=5, top_k=20, top_p=0.9) according to actual needs, and freely switch between different application scenarios such as "high-precision single solution" and "multi-path exploration".
[0123] Embodiment 3: After completing large-scale self-supervised pre-training, the chemical large language model proposed in the application can further adapt to specific downstream tasks through fine-tuning (fine-tuning) to realize different types of chemical intelligent prediction functions such as classification and regression. In the fine-tuning stage, task-specific output layers and loss functions are added, combined with labeled data, and the model's learned general chemical knowledge is used for targeted optimization, thereby significantly improving performance on specified tasks.
[0124] The core process of the fine-tuning process is as follows: the model parameters obtained by pre-training are used as initialization weights, and the labeled samples of the downstream task are input, each sample containing a SMILES expressed molecule or reaction structure (which has been converted to a digital sequence by tokenizer) and the corresponding target label. According to the task type, the output layer structure and the loss function selection are different. For classification tasks (such as toxicity discrimination, activity discrimination, etc.), the output layer usually has several neurons, which are activated by the softmax or sigmoid function to output class probabilities, and the cross entropy loss is used to optimize the parameters. For regression tasks (such as temperature, yield, and physicochemical property prediction), the output layer has one or more neurons that directly output real values, and the mean squared error (MSE) or mean absolute error (MAE) is used as the loss function to optimize. The algorithm is as shown in Figure 3
[0125] Specifically, assuming that the input sequence is X, the high-dimensional hidden representation H is obtained after encoding by the Transformer network. For single-label classification tasks, the output layer is defined as:
[0126]
[0127] where W is the full connection weight matrix, is the high-dimensional hidden representation, b is the bias term, is the class probability distribution. The loss function is the cross entropy:
[0128]
[0129] where C is the number of classes, is the one-hot encoding of the true label.
[0130] For regression tasks, the output is:
[0131]
[0132] The loss function is mean squared error (MSE):
[0133]
[0134] where N is the number of samples, is the i-th true value, is the i-th predicted value.
[0135] The fine-tuning tasks actually carried out by the invention include but are not limited to the following types:
[0136] 1. Reaction condition regression (temperature, yield prediction)
[0137] For a given reaction SMILES expression, the model outputs corresponding reaction temperature (in Celsius), product yield (in percentage), etc. continuous values. Use the ORD dataset to label samples, and the regression head outputs real value labels. The optimization goal is to minimize MAE. This task supports multi-target joint regression (such as predicting temperature and yield at the same time), and the output layer corresponds to multiple nodes, each node independently outputs target attributes.
[0138] 2. Molecular property classification (pharmacological activity, toxicity, solubility, etc.)
[0139] For a given molecule SMILES, the model outputs its classification label on the specified dataset (such as Tox21 / ClinTox toxicity positive and negative, BBBP blood-brain barrier permeability, HIV / BACE activity, etc.). Use multi-task learning, multi-head output corresponds to different datasets and labels, and the loss function is multi-label binary cross entropy.
[0140] 3. Molecular property regression (physicochemical parameters, molecular fingerprints, etc.)
[0141] Some tasks require outputting continuous property values of molecules, such as LogP, molecular weight, melting point, etc. The method is the same as the above regression process.
[0142] 4. Multi-step synthesis path parameter prediction (MCTS assisted)
[0143] For the policy (path selection probability) and value (synthetic difficulty level) outputs of each node in Monte Carlo tree search, the model input is the current molecule or reaction state, and the output is the corresponding score, which is used for efficient planning of multi-step synthesis path. This process fine-tunes the chemical large model into a path decision function, realizing deep cooperation with intelligent planning algorithms.
[0144] To further improve the fine-tuning efficiency of the large model, reduce the computing power consumption, and enhance the migration ability, the present application introduces a LoRA (Low-Rank Adaptation) parameter efficient fine-tuning mechanism. The basic idea of LoRA is to introduce a low-rank trainable component to part of the weight matrix while keeping the original model parameters frozen, realizing efficient incremental learning of the model. The mathematical expression is as follows:
[0145] For a certain weight matrix W in Transformer, LoRA modifies it as follows:
[0146]
[0147] where W is the original frozen parameter, , are low-rank matrices, and Only B and A are trainable parameters in the fine-tuning stage, significantly reducing the required training parameter amount and memory consumption.
[0148] Through the LoRA mechanism, the model can quickly adapt to new tasks and data distribution while keeping most of the parameters unchanged, greatly improving the fine-tuning efficiency. In the multi-task fine-tuning experiment, the model using LoRA can achieve almost equivalent or even better performance than full-parameter fine-tuning on Tox21, BBBP, ClinTox, and other molecular property classification tasks with very small memory and computing resources, greatly expanding the model's practicality in high-throughput drug screening, efficient exploration of materials, and other scenarios.
[0149] In addition, the low-rank structure of LoRA also improves the model's migration generalization ability, enabling the model to quickly customize new tasks across domains and datasets without the need for large-scale retraining, greatly speeding up the AI chemical research and development cycle.
[0150] In summary, through the above fine-tuning method, the present application realizes the unified adaptation and efficient deployment of the large model in multiple task scenarios such as chemical reaction prediction, molecular property discrimination, conditional regression, and multi-step path optimization, greatly improving the model's industrial application value and scientific research driving force.
[0151] Embodiment 4: In the disclosed chemical large language model system, chemical synthesis route planning is the core link to realize automated and intelligent molecular design and reverse synthesis analysis. To improve the efficiency and quality of synthesis route exploration, the present application adopts the Monte Carlo Tree Search (MCTS) algorithm and combines it with a pre-trained large model for synthesis path planning method, significantly enhancing the intelligent decision-making ability and global optimality of synthesis path planning.
[0152] I. MCTS algorithm step overview
[0153] MCTS algorithm is a tree structure search algorithm based on random simulation, which is particularly suitable for complex branch and large solution space of chemical synthesis path design problem. MCTS performs four main stages in each round: selection, expansion, evaluation, and backpropagation update. The overall process is as follows:
[0154] 1. Selection phase
[0155] Starting from the root node (the target molecule to be synthesized), according to the policy stored on the node (policy), edge value (Q value), etc., recursively select the highest priority child node until reach the leaf node that has not been fully expanded. The calculation of node priority combines the prior probability given by the neural network and the number of MCTS simulation visits, and the optimal action is usually selected using the following formula :
[0156]
[0157] where, is the average value estimate of the edge, is the exploration term based on the prior probability and temperature parameter.
[0158] 2. Expansion phase
[0159] If the molecule represented by the selected leaf node can be further split, the algorithm will apply all feasible reverse reaction templates to generate several new precursor molecules, each precursor forms a new child node and is connected to the parent node. Here, the chemical large model is used to predict the optimal decomposition template and its probability.
[0160] 3. Evaluation phase
[0161] For newly expanded child nodes, if it is the first time the node is visited, its molecular state is evaluated using a neural network (such as ChemBart), outputting a policy probability and a value estimate, i.e., the synthesis difficulty and decomposition direction of the current molecule. If the node meets the termination condition (such as the molecule being a basic raw material or exceeding the maximum search depth), a termination score is directly assigned.
[0162] 4. Retrospective Update Phase
[0163] The values obtained during the evaluation phase are traced back along the path from the leaf nodes to the root node, progressively updating the visit count and average Q-value of each edge. The statistics for each edge are updated using the following formula:
[0164]
[0165]
[0166] in, Let v be the number of times the edge is visited, and v be the final evaluation score of this simulation.
[0167] Through multiple iterative simulations (typically thousands to tens of thousands of simulations), MCTS continuously enriches the information of the search tree, and finally outputs the final probability distribution (i.e. the optimal selection probability of the molecular decomposition template) based on the visit frequency of each child edge of the root node.
[0168] II. MCTS Probability Output and Strategy Formula
[0169] The formula for calculating the probability distribution Π of each inverse synthesis template output by the MCTS root node is as follows:
[0170]
[0171] in, It is a retrosynthetic reaction Total number of visits yes The sum, This refers to the temperature coefficient. A relatively high one. Values encourage greater diversity, lower A tendency toward greedy strategies.
[0172] In the reinforcement learning loop, the policy explored by MCTS is combined with the original policy of the neural network, and the parameters of the neural network's prediction policy probability and value estimation are continuously updated, forming a data-driven, adaptive optimization closed loop, ultimately achieving high-quality route design and innovation capability for new target molecules.
[0173] III. Using MCTS to plan chemical synthesis routes
[0174] (1) Input the SMILES expression of the target molecule, initialize as the root node of the synthesis tree;
[0175] (2) Calculate the root node strategy probability and value using neural networks;
[0176] (3) Through multiple rounds of MCTS simulation, explore all possible decomposition paths, and select the most probable inverse synthesis reaction to expand the synthesis tree;
[0177] (4) If the leaf node is a basic molecule or cannot be decomposed, terminate the branch;
[0178] (5) Iterate until all branches meet the termination condition or maximum depth, and the synthesis tree is generated;
[0179] (6) According to the synthesis tree structure, output the optimal (or top-k) synthesis route, including the inverse synthesis reaction used at each step, precursor molecules, and progressive relationship.
[0180] Four, reinforcement learning and MCTS collaborative optimization
[0181] In the model training phase, a reinforcement learning closed-loop framework is adopted: the system automatically generates a large number of synthesis trees of target molecules, extracts the decomposition strategy and synthesis state of each node molecule after each round of simulation as training samples, optimizes the neural network model loss function, see the following formula, so that the strategy and MCTS output maximum consistency, and the value evaluation is more in line with the actual synthesis difficulty.
[0182] Loss function:
[0183]
[0184] Where, is the policy function output by the neural network, is the probability output by MCTS, is the value function estimated by the neural network, z(s) is the true state value, , is the weight parameter.
[0185] Through continuous collection of model self-generated data and continuous optimization, the system can improve the generalization ability and innovation route discovery ability for complex synthesis problems.
[0186] The optimization boundary is the probability and value of the MCTS result, which is directly related to the frequency of reaction occurrence and the difficulty of molecular synthesis in reality, and the goal of optimization is to improve the model's understanding of the synthesis difficulty of each path (training target) and accelerate the MCTS molecular planning (training effect).
[0187] Five, system advantages and technical innovation
[0188] The present application closely combines a deep learning chemical reaction large language model with an MCTS algorithm. On the one hand, the chemical knowledge of the large model is used to improve the accuracy of MCTS node evaluation and branch optimization. On the other hand, the large-scale exploration and decision-making advantage of MCTS is used to promote the continuous “self-evolution” of the model, realizing: high adaptability of various sources of chemical reaction data, reducing the data threshold; effectively reducing the dependence on external experimental data, and quickly adapting to new fields through a small amount of new data; discovering new synthetic routes not reported in existing literature and patents, greatly promoting molecular innovation and green synthesis; multiple (diversified) synthesis paths can be output according to requirements, improving the feasibility of practical application and the decision-making space of chemists.
[0189] In summary, the MCTS-driven chemical intelligent synthesis route planning system proposed in the present application has achieved breakthroughs in synthesis efficiency, path quality, knowledge transfer and innovation ability, and has high scientific research and industrial application value.
[0190] In the present application, for the automatic synthesis route planning of complex chemical molecules, the pre-trained large language model (such as ChemBart) is not only used for single-step reaction precursor prediction and multi-task regression, but also innovatively introduced into the Monte Carlo tree search (MCTS) algorithm to fit and output the policy probability distribution (policy function, p) and value function (value function, v) of each node in the search process, and then drive the optimal search of the multi-step reaction tree.
[0191] Embodiment 5: This embodiment describes in detail the implementation mechanism and mathematical expression of the model. The algorithm flow is as shown in Figure 4
[0192] I. Model fitting method of Policy and Value
[0193] 1. Prediction of node value function (Value Function, v)
[0194] In the MCTS search tree, each node represents a molecule to be synthesized, and the node value function v(n) measures the synthesis difficulty, cost or expected distance of the molecule from the current state to the basic raw material (a molecule that can be directly purchased or known to be synthesized). The traditional method usually uses molecular fingerprints (such as ECFP) in combination with fully connected neural networks (MLP) for fitting. However, the present application uses the powerful chemical semantic modeling capability of the pre-trained large model to realize end-to-end structure representation to value output fitting.
[0195] The specific method is as follows: for a search tree node n, its representative molecule SMILES expression is denoted as m. m is input into the pre-trained and fine-tuned large model, and the value prediction of the molecule is directly obtained through the output layer of the model:
[0196]
[0197] where, are fine-tuned parameters.
[0198] 2. Prediction of policy function (p)
[0199] The policy function p(n) is used to score all children of node n (i.e. all alternative inverse synthetic reaction pathways / precursor combinations), outputting a probability distribution guiding the branching preference of MCTS in subsequent simulations.
[0200] The specific method is: for each candidate child node , combine it with the molecular SMILES expression of the current parent node n and the involved reagents to form a complete reaction SMILES expression . Each is input into a large model, outputting the corresponding reaction feasibility score :
[0201]
[0202] After normalization of the scores of all candidate branches, the final policy vector is formed:
[0203]
[0204] This normalization process guarantees the form of a probability distribution, and can be directly used as the selection probability of MCTS.
[0205] In specific implementation, to fuse the confidence of chemical literature with the model-predicted synthesis success probability, the policy vector can be further combined with the literature confidence distribution using weighted fusion or Hadamard product (element-wise multiplication):
[0206]
[0207] where, is the fused policy probability vector, is the probability output by the pre-trained large model for precursors--the feasibility confidence given by literature or historical data, and p is the strategy and value fitted by the large model--the probability of the reaction being able to pass through in multi-step synthesis.
[0208] II. Complete flow of synthesis route planning
[0209] 1. Multi-step MCTS synthesis path search
[0210] The complete synthetic route planning takes the target molecule's SMILES as input and is executed recursively through the following process:
[0211] Initialization: The target product molecule is used as the root node to initialize the search tree;
[0212] Candidate generation: For the current molecular node, beam search (width k, usually k=5~10) is used to generate the top-k possible retrosynthetic pathways (i.e., combinations of precursor molecules and related reagents) from the large model.
[0213] Reaction screening and legality verification: Use tools such as RDKit to standardize candidate SMILES, filter out invalid or duplicate structures, and improve path effectiveness;
[0214] Node expansion: For each valid child node, add it to the tree as a new node. Use the larger model to predict the value and policy of each child node separately.
[0215] Search simulation: Each round of MCTS iteration follows the known policy distribution and UCB formula, starting from the root node and proceeding along the branches until a leaf node is reached (the leaf node can be a basic raw material, a depth limit, or a state where synthesis is infeasible).
[0216] Evaluation and backtracking: Leaf nodes are assigned a final reward based on conditions such as whether the raw material is known, and the Q and N values (visit counts) of each node along the path are updated backtracking.
[0217] Path selection: After multiple rounds of simulation, the frequency of visits to all branches of the root node forms a probability distribution (see MCTS formula), which is used to output the optimal or diversified synthesis route.
[0218] 2. Information integration for diverse response implementation
[0219] To enhance the chemical feasibility and overall practicality of the planning results, the following multi-objective information can be further integrated during the planning process using the aforementioned fine-tuned large models:
[0220] Temperature and yield prediction: For each step of the reaction, the temperature and yield regression head obtained by fine-tuning the same model is used to predict the optimal reaction conditions and expected yield.
[0221] Molecular attribute-assisted scoring: For intermediate molecules, the attribute classification heads of the large model (such as toxicity, activity, physicochemical parameters, etc.) are called to output risk warnings and usability assessments.
[0222] 3. Mathematical Expression and Information Flow
[0223] The overall synthetic tree planning process can be summarized as the following information flow:
[0224] Initial target molecule M0 as root node input;
[0225] For each node n, beam search generates ;
[0226] Both policy function p(n) and value function v(n) are obtained by the large model, see the above formula.
[0227] MCTS path exploration accumulates scores combined with each step policy and value weighting, finally selects the maximum probability path or diversified candidate path.
[0228] III. Experimental performance and advantages
[0229] The system realizes automatic multi-step synthesis planning on mainstream multi-step synthesis route planning benchmark datasets such as Retro*-190, and achieves higher path feasibility and success rate than other large model predictions. Through comparative experiments, ChemBart large model significantly reduces the mean square error of policy and value prediction in MCTS strategy and value fitting tasks, enabling MCTS to effectively distinguish between "feasible" and "infeasible" branches, improving the scientificity, innovation and industrial feasibility of the final output synthesis route, and achieving better performance than traditional ECFP+MLP model fitting strategy and value function. It is a major breakthrough in reinforcement learning algorithms in the field of chemical synthesis route planning.
[0230] In actual chemical synthesis verification, the planned multi-step route shows high innovation and practical implementability in both classic and new target molecule scenarios. For example, ChemBart+MCTS system not only can reproduce the classic bond-breaking strategy in literature patents, but also can explore shorter or more optimal new synthesis paths through parameter tuning.
[0231] IV. Technical innovation points and application value
[0232] End-to-end multi-task collaboration: single model parameters support the whole process from single-step reverse synthesis, reaction condition prediction to multi-step MCTS planning, improving efficiency and integration level.
[0233] Deep embedding of chemical knowledge: the pre-trained model has internalized a large number of chemical rules, reaction principles and structure semantics, making policy and value evaluation more professional and interpretable.
[0234] Support innovative path discovery: through the combination of large model and tree search, it can automatically explore new bond-breaking and synthesis strategies that are difficult to find by traditional manual methods.
[0235] Integrated information output: Each step of the path is automatically completed with temperature, yield, molecular properties and other multi-dimensional information, facilitating the landing of experiments.
[0236] In summary, the present application realizes the automation, intelligence and innovation of the process from the retrosynthetic planning of complex organic molecules to the multi-objective property evaluation through the deep integration of pre-trained large language models and MCTS, greatly expands the technical boundaries of chemical intelligent synthesis design, and has important academic and industrial application prospects.
[0237] In the implementation process of the present application, in order to further improve the decision-making ability and innovation of the large language model in the planning of complex multi-step synthesis path, a data generation and model optimization method based on reinforcement learning is proposed. The method is divided into two main stages: the first stage is cold start (cold start), and the ReSynZ programmed retrosynthetic synthesis tool is used to automatically generate a multi-step synthesis path, which assists the model to realize the rapid learning of the basic strategy and the value function; the second stage is bootstrap iterative training, and the new synthesis route generated by the fine-tuned large model and MCTS is used to continuously enrich the training samples and improve the fitting ability of the model to the actual innovative route.
[0238] First step: cold start data rapid training
[0239] The cold start stage mainly solves the problems of insufficient initial decision-making ability of the large model and unstable synthesis path planning. The specific method is to use ReSynz and other chemical retrosynthetic synthesis engines to automatically generate multi-step synthesis paths (each path is a group of SMILES sequences and its split reaction template) for a large number of target molecules. These automatically generated data structures are clear, complete in synthesis steps, and contain target products, each step precursor, bond type, and can also be supplemented with public database to complete the basic attributes. By inputting these synthesis paths in the form of "state-action-result" triplets into the large model for supervised training, the model can quickly master the basic strategy and typical bond breaking rules of multi-step synthesis, realizing the cold start transition from complete randomness to guided.
[0240] Second step: model bootstrap and continuous reinforcement learning
[0241] After the initial synthesis strategy is formed in the cold start, the bootstrap iterative training phase is entered. At this time, the fine-tuned pre-trained large model is combined with the MCTS system to automatically explore more diverse synthesis paths for real or complex target molecules. For each successful synthesis path, the information of each node molecule, split reaction and its success probability, final reward, etc. in the path is constructed as a reinforcement learning training sample. Specifically, each step in the path (molecule state, split action, MCTS simulation probability distribution, actual synthesis reward) is used as training data for the model policy head and value head. In this way, not only can the global search capability of the model in the complex chemical space be continuously optimized, but also novel bond breaking methods and innovative synthesis strategies that are not covered by traditional literature can be learned.
[0242] Through the combination of cold start and bootstrap reinforcement learning, the large language model of the present application can realize end-to-end training and evolution from basic synthesis strategy to high complexity, diversity and innovation synthesis path, significantly improving the solving ability and actual landing value of complex chemical problems.
[0243] As described above, although the present application has been shown and described with reference to specific preferred embodiments, it is to be understood that such is by way of illustration and not of limitation. Various changes and modifications can be made therein without departing from the spirit and scope of the present application as defined in the appended claims.< / end> < / cls> < / end> < / cls> < / unk> < / end> < / cls> < / end> < / cls> < / end> < / cls>
Claims
1. A method for training a large language model of chemical reactions, characterized in that, Includes the following steps: S1: Construct a chemical reaction dataset, express chemical reactions as triples of "reactant > reagent > product", and use SMILES or SMARTS language for structured representation. Construct a chemical atom-level vocabulary, segment the chemical reaction triples according to the atom or atom mapping level, and generate corresponding token sequences. S2: Construct a large language model based on the Transformer architecture, and perform self-supervised pre-training using mask filling. Randomly mask any one of the reactants, reagents or products in the chemical reaction triplet, and train the large language model to predict the masked part with the reaction sentence as the target. S3: Fine-tune the pre-trained large language model for downstream tasks, and use the fine-tuned large language model as the final chemical reaction large language model.
2. The chemical reaction large language model training method according to claim 1, characterized in that, The chemical reaction dataset is derived from at least one of the USPTO-full, USPTO-MIT, USPTO-50K and ORD databases, and has undergone SMILES validity verification, structural standardization, outlier removal and data augmentation strategies.
3. The chemical reaction large language model training method according to claim 2, characterized in that, The chemical atomic-level vocabulary associates each token with a unique atomic symbol, structural identifier, SMILES special character, or atomic mapping identifier; the reaction sentences are... <cls>As the starting token of the sequence <end> As the end token of the sequence.< / end> < / cls> 4. The chemical reaction large language model training method according to claim 1, characterized in that, The large language model includes an embedding layer, a multi-head self-attention mechanism, an encoder, and a decoder; Each token is mapped to an embedding vector containing word vector information and position information through an embedding layer; The multi-head self-attention mechanism is used to globally model the interactions between all tokens: The encoder is used to output a molecular or reaction characterization that includes global contextual semantics; The decoder enables dynamic interaction between the input sequence and the generated sequence.
5. The method for training a large language model of chemical reactions according to claim 1, characterized in that, The fine-tuning adopts the LoRA parameter fine-tuning strategy, which introduces a low-rank matrix to adapt the weights of the large language model to support response conditional regression, molecular property classification, and molecular property regression tasks. The classification task uses cross-entropy loss, and the regression task uses mean absolute error loss.
6. A chemical synthesis pathway planning method, characterized in that, Includes the following steps: Receive the target molecule as the initial input; The Monte Carlo tree search algorithm is used to explore synthetic pathways in the retrosynthetic reaction space with the target molecule as the root node. During the execution of the Monte Carlo tree search, the chemical reaction big language model obtained by the chemical reaction big language model training method according to any one of claims 1 to 5 predicts the strategy function and value function of each search node, wherein the strategy function outputs the selection strategy probability of each candidate retrosynthetic reaction, and the value function outputs the value estimate of the molecular synthesis difficulty. Based on the output of the Monte Carlo tree search algorithm, at least one retrosynthetic pathway from the target molecule to a set of reaction precursors is generated.
7. The chemical synthesis pathway planning method according to claim 6, characterized in that, The Monte Carlo tree search includes a selection phase, an expansion phase, an evaluation phase, and a backtracking update phase. The selection phase recursively selects child nodes based on policy probabilities and value estimates. The expansion phase is used to generate precursor molecules and their child nodes. The evaluation phase evaluates nodes using policy probabilities and value estimates. The backtracking update phase updates the number of visits and the average value estimate along the path.
8. The chemical synthesis route planning method according to claim 6, characterized in that, In the extended phase of the Monte Carlo tree search, at least one of the following mechanisms—bundle search, top-k sampling, or top-p sampling—is used to generate diverse combinations of candidate precursor molecules for the current molecular node.
9. The chemical synthesis pathway planning method according to claim 6, characterized in that, The method also includes a step of completing the information of the output inverse synthesis path: For each step of the reaction in the path, the regression prediction function of the chemical reaction big language model is invoked to complete the reaction temperature or product yield. For intermediate molecules in the pathway, the classification and prediction function of the large language model of the chemical reaction is invoked to assess their pharmacological activity, toxicity, or solubility.
10. The chemical synthesis pathway planning method according to claim 6, characterized in that, It also includes reinforcement learning optimization steps, which include a cold start phase and a bootstrapping iterative phase; The cold start phase uses multi-step synthesis path data automatically generated by a programmatic retrosynthesis tool to perform preliminary supervised training on the chemical reaction big language model in order to learn the policy function and value function. The bootstrap iterative stage utilizes the novel synthetic pathways automatically generated by the pre-trained chemical reaction large language model and Monte Carlo tree search for continuous optimization.
Citation Information
Patent Citations
Reagent molecule prediction method and device, reactant molecule model training method and device, equipment and medium
CN115206451A
Multi-level organic chemical reaction prediction method based on double encoders
CN119479866A