Methods of training a potential function model, computing devices for atomistic simulations, media, and products
Patent Information
- Application Number
- CN202611047623.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2046-07-15
AI Technical Summary
[0030] Using the prior-guided adaptive training potential function model method of this invention, high-risk local environments can be stably identified in a latent representation coordinate system where the basic model remains unchanged; local substructures, rather than whole structures, are used as high-precision annotation units, reducing annotation costs; repeated queries are suppressed by learning the coverage library within the task; while maintaining the core high-risk local environments, the boundaries of substructures are refined under constraints to improve the physical rationality of the annotated samples; and the potential function model can be updated in a closed loop using newly added annotated data, forming a closed-loop process that improves the accuracy, stability, relevance, and continuous availability of large-scale atomic simulations.
Smart Images

Figure CN122551922B_ABST
Abstract
Description
Technical Field
[0001] This invention generally relates to computer systems utilizing computational models, and more specifically to methods for training potential function models, computational devices, media, and products for atomic simulations. Background Technology
[0002] In recent years, machine learning potential functions have been widely used in atomic simulations, aiming to replace the high overhead of calculating atomic-level properties such as energy, force, and stress in traditional first-principles methods. With the development of basic modeling techniques, pre-trained potential functions can provide unified representation and prediction capabilities across a wide range of material systems, making them promising for applications in large-scale molecular dynamics simulations, defect evolution, diffusion, phase transitions, and device operation analysis.
[0003] However, the basic model still faces a key problem when deployed to specific tasks: the simulation trajectory will continuously enter new local atomic environments, which may not be adequately covered during the pre-training stage, leading to model failure. Since device-level and large-scale system simulations are usually long in duration and involve a large number of atoms, local events are sparse but have significant impacts. If these high-risk local environments are not identified in time and corrected at low cost, the overall simulation results will be distorted or even collapse.
[0004] Regarding the aforementioned issues, online data selection and model updates for machine learning potential functions have led to a technical approach known as "active learning" or "online adaptive correction." The basic idea behind this approach is to identify high-risk samples during simulation, obtain supervised data using high-precision annotation methods, and then use this new data to update the potential function model.
[0005] Currently, the existing solutions under this technical route mainly include the following types.
[0006] The first type is an active learning scheme based on model uncertainty. This type of scheme typically uses methods such as model ensemble, model committee, Bayesian approximation, variance estimation, or Mahalanobis distance in the descriptor space to estimate the uncertainty of the entire structure or local environment; when the uncertainty exceeds a threshold, corresponding samples are selected for first-principles annotation and retraining.
[0007] The second type is a local anomaly detection scheme based on descriptor statistics. This type of scheme usually first maps the local environment to a handmade descriptor space, such as smoothing overlapping atomic position descriptors, and then evaluates whether it deviates from the training set distribution based on the mean, covariance, or distance threshold.
[0008] The third type is an online correction scheme based on whole-frame sampling or whole-trajectory sampling. This type of scheme typically samples the whole-frame structure periodically in the simulated trajectory, directly calls the high-precision annotation of the whole-frame structure, and then uniformly adds it to the training set to update the model.
[0009] The fourth type is the posterior adaptation scheme in the deployment of the basic model. This type of scheme usually uses the pre-trained potential function directly for the new task. When the prediction error is found to be large, it is adapted through fine-tuning, incremental training or replay training. However, its sample selection often depends on global error, empirical rules or simple uncertainty thresholds.
[0010] While the aforementioned approaches have improved the online adaptability of machine learning potential functions to some extent, several shortcomings remain. First, they lack a stable foundational prior reference system. Many online approaches use feature representations or statistics that change continuously with training; after model updates, the anomaly detection benchmark drifts, making it difficult to reliably determine whether the current local environment deviates from the original knowledge range of the foundational model. Second, the sample selection granularity is too coarse. Existing methods often use the entire frame structure as the annotation unit, resulting in a large number of atoms unrelated to high-risk events being included in high-precision annotation, wasting computational resources. Third, it is difficult to avoid duplicate queries. When an already annotated local environment reappears in subsequent trajectories, existing methods often lack an in-task overlay memory mechanism, easily leading to the repeated selection of similar samples. Fourth, the physical rationality after local segmentation is insufficient. Directly extracting local fragments from a large system easily leads to problems such as dangling bonds at boundaries and local stress distortion; if directly used for first-principles annotation, it will reduce annotation quality. Fifth, it is difficult to balance large-scale simulation and online updates. Large systems have a large number of atoms, making direct global high-precision correction too costly; without localized query, parallel annotation, and incremental training mechanisms, it is difficult to support device-scale or long-term simulations.
[0011] In summary, while pre-trained machine learning potential functions exhibit good generalization ability in device-scale or large-scale atomic simulations, they are prone to problems such as force prediction distortion, structural evolution errors, non-physical bonding, and long-term integration instability when encountering local atomic environments with insufficient pre-training data coverage. Existing methods typically rely on whole-frame structural uncertainty evaluation or global sampling, resulting in high-precision annotation costs, inaccurate localization of truly high-risk local events, and low efficiency in online correction, making it difficult to support long-term, large-scale, and device-scale simulations.
[0012] Therefore, there is a need in the art to improve techniques for training machine learning potential function models to perform atomic simulation tasks in at least one of the above aspects. Summary of the Invention
[0013] This invention is provided to offer further improved techniques for training machine learning potential function models to perform atomic simulation tasks.
[0014] One aspect of the present invention provides a method for training a potential function model, the potential function model including an encoder, the method comprising the following steps: S1: using the encoder to perform embedding extraction on input data of the current iteration to obtain a local embedding vector, the input data reflecting the three-dimensional structure of atoms; S2: evaluating the deviation of the local embedding vector relative to a prior library and a learning coverage library, the prior library being constructed based on a basic training dataset, and the learning coverage library being constructed based on substructures labeled during training; S3: determining out-of-distribution atoms in the input data based on the deviation; S4: extracting local substructures centered on the out-of-distribution atoms; S5: performing training on the local substructures based on the potential function model. S6: Refine the substructure to obtain a refined local substructure; S7: Perform first-principles annotation on the refined local substructure to obtain atomic-level properties associated with the refined local substructure; S8: Save the refined local substructure and the atomic-level properties associated with the refined local substructure as the latest labeled samples to the buffer training dataset; and S9: Train the potential function model using the buffer training dataset according to a preset strategy, wherein the potential function model generates atomic-level properties associated with the current iteration based on the input data in the current iteration, and the atomic-level properties associated with the current iteration are used as input data for the next iteration through molecular dynamics analysis.
[0015] As described above, the local embedding vector is a first local embedding vector; the encoder's parameters are fixed in multiple iterations. The method further includes: S9: using the encoder to extract embeddings from the basic training data in the basic training dataset to construct the prior library according to element types, the basic training data reflecting the three-dimensional structure of atoms, S9 including: S91: using the encoder to extract embeddings from the basic training data to obtain a second local embedding vector; S92: grouping the second local embedding vectors according to element types, and performing clustering on the second local embedding vectors of each element to obtain multiple prototype centers; S93: calculating the scale parameter of the cluster associated with each prototype center, the scale parameter including one or more of the following: radius, quantile radius, or other one-dimensional scale; and S94: saving the prototype center and scale parameter for each element as the prior library.
[0016] As described above, step S2 includes: S21: calculating a first deviation score for each atom in the input data relative to the prior library, the first deviation score being associated with the normalized distance from the local embedding vector of the atom to the nearest prototype center of the same element in the prior library; S22: calculating a second deviation score for each atom in the input data relative to the learning coverage library, the second deviation score being associated with the normalized distance from the local embedding vector of the atom to the nearest prototype center of the same element in the learning coverage library; and step S3 includes: S31: comparing the first deviation score with a first preset threshold, and comparing the second deviation score with a second preset threshold; and S32: in response to the first deviation score being greater than the first preset threshold and the second deviation score being greater than the second preset threshold, determining the atom as the out-of-distribution atom.
[0017] As described above, step S4 includes: S41: for each external atom, establishing a neighborhood of the external atom under periodic boundary conditions; and S42: cutting out the local substructure in the neighborhood according to a preset cutting strategy, wherein the local substructure includes a core region surrounding the external atom and a shell region extended around the core region.
[0018] As described above, the preset cutting strategy includes an anisotropic buffer cutting strategy.
[0019] As described above, step S5 includes: S51: fixing the atoms in the core region; S52: performing structural relaxation on the atoms in the outer shell region based on the potential function model; S53: stopping the structural relaxation in response to force convergence satisfying a preset threshold or reaching the maximum number of iterations, to obtain the refined local substructure; and S54: outputting the refined local substructure.
[0020] The structural relaxation described above is either quasi-Newtonian relaxation or rapid inertial relaxation.
[0021] As described above, step S6 is executed by invoking a first-principles calculation program.
[0022] As described above, the local embedding vector is a first local embedding vector, and the method further includes: S10: updating the learning coverage library based on the refined local substructure, S10 including: S101: using the encoder to perform embedding extraction on a subset of the input data to obtain a third local embedding vector, the subset of the input data being associated with the refined local substructure; S102: adding the third local embedding vector to the learning coverage library; S103: calculating the distance between each third local embedding vector and an existing prototype in the learning coverage library; and S104: in response to the distance being greater than a preset merging threshold, setting the third local embedding vector as a new prototype.
[0023] As described above, the buffered training dataset includes the latest labeled samples and a replay subset of historical samples, wherein the replay subset is obtained by importance sampling of the historical samples according to historical error and temperature decay mechanisms.
[0024] The method described above includes at least one of the following: the number of the latest labeled samples in the buffered training dataset reaches a preset update threshold; the error of the latest labeled samples in the buffered training dataset exceeds a preset error threshold.
[0025] As described above, the encoder is obtained based on the base training dataset.
[0026] In the method described above, the encoder is a graph neural network encoder.
[0027] Another aspect of the present invention provides a computing device for atomic simulation, comprising: computing resources; a potential function model trained using the method described above, the potential function model being configured to invoke the computing resources to, in each iteration, generate atomic-level properties associated with the three-dimensional structure based on input data reflecting the three-dimensional structure of the atom; and a molecular dynamics analysis tool configured to invoke the computing resources to, in each iteration of the potential function model, perform molecular dynamics analysis on the atomic-level properties generated to obtain output data representing the three-dimensional structure associated with that iteration, wherein the output data associated with multiple iterations of the potential function model is used to compose a dynamic trajectory.
[0028] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0029] Another aspect of the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the above embodiments.
[0030] Using the prior-guided adaptive training potential function model method of this invention, high-risk local environments can be stably identified in a latent representation coordinate system where the basic model remains unchanged; local substructures, rather than whole structures, are used as high-precision annotation units, reducing annotation costs; repeated queries are suppressed by learning the coverage library within the task; while maintaining the core high-risk local environments, the boundaries of substructures are refined under constraints to improve the physical rationality of the annotated samples; and the potential function model can be updated in a closed loop using newly added annotated data, forming a closed-loop process that improves the accuracy, stability, relevance, and continuous availability of large-scale atomic simulations. Attached Figure Description
[0031] Figure 1 This is a schematic diagram reflecting a process in an adaptive training framework according to some embodiments of the present invention.
[0032] Figure 2 This is a schematic diagram illustrating the process of constructing a priori library according to some embodiments of the present invention.
[0033] Figure 3 This is a schematic diagram of an example process for extracting local substructures according to some embodiments of the present invention.
[0034] Figure 4 This is a schematic diagram reflecting another process in an adaptive training framework according to some embodiments of the present invention.
[0035] Figure 5 This is a flowchart of a method for training a potential function model according to some embodiments of the present invention.
[0036] Figure 6 This is a flowchart of a first process associated with a method for training a potential function model according to some embodiments of the present invention.
[0037] Figure 7 This is a flowchart of a second process associated with a method for training a potential function model according to some embodiments of the present invention.
[0038] Figure 8 This is a flowchart of a third process associated with a method for training a potential function model according to some embodiments of the present invention.
[0039] Figure 9 This is a flowchart of a fourth process associated with a method for training a potential function model according to some embodiments of the present invention.
[0040] Figure 10This is a block diagram of a computing device for atomic simulation according to some embodiments of the present invention.
[0041] Figure 11 This is a block diagram of a computer-readable storage medium according to some embodiments of the present invention.
[0042] Figure 12 This is a block diagram of a computer program product according to some embodiments of the present invention.
[0043] In the accompanying drawings, the same reference numerals refer to the same elements. Detailed Implementation
[0044] In this application, ordinal numbers such as "first," "second," and "third" are used to distinguish different instances of objects with the same name. The ordinal numbers "first," "second," and "third" do not indicate a relative order of the indicated objects in time, space, sequence, or other aspects.
[0045] In this application, the term "potential function model" (or simply "potential function" or "model") refers to a mathematical model used to describe the interactions between particles in an atomic or molecular system. Its input is data reflecting the three-dimensional structure of the atomic system, including the positional information of each atom in the system, and its output is atomic-level properties associated with the system. As an example, atomic-level properties may include the total energy of the system and the forces acting on each atom. In some scenarios, atomic-level properties may also include physical quantities such as the stress tensor.
[0046] In traditional atomic simulation methods, the atomic-level properties associated with three-dimensional structures, such as energy, force, and stress, are typically obtained through first-principles calculations. While these methods offer high accuracy, the computational cost increases dramatically with the scale of the system, making them unsuitable for large-scale or long-term simulations. Machine learning potential functions, on the other hand, utilize mapping relationships learned from first-principles calculations to approximate these physical quantities at a lower computational cost, thereby significantly improving simulation efficiency while maintaining acceptable accuracy.
[0047] The "potential function model" involved in this invention specifically refers to a potential function model constructed based on machine learning methods, including but not limited to pre-trained basic model potential functions and their variants after online adaptive updates. Typical applications include, but are not limited to, molecular dynamics simulations, defect evolution, diffusion processes, phase transition processes, and device operation process analysis. It should be understood that the specific network architecture, training framework, and input feature representation of the potential function in the various embodiments of this invention do not constitute a limitation on the scope of protection of this invention. Those skilled in the art can choose known or self-designed potential function model structures according to actual task requirements.
[0048] In this application, the term "atomic simulation task" refers to a simulation process that uses a potential function model to perform multiple iterations of calculations on an atomic or molecular system. In an atomic simulation task, the potential function model does not perform a single prediction operation, but rather acts as a simulation engine that runs continuously over time, advancing the evolution of the system's state through multiple iterations by coupling with molecular dynamics analysis tools.
[0049] At the beginning of the atomic simulation task, the system is in an initial atomic configuration, which may include the type identifier and initial position coordinates of each atom, serving as the input for the first iteration. After receiving this input, the potential function model outputs the total energy of the system, the forces acting on each atom, and an optional stress tensor (or simply "stress"). The energy, forces, and optional stress constitute the output of the first iteration.
[0050] The output of the first iteration is passed to the molecular dynamics analysis tool to generate the atomic configuration for the second iteration. This atomic configuration serves as the input for the second iteration, maintaining the same atomic types as the first iteration, but with altered positional coordinates based on the forces output in the first iteration. The potential function model then repeats the energy prediction and force solution process for this new atomic configuration, outputting the energy, force, and optional stresses for the second iteration, thus completing the second iteration.
[0051] The above process is repeated continuously. The forces in the output of each iteration are processed by molecular dynamics analysis tools to generate the input atomic configuration for the next iteration. The next iteration uses this atomic configuration as input to generate new force outputs, thus forming an iterative closed loop, which terminates when the preset total number of simulation steps or convergence condition is reached. The output atomic configurations of each iteration together constitute the dynamic trajectory.
[0052] In this application, the term "encoder" refers to a functional module in a machine learning potential function model that maps a local atomic environment into a high-dimensional feature representation. Specifically, the encoder takes the type and position coordinates of the target atom and its neighboring atoms as input, performs feature transformation and aggregation operations, and outputs a set of vectors or tensors that characterize the geometric and chemical features of the local atomic environment. This output is the intermediate representation upon which subsequent tasks such as atomic-level property prediction (e.g., energy, force, and optional stress) and uncertainty assessment rely.
[0053] During the pre-training phase, the encoder is trained based on a basic training dataset, enabling it to learn a general atomic environment representation capability across a wide range of material systems. In various embodiments of the present invention, since the encoder's parameters are fixed after pre-training and no longer change with the online adaptive update process, this feature space can provide a stable basic prior reference frame, avoiding anomaly detection benchmark drift caused by model updates.
[0054] It should be understood that the encoder involved in this invention is not limited to a specific network architecture. It can be an encoder based on graph neural networks, a feature extraction module based on equivariant graph neural networks, or other known or self-designed model structures that can realize the mapping from local atomic environments to fixed-dimensional feature vectors, as long as the parameters are fixed after pre-training and the output representation has the ability to distinguish local atomic environments. The specific architecture selection does not constitute a limitation on the scope of protection of this invention.
[0055] In this application, the term "embedding extraction" refers to the process of using an encoder to perform feature mapping on a target local atomic environment in a system. Specifically, in molecular dynamics simulations or other atomic simulations, for a specific atom or cluster of atoms in the system, its neighborhood is first determined, and information such as the type identifiers and relative position coordinates of all atoms within that neighborhood is obtained, forming an input description of a local atomic environment. Subsequently, this input description is fed into an encoder with fixed parameters. After feature transformation and neighborhood information aggregation operations within the encoder, a set of fixed-dimensional numerical vectors is output, which is the feature representation of the local atomic environment.
[0056] The complete mapping process from the local atomic environment to the feature vector described above is what this invention refers to as embedding extraction. Since the encoder parameters no longer change with online adaptive updates after pre-training, the embedding extraction operation is always performed based on the same set of fixed mapping parameters throughout the simulation process. Its output feature space does not drift with model updates, thus ensuring consistent comparability between features extracted at different times and on different trajectory segments.
[0057] In this application, the term "local embedding vector" refers to the fixed-dimensional numerical vector output by the extraction operation, which represents the position of the corresponding local atomic environment in the encoder feature space. Each local embedding vector corresponds to a specific local atomic environment, and its vector components carry information such as the geometric arrangement, chemical composition, and nearest-neighbor interaction patterns of atoms in that environment.
[0058] In this application, the term "first-principles annotation" refers to the process of using computational methods based on the fundamental principles of quantum mechanics to perform high-precision energy, force, and stress calculations on atomic or molecular systems, and using the obtained calculation results as supervisory data for model training or updating. Specifically, the first-principles computational method starts with the Schrödinger equation, and after introducing specific approximations (such as the density functional theory framework), solves for the electronic structure, thereby obtaining the total energy of the system, and further obtaining the forces acting on each atom, as well as the optional stress tensor.
[0059] Figure 1This is a schematic diagram reflecting the process in an adaptive training framework 100 according to some embodiments of the present invention.
[0060] like Figure 1 As shown, in each iteration, the adaptive training framework 100 begins by reading input data 115. Input data 115 can be various forms of data reflecting the three-dimensional structure of the system, including atoms. In the first iteration of the atomic simulation task performed by the potential function model 110, input data 115 can be data reflecting the initial structure to be simulated. In subsequent iterations of the atomic simulation task performed by the potential function model 110, input data 115 can be output data 195 from the previous iteration. Output data 195 can be data reflecting the changed atomic structure obtained by molecular dynamics analysis tools based on the atomic-level properties 185 output by the potential function model 110 in that iteration.
[0061] The potential function model 110 may include an encoder 112. As an example and not a limitation, the encoder 112 may be pre-trained using a pre-training dataset, and the parameters of the encoder 112 remain unchanged after pre-training to avoid detection reference frame drift after model updates.
[0062] The encoder 112 can be used to extract the embeddings from the input data 115 to obtain the local embedding vector 125. The deviation of the local embedding vector 125 from both the prior library 132 and the learned coverage library 134 can be evaluated.
[0063] The learning coverage library 134 can be constructed based on substructures annotated during training. For example, the learning coverage library 134 can be constructed based on annotated substructure 167. For ease of understanding, optional further details on constructing the learning coverage library 134 will be explained after the complete description of the adaptive training framework 100.
[0064] The prior library 132 can be built based on the basic training dataset 135. The following will combine... Figure 2 Further optional details regarding the construction of the prior library 132 will be provided. For ease of understanding, these will be explained after completing the... Figure 2 Following the description of the relevant technical details, optional further details on assessing the degree of deviation will be provided.
[0065] Off-distribution atoms 145 can be identified based on the degree of deviation. The term "off-distribution atom" (also known as "high-risk atom") refers to atoms in the input data 115 that deviate from both the prior library 132 and the learning coverage library 134, i.e., atoms not covered by either the pre-training data or the learned data. The local atomic environment of off-distribution atoms can also be referred to as a high-risk local area. When simulating high-risk local areas using the potential function model, problems such as force prediction distortion, structural evolution errors, non-physical bonding, and long-term integral instability are prone to occur. Therefore, it is desirable to accurately locate off-distribution atoms for high-precision quantum labeling, and update the potential function model with the newly added labeled data in a closed loop to improve the accuracy of the potential function model in atomic simulation.
[0066] Accordingly, the outer atoms 145 can be used as centers to cut out local substructures 155 to locate the aforementioned high-risk local areas. For example, for each high-risk atom, its neighborhood is established under periodic boundary conditions, and local substructures are generated according to a preset cutting strategy.
[0067] In some embodiments, an anisotropic buffering strategy can be employed: defining the core radius; defining the buffer layer thickness; and progressively growing substructures based on local coordination, local composition ratios, and supercell expansion rules. In this anisotropic buffering strategy, local substructures are typically divided into a core region and a shell region. The core region surrounds high-risk central atoms, preferentially preserving key local environments that trigger anomaly detection. The shell region is a buffer area expanded around the core region, used to absorb boundary effects and allow movement during subsequent refinement. In some embodiments, a box-shaped expansion enumeration-based strategy can also be used to select the best-scoring substructure from several candidate expanded substructures. The following will combine... Figure 3 Further details on the optional extraction of local substructures are provided.
[0068] Directly extracted local substructures often suffer from boundary discontinuities, excessive local stress, or dangling bond issues. To improve the physical plausibility of first-principles annotation samples, some embodiments employ a potential function model 110 to perform constrained structure refinement on the local substructure 155 before annotation, resulting in a refined local substructure 165.
[0069] Specifically, the core region atoms can be fixed to maintain the geometry of high-risk local events, while the outer shell atoms can be made movable. A machine learning potential function can be used to perform structural relaxation on the movable atoms. In some embodiments, structural relaxation may include a quasi-Newton method or a fast inertial relaxation engine. Structural relaxation can be stopped when force convergence meets a preset threshold or the maximum number of iterations is reached, and the refined local substructure is output.
[0070] Some implementations use a potential function for batch restricted relaxation, rather than directly optimizing the gradient of the uncertain objective function. This design allows the restricted structure refinement to more closely approximate the true potential energy surface, facilitating the generation of plausible substructures that can be annotated with first-principles calculations.
[0071] The refined local substructure 165 is processed using a first-principles calculation interface to obtain atomic-level properties (e.g., total energy, atomic forces, and optional stresses) to obtain an annotated substructure 167. In some embodiments, an external first-principles calculation program can be used to complete the annotation by automatically generating input files, running multiple tasks in parallel, reading output results, and backfilling them into the local substructure object. The first-principles annotation program is not limited to any specific software and can be replaced with other electronic structure methods or higher-precision potential energy surface annotators.
[0072] The labeled substructure 167 can be saved as the latest labeled sample to the buffered training dataset 175. The latest labeled sample may include the refined local substructure and atomic-level properties (e.g., energy, force, and optional stress) associated with the refined local substructure. The buffered training dataset 175 can act as a training buffer, and the data stored therein allows for intermittent fine-tuning of the machine learning potential function over consecutive iterations.
[0073] The potential function model 110 can be trained (i.e. updated) using a buffered training dataset 175 according to a preset strategy. In some embodiments, a certain number of new samples can be accumulated before the first update, and an update can be triggered every time a certain number of new samples are added. When the error of a new sample exceeds a preset threshold, an update can be triggered immediately. In some embodiments, a final update can be performed at the end of the trajectory.
[0074] In some embodiments, to prevent model forgetting, the training samples used for updating may include not only the latest labeled samples but also a replay subset of historical samples. In some embodiments, the replay samples may be sampled based on importance according to historical error and temperature decay mechanisms to balance the preservation of old knowledge and the absorption of new knowledge. As an example and not a limitation, full-parameter fine-tuning, adapter fine-tuning, low-rank adaptation fine-tuning, or other incremental training methods may also be used to update the potential function model.
[0075] The following describes optional further details of constructing the learning coverage library. As an example, after a local substructure has been annotated with first-principles annotations, encoder 112 can be used to re-extract the local embeddings from the annotated substructure 167. These local embeddings can be added to the learning coverage library element by element. If the distance between a new embedding and an existing prototype in the learning coverage library is less than a merging threshold, it is considered covered, and no new prototype is added; if the distance is greater than the merging threshold, a new learning prototype is added.
[0076] As an example, and not a limitation, the learning coverage library can absorb only the local embeddings of core region atoms, or it can absorb the local embeddings of all labeled substructure atoms. As an example, and not a limitation, the merging threshold can also be designed to vary by element or by prototype.
[0077] Figure 2 This is a schematic diagram illustrating the process of constructing a priori library according to some embodiments of the present invention.
[0078] like Figure 2 As shown, encoder 112 can be obtained through training based on the basic training dataset 135. The encoder parameters can be fixed and not participate in subsequent online updates. In some embodiments, encoder 112 can be a graph neural network encoder.
[0079] The encoder 112 can be used to extract the embeddings of each atom local environment in the basic training data or accessible reference data to obtain the second local embedding vector 225.
[0080] The second local embedding vector 225 can be grouped according to element type, and clustering can be performed on the second local embedding vector 225 for each element type to obtain multiple prototype centers 235. For each prototype center, the scale parameter 245 of its corresponding cluster can be calculated. In some embodiments, the scale parameter 245 may include radius, quantile radius, or other one-dimensional scale quantity. The prototype centers 235 and scale parameter 245 of each element can be saved as an element conditional prior library to obtain a prior library 132.
[0081] As an example, and not a limitation, clustering can be performed using K-means clustering. Alternatively, mini-batch K-means, spherical clustering, hierarchical clustering, prototype compression, or other vector quantization methods can also be used. As an example, and not a limitation, the prior library is stored as an array file organized by elements, with each element corresponding to multiple center vectors and radius parameters.
[0082] The following describes optional further details for assessing the degree of deviation.
[0083] As an example, not a limitation, let z be the local embedding vector of an atom belonging to element e. The prior deviation score is defined as the normalized distance of this embedding vector to the nearest prototype center in the prior library of the same element: Score = Minimum {Square vector distance / (Square prototype radius + Stability term)}, where: the squared vector distance measures the degree of deviation between the current local environment and a prototype center, the squared prototype radius is used for scale normalization, and the stability term is used to avoid the denominator being zero or too small. The larger the score, the greater the degree of deviation of the current local environment from the prior of the basic model.
[0084] In addition to using the nearest prototype normalized distance, prior deviation scores can also be achieved using kernel density scores, nearest neighbor scores, Gaussian mixture model negative log-likelihood scores, multi-scale clustering scores, etc.
[0085] To avoid repeatedly querying similar local environments that have already been labeled, some embodiments introduce a task-specific learning coverage library in addition to the frozen basic prior library. When evaluating the degree of deviation, for each candidate atom, both the deviation score relative to the basic prior library and the deviation score relative to the learning coverage library are calculated. An atom is considered a high-risk atom only if both of the following conditions are met: the basic prior deviation score is greater than the basic threshold; and the learning coverage deviation score is greater than the learning threshold.
[0086] For each atom, the prior library determines whether the atom deviates from the knowledge range already existing in the model based on the basic training dataset, while the learned coverage library determines whether the local environment of the atom has already been labeled and absorbed in the current task. The joint decision-making mechanism of the prior library and the learned coverage library can suppress duplicate queries while maintaining the stability of the basic prior reference frame.
[0087] Figure 3 This is an illustration of an example process for extracting local substructures according to some embodiments of the present invention. Figure 3 The processes shown are merely examples and should not be considered as limiting the scope of the invention.
[0088] This example process includes three stages: initial cutting, buffer layer growth, and windowed scoring. The specific execution process is as follows.
[0089] The first stage is the initial cut. For example... Figure 3 As shown, in the large-scale atomic system to be processed, for the high-risk local environment of the identified out-of-distribution atom, an initial seed containing the out-of-distribution atom and its neighboring atoms is cut from the complete system according to the preset initial cutting radius, with the location of the out-of-distribution atom as the center.
[0090] The second stage is buffer growth. Based on the initial seed, atoms are added layer by layer outward according to a preset buffer expansion strategy, forming an expanded substructure surrounding the distributed atoms. The expansion scale of the buffer is adjustable in different spatial directions, allowing for anisotropic expansion methods to be adopted for different local environmental characteristics.
[0091] The third stage is window-based scoring. After the buffer growth is complete, a window is formed for each extended substructure, the score of each window is evaluated, and the configuration with the best score is selected as the local substructure to be refined.
[0092] For ease of understanding, Figure 4The diagram illustrates another process in an adaptive training framework according to some embodiments of the present invention.
[0093] Figure 4 The adaptive training framework shown includes prior library construction 410 and adaptive update 420. However, it should be understood that this illustration is not intended to limit the scope of the invention, and the adaptive training framework according to the invention may also exclude prior library construction 410 and only include adaptive update 420, as described above. Figure 1 Described.
[0094] In the prior library construction 410, the base model is obtained using the original dataset as the training dataset. This base model has a frozen encoder. In other words, the parameters of the encoder of the base model remain fixed. The original dataset can be input into the frozen base model to construct a prior library for element-wise classification. The prior library can include multiple prototype clusters for each element.
[0095] In Adaptive Update 420, for each iteration, the local context of the input data is fed into the frozen encoder to identify out-of-distribution atoms that deviate from both the prior library and the learned coverage library from the local context. Local substructures are extracted centered on these out-of-distribution atoms, and the core regions of these substructures are fixed. An online model (which can correspond to the combination of...) is then used. Figure 1 The potential function model 110 (the encoder of the online model has the same parameters as the frozen encoder) is used to perform structural relaxation on the shell region of the substructure to obtain a refined local substructure.
[0096] First-principles calculations based on density functional theory (DFT) can be used to annotate the refined local substructures, obtaining associated energies, forces, and optional stresses. These data are then used to intermittently update the online model. In each iteration, the output of the online model is subjected to molecular dynamics analysis to obtain three-dimensional structural data, including the local environment, for use as input to the next iteration.
[0097] According to one aspect of the present invention, a method for training a potential function model is provided.
[0098] Figure 5 This is a flowchart of a method for training a potential function model according to some embodiments of the present invention.
[0099] In some embodiments, the method may include step S1: using an encoder to perform embedding extraction on the input data of the current iteration to obtain a local embedding vector. The input data may reflect the three-dimensional structure of the atom.
[0100] In some embodiments, the method may include step S2: evaluating the degree of deviation of local embedding vectors relative to a prior library and a learned coverage library. The prior library may be constructed based on an underlying training dataset. The learned coverage library may be constructed based on substructures annotated during training.
[0101] In some embodiments, the method may include step S3: determining out-of-distribution atoms in the input data based on the degree of deviation.
[0102] In some embodiments, the method may include step S4: cutting out local substructures centered on the distributed outer atoms.
[0103] In some embodiments, the method may include step S5: refining the local substructure based on the potential function model to obtain the refined local substructure.
[0104] In some embodiments, the method may include step S6: performing first-principles annotation on the refined local substructure to obtain atomic-level properties associated with the refined local substructure.
[0105] In some embodiments, the method may include step S7: saving the refined local substructure and the atomic-level properties associated with the refined local substructure as the latest labeled sample to the buffered training dataset.
[0106] In some embodiments, the method may include step S8: training the potential function model using a buffered training dataset according to a preset strategy.
[0107] The potential function model can generate atomic-level properties associated with the current iteration based on the input data in the current iteration. The atomic-level properties associated with the current iteration can be used as input data for the next iteration through molecular dynamics analysis.
[0108] Steps S1-S8 can, for example, be combined with... Figure 4 The adaptive update 420 corresponds to this, but the present invention is not limited thereto.
[0109] Some embodiments provide a priori-guided adaptive update method that, based on the element conditional latent prior library of the base model, scores the local environment of each atom online during the simulation process, identifies high-risk local environments that deviate from the prior coverage and the learned coverage, performs restricted refinement and high-precision quantum annotation only on the substructures corresponding to these local environments, and uses the newly added annotated data to update the potential function model in a closed loop, thereby reducing the cost of high-precision annotation and improving the accuracy, stability, relevance, and continuous availability of large-scale atom simulations.
[0110] Some implementations use a frozen encoder and a fixed underlying prior library for anomaly detection, which does not change the underlying prior reference frame due to updates to the online potential function model, making them more suitable for long-term online deployment. Some implementations use local substructures rather than the entire structure as annotation objects, enabling high-precision computations to be concentrated on truly high-risk local environments, significantly reducing annotation costs.
[0111] Some implementations employ mechanisms such as sampling triggering, local segmentation, parallel annotation, and batch fine-tuning to enable the basic model to be continuously corrected online in large-scale, long-term simulations. In some implementations, the basic prior library reflects the existing knowledge coverage of the basic model, while the learning coverage library reflects the knowledge coverage absorbed by the current task. The combination of these two approaches helps to achieve both the retention of basic transfer capabilities and rapid adaptation to the current task.
[0112] In some embodiments, the local embedding vector may be a first local embedding vector. In some embodiments, the parameters of the encoder may be fixed in multiple iterations.
[0113] In some embodiments, the method may optionally further include step S9: using an encoder to embed and extract basic training data from the basic training dataset to construct a prior library according to element types, wherein the basic training data reflects the three-dimensional structure of atoms.
[0114] Step S9, for example, can be with Figure 4 The prior library construction in 410 corresponds to this, but the present invention is not limited thereto.
[0115] In some embodiments, the method may optionally further include step S10: updating the learning coverage library based on the refined local substructure.
[0116] In some embodiments, step S6 is performed by invoking a first-principles calculation program.
[0117] In some embodiments, the buffered training dataset may include a replay subset of the latest labeled samples and historical samples. The replay subset may be obtained by sampling historical samples according to their importance based on historical error and temperature decay mechanisms.
[0118] In some embodiments, the preset strategy may include at least one of the following: the number of the latest labeled samples in the buffered training dataset reaches a preset update threshold; the error of the latest labeled samples in the buffered training dataset exceeds a preset error threshold.
[0119] In some embodiments, the encoder may be derived from a base training dataset. In some embodiments, the encoder may be a graph neural network encoder.
[0120] The following will combine Figures 6-9 Detailed description Figure 5The specific implementation details of the method in the text.
[0121] Figure 6 This is a flowchart of a first process associated with a method for training a potential function model according to some embodiments of the present invention. This first process may be... Figure 5 The specific implementation of step S9 in the method is described, but the scope of the present invention is not limited thereto.
[0122] In some embodiments, the first process may include step S91: using an encoder to perform embedding extraction on the basic training data to obtain a second local embedding vector.
[0123] In some embodiments, the first process may include step S92: grouping the second local embedding vectors according to element type, and performing clustering on the second local embedding vectors of each element to obtain multiple prototype centers.
[0124] In some embodiments, the first process may include step S93: calculating a scale parameter for the cluster associated with each prototype center. The scale parameter may include one or more of the following: radius, quantile radius, or other one-dimensional scale.
[0125] In some embodiments, the first process may include step S94: saving the prototype center and scale parameters for each element as a priori library.
[0126] Figure 7 This is a flowchart of a second process associated with a method for training a potential function model according to some embodiments of the present invention. This second process may be... Figure 5 The specific implementation of steps S2 and S3 in the method is described, but the scope of the present invention is not limited thereto.
[0127] In some embodiments, the second process may include step S21: calculating a first deviation score for each atom in the input data relative to a prior library. The first deviation score may be associated with the normalized distance from the atom's local embedding vector to the nearest prototype center of the same element in the prior library.
[0128] In some embodiments, the second process may include step S22: calculating a second deviation score for each atom in the input data relative to the learned coverage library. The second deviation score may be associated with the normalized distance from the local embedding vector of that atom to the nearest prototype center of the same element in the learned coverage library.
[0129] In some embodiments, the second process may include step S31: comparing a first deviation score with a first preset threshold, and comparing a second deviation score with a second preset threshold.
[0130] In some embodiments, the second process may include step S32: in response to a first deviation score being greater than a first preset threshold and a second deviation score being greater than a second preset threshold, the atom is determined to be an out-of-distribution atom.
[0131] Figure 8 This is a flowchart of a third process associated with a method for training a potential function model according to some embodiments of the present invention. This third process may be... Figure 5 The specific implementation of steps S4 and S5 in the method is described, but the scope of the present invention is not limited thereto.
[0132] In some embodiments, the third process may include step S41: for each out-of-distribution atom, establishing a neighborhood of that out-of-distribution atom under periodic boundary conditions.
[0133] In some embodiments, the third process may include step S42: cutting local substructures in the neighborhood according to a preset cutting strategy. The local substructure may include a core region surrounding the distributed outer atoms and a shell region extending around the core region. In embodiments, the preset cutting strategy may include an anisotropic buffer cutting strategy.
[0134] In some embodiments, the third process may include step S51: fixing the atoms in the core region.
[0135] In some embodiments, the third process may include step S52: structural relaxation of the atoms in the shell region based on a potential function model.
[0136] In some embodiments, the third process may include step S53: in response to force convergence satisfying a preset threshold or reaching the maximum number of iterations, stopping structural relaxation to obtain a refined local substructure.
[0137] In some embodiments, the third process may include step S54: outputting a refined local substructure. In embodiments, structural relaxation is quasi-Newtonian relaxation or fast inertial relaxation.
[0138] Figure 9 This is a flowchart of a fourth process associated with a method for training a potential function model according to some embodiments of the present invention. This fourth process may be... Figure 5 The specific implementation of step S10 in the method is described, but the scope of the present invention is not limited thereto.
[0139] In some embodiments, the fourth process may include step S101: using an encoder to perform embedding extraction on a subset of the input data to obtain a third local embedding vector. The subset of input data may be associated with a refined local substructure.
[0140] In some embodiments, the fourth process may include step S102: adding the third local embedding vector to the learning coverage library.
[0141] In some embodiments, the fourth process may include step S103: calculating the distance between each third local embedding vector and an existing prototype in the learning coverage library.
[0142] In some embodiments, the fourth process may include step S104: in response to a distance greater than a preset merging threshold, setting the third local embedding vector as a new prototype.
[0143] Some implementations introduce a learning coverage library to establish in-task memory for already labeled and absorbed local environments, avoiding repeated entry of similar environments into the high-precision annotation process. Some implementations perform restricted structure refinement with core region fixed and shell region relaxed before first-principles annotation, thereby reducing boundary distortion and improving the physical rationality of local samples.
[0144] According to another aspect of the present invention, a computing device for atomic simulation is provided.
[0145] Figure 10 This is a block diagram of a computing device 1000 for atomic simulation according to some embodiments of the present invention.
[0146] The computing device 1000 includes computing resources 1010, a potential function model 110, and molecular dynamics analysis tools 1030. The potential function model 110 can be implemented using the methods described above. Figures 5-9 The methods or processes described are used for training. In some embodiments, the potential function model 110 can be configured to invoke computational resources 1010 to generate, in each iteration, atomic-level properties associated with the three-dimensional structure based on input data reflecting the three-dimensional structure of the atoms.
[0147] In some embodiments, the molecular dynamics analysis tool 1030 can be configured to invoke computing resources 1010 to perform molecular dynamics analysis on the atomic-level properties generated by the potential function model 110 in each iteration, to obtain output data representing the three-dimensional structure associated with that iteration. In some embodiments, the output data associated with multiple iterations of the potential function model 110 is used to compose a dynamic trajectory.
[0148] According to another aspect of the present invention, a computer-readable storage medium is provided.
[0149] Figure 11 This is a block diagram of a computer-readable storage medium 1100 according to some embodiments of the present invention.
[0150] A computer-readable storage medium 1100 stores a computer program 1150. When executed by a processor, the computer program 1150 implements the above-mentioned... Figures 5-9 The steps of each method or process described.
[0151] According to another aspect of the present invention, a computer program product is provided.
[0152] Figure 12 This is a block diagram of a computer program product 1200 according to some embodiments of the present invention.
[0153] Computer program product 1200 may include computer program 1150. Computer program 1150, when executed by a processor, implements the above-mentioned... Figures 5-9 The steps of each method or process described.
[0154] The various aspects of the present invention have been described above through exemplary embodiments. However, it should be understood that various modifications can be made to the above exemplary embodiments without departing from the spirit and scope of the invention. Accordingly, these modified embodiments also fall within the protection scope of the claims.
Claims
1. A method for training a potential function model, the potential function model comprising an encoder, characterized in that, The method includes the following steps: S1: The encoder is used to extract the embeddings from the input data of the current iteration to obtain a local embedding vector, wherein the input data reflects the three-dimensional structure of the atom; S2: Evaluate the deviation of the local embedding vector relative to a prior library and a learned cover library, wherein the prior library is constructed based on a base training dataset and the learned cover library is constructed based on substructures labeled during training, wherein S2 includes: S21: Calculate a first deviation score for each atom in the input data relative to the prior library, the first deviation score being associated with the normalized distance from the atom's local embedding vector to the nearest prototype center of the same element in the prior library. S22: Calculate a second deviation score for each atom in the input data relative to the learning coverage library, the second deviation score being associated with the normalized distance from the local embedding vector of the atom to the nearest prototype center of the same element in the learning coverage library; S3: Determine the out-of-distribution atoms in the input data based on the degree of deviation, wherein S3 includes: S31: Compare the first deviation score with a first preset threshold, and compare the second deviation score with a second preset threshold. S32: In response to the first deviation score being greater than the first preset threshold and the second deviation score being greater than the second preset threshold, the atom is determined to be the out-of-distribution atom; S4: Cut out local substructures centered on the aforementioned outer atoms; S5: Based on the potential function model, refine the local substructure to obtain the refined local substructure; S6: Perform first-principles annotation on the refined local substructure to obtain atomic-level properties associated with the refined local substructure; S7: Save the refined local substructure and the atomic-level attributes associated with the refined local substructure as the latest labeled samples to the buffered training dataset; and S8: Train the potential function model using the buffered training dataset according to a preset strategy. The potential function model generates atomic-level properties associated with the current iteration based on the input data in the current iteration, and the atomic-level properties associated with the current iteration are used to obtain input data for the next iteration through molecular dynamics analysis.
2. The method according to claim 1, characterized in that, The local embedding vector is the first local embedding vector; The encoder's parameters are fixed across multiple iterations, and the method further includes: S9: The encoder is used to embed and extract basic training data from the basic training dataset to construct the prior library according to element types. The basic training data reflects the three-dimensional structure of atoms. S9 includes: S91: The encoder is used to extract the embeddings from the basic training data to obtain a second local embedding vector; S92: Group the second local embedding vectors according to the element type, and perform clustering on the second local embedding vectors of each element to obtain multiple prototype centers; S93: For each prototype center, calculate the scale parameter of the cluster associated with that prototype center, said scale parameter including one or more of the following: radius, quantile radius, or other one-dimensional scale; and S94: Save the prototype center and scale parameters for each element as the prior library.
3. The method according to claim 1, characterized in that, S4 includes: S41: For each out-of-distribution atom, establish its neighborhood under periodic boundary conditions; and S42: According to a preset cutting strategy, the local substructure is cut out in the neighborhood, the local substructure including a core region surrounding the distributed outer atoms and a shell region extended around the core region.
4. The method according to claim 3, characterized in that, The preset segmentation strategy includes an anisotropic buffer segmentation strategy.
5. The method according to claim 3, characterized in that, S5 includes: S51: Fix the atoms in the core region; S52: Perform structural relaxation on the atoms in the outer shell region based on the potential function model; S53: In response to force convergence satisfying a preset threshold or reaching the maximum number of iterations, stop the structural relaxation to obtain the refined local substructure; and S54: Output the refined local substructure.
6. The method according to claim 5, characterized in that, The structural relaxation is either quasi-Newtonian relaxation or rapid inertial relaxation.
7. The method according to claim 1, characterized in that, S6 is executed by calling the first-principles calculation program.
8. The method according to claim 1, characterized in that, The local embedding vector is the first local embedding vector, and The method further includes: S10: Update the learning coverage library based on the refined local substructure. S10 includes: S101: The encoder is used to perform embedding extraction on a subset of the input data to obtain a third local embedding vector, wherein the subset of the input data is associated with the refined local substructure; S102: Add the third local embedding vector to the learning coverage library; S103: Calculate the distance between each third local embedding vector and the existing prototypes in the learning coverage library; and S104: In response to the distance being greater than a preset merging threshold, the third local embedding vector is set as a new prototype.
9. The method according to claim 1, characterized in that, The buffered training dataset includes the latest labeled samples and a replay subset of historical samples, wherein the replay subset is obtained by importance sampling of the historical samples according to historical error and temperature decay mechanisms.
10. The method according to claim 1, characterized in that, The preset strategy includes at least one of the following: The number of the latest labeled samples in the buffered training dataset reaches a preset update threshold; The error of the latest labeled sample in the buffered training dataset exceeds a preset error threshold.
11. The method according to claim 1, characterized in that, The encoder is obtained based on the base training dataset.
12. The method according to claim 1, characterized in that, The encoder is a graph neural network encoder.
13. A computing device for atomic simulation, comprising: Computing resources; The potential function model trained using the method described in any one of claims 1-12 is configured to invoke the computational resources in each iteration: Atom-level properties associated with the three-dimensional structure are generated based on input data that reflects the three-dimensional structure of atoms. as well as Molecular dynamics analysis tools, configured to invoke the computing resources, to: Molecular dynamics analysis is performed on the atomic-level properties generated by the potential function model in each iteration to obtain output data representing the three-dimensional structure associated with that iteration. The output data associated with multiple iterations of the potential function model is used to form a dynamic trajectory.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-12.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-12.
Citation Information
Patent Citations
Data sampling method for fine tuning of large model of machine learning potential function
CN121148563A