Molecular optimization method and system based on rule of reason and reinforcement learning

By combining the construction of compound substructure association rule sets with reinforcement learning, the interpretability and efficiency issues of molecular optimization in drug development are solved, achieving good performance and zero-shot optimization capability in single-objective and multi-objective optimization tasks.

CN122369677APending Publication Date: 2026-07-10EAST CHINA UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
EAST CHINA UNIV OF SCI & TECH
Filing Date
2026-04-10
Publication Date
2026-07-10

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention discloses a molecular optimization method and system based on rationale rules and reinforcement learning. Specifically, this invention provides a Rationale-Opt model. This model extracts rationale rules with the potential to influence the target properties of molecules from large-scale chemical data and transforms them into executable operators, guiding a reinforcement learning-based algorithm to perform chemically intuitive structure editing, thereby optimizing the molecule. The model of this invention exhibits good performance in single-objective and multi-objective optimization tasks, as well as zero-shot and few-shot scenarios, and can still achieve good multi-objective optimization in scenarios lacking multi-objective labeled data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of drug design and molecular optimization, and more specifically, to a molecular optimization method and system based on rationale rules and reinforcement learning. Background Technology

[0002] The optimization of materials and molecular design often involves multiple conflicting objectives. Drug development, where candidate molecules must simultaneously satisfy multiple objectives such as bioactivity, target selectivity, and safety, is a typical example. Modern drug development typically divides this into two stages: early lead compound screening and subsequent optimization. The latter requires improving key properties such as absorption, distribution, metabolism, excretion, and toxicity (ADMET) while retaining the core pharmacophore. This process relies on iterative improvements by experts through experiments, which is time-consuming, labor-intensive, and difficult to utilize historical structure-property correlation data, thus urgently requiring the assistance of artificial intelligence. Furthermore, molecular properties originate from interactions between substructures dependent on their local environment; capturing these higher-order correlations is a new direction for efficient molecular design.

[0003] To address these objectives, various solutions have been proposed in recent years, but these methods still have shortcomings. First, deep learning models, represented by Modof and HierG2G, utilize molecular graph representations to improve molecular optimization efficiency. However, they suffer from insufficient interpretability, creating a semantic gap between the model and the structure-activity reasoning used by experts, limiting practical application and credibility. Second, molecular modeling based on ex post-interpretability methods includes various approaches, such as the Substructure Masking Interpretability Method (SME), which assesses contributions through masked local fragments, and Prompt-MolOpt, which further utilizes SME to achieve multi-objective optimization. However, these methods only provide static descriptive explanations and cannot reveal the decision-making basis for structure editing. Third, rule-based and statistical pattern-based methods follow explicit structural modification rules during optimization, such as Matched Molecular Pair Analysis (MMPA) to elucidate the chemical background of structural transformations and Association Rule Mining (ARM) to extract substructure co-occurrence patterns. However, MMPA is limited to local structural neighborhoods, ARM has not become a core component of optimization, and simple rules cannot handle complex needs such as sequential decision-making. Fourth, reinforcement learning (RL) methods, such as GCPN and MolDQN, can efficiently explore chemical space and guide molecular generation, but their generation strategies are not transparent, and their decision-making logic deviates from expert reasoning, making it difficult to balance performance and interpretability.

[0004] Therefore, existing methods can be divided into two complementary but not interchangeable categories: deep learning and RL optimization are efficient, but their decision-making mechanisms are difficult to interpret; rule-based and statistical pattern-based methods are interpretable but lack the flexibility to operate in high-dimensional spaces. The core shortcoming of the above methods is that they fail to balance powerful optimization performance with the traceability and reusability of decisions.

[0005] In summary, there is an urgent need in this field for a molecular optimization method and system that combines interpretable and transferable decision priors with reinforcement learning to enable chemically intuitive modifications based on structural evidence. Summary of the Invention

[0006] The purpose of this invention is to provide a molecular optimization method and system based on rationale rules and reinforcement learning.

[0007] A first aspect of the present invention provides a method for constructing a set of association rules for substructures of compounds, the method comprising the steps of: (1) Provide a general compound dataset and a target property compound dataset; the general compound dataset includes structural data of various compounds; the target property compound dataset includes structural data of various compounds labeled with target properties; (2) Preprocess the general compound dataset to obtain a preprocessed general compound dataset; perform structural decomposition and screening on the structural data in the preprocessed general compound dataset to obtain a substructure library; (3) The target property compound dataset is preprocessed to obtain a preprocessed target property compound dataset; using an association rule mining method, based on the substructure of the substructure library, association rules are mined in the preprocessed target property compound dataset and statistical indicators are calculated; the association rules include rule antecedent substructure combinations and rule consequent substructure combinations; the substructures in the rule substructure combinations come from the substructure library; (4) Based on the statistical indicators of each association rule, the association rules are pre-screened to obtain a preferred set of association rules; (5) For each preferred association rule in the preferred association rule set, the minimum topological distance between the rule antecedent substructure combination and the rule consequent substructure combination is evaluated based on the atomic index set of the rule antecedent substructure combination and the atomic index set of the rule consequent substructure combination. (6) Based on the minimum topological distance, perform a round of filtering on the preferred association rules to obtain a round of filtered association rules; (7) Mask the substructures in the rule substructure combination to obtain the masked rule substructure combination; use a pre-trained consensus model to predict the compound properties of the masked rule substructure combination and the unmasked rule substructure combination, thereby evaluating the attribution values ​​of the rule antecedent substructure combination, the rule consequent substructure combination and the association rule, and then use the attribution values ​​of the rule antecedent substructure combination, the rule consequent substructure combination and the association rule to evaluate the association rule gain index; (8) Based on the association rule gain index, the association rules selected in the first round of screening are screened in a second round to finally obtain the association rule set of compound substructure.

[0008] In another preferred embodiment, the general compound dataset includes the PubChem database and the admetSAR3.0 dataset.

[0009] In another preferred embodiment, the target property compound dataset includes datasets selected from the group consisting of: water-soluble datasets, mutagenic datasets, hERG-related cardiotoxicity datasets, or blood-brain barrier datasets.

[0010] In another preferred embodiment, the structural data includes SMILES data of the compound.

[0011] In another preferred embodiment, the properties of the compound include those selected from the group consisting of: water solubility (ESOL), mutagenicity (Mutag), hERG-related cardiotoxicity (hERG), blood-brain barrier permeability (BBBP), or combinations thereof.

[0012] In another preferred embodiment, step (2) specifically includes the following steps: (2.1) Standardize and remove duplicates from the general compound dataset to obtain a preprocessed general compound dataset; (2.2) The structure data of various compounds in the preprocessed general compound dataset are decomposed to obtain a substructure library.

[0013] In another preferred embodiment, in step (2.2), the structure is disassembled using the BRICS method.

[0014] In another preferred embodiment, step (2) further includes the step: (2.3) Select the most frequent substructures from the substructure library to form the original action pool.

[0015] In another preferred embodiment, "high frequency" means ranking in the top m or top n% of the frequency, where m and n are integers greater than 0; more preferably, m ≥ 500, 600, 700, 800; more preferably, m = 800.

[0016] In another preferred embodiment, in step (3), the preprocessing of the target property compound dataset includes standardization, deduplication, and structural decomposition.

[0017] In another preferred embodiment, in step (3), the statistical index of each substructure combination in each compound is evaluated using the Apriori algorithm.

[0018] In another preferred embodiment, the statistical indicators include support, confidence, and lift.

[0019] In another preferred embodiment, for a combination of rule antecedent substructures in an association rule... Rule-based component structure combination The support is calculated as follows: , Where A is the combination of rule antecedent substructures; B is the combination of rule consequent substructures. N is the number of compounds in the preprocessed compound dataset that have combinations of two regular substructures, A and B; N is the total number of compounds in the preprocessed compound dataset.

[0020] In another preferred embodiment, for a combination of rule antecedent substructures in an association rule... Rule-based component structure combination The confidence level is calculated as follows: , Where A is the combination of rule antecedent substructures; B is the combination of rule consequent substructures. The number of compounds in the preprocessed compound dataset that have combinations of two regular substructures, A and B; The number of compounds in the preprocessed compound dataset that have a regular antecedent substructure combination A.

[0021] In another preferred embodiment, for a combination of rule antecedent substructures in an association rule... Rule-based component structure combination The lift is calculated as follows: , Where A is the combination of rule antecedent substructures; B is the combination of rule consequent substructures. For association rules Confidence level; The support of rule-following substructure combination B.

[0022] In another preferred embodiment, the support of the rule-following substructure combination B is calculated as follows: , in, N is the number of compounds in the preprocessed compound dataset that have a regular post-component substructure combination B; N is the total number of compounds in the preprocessed compound dataset.

[0023] In another preferred embodiment, for a combination of rule antecedent substructures in an association rule... Rule-based component structure combination , and the set of atomic indices of the rule antecedent substructure combination A. The set of atomic indices of the substructure combination B after the rule. The minimum topological distance is calculated as follows: , in, The atomic index set of the rule antecedent substructure combination A is the first... The index number of each atom; The atomic index set of the rule-following substructure combination B is the first... The index number of each atom.

[0024] In another preferred embodiment, step (6) specifically includes: when the minimum topological distance of the preferred association rule is ≤ When that happens, the preferred association rule is added to the association rules of the next round of filtering.

[0025] In another preferred embodiment, the .

[0026] In another preferred embodiment, in step (7), the pre-trained consensus model includes multiple pre-trained relational graph convolutional networks (RGCN).

[0027] In another preferred embodiment, the pre-trained consensus model comprises 10 pre-trained relational graph convolutional networks.

[0028] In another preferred embodiment, the pre-trained graph convolutional network is a graph convolutional network obtained by training with multiple random seeds.

[0029] In another preferred embodiment, the prediction result of the pre-trained consensus model is obtained by averaging multiple pre-trained relational graph convolutional networks.

[0030] In another preferred embodiment, in step (7), the substructure is masked using a chemically intuitive interpretability method (SME), and the difference in model predictions before and after masking is calculated.

[0031] In another preferred embodiment, for a combination of rule antecedent substructures in an association rule... Rule-based component structure combination The combined gain index is calculated as follows: , in, The attribution value for the rule's antecedent substructure combination A; The attribution value for rule-following substructure combination B; This is the attribution value for association rule AB.

[0032] In another preferred embodiment, step (8) specifically includes: sorting the absolute values ​​of the association rule gain index and retaining a predetermined number of association rules as a set of association rules for compound substructures.

[0033] In another preferred embodiment, the predetermined quantity refers to the top-ranked substructure combination.

[0034] In another preferred embodiment, "ranking high" means ranking in the top m or top n%, where m and n are integers greater than 0; more preferably, n ≥ 50%, 60%, or 70%; even more preferably, n = 80%.

[0035] A second aspect of the present invention provides a method for molecular optimization of compounds, the method comprising the steps of: (S1) Provide an original compound, a substructure association rule set containing target property-related structural transformations, and an original action pool; the substructure association rule set containing target property-related structural transformations and the original action pool are obtained using the method described in the first aspect of the present invention; (S2) The original compound is transformed into an embedding vector, including the following steps: locating the target substructure in the original compound according to predefined structural rules, and masking the target substructure to obtain a masked target substructure; using a graph convolutional network to convolve the masked target substructure and its neighborhood context to obtain a convolution result; and weighting and aggregating the convolution result through attention pooling to obtain the embedding vector of the original compound. (S3) Input the embedding vector, the original action pool, and the substructure association rule set containing target property-related structural transformations into the reinforcement learning model; the reinforcement learning model includes a policy layer and a reward layer, wherein: The strategy layer filters and constrains the original action pool based on the substructure association rule set containing structural transformations related to target properties, obtaining a constrained action space; it uses a reinforcement learning algorithm to receive the embedding vector and combines it with the reward signal to make decisions on candidate editing operations in the constrained action space, thereby optimizing the target substructure in the original compound and generating a new compound; it uses a compound property prediction model to evaluate the target properties of the original compound and the new compound, obtaining the evaluation results; The reward layer calculates a reward signal based on the target property evaluation results of the original compound and the new compound; the reward signal is used as environmental feedback input to the policy layer, thereby updating the parameters of the reinforcement learning algorithm and guiding the candidate editing operation to evolve towards the optimization of the target property; (S4) When the target property reaches a predetermined threshold, an optimized compound is obtained.

[0036] In another preferred embodiment, the original action pool is obtained through step (2) of the method described in the first aspect of the present invention.

[0037] In another preferred embodiment, the predefined structural rules include: substructures that are unfavorable to the target properties identified by the relational graph convolutional network, and manually specified substructures.

[0038] In another preferred embodiment, the reinforcement learning algorithm is a near-end policy optimization.

[0039] In another preferred embodiment, the near-end policy optimization is a near-end policy optimization algorithm (MaskablePPO) that supports an action masking mechanism.

[0040] In another preferred embodiment, in the strategy layer, the strategy layer filters and constrains the original action pool based on the substructure association rule set containing target property-related structural transformations, including the following steps: (b1) Preliminary screening based on topological and physicochemical constraints; and (b2) Based on the set of association rules for compound substructures, further filtering is performed to obtain the constrained action space.

[0041] In another preferred embodiment, step (b1) specifically includes: (b1.1) Retain candidate substructures with the number of atoms in the range of 0.8–2.2 times that of the target substructure; and (b1.2) Retain candidate substructures that have the same number of connection sites as the target substructure.

[0042] In another preferred embodiment, step (b2) specifically includes: (b2.1) The candidate substructures obtained in step (b1) after preliminary screening and the substructures that are in context with them are fused together and transformed into local embedding representations; (b2.2) Evaluate the similarity between the local embedding representation and each rationale embedding representation in the substructure association rule set containing the structural transformation related to the target property, and retain candidate substructures whose similarity reaches a predetermined threshold.

[0043] In another preferred embodiment, in step (b2.1), the local embedding representation is calculated as follows: , in, These are candidate substructures that have undergone preliminary screening; Embedding of candidate substructures after preliminary screening; The embedding of a substructure that is in context with the candidate substructure.

[0044] In another preferred embodiment, in step (b2.2), the similarity is cosine similarity.

[0045] In another preferred embodiment, the action space of the constraint obtained in step (b2.2) is: , in, For constrained action space; Candidate substructures after preliminary screening Local embedding representation; Embedding representations for rationale; This is a predetermined threshold.

[0046] In another preferred embodiment, the .

[0047] In another preferred embodiment, the reward signal is calculated as follows: , in, For the set of target properties, For the first The change of each objective property before and after optimization These are independent nonlinear mapping functions defined for different property scales.

[0048] In another preferred embodiment, the property scale includes regressive output and categorical output.

[0049] A third aspect of the present invention provides a system for molecular optimization, the system comprising: (M1) Input module, which is configured to input data, the data including the original compound, a set of substructure association rules containing structural transformations related to the target property, and the original action pool; (M2) Optimization module, configured as a molecular optimization model, which optimizes the original compound toward the target property to obtain an optimization result; the molecular optimization model includes: (m1) A preprocessing unit configured to perform the following operations: locate the target substructure in the original compound according to predefined structural rules, and mask the target substructure to obtain a masked target substructure; perform convolution on the masked target substructure and its neighborhood context using a graph convolutional network to obtain a convolution result; and perform weighted aggregation of the convolution result through attention pooling to obtain the embedding vector of the original compound. (m2) A reinforcement learning unit, comprising a policy subunit and a reward function subunit, wherein: The strategy subunit is configured to perform the following operations: based on the substructure association rule set containing target property-related structural transformations, filter and constrain the original action pool to obtain a constrained action space; use a reinforcement learning algorithm to receive the embedding vector and combine it with a reward signal to make a decision on candidate editing operations in the constrained action space, thereby performing structural optimization on the target substructure in the original compound to generate a new compound; use a compound property prediction model to evaluate the target properties of the original compound and the new compound to obtain evaluation results; The reward function subunit is configured to perform the following operations: calculate a reward signal based on the target property evaluation results of the original compound and the new compound; the reward signal is used as environmental feedback input to the policy layer, thereby updating the parameters of the reinforcement learning algorithm and guiding the candidate editing operation to evolve towards the optimization of the target property; When the target property reaches a predetermined threshold, the optimization result is obtained; (M3) Output module, which is configured to output the optimization results of the optimization module.

[0050] A fourth aspect of the present invention provides an electronic device including a processor and a memory, the memory having a plurality of executable instructions, the processor being configured to read the instructions and execute steps as described in the method of the first aspect of the present invention.

[0051] A fifth aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions that, when read and executed by a processor, implement the steps of the method as described in the first aspect of the present invention.

[0052] A sixth aspect of the present invention provides a computer program product including computer-executable instructions that, when executed by a processor, implement the steps of the method as described in the first aspect of the present invention.

[0053] In a seventh aspect, the present invention provides an optimized compound generated using the method described in the second aspect of the present invention.

[0054] It should be understood that, within the scope of this invention, the above-described technical features of this invention and the technical features specifically described below (such as in the embodiments) can be combined with each other to form new or preferred technical solutions. Due to space limitations, they will not be described in detail here. Attached Figure Description

[0055] Figure 1The diagram shows the overall framework of the Rationale-Opt method. (a) The construction process of the substructure library and rule library; (b) The MaskablePPO decision module based on context awareness and molecular semantic vector space; (c) Identifying the substructure with the lowest attribution contribution using relational graph convolutional network (RGCN).

[0056] Figure 2 This section presents a case study of Rationale-Opt in the DRD2–QED multi-objective optimization task. The model transforms compound I into compound II and presents the rationale rules (co-occurring substructure patterns) behind the optimization decisions. From left to right, the panels sequentially display: the two-dimensional structure of compound I and its molecular docking results; the corresponding principle rules (co-occurring substructure patterns); and the two-dimensional structure of the optimized compound II and its molecular docking results. (a) Case Study 1; (b) Case Study 2; (c) Case Study 3.

[0057] Figure 3 The performance of Rationale-Opt in single-objective and multi-objective optimization experiments is shown.

[0058] Figure 4 The performance of Rationale-Opt in zero-sample and few-sample application scenarios is shown. Detailed Implementation

[0059] Through extensive and in-depth research, the inventors have, for the first time, constructed a method and system for molecular optimization based on rationale rules of molecular structure-activity relationships and reinforcement learning. First, a rationale rule with the potential to influence target molecular properties was constructed by mining from large-scale chemical data. Then, using this rationale rule as the rule layer, a reinforcement learning-based algorithm as the policy layer, and a policy learning process that progressively approaches the Pareto front as the reward layer, the framework of this invention, Rationale-Opt, was constructed. Rationale-Opt demonstrates outstanding performance in the DRD2–QED multi-objective optimization task under similarity constraints, multiple ADMET endpoints, and zero-shot / few-shot scenarios, significantly outperforming existing models. Based on this, this invention was completed.

[0060] It should be understood that the specific methods and experimental conditions of the invention described below in varying degrees of detail are intended to provide a substantive understanding of the invention. Definitions of certain terms used in this specification are provided below. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0061] the term As used herein, the terms “containing” or “including (comprise)” can be open-ended, semi-closed, or closed-ended. In other words, the terms also include “consistently made of” or “made of”.

[0062] As used herein, the term “and / or” refers to and covers any and all possible combinations of one or more of the related listed items.

[0063] As used in this article, the term "significant" means that, in a hypothesis test, the observed effect (such as the difference between the experimental and control groups) is unlikely to be caused solely by random error. A hypothesis test includes: the null hypothesis (H0), which assumes that the observed effect does not exist (such as no difference between the experimental and control groups); the p-value, which is the probability of observing the current or more extreme effect when H0 is true; and the significance threshold (α). The significance threshold is typically used to determine whether a hypothesis test is significant. Generally, the significance threshold is 0.05. If the p-value ≤ α, then H0 is rejected, meaning the observed effect exists, and the result is called "significant."

[0064] As used in this article, the term "reinforcement learning (RL)" is a decision-making strategy in machine learning that enables an agent to learn how to take a series of actions to maximize long-term cumulative rewards through trial-and-error interactions with its environment.

[0065] As used herein, the terms "association rule," "principle rule," "rational rule," "decision rule," "rational basis," "compound substructure association rule set," "rule base," "rationales," "rule base," "Rationalerules," and "Rationale base" are used interchangeably and refer to a set of molecular structure-activity relationship rules constructed in this invention. Specifically, this invention constructs a substructure library by disassembling and screening structures based on a public compound dataset; further, it collects molecules with target properties and performs BRICS molecular fragmentation on these molecules; based on the substructure library, it uses association rule mining (ARM) to identify structural co-occurrence patterns from molecules with target properties, and then screens them according to the properties of structural co-occurrence, thereby obtaining rules with high potential influence on molecular properties for subsequent reinforcement learning. As used herein, the terms "rule antecedent" and "rule antecedent substructure combination" are used interchangeably, and similarly, "rule consequent" and "rule consequent substructure combination" are used interchangeably, both referring to the substructure combination that constitutes the association rule. Examples of the association rules, rule antecedents, and rule consequents of this invention are shown in Table 3.

[0066] As used herein, the terms "multi-attribute" and "multi-objective" are used interchangeably, referring to optimizing a molecule from multiple aspects to achieve improvements in multiple attributes during molecular optimization. Similarly, "single-attribute" and "single-objective" are used interchangeably, meaning that molecular optimization aims to improve a single attribute. Single attributes / objectives can include: water solubility (ESOL), mutagenicity (Mutag), hERG-related cardiotoxicity (hERG), or blood-brain barrier permeability (BBBP). Multi-attribute / objectives can include: hERG & Mutag, ESOL & hERG, ESOL & Mutag, and Mutag & BBBP.

[0067] As used herein, the term "statistical indicator" refers to indicators including support, confidence, and lift. Specifically, support refers to the frequency or coverage of a given association rule in the overall sample; confidence is a conditional probability, that is, the probability that a consequent substructure combination will also occur given that an antecedent substructure combination has already occurred in a given association rule; lift is the ratio of the confidence to the probability of the consequent substructure combination occurring in the overall sample, used to characterize the degree to which the occurrence of an antecedent substructure combination increases the probability of the consequent substructure combination occurring.

[0068] As used herein, the term "original action pool" refers to a set of substructures that can guide substructure replacement, where "action" is defined as a replacement operation on a substructure. The original action pool is obtained by filtering a substructure library, retaining several substructures that appear frequently in the library. In this invention, the original action pool includes 800 substructures.

[0069] As used in this article, the term "neighborhood context" refers to the region consisting of all nuclear chemical bonds encompassed by k layers (k bonds) diffusing outward from the masked substructure. k is typically 1-4.

[0070] The computer system is equipped with at least one processor and a memory. The processor invokes a sequence of computer-executable instructions stored in the memory to implement the evaluation process defined in the claims. Although the flowchart describes the operation steps in a specific logical order, in actual execution, the steps may be processed in parallel, their order adjusted, or partially omitted in some cases. As long as such adjustments do not deviate from the core features of the technical solution described in the claims and achieve the same technical effect, they all fall within the scope of protection of this invention. This flexibility in execution order is determined by the programmable nature of computer instructions.

[0071] Rationale-Opt As used herein, the terms "Rationale-Opt," "the method of this invention," "the system of this invention," and "the framework of this invention" are used interchangeably to refer to the molecular optimization framework constructed in this invention. Rationale-Opt defines a well-defined operation space through interpretable, structured rules, and learns constrained decision-making policies operating within that space. These "rationale rules" originate from large-scale data mining and are incorporated into the reinforcement learning framework as high-level decision priors. Through Pareto-aware reward design, they guide policy optimization, achieving stable approximation of non-dominated solutions in multi-objective scenarios.

[0072] At the implementation level, the Rationale-Opt system systematically combines substructure attribution and association rule mining techniques to distill key structure-property patterns from complex high-dimensional chemical spaces. This framework does not attempt lossless compression of structural information, but rather abstracts implicit nonlinear structure-property relationships into explicit rules. Specifically, it utilizes the substructure-mask explanation (SME) method to perform attribution analysis on substructures and their combinations based on BRICS (Breaking of Retrosynthetically Interesting Chemical Substructures), quantifying the contribution of different structural units to property variations. This attribution-based fragment replacement strategy helps improve solubility, toxicity, and hERG-related safety. To address the issue that strategies based on global average attribution ignore synergistic and site-dependent effects between fragments, association rule mining (ARM) is introduced. This method mines co-occurrence patterns of substructures at the implementation level and uses SME attribution as a screening criterion to construct a context-dependent structural combination rule base. By combining the above methods, the high-dimensional and elusive structure-property response surface can be mapped into a set of interpretable decision operators. This can effectively solve scientific design problems with discrete topological characteristics, strong physicochemical constraints, and complex structure-property relationships (such as topology construction of porous materials and atomic-level control of catalyst active sites), and provide a general theoretical framework for related application scenarios.

[0073] At the policy execution level, Rationale-Opt employs MaskablePPO, which supports action masking, to constrain policy search within a feasible subspace defined by combinations of high-value structures. This allows the agent to retain exploration freedom while avoiding chemically infeasible or low-value regions, and to progressively approach the Pareto optimal front under multi-objective constraints. In this setting, rules serve as adaptive constraints to guide policy optimization, rather than as fixed obstacles to exploration.

[0074] The system of the present invention This invention provides a system for molecular optimization. The system can be embodied as an electronic device, including but not limited to: smartphones, tablets, personal computers, servers, terminals, or other intelligent terminals with data processing capabilities. The system can also be embodied as a computer-readable storage medium, such as a disk, optical disk, solid-state drive, read-only memory, or flash memory, on which a computer program is stored, which, when executed by one or more processors, enables the data processing flow. Furthermore, the system can also be embodied as a computer program product containing computer instructions that, when executed by a computer, cause the computer to perform all or part of the steps of the data processing flow.

[0075] The data processing flow can be loaded, deployed, or run on any of the aforementioned electronic devices. Through the collaboration of hardware resources and the software logic defined in the flow, the system can complete specific data acquisition, transmission, calculation, analysis, storage, or presentation tasks.

[0076] The main advantages of this invention include: (1) This invention constructs a compound rationale rule. By summarizing implicit nonlinear structure-property relationships into an explicit rule set, it possesses endpoint discrimination and structural semantic difference, providing prior information for reinforcement learning policy search.

[0077] (2) This invention is the first to construct a molecular optimization model, Rationale-Opt, that combines rationale rules and reinforcement learning. Rationale-Opt exhibits good performance in drug design and discovery tasks such as single-objective optimization and multi-objective optimization. Furthermore, Rationale-Opt performs better than models without rule guidance.

[0078] (3) Compared with existing molecular optimization methods or models, Rationale-Opt can achieve better optimization results in single-attribute and multi-attribute optimization tasks, and can optimize molecules under zero-sample conditions, achieving optimization without target endpoint labeling data.

[0079] The present invention will be further illustrated below with reference to specific embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. It is also understood that the purpose of describing the present invention in conjunction with the embodiments is to cover other options or modifications that may be derived based on the claims of the present invention. To provide a deep understanding of the invention, many specific details will be included in the following description. The invention may also be practiced without using these details. Furthermore, to avoid confusion or obscuring the focus of the invention, some specific details will be omitted in the description.

[0080] Data collection and preparation To systematically evaluate the generalization ability of Rationale-Opt under different contexts and data sparsity conditions, existing datasets such as ESOL, Mutag, hERG, and BBBP were selected to construct single-objective optimization models. Multi-objective optimization tasks were constructed by merging the training splits of the corresponding single-endpoint datasets, including Mutag&hERG, ESOL&hERG, ESOL&Mutag, and Mutag&BBBP. To maintain consistency with the modeling framework operating at the single-molecule level, all training instances composed of molecule pairs were further split and deduplicated, ultimately forming a unified single-molecule training corpus. The validation set was consistent with Prompt-MolOpt.

[0081] For the DRD2 & QED dataset, the publicly available setup was used. This dataset contains 55,686 molecular pairs. Similarly, molecular pairs were split and deduplicated to construct the training corpus for this study. The test set consists of 800 molecules that performed poorly on both the DRD2 affinity and QED metrics, used to evaluate the improvement capabilities of Rationale-Opt compared to other state-of-the-art multi-attribute optimization methods. This setup emphasizes the difficulty of structural optimization "starting from a disadvantageous point," more closely resembling the real-world scenario of progressively modifying low-quality lead compounds in drug design.

[0082] The molecular properties involved in this study were primarily derived from computational predictions or simulation assessments, rather than relying entirely on experimental measurements. Simulation assessment methods have been widely used in the early stages of drug screening. ADMET-related properties such as ESOL, Mutagenicity, hERG, and BBBP were predicted using a consensus prediction framework integrating multiple graph neural network models or the admetSAR3.0 platform; DRD2 affinity was predicted using a support vector machine classification model; QED (quantitative estimate of drug-likeness) was calculated based on a weighted nonlinear combination model of descriptor desirability functions and implemented using RDKit.

[0083] The use of predictive properties is based on two main considerations. First, in the actual drug discovery process, most candidate molecules lack complete experimental characterization data; therefore, computational prediction is a routine tool in the decision-making process. Second, this study focuses on the structural decision-making process and optimal path selection matrix under property constraints, rather than a limit assessment of the accuracy of a single predictive model. Within this framework, the relative ranking and trend information provided by the predictive model is sufficient to support a systematic analysis of strategy evolution, transferability, and interpretability. Although predictive models inevitably introduce some uncertainty, this characteristic exists in all comparative methods, thus avoiding systematic bias. Compared to relying solely on small-scale experimental datasets, predictive properties significantly expand the explorable chemical space through the nonlinear combination of multiple expectation functions.

[0084] In addition, to enhance the model's ability to explore structures and its cross-task transferability, the PubChem drug-like molecules and admetSAR3.0 datasets were integrated. After standardization and deduplication, a total of 183,423 molecules were obtained. After BRICS molecule fragmentation, a total of 46,424 BRICS fragments were obtained as a substructure library.

[0085] Subsequently, all types of BRICS fragments were sorted by frequency from high to low, and the top 800 fragments were used as the original action pool. This design frees the model's policy search from the local structural neighborhood covered by a single task dataset, explicitly guiding it to explore a broader structural space supported by large-scale statistical evidence, thus systematically supporting the discovery of novel structural combinations. The resulting general fragment library provides a shared and stable structural foundation for subsequent policy learning and cross-task transfer.

[0086] Example 1: Constructing a Rationale Base 1. Mining co-occurrence patterns of substructures through association rules: To explicitly characterize the cooperative relationships and dependent structures among different substructures within a molecule, Association Rule Mining (ARM) is introduced to model the co-occurrence patterns of molecular substructures. ARM directly characterizes statistically stable co-occurring structural combinations at the substructure level, thus providing interpretable and operable intermediate representations for subsequent policy learning.

[0087] This study employs the classic Apriori algorithm to perform frequent itemset search and rule generation on substructure combinations obtained from BRICS fragmentation of molecules with target properties, thereby identifying stable structural co-occurrence relationships across different molecular instances. In its implementation, a single molecule is considered a transaction, and its substructures are considered items; the joint occurrence of multiple substructures constitutes an itemset. Within this framework, Apriori can systematically identify frequently occurring substructure combinations in a set of molecules and generate formal association rules A⇒B to characterize the co-occurrence relationships and potential dependency patterns of substructures at the molecular level. This modeling approach does not rely on the linear additivity assumption of substructure effects but instead captures high-order combinatorial relationships between multiple fragments in a data-driven manner, thus providing structural-level prior information for molecular optimization decisions.

[0088] The Apriori algorithm holds the following property: if an itemset is frequent, then all its subsets are also frequent; conversely, if an itemset is infrequent, then all its supersets can be safely pruned. This property allows it to efficiently compress the search range in the combinatorial space and systematically explore high-potential combinatorial relationships. Apriori outputs explicit enumerations and rule-level data, enabling each relationship to be viewed, understood, and manually verified, thus achieving interpretability. Apriori uses statistical metrics such as support, confidence, and lift to perform multi-level screening of candidate rules, quantitatively evaluating the statistical significance and stability of the rules. The calculation formula is as follows: , , , Among them, A and B are combinations of substructures. For association rules, For molecular samples with two combinations of substructures, A and B, The number of molecular samples with both A and B substructure combinations. The number of compounds having an A substructure combination. Let B be the support of the consequent substructure combination B, and N be the total number of molecular samples in the dataset. The statistical support of the consequent substructure combination B aims to reflect the marginal probability of B's ​​occurrence in the overall sample space, and is used to measure the baseline occurrence level of B in the rule.

[0089] 2. Rationale screening: Not all statistically frequent substructure co-occurrence patterns have practical optimization value. Therefore, it is necessary to screen the rules step by step from three levels: statistical reliability, chemical interpretability, and property relevance, to ensure that the final retained rationales are stable, reasonable, and highly relevant to the target task.

[0090] First, at the statistical level, the rules generated by Apriori are initially screened based on support, confidence, and lift, eliminating rules that are unstable in terms of data distribution or lack significant relevance. The purpose of this step is to ensure that the rules have basic statistical reliability within the overall ensemble, avoiding noise interference introduced by extremely low-frequency or near-independent co-occurrences.

[0091] Secondly, chemical rationality constraints are further introduced to exclude structural combinations that lack physical meaning. Let the set of atomic indices for the preceding substructure combinations in the molecule be... The set of atomic indices for the subsequent substructure combination is ,in and They represent the first and second substructures in the combination of the antecedent and consequent, respectively. The and the first The index number of each atom. The minimum topological distance between two substructures is defined as: , If and only if the formula is satisfied When the substructure combination is considered to satisfy the proximity constraint, the threshold is... The value is set to 3. This setting is based on the empirical consensus of small molecule structural biology and structure-activity relationship research: in organic small molecule systems, if the shortest topological distance between two structural units does not exceed three chemical bonds, it usually means that they are in the same local interaction environment and are more likely to have synergistic effects through inductive effects, conjugation effects, or steric repulsion; when the distance exceeds three bonds, the probability of direct interaction decreases significantly, and its coupling effect is often shielded by the intermediate structural unit. Therefore, τ = 3 can effectively exclude long-range accidental co-occurrences that lack physical meaning while taking into account coverage and chemical rationality.

[0092] Subsequently, model attribution analysis was introduced to assess the direct correlation between rules and target molecular properties. Specifically, Model-Simplified Attribution (SME) was employed to quantify the marginal contribution of structural units to model predictions at the molecular instance scale. SME utilizes multiple Relational Graph Convolutional Networks (RGCNs), consensus models trained with multiple random seeds, to perform substructure-level attribution analysis. Specifically, SME quantifies the marginal contribution of structural units to model predictions by masking the sets of atoms corresponding to substructures and comparing the changes in predictions before and after masking. In terms of prediction generation, each RGCN model takes a molecular graph as input, aggregates atomic and bond type information through a multi-layer relational message passing mechanism, obtains the overall molecular representation through a graph-level readout function, and finally outputs the predicted value of the target property by the property prediction head. The prediction results of the consensus model are obtained by averaging the outputs of 10 randomly initialized RGCN models, thereby reducing the uncertainty caused by single model parameter initialization and training fluctuations and improving prediction stability.

[0093] This invention simultaneously calculates two types of attribution within a specific molecular context: (i) the attribution value of a single substructure combination, and (ii) the overall attribution value of the association rule. The attribution value is the change (difference) in the model's predicted value after masking the substructure, used to measure the marginal contribution of that structural unit to the predicted property in the current molecular context. To characterize the deviation of the combination effect from the linear superposition assumption, a combination gain index is defined: , in, This indicates the attribution of the combination of the two substructures A and B. and These represent the attribution for combinations of individual substructures. This metric measures the nonlinear interaction effects learned by the model when considering fragment coexistence: positive values ​​indicate synergistic effects, while negative values ​​indicate antagonistic or redundant effects. It should be noted that the sign of gain only reflects the direction of influence on the predicted value; its specific "advantage" needs to be interpreted in conjunction with the task semantics (e.g., an increase in the predicted value in a toxicity task does not necessarily indicate optimization).

[0094] At the instance scale, the gain of the same rule may vary significantly across different molecules, reflecting its sensitivity to the local structural environment. To avoid conflating different contextual effects into the same statistic, instances are first divided into boosting and debuffing classes based on the sign of the gain. Then, at the rule level, instances of both classes are aggregated separately, and their average gain is calculated. This yields the overall synergistic performance of the rule at the dataset level.

[0095] Finally, using |gain| as a measure of rule importance, the rules were ranked, and the top 80% of the rules were retained as the final rule base for that endpoint. This yielded a set of rationale rules that are statistically significant, chemically plausible, and closely related to property changes. This strategy suppresses near-linear or inefficient rule noise while retaining high-value rules with the potential to significantly influence property changes, providing structural-level prior constraints for subsequent reinforcement learning-based molecular optimization processes.

[0096] Example 2: Rationale-Opt build process To transform the rationale rules obtained in the aforementioned embodiments into an executable, controllable, and traceable optimization decision sequence for specific molecular instances, the Rationale-Opt framework is proposed. This framework treats the rationale rules obtained from data mining as high-level, interpretable decision priors, and learns a contextualized policy through reinforcement learning. Under specific molecular structural contexts and multi-objective constraints, it autonomously decides how to select, combine, and execute the structural transformations corresponding to these rules.

[0097] Specifically, Rationale-Opt comprises four tightly coupled core modules: rational rules, instance, contextual policy, and reward, forming a closed-loop system from knowledge extraction to policy learning. Figure 1 ).

[0098] (1) Rule layer ( Figure 1 a): Construct a rationale rule library based on the aforementioned BRICS fragmentation, Apriori mining, and statistical and chemical constraint screening to provide structured prior knowledge for subsequent decision-making.

[0099] In the action generation phase, Rationale-Opt treats the action space as a designed decision structure and systematically filters feasible structure editing schemes by introducing a dual filtering mechanism based on physicochemical constraints and chemical semantics. Its core objective is not simply to reduce the number of actions, but to restrict the search to chemically reasonable and mechanistically interpretable transformation subspaces while maintaining the diversity of exploration.

[0100] Specifically, a two-stage action screening strategy is employed to construct the candidate action space. The first stage performs preliminary filtering of the initial substructure library based on topological and physicochemical constraints. Firstly, to maintain molecular-scale stability and avoid generating extreme structures that are too large or too small, only candidate fragments with an atomic number 0.8–2.2 times that of the original substructure to be replaced are retained. Secondly, candidate fragments must possess the same number of reactive sites as the original structure to ensure topological consistency of chemical bonds. Furthermore, to ensure that each editing step produces substantial structural evolution, duplicate fragments are removed. These constraints significantly reduce the search space and decrease the complexity of action combinations without requiring additional training. After the two-stage filtering of the initial substructure library, the current state is obtained. The action space.

[0101] The second stage introduces a chemically-aware semantic filtering mechanism, embedding domain knowledge into the decision-making process. A rationale rule library was built for this purpose. Each of the principles With embedding vector This indicates that it is used to characterize common and proven beneficial molecular modification patterns. For each candidate fragment after initial screening... Embed it Contextual embedding with the current reaction site By fusing the results, we obtain the local microenvironment representation after hypothesis transformation: , Then calculate Embedded with various principles Cosine similarity, only retaining those with a maximum similarity value not lower than a threshold. The candidate actions, i.e. the final action space, are constrained by the similarity measure space: , in, The default value is 0.2. The key to this mechanism lies in providing a directional bias to the exploration process: the agent does not randomly explore in a completely unstructured action space, but rather searches for policies within a semantic space shaped by chemical experience and structural principles. Thus, the action space is no longer a simple set of candidates, but a knowledge-shaped decision manifold. On this manifold, policy search is preferentially carried out along chemically rational directions, and invalid or infeasible transformations are systematically suppressed, thereby significantly reducing the exploration dimensionality and improving optimization stability.

[0102] (2) Instance layer ( Figure 1c): For the molecular samples to be optimized, a property prediction model based on graph convolutional network (RGCN) combined with the SME attribution mechanism is used to identify the substructures that have the most adverse impact on the target properties. These substructures are considered as priority starting points for modification. Users can also explicitly specify the structural units to be edited or retained, achieving constrained human-machine collaborative optimization.

[0103] Specifically, the model first identifies key substructures that negatively impact the target properties through a substructure contribution evaluation module, or specifies the region to be edited based on a user-defined molecular mask. Then, the substructure and its topological neighborhood are extracted as the local structural context. A relational graph convolutional network is used to encode features of the substructure to be replaced and its context, and attention pooling is used to weight and aggregate the node representations to obtain a graph-level embedding representation. Attention pooling assigns learnable weights to each node, achieving adaptive emphasis on key structural units. Subsequently, a fully connected layer performs nonlinear transformation and fusion of the embedded features to form a state vector at time step t. The state vector is a fixed-dimensional continuous real-valued vector used to represent the current editable local structure and its environmental context, and serves as the input to the downstream reinforcement learning policy network.

[0104] (3) Strategy learning layer ( Figure 1 b): Includes learning modules and reward modules.

[0105] Learning Module: Building upon the above information, a policy network based on Maskable Proximal Policy Optimization (MaskablePPO) is introduced to perform policy search within a rule-constrained semantic embedding space. MaskablePPO allows the environment to dynamically pass action validity masks at each time step, thereby limiting the policy search space to a chemically reasonable and rule-permitted subset. This design not only significantly improves sampling efficiency but also fundamentally avoids meaningless or unexecutable transformation paths, enabling policy learning to focus on high-value decision regions.

[0106] Specifically, a reinforcement learning algorithm based on Proximal Policy Optimization (PPO) is adopted, and the MaskablePPO implementation is provided in SB3-Contrib, an extended version of the PyTorch-based reinforcement learning library Stable-Baselines3 (SB3). PPO suppresses drastic policy updates through a pruned alternative objective function and exhibits good stability in high-dimensional discrete action spaces.

[0107] Reward Module: In terms of reward design, Rationale-Opt explicitly models multi-attribute optimization as a policy learning process that gradually approaches the Pareto front, and clearly distinguishes between feasibility constraints and performance improvement goals in the reward space.

[0108] Specifically, "degradation of any key property" is defined as an unacceptable state: once a candidate molecule deteriorates compared to the original molecule in any target property, the model immediately receives a significant negative reward, thus actively excluding all non-Pareto feasible solutions at the strategy level. Only when all properties do not degrade does the model enter a further reward evaluation stage; when all target properties simultaneously meet their respective success conditions, the model receives an additional synergistic reward. All reward signals are calculated based on the difference between the property prediction results of the original molecule and the generated molecule by the admetSAR3.0 model embedded in the reward layer. The success condition refers to an initial property being in an unfavorable range, but ultimately exceeding a predetermined threshold for the corresponding property. For hERG, BBBP, Mutag, and ESOL, the predetermined thresholds are shown in Table 1. For each newly generated molecule, its SMILES structure is immediately input into admetSAR 3.0 for property prediction; the input is SMILES, and the output is the property prediction value.

[0109] Table 1. Thresholds for Defining Successful Optimization Within the feasible solution space, a product-type collaborative reward function is used to model the joint improvement of multiple attributes: , in, Represents the set of properties to be optimized. For the first The change of each property before and after optimization This is an independent nonlinear mapping function defined for different property scales (such as regressive and categorical outputs). This product structure means that zero improvement in any property weakens the overall reward, while simultaneous improvement in multiple properties produces superlinear synergistic gains. Thus, the model is naturally guided to continuously optimize within the nondominated solution space, gradually approaching the Pareto front, rather than making implicit and uncontrollable numerical trade-offs between different properties.

[0110] For each molecule instance to be optimized, the substructure that contributes most unfavorably to the target properties is identified using RGCN and SME as the starting point for optimization; it also allows users to explicitly specify the structural units that need to be modified or retained, thus supporting highly flexible human-machine collaborative optimization. Figure 1 c). This design ensures that the optimization process can be both automated and embedded with expert constraints.

[0111] Example 3: Performance of DRD2 and QED optimization To systematically evaluate the decision-making ability of Rationale-Opt in strongly constrained multi-attribute optimization scenarios, it was compared with four mainstream models—JTNN, HierG2G, Modof, and Prompt-MolOpt—on a dual-attribute optimization task involving dopamine D2 receptor (DRD2) and drug similarity (QED). This task requires the model to improve target affinity and drug-likeness score while maintaining the similarity of the molecular backbone and overall structure, thus constituting a typical structurally constrained, multi-objective collaborative optimization problem.

[0112] The experimental setup followed standard protocols in existing work: given an initial set of molecules (with low DRD2 predictions and QED), the model was required to generate new molecules with similar structures but significantly improved properties, satisfying DRD2 ≥ 0.5 and QED ≥ 0.6. Molecular similarity was measured using Morgan fingerprints (radius 2, 2048 dimensions) and Tanimoto coefficients, and success rates (Rate%) were calculated at different similarity thresholds (δ = 0.4, 0.5, 0.6). Consistent with Prompt-MolOpt, a success was counted if the model generated molecules that met the similarity constraints and achieved the required properties in 20 independent optimization attempts. The DRD2 binding score was evaluated using a publicly available Support Vector Machine (SVM) classifier, which provides an estimate of the probability of ligand binding to the dopamine D2 receptor; the QED score assessed drug diversity by integrating eight commonly used molecular descriptors (including molecular weight, lipophilicity, number of aromatic rings, and polar surface area), thereby quantifying the similarity between the molecule and approved drugs.

[0113] As shown in Table 1, Rationale-Opt significantly outperforms the comparative methods under all similarity constraints. When δ=0.4, its success rate reaches 35.63%, approximately 6.6 percentage points higher than the current best-performing Prompt-MolOpt. Even under stricter structural constraints (δ=0.6), Rationale-Opt maintains a significant advantage. This result demonstrates that this method does not rely on substantial structural rewriting to achieve property improvements, but rather achieves stable multi-attribute synergistic improvement within a constrained structural space, showcasing an effective modeling capability for structure-property coupling.

[0114] Notably, even with a zero-shot setting, Rationale-Opt still achieved a success rate of 34.12%, significantly higher than Prompt-MolOpt's 19.38%. This phenomenon indicates that the model can still effectively optimize based on its internally learned decision structure even without task-specific supervision. This further illustrates that Rationale-Opt captures not just surface-level operational patterns for a single endpoint, but rather reusable structure-property decision logic across tasks. This allows the model to reuse the same set of structural reasoning patterns across different tasks and molecular contexts, without relying on task-specific heuristic adjustments.

[0115] Table 1. Overall Comparison of Multi-Attribute Optimization between DRD2 and QED Note: Rate%, refers to the proportion of molecules successfully optimized in the test set. Successful optimization is defined as: at least 20 optimized molecules satisfy the similarity constraint σ, and their property scores fall within the target interval (DRD2≥0.5 and QED≥0.6); when σ=0.4 / 0.5 / 0.6, the optimized molecules must maintain a similarity of 0.4 / 0.5 / 0.6 with the original molecules, respectively.

[0116] Overall, compared to existing methods, Rationale-Opt's consistent performance improvement is not only reflected in numerical metrics, but also directly reflects its effectiveness in "decision-level" modeling: the reinforcement learning strategy can stably call high-value rationales structures for optimization search under the guidance of molecular context awareness, thus verifying the methodological rationality and practical effectiveness of this context-aware decision framework in strongly constrained multi-objective scenarios.

[0117] Example 4: Successful Reproduction of the Optimized Case To evaluate the effectiveness and interpretability of Rationale-Opt in real-world drug design scenarios, several representative optimization examples were selected in the DRD2–QED multi-objective optimization task. The structural editing performed by the model, the triggered rationales, and the corresponding changes in receptor binding modes were systematically analyzed. Affinity experimental data for DRD2 were obtained from existing data, and QED was calculated using RDKit (version 2022). Molecular docking was performed using the Glide module of Schrödinger (version 2022.4). The DRD2 protein structure was derived from publicly available crystal structures.

[0118] (1) Case 1: like Figure 2 As shown, the model optimizes compound I into compound II by replacing the unsubstituted benzene ring with a methoxy-substituted aromatic ring ( Figure 2a) While maintaining the skeletal structure, simultaneous improvements in affinity and drug-likeness were achieved. Specifically, QED increased from 0.828 to 0.857, and DRD2 affinity increased from 639 nmol / L to Ki = 28 nmol / L. This structural modification can be traced back to the significantly enriched "1,4-diazacyclohexane-oxygenated aromatic ring" co-occurrence combination in the rationale base. Figure 2 a) This combination showed a stable correlation with better DRD2 activity and QED performance in historical data and was encoded as an executable rule to constrain the direction of structure editing.

[0119] From the perspective of reported structure-activity relationships, Trp386 and Phe390 are key aromatic residues in the deep hydrophobic pocket of DRD2, making significant contributions to the stable binding of high-affinity ligands. Previous studies have shown that the electronic properties of the aromatic ring and the polarity distribution of substituents affect their orientation and stacking in this region. In this case, the introduction of the methoxy group modifies the conformation of the ligand in the pocket. Figure 2 a) This brings the protonated tertiary amine closer to the conserved residue Asp114 on TM3, forming a stable hydrogen bond / salt bridge interaction. This interaction is widely considered to be one of the structural features of DRD2 high-affinity ligands.

[0120] These results demonstrate that Rationale-Opt does not blindly explore chemical space, but rather guides local modifications through traceable structural rules, causing molecular conformations to converge toward known favorable receptor interaction modes, while simultaneously achieving synergistic property enhancement.

[0121] (2) Case 2: like Figure 3 As shown, the model also chooses to replace the original aromatic ring with c1ccccc1OC ( Figure 2 (b) However, this modification did not cause changes at the skeletal level, but rather affected the spatial orientation of the aromatic ring in the acceptor pocket through subtle adjustments to the substitution pattern. Experimental data showed that the affinity increased from 577 nmol / L to Ki = 28 nmol / L, while the QED did not decrease significantly. Docking results ( Figure 2 b) shows that the optimized ligand exhibits a more tilted aromatic ring orientation in the pocket, thereby enhancing its π–π and cation–π interactions with aromatic residues such as Trp386 and Phe390. Simultaneously, this conformational change favors the arrangement of protonated tertiary amines toward Asp114, forming a more stable polar interaction network.

[0122] (3) Case 3: Case 3 further validates the robustness of the model under different structural backgrounds. For example... Figure 2As shown in c, the model replaces the original chlorinated fused aromatic heterocyclic fragment (c1ccnc2cc(Cl)ccc12) with a dichloro-substituted benzene ring (c1cccc(Cl)c1Cl), achieving a QED increase from 0.422 to 0.558, accompanied by an increase in affinity from 1883 nmol / L to Ki=12 nmol / L. This modification can be traced back to the rules in the rationale base that characterize the co-occurrence relationship of "hydrophobic aromatic skeleton – central tertiary amine" (…). Figure 2 c), the core of which lies in better matching the key tertiary amine-receptor interaction by adjusting the electronic and polar characteristics of the aromatic fragment. Previous SAR studies have shown that chlorinated substituents can modulate the electron cloud distribution of the aromatic ring and enhance the hydrophobic anchoring effect at a relatively small volume cost, thereby improving ligand efficiency. Docking results ( Figure 2 c) shows that the ligands after structural substitution exhibit a significantly different orientation in the pocket compared to the original compound, which strengthens the salt bridge and hydrogen bond interactions between the tertiary amine and Asp1143.32. At the same time, the dichlorobenzene ring maintains stable contact with the hydrophobic region, forming a more coordinated overall binding conformation.

[0123] The above cases demonstrate that Rationale-Opt does not randomly explore and assemble chemical fragments, but rather gradually develops a stable selection bias towards specific structure-interaction combinations under the constraint of interpretable rule priors. Although the model is not explicitly injected with receptor interaction information, its decision results are statistically highly consistent with classical structure-activity relationships, reflecting a similar expert-driven systematic molecular optimization logic.

[0124] Example 5: Performance of key properties of Rationale-Opt in drug discovery This embodiment evaluates the performance of Rationale-Opt on several representative ADMET-related molecular optimization tasks, covering both single-objective and multi-objective settings, and analyzes the role of fragment-based rationale bases in the reinforcement learning optimization process through systematic ablation experiments.

[0125] The experiment selected four property endpoints widely used in QSAR modeling and drug discovery: water solubility (ESOL), mutagenicity (Mutag), hERG-related cardiotoxicity (hERG), and blood-brain barrier permeability (BBBP). Multi-objective optimization experiments used publicly available datasets (hERG&Mutag, ESOL&hERG, ESOL&Mutag, and Mutag&BBBP).

[0126] To quantitatively evaluate the model's optimization capability across different tasks, a relatively stringent success rate (SR%) metric is introduced to measure the model's performance. Specifically, for each poorly performing original molecule (DRD2(M) < 0.5 and QED(M) < 0.6), the proportion of times the model successfully optimizes that molecule in the first 20 inferences (the optimized molecule must satisfy the preset constraint thresholds DRD2(M) ≥ 0.5 and QED(M) ≥ 0.6) is calculated. The success rate is calculated as follows: , in, This indicates the number of molecules with poorer properties; Indicates the first The number of paths successfully optimized among 20 paths for molecules with poor properties; Indicates the first The total number of paths for molecules with poor properties (20 in this case).

[0127] In single-objective optimization tasks, Rationale-Opt achieved significant performance improvements across four representative endpoints. Figure 3 The success rates on the hERG and Mutagenicity tasks reached 88.5% and 74.4%, respectively, both significantly higher than the variant models after removing the rule base (78.3% and 59.4%, respectively). The remaining endpoints also showed a consistent performance trend. These results indicate that the statistical structural patterns (rationales) automatically mined from the training data provide high-value structural biases during reinforcement learning exploration, making policy search more inclined to generate modifications highly relevant to property improvement, thereby increasing the overall optimization success rate.

[0128] In multi-objective optimization tasks, Rationale-Opt also demonstrated robust collaborative optimization capabilities. In the hERG & Mutagenicity and ESOL & hERG tasks, Rationale-Opt achieved success rates of 77.0% and 75.3%, respectively, representing improvements of 1.1% and 3.6% compared to the unregulated model. In combinations like Mutag & BBBP, with larger structural spaces and more complex property couplings, the benefits of rule-guided optimization were even more significant (0.583 vs 0.479, an absolute improvement of over 10%). Furthermore, even in the Mutag & ESOL task with fewer samples, the model demonstrated the prior role of rationalelibrium, maintaining an average success rate of 60.6%, showcasing the stable prior value of rationale bases under low data density conditions.

[0129] Overall, Rationale-Opt demonstrates consistent and robust performance advantages in both single-objective and multi-objective settings. This indicates that the rationale base is not simply a search accelerator, but rather provides reusable structural decision priors for policy learning, enabling the model to form stable and transferable optimization paths in high-dimensional combinatorial spaces.

[0130] Example 6: Performance of Rationale-Opt under zero-sample and few-sample deployment conditions In real-world ADMET optimization processes, researchers often struggle to obtain large-scale, jointly labeled data that simultaneously measures multiple endpoints for the same batch of molecules. More commonly, different endpoints correspond to independently constructed single-endpoint datasets, with significant differences in data sources, molecule coverage, and sample size. Against this backdrop, the cross-endpoint migration capability of Rationale-Opt under more realistic deployment conditions was further evaluated.

[0131] In this setup, one endpoint is considered an established endpoint A (with sufficient training data and a rule base), and the other endpoint is considered a newly added endpoint B. A transfer scenario from zero-shot to few-shot is constructed by controlling the proportion of visible samples for endpoint B during the training phase. Specifically, two settings are compared: (i) zero-shot: using only the training data and rule base of endpoint A, without introducing any B endpoint annotations; (ii) few-shot: using the full dataset of endpoint A, and introducing 20% ​​of the training data of endpoint B and its corresponding partial rule base. Experiments are conducted on four endpoint pairs: hERG&Mutagenicity, ESOL&hERG, ESOL&Mutagenicity, and Mutagenicity&BBBP, with each directed combination treated as an independent task (e.g., BBBP→Mutagenicity and Mutagenicity→BBBP). The success rate is defined as "SuccessRate".

[0132] The results show that ( Figure 4In all eight directed tasks, the few-shot setting consistently outperformed the zero-shot setting. For example, in the Mutagenicity→hERG task, the success rate improved from 0.4523 to 0.7750; in the Mutagenicity→ESOL and Mutagenicity→BBBP tasks, the success rates improved by 0.1740 and 0.1577, respectively. Even in combinations that are relatively easy to optimize or highly correlated with the master endpoint (such as hERG→ESOL), few-shot learning still brought a consistent but small gain (0.8210→0.8357). It should be noted that in some tasks, the success rate of few-shot learning was higher than that of the standard multi-objective results based on the dedicated bi-objective dataset in Example 7. It is important to emphasize that this phenomenon does not mean that the few-shot setting is superior to standard multi-objective training under all conditions, but rather stems from the different problems addressed by the two types of experiments and the different construction methods of the training data. Example 7 builds a model based on multi-endpoint joint annotation data, while this example only relies on single-endpoint data to achieve better results, which is more in line with the situation in real-world applications where it is often difficult to obtain multi-endpoint annotation data at the same time.

[0133] This result reveals a key characteristic of Rationale-Opt in real-world applications: when data for newly introduced endpoints is highly limited, the model can explore based on data from other endpoints and form an optimization direction bias under the constraints of a multi-objective reward function; it can effectively recalibrate the original optimization trajectory with only a small number of newly added endpoint samples, thus spontaneously forming an implicit staged learning mechanism in the multi-objective reinforcement learning process. Even without relying on artificially constructed multi-attribute jointly labeled datasets and with extremely scarce supervision from newly added endpoints, Rationale-Opt can still achieve stable and effective cross-endpoint transfer, demonstrating its practical value and good generalization potential in real molecular optimization tasks.

[0134] Example 7: Analysis of Rationale base This embodiment involves a systematic evaluation of the performance of the constructed rationale base in terms of scale and endpoint specificity. Statistical analysis was performed on the number of rationales retained by each endpoint at different screening stages, the initial scale of rationales generated by each endpoint, and the changes in the number after the first and second rounds of screening, summarized in Table 2.

[0135] Table 2. Number of rationales retained at different screening stages To further examine the specific content and chemical semantics of the rationale base, Table 3 shows the top 10 rationales with the highest scores for each endpoint.

[0136] Table 3. Top 10 rationales with the highest scores for each endpoint It can be observed that rationales at different endpoints exhibit structural differences consistent with the property mechanism. For example, hERG rules are mainly enriched in combinations of aromatic heterocycles, halogen substitutions, and protonable amine centers, reflecting the characteristics of "aromatic hydrophobic framework + basic center"; ESOL rules, on the other hand, focus on polar segments such as hydroxyl groups, amides, and ether bonds, and their co-occurrence with the hydrophobic framework, reflecting sensitivity to polarity distribution and solvation ability. This phenomenon indicates that the constructed rule base does not only reflect the general structural patterns that frequently occur in the dataset, but can also identify substructure combinations that are highly correlated with property changes for specific optimization objectives.

[0137] Overall, the rationale base constructed by this method possesses clear endpoint discrimination and structural semantic differences, providing structured, executable, and highly aligned prior information for subsequent rule-guided reinforcement learning policy search. The introduction of this knowledge layer is one of the key factors enabling this method to maintain stable exploration directionality in complex, multi-objective chemical spaces.

[0138] All documents mentioned in this invention are incorporated herein by reference as if each document were individually incorporated by reference. Furthermore, it should be understood that after reading the foregoing teachings of this invention, those skilled in the art can make various alterations or modifications to this invention, and these equivalent forms also fall within the scope defined by the appended claims.

Claims

1. A method for constructing a set of association rules for compound substructures, characterized in that, The method includes the following steps: (1) Provide a general compound dataset and a target property compound dataset; the general compound dataset includes structural data of various compounds; The target property compound dataset includes structural data of various compounds labeled with the target properties; (2) Preprocess the general compound dataset to obtain a preprocessed general compound dataset; The structure data in the preprocessed general compound dataset is decomposed and filtered to obtain a substructure library; (3) Preprocess the target property compound dataset to obtain a preprocessed target property compound dataset; Using association rule mining methods, association rules are mined from the preprocessed target property compound dataset based on the substructures of the substructure library, and statistical indicators are calculated. The association rules include rule antecedent substructure combinations and rule consequent substructure combinations. The substructures in the rule substructure combinations are derived from the substructure library. (4) Based on the statistical indicators of each association rule, the association rules are pre-screened to obtain a preferred set of association rules; (5) For each preferred association rule in the preferred association rule set, the minimum topological distance between the rule antecedent substructure combination and the rule consequent substructure combination is evaluated based on the atomic index set of the rule antecedent substructure combination and the atomic index set of the rule consequent substructure combination. (6) Based on the minimum topological distance, perform a round of filtering on the preferred association rules to obtain a round of filtered association rules; (7) Mask the substructures in the rule substructure combination to obtain the masked rule substructure combination; use a pre-trained consensus model to predict the compound properties of the masked rule substructure combination and the unmasked rule substructure combination, thereby evaluating the attribution values ​​of the rule antecedent substructure combination, the rule consequent substructure combination and the association rule, and then use the attribution values ​​of the rule antecedent substructure combination, the rule consequent substructure combination and the association rule to evaluate the association rule gain index; (8) Based on the association rule gain index, the association rules selected in the first round of screening are screened in a second round to finally obtain the association rule set of compound substructure.

2. The method as described in claim 1, characterized in that, The general compound dataset includes compounds from the PubChem database and the admetSAR3.0 dataset; the target property compound dataset includes datasets selected from the group consisting of: water-soluble datasets, mutagenicity datasets, hERG-related cardiotoxicity datasets, or blood-brain barrier datasets; the structural data includes SMILES data of the compounds; The properties of the compound include those selected from the group consisting of: water solubility, mutagenicity, hERG-related cardiotoxicity, blood-brain barrier permeability, or combinations thereof; Step (2) specifically includes the following steps: (2.1) Standardize and remove duplicates from the general compound dataset to obtain a preprocessed general compound dataset; (2.2) The structure data of various compounds in the preprocessed general compound dataset are decomposed to obtain a substructure library; (2.3) Select high-frequency substructures from the substructure library to form the original action pool; In step (2.2), the BRICS method is used to disassemble the structure; In step (3), the statistical metrics for each substructure combination in each compound are evaluated using the Apriori algorithm; the statistical metrics include support, confidence and boost. For a combination of rule antecedent substructures in an association rule Rule-based component structure combination The support is calculated as follows: , Where A is the combination of rule antecedent substructures; B is the combination of rule consequent substructures. N is the number of compounds in the preprocessed compound dataset that have combinations of two regular substructures, A and B; N is the total number of compounds in the preprocessed compound dataset. For a combination of rule antecedent substructures in an association rule Rule-based component structure combination The confidence level is calculated as follows: , Where A is the combination of rule antecedent substructures; B is the combination of rule consequent substructures. The number of compounds in the preprocessed compound dataset that have combinations of two regular substructures, A and B; The number of compounds in the preprocessed compound dataset that have a regular antecedent substructure combination A; For a combination of rule antecedent substructures in an association rule Rule-based component structure combination The lift is calculated as follows: , Where A is the combination of rule antecedent substructures; B is the combination of rule consequent substructures. For association rules Confidence level; The support of rule-following substructure combination B; The support of the rule-following substructure combination B is calculated as follows: , in, N is the number of compounds in the preprocessed compound dataset that have a regular post-component substructure combination B; N is the total number of compounds in the preprocessed compound dataset. Step (6) specifically includes: when the minimum topological distance of the preferred association rule is ≤ When this happens, the preferred association rule is added to the association rules of the next round of filtering; In step (7), the pre-trained consensus model includes multiple pre-trained relational graph convolutional networks; In step (7), the substructure is masked using a chemically intuitive interpretability method, and the difference in model predictions before and after masking is calculated. For a combination of rule antecedent substructures in an association rule Rule-based component structure combination The combined gain index is calculated as follows: , in, The attribution value for the rule's antecedent substructure combination A; The attribution value for rule-following substructure combination B; The attribution value for association rule AB; Step (8) specifically includes: sorting the absolute values ​​of the association rule gain index and retaining a predetermined number of association rules as a set of association rules for compound substructures.

3. A method for molecular optimization of compounds, characterized in that, The method includes the following steps: (S1) Provide an original compound, a substructure association rule set containing structural transformations related to the target properties, and an original action pool; the substructure association rule set containing structural transformations related to the target properties and the original action pool are obtained using the method described in claim 1; (S2) Convert the original compound into an embedding vector, including the steps of: locating the target substructure in the original compound according to predefined structural rules, and masking the target substructure to obtain the masked target substructure; The target substructure of the mask and its neighborhood context are convolved using a graph convolutional network to obtain the convolution result; the convolution result is weighted and aggregated by attention pooling to obtain the embedding vector of the original compound. (S3) Input the embedding vector, the original action pool, and the substructure association rule set containing target property-related structural transformations into the reinforcement learning model; the reinforcement learning model includes a policy layer and a reward layer, wherein: The strategy layer filters and constrains the original action pool based on the substructure association rule set containing structural transformations related to target properties, obtaining a constrained action space; it uses a reinforcement learning algorithm to receive the embedding vector and combines it with the reward signal to make decisions on candidate editing operations in the constrained action space, thereby optimizing the target substructure in the original compound and generating a new compound; it uses a compound property prediction model to evaluate the target properties of the original compound and the new compound, obtaining the evaluation results; The reward layer calculates a reward signal based on the target property evaluation results of the original compound and the new compound; the reward signal is used as environmental feedback input to the policy layer, thereby updating the parameters of the reinforcement learning algorithm and guiding the candidate editing operation to evolve towards the optimization of the target property; (S4) When the target property reaches a predetermined threshold, an optimized compound is obtained.

4. The method as described in claim 3, characterized in that, In step (S2), the predefined structural rules include: substructures that are unfavorable to the target properties identified by the relational graph convolutional network, and manually specified substructures; The reinforcement learning algorithm is a near-end policy optimization algorithm; the near-end policy optimization algorithm is a near-end policy optimization algorithm that supports action masking mechanism; In the strategy layer, the strategy layer filters and constrains the original action pool based on the substructure association rule set containing structural transformations related to the target properties, including the following steps: (b1) Preliminary screening based on topological and physicochemical constraints; and (b2) Based on the set of association rules for compound substructures, further filtering is performed to obtain the constrained action space; Step (b1) specifically includes: (b1.1) Retain candidate substructures with the number of atoms in the range of 0.8–2.2 times that of the target substructure; and (b1.2) Retain candidate substructures with the same number of connection sites as the target substructure; Step (b2) specifically includes: (b2.1) The candidate substructures obtained in step (b1) after preliminary screening and the substructures that are in context with them are fused together and transformed into local embedding representations; (b2.2) Evaluate the similarity between the local embedding representation and each rationale embedding representation in the substructure association rule set containing the structural transformation related to the target property, and retain candidate substructures whose similarity reaches a predetermined threshold; In step (b2.1), the local embedding representation is calculated as follows: , in, These are candidate substructures that have undergone preliminary screening; Embedding of candidate substructures after preliminary screening; The embedding of a substructure that has a context with the candidate substructure; In step (b2.2), the similarity is cosine similarity; The action space of the constraints obtained in step (b2.2) is: , in, For constrained action space; Candidate substructures after preliminary screening Local embedding representation; Embedding representations for rationale; This is a predetermined threshold.

5. The method as described in claim 3, characterized in that, The reward signal is calculated as follows: , in, For the set of target properties, For the first The change of each objective property before and after optimization These are independent nonlinear mapping functions defined for different property scales; the property scales include regression-type outputs and categorical outputs.

6. A system for molecular optimization, characterized in that, The system includes: (M1) Input module, which is configured to input data, the data including the original compound, a set of substructure association rules containing structural transformations related to the target property, and the original action pool; (M2) Optimization module, configured as a molecular optimization model, which optimizes the original compound toward the target property to obtain an optimization result; the molecular optimization model includes: (m1) A preprocessing unit configured to perform the following operations: locate the target substructure in the original compound according to predefined structural rules, and mask the target substructure to obtain a masked target substructure; perform convolution on the masked target substructure and its neighborhood context using a graph convolutional network to obtain a convolution result; and perform weighted aggregation of the convolution result through attention pooling to obtain the embedding vector of the original compound. (m2) A reinforcement learning unit, comprising a policy subunit and a reward function subunit, wherein: The strategy subunit is configured to perform the following operations: based on the substructure association rule set containing target property-related structural transformations, filter and constrain the original action pool to obtain a constrained action space; use a reinforcement learning algorithm to receive the embedding vector and combine it with a reward signal to make a decision on candidate editing operations in the constrained action space, thereby performing structural optimization on the target substructure in the original compound to generate a new compound; use a compound property prediction model to evaluate the target properties of the original compound and the new compound to obtain evaluation results; The reward function subunit is configured to perform the following operations: calculate a reward signal based on the target property evaluation results of the original compound and the new compound; the reward signal is used as environmental feedback input to the policy layer, thereby updating the parameters of the reinforcement learning algorithm and guiding the candidate editing operation to evolve towards the target property optimization direction; When the target property reaches a predetermined threshold, the optimization result is obtained; (M3) Output module, which is configured to output the optimization results of the optimization module.

7. An electronic device comprising a processor and a memory, characterized in that, The memory contains multiple executable instructions, and the processor is used to read the instructions and execute the steps in the method as described in claim 1.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when read and executed by a processor, implement the steps of the method as described in claim 1.

9. A computer program product comprising computer-executable instructions, characterized in that, When the computer-executable instructions are executed by the processor, they implement the steps of the method as described in claim 1.

10. An optimized compound, characterized in that, The compound is generated using the method of claim 3.