A model training method and device

CN120893523BActive Publication Date: 2026-09-25SHANGHAI XIYU TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510996809.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2026-09-25
Estimated Expiration
2045-07-18

AI Technical Summary

Technical Problem

[0003]现有技术通常由统一训练脚本进行模型训练和模型测试的调度,实现模型训练和模型测试的串行执行,紧密耦合,但是增加了统一训练脚本在任务调度和资源分配方面的负担,容易引发资源瓶颈,降低模型训练效率

Benefits of technology

[0013]本发明实施例的技术方案,通过获取模型测试计划和目标训练模型的当前训练状态,判断目标训练模型是否满足模型测试条件,在满足模型测试条件时,对目标训练模型进行复制,得到至少一个目标测试模型,对目标训练模型进行模型训练,同时,对目标测试模型异步并行进行模型测试,根据模型测试结果判断是否完成对目标训练模型的模型训练。解决了现有技术的模型训练和模型测试方式,容易引发资源瓶颈,降低模型训练效率,甚至导致内存溢出,使得模型训练、模型测试失败的问题,通过异步并行执行模型测试的方式,最大化利用空闲时间或空闲资源,提高了资源利用率,提高了模型训练效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120893523B_ABST
    Figure CN120893523B_ABST
Patent Text Reader

Abstract

The application discloses a model training method and device, the method comprises the following steps: determining whether a target training model meets a model test condition according to a model test plan and a current training state of the target training model; if yes, copying the target training model to obtain at least one target test model; training the target training model, and testing the target test model asynchronously and in parallel according to a model test result to determine whether the model training of the target training model is completed. The application can improve resource utilization and model training efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of model training technology, and in particular to a model training method and apparatus. Background Technology

[0002] Training natural language processing (NLP) models typically involves multiple complex training steps, and the training datasets are usually large, consuming significant computing power, memory, and other hardware resources. However, the performance of NLP models is not necessarily improved by having more training steps. Therefore, it is necessary to perform model performance testing after each training step to monitor performance changes during the training process.

[0003] Existing technologies typically use a unified training script to schedule model training and testing, achieving serial execution of these two processes with tight coupling. However, this increases the burden on the unified training script in terms of task scheduling and resource allocation, easily leading to resource bottlenecks and reduced model training efficiency. Especially in scenarios with large training and / or test datasets, this can easily cause memory overflow, resulting in model training and testing failures, reduced model training stability, and further reduced model training efficiency. Summary of the Invention

[0004] This invention provides a model training method and apparatus to improve resource utilization and model training efficiency.

[0005] In a first aspect, embodiments of the present invention provide a model training method, the method comprising:

[0006] Based on the model testing plan and the current training status of the target training model, determine whether the target training model meets the model testing conditions;

[0007] If the conditions are met, the target training model is copied to obtain at least one target test model;

[0008] The target training model is trained, and the target test model is tested asynchronously and in parallel. The model training of the target training model is then determined based on the test results.

[0009] Secondly, embodiments of the present invention also provide a model training apparatus, the apparatus comprising:

[0010] The model testing condition judgment module is used to determine whether the target training model meets the model testing conditions based on the model testing plan and the current training state of the target training model.

[0011] The target training model copying module is used to copy the target training model if certain conditions are met, so as to obtain at least one target test model.

[0012] The parallel training and testing module is used to train the target training model and simultaneously test the target test model asynchronously and in parallel. The module determines whether the training of the target training model is complete based on the test results.

[0013] The technical solution of this invention obtains the model testing plan and the current training state of the target training model, determines whether the target training model meets the model testing conditions, and if the conditions are met, replicates the target training model to obtain at least one target test model. The target training model is then trained, and simultaneously, the target test model is asynchronously and in parallel tested. The model training of the target training model is then determined based on the test results. This solves the problem that existing model training and testing methods easily lead to resource bottlenecks, reduced model training efficiency, and even memory overflow, causing model training and testing failures. By executing model testing asynchronously and in parallel, idle time or resources are maximized, improving resource utilization and model training efficiency.

[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart of a model training method provided in Embodiment 1 of the present invention;

[0017] Figure 2 This is a flowchart of a model training method provided in Embodiment 2 of the present invention;

[0018] Figure 3 This is a schematic diagram of the structure of a model training device provided in Embodiment 3 of the present invention;

[0019] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation

[0020] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices. In the embodiments of this application, certain software, components, models, and other existing industry solutions may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions.

[0022] The acquisition, transmission, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.

[0023] Example 1

[0024] Figure 1 The flowchart of a model training method is provided in Embodiment 1 of the present invention. This embodiment is applicable to model training. The method can be executed by a model training device, which can be implemented in hardware and / or software and can be configured in a server.

[0025] like Figure 1 As shown, the method includes:

[0026] S110. Based on the model testing plan and the current training status of the target training model, determine whether the target training model meets the model testing conditions.

[0027] The model testing plan refers to the testing plan that must be followed when testing the target trained model. The model testing plan may include the type and size of the model testing dataset, the model testing cycle, and the model training phases that match the model testing cycle. The model testing cycle refers to the model testing frequency, that is, the interval between two consecutive model tests. The model testing frequency may differ for different model training phases. The model training phases can be divided according to the training steps of the target trained model.

[0028] The target training model refers to the model currently undergoing training. The current training state can include the current training step and real-time training information. Real-time training information can include the training time elapsed for the current training step and the current training stage. A training step, or batch, of the target training model completes one batch after performing a forward computation and parameter update on each training data point in the input training dataset. A training step, or batch, includes multiple batch training stages, such as forward computation and parameter updates. Forward computation can also include multiple computation loops, which will not be discussed further here.

[0029] Whether the target training model meets the model testing conditions can be determined based on the model testing cycle in the model testing plan and the current training step of the target training model. Specifically, since the model testing cycle is the model testing frequency corresponding to different model training stages, and model training stages can be divided according to the training steps of the target training model, the model testing frequency corresponding to the current training step can be determined based on the model testing cycle in the current training stage. For example, the model testing cycle in the model testing plan and its matching model training stage could be: the 0th to 50th batches of the target training model as the first model training stage, and the model testing frequency corresponding to this model training stage could be once every 5 batches. Further, the model testing conditions are determined based on the current training step of the target training model. For example, if the current training step of the target training model is the 5th batch, and the current batch training stage has already completed the parameter update stage for all training data in the training dataset, then the target training model meets the model testing conditions.

[0030] It should be noted that when representing each model testing period of the target model testing plan according to the training steps (Batch) of the target training model, in an optional embodiment, the training step intervals corresponding to each model testing period can be the same or different. The length of the training step interval corresponding to each model testing period is not limited; it can be 1, for example, one Batch interval constitutes one model testing period, or it can be an integer greater than 1, for example, five Batch intervals constitute one model testing period, and so on.

[0031] In another optional embodiment, the model testing plan may include different model testing cycles. Understandably, as the number of training steps increases, the model testing cycle can be gradually shortened, thereby increasing the model testing density. This setup ensures that the model training effect can be monitored in a timely manner during the mid-to-late stages of model training, avoiding performance degradation caused by overfitting and thus preventing waste of computing resources. For example, the first model testing phase could be set as batches 0-50, with model testing performed every 5 batches; the second model testing phase as batches 51-80, with model testing performed every 3 batches; the third model testing phase as batches 81-100, with model testing performed every 2 batches; the fourth model testing phase as batches 101-110, with model testing performed every 1 batch, and so on.

[0032] In this embodiment, the model testing conditions are determined by the model testing plan and the current training state of the target training model. The model testing plan determines the model testing frequency corresponding to different model testing stages of the target training model, and thus, combined with the current training step in the current training state, determines the model testing frequency corresponding to the current model testing stage. The current training state of the target training model serves two purposes: firstly, it allows for the determination of the model testing frequency corresponding to the current model testing cycle; secondly, it is understood that model testing is triggered when a certain training step is completed.

[0033] Furthermore, determining whether the target training model meets the model testing conditions can include:

[0034] S1. Based on at least one of the model attributes, model training type, and target training task type of the target training model, determine the target model test plan corresponding to the target training model from at least two candidate model test plans;

[0035] S2. Based on the model testing cycle in the target model testing plan and the current training step in the current training state of the target training model, determine whether the target training model meets the model testing conditions.

[0036] The model attributes can include model parameter size, model structure, and model modality. The model training type can include pre-training, supervised fine-tuning, and reinforcement learning post-training. There are many ways to classify the target training task type. According to the output format, it can be divided into inference tasks and generation tasks. According to the training data type, it can be divided into unimodal tasks (images, speech, or text, etc.) and multimodal tasks.

[0037] Understandably, different trained models have different model attributes, training types, and target training task types, resulting in differences in the type, size, total training batches, and number of training data points per batch required for model training. Correspondingly, the type and size of the test dataset, the total number of tests, and the density of tests required for different trained models also vary. Therefore, corresponding candidate model testing plans can be set up for different target trained models to adapt to their model attributes, training types, and target training task types.

[0038] In this embodiment, a target model test plan matching the target training model is first selected from a pre-set pool of candidate model test plans based on at least one parameter of the target training model. Then, by combining the model test cycle in the target model test plan with the current training step of the target training model, it is determined whether the target training model meets the model test conditions.

[0039] This embodiment pre-sets different model testing plans for different training models, which can improve the applicability of model testing to different training models, thereby improving model training efficiency.

[0040] Furthermore, S2 can include:

[0041] S21. In at least two model testing cycles of the target model testing plan, determine the current model testing cycle based on the current training step of the target training model;

[0042] S22. Based on the current model testing cycle, the current training step of the target training model, and the interval between the previous testing step, determine whether the target training model meets the model testing conditions.

[0043] Specifically, since different training stages may correspond to different model testing cycles, and training stages are divided according to the training steps of the target training model, determining the current training stage based on the current training step in the current training state of the target training model allows us to determine the current model testing cycle corresponding to the current training stage within each model testing cycle of the target model testing plan. For example, if the current model training stage is Batch 0-50, the corresponding current model testing cycle is one model testing task executed every 5 batches.

[0044] The interval between the current time and the previous test step can be either the time interval between the current time and the completion of the previous test step, or the step interval between the current training step and the historical training step corresponding to the start of the previous test step.

[0045] After determining the current model testing period, it can be determined whether the next model test needs to be executed based on the current training step and the previous testing step. Specifically, the step interval between the current training step and the historical training steps corresponding to the start of the previous testing step is calculated, and it is determined whether the step interval matches the current model testing period, that is, whether the step interval is equal to the current model testing period. If so, it is determined that the target training model meets the model testing conditions.

[0046] In a specific example, taking the current model testing cycle as executing a model testing task once every 5 batches, if the current training step is the 5th batch and no testing step has been executed yet, then the target trained model meets the model testing conditions and can execute subsequent model tests; if the current training step is the 10th batch, the step interval between the current training step and the historical training step (the 5th batch) corresponding to the start of the previous testing step is 5 batches, which matches the current model testing cycle. At this time, the target trained model meets the model testing conditions and can execute subsequent model tests.

[0047] S120. If satisfied, the target training model is copied to obtain at least one target test model.

[0048] Once the target training model meets the model testing conditions, it is replicated, and its parameters are fixed to obtain the target test model. The performance of the target training model at this stage is then tested using the target test model.

[0049] The number of target test models can be one or at least two. Understandably, deploying additional target test models consumes memory; therefore, a smaller number of target test models reduces the consumption of memory and computing resources. A larger number of target test models allows for distributed execution of model tests, resulting in shorter testing times and higher efficiency.

[0050] In this embodiment, the number of target test models can be flexibly adjusted according to the actual needs of model testing or different model testing cycles, so as to adapt to the different needs of resource consumption and testing time in different model testing cycles.

[0051] Furthermore, based on the existing unified training script execution model training control and resource scheduling, an additional model testing service can be set up to control and schedule resources to perform model testing on the target test model.

[0052] In this embodiment, based on the model testing plan and the current training state of the target training model, when it is determined that the target training model meets the model testing conditions, the target training model is copied, and the copied target test model is tested. This decouples model testing from model training, ensuring that model testing does not affect the progress of model training, does not add extra scheduling and control pressure to the unified training script, reduces the risk of memory overflow, and improves model training efficiency and the stability of the target training model.

[0053] S130. Train the target training model and simultaneously test the target test model asynchronously in parallel. Determine whether the training of the target training model is complete based on the test results.

[0054] In this embodiment, model training of the target training model and model testing of the target test model are performed asynchronously and in parallel. It should be noted that performing model testing based on the target test model and performing model training on the target training model are two decoupled processes. During the process of determining whether the target training model meets the model testing conditions and copying the target training model in S110-S120, the target training model is still in the normal training process.

[0055] In this embodiment, model training and model testing are executed asynchronously and in parallel. The model testing service can utilize idle time during the model training process, and / or other computing resources besides those used for model training, to perform model testing tasks on the target test model. For example, a batch includes multiple forward computation phases and parameter update phases. During the parameter update phase, computing resources are relatively idle; therefore, the idle time during the parameter update phase of the model training process can be used to execute model testing tasks. Simultaneously, some idle computing resources, such as the computing resources of some graphics cards whose computing power is insufficient to support model training, can be used for model testing.

[0056] In this embodiment, model training and model testing are executed asynchronously and in parallel. The model testing task is performed using idle time or idle computing resources. This does not affect the normal progress of model training, and there is no need to wait for the model testing to be completed before the next batch of model training is carried out, which improves the efficiency of model training. At the same time, it maximizes the use of idle time and idle resources during model training, improves the utilization rate of computing resources, and ensures the efficiency of model testing.

[0057] In an optional embodiment, determining whether the model training of the target training model is complete based on the model test results may include: if it is determined that the model test results meet the first model training completion condition, then the model parameters corresponding to the target test model are used as the model parameters of the target training model to complete the model training.

[0058] The model testing results can be represented by a single-dimensional model testing performance metric or by a fusion of multiple-dimensional model testing performance metrics. Model testing performance metrics can include accuracy, precision, recall, F1 score, loss function value, n-gram matching rate, mean squared error, and mean absolute error. The fusion of multiple-dimensional model testing performance metrics can be a weighted sum of at least two of the above metrics. It is important to note that for accuracy, precision, recall, F1 score, and n-gram matching rate, higher values ​​indicate better model performance, while for loss function value, mean squared error, and mean absolute error, lower values ​​indicate better model performance. Therefore, when fusing multiple-dimensional model testing performance metrics, the relationship between each metric and model performance must be considered. For example, when fusing precision, accuracy, and loss function value, a weighted sum of precision, accuracy, and 1 minus the loss function value can be used; the calculated model testing result is positively correlated with model performance.

[0059] If the model test results meet the first condition for model training completion, and the numerical value of the model test results is positively correlated with model performance, then the model test results can be greater than or equal to the first threshold. If the numerical value of the model test results is negatively correlated with model performance, then the model test results can be less than or equal to the second threshold.

[0060] In another optional embodiment, determining whether the model training of the target training model is completed based on the model test results may further include: determining the variation pattern of the test results based on the current model test results and at least one historical model test results; if the variation pattern of the test results is determined to meet the second model training completion condition, then determining the target test result from the current model test results and at least one historical model test results, and using the model parameters of the target test model corresponding to the target test result as the model parameters of the target training model to complete the model training.

[0061] The variation pattern of test results can be represented by a test result curve. Specifically, the test result curve is plotted based on the current model test results and the current time, as well as at least one historical model test result and the historical time when the historical model test results were obtained.

[0062] It should be noted that when determining whether the model has completed training based on the variation pattern of the test results, the model parameters of the target test model that match the test results of each model need to be saved so that the optimal model parameters can be determined later as the final model parameters for completing training.

[0063] The pattern of test result changes satisfying the second condition for completing model training can be defined as the growth trend of the test result curve slowing down or stabilizing. Specifically, this could mean the slope of the test result curve is less than a first preset slope, or the duration of the slope being less than a second preset slope is greater than or equal to a preset time threshold. In this case, the model test results tend to stabilize, and further training offers limited improvement to model performance; therefore, continuing training is not cost-effective, and model training can be completed. At this point, the current model test result can be used as the target test result, and the model parameters of the target test model corresponding to the current model test result can be used as the model parameters of the target training model.

[0064] The pattern of test result changes must satisfy the second condition for model training completion. Alternatively, the test result curve can show a downward trend. Specifically, the slope of the test result curve can be less than 0, whether the model performance suddenly drops or continues to drop. In this case, it indicates that the model performance is declining as training continues, and model training can be completed. At this point, the last model test result before the initial moment when the slope of the test result curve is less than 0 can be taken as the target test result, and the model parameters of the target test model corresponding to the target test result can be taken as the model parameters of the target training model.

[0065] Furthermore, after asynchronously and in parallel testing the target test model and obtaining the current model test result, the process further includes: if it is determined that the current model test result meets the first model test cycle adjustment condition, or if the absolute value of the difference between the current model test result and at least one historical model test result meets the second model test cycle adjustment condition, then the model test cycle in the target model test plan is adjusted; based on the adjusted model test cycle and the current training step in the current training state of the target training model, it is determined whether the target training model meets the model test conditions.

[0066] Understandably, although this embodiment sets up model testing plans that match the model attributes, model training type, and target training task type for different training models, the model testing cycle in the model testing plan can only serve as a general reference when the training model performs model testing. If the model testing results differ from expectations during actual model testing, the model testing cycle in the current target model testing plan can be flexibly adjusted to adapt to the actual situation of model testing and improve model training efficiency.

[0067] For example, if batches 0-50 are used as the first model training stage, batches 51-80 as the second model training stage, batches 81-100 as the third model training stage, batches 101-110 as the fourth model training stage, and so on, the model testing cycle for each training stage in the target model testing plan decreases and the testing frequency increases as the training stage progresses. When entering the next model training stage, the model testing frequency needs to be increased. However, if the model training results are not ideal at this point, it indicates that the target training model is still learning. To ensure model training efficiency, the model testing cycle in the target model testing plan needs to be adjusted, appropriately extending the model testing cycle and reducing the model testing frequency to reduce resource consumption caused by model testing and prioritize the model training process. If the model training results are ideal, it indicates that the performance of the target training model exceeds expectations. In this case, the model testing frequency can be increased or the model training frequency of the next model training stage can be applied earlier to accelerate the training process and avoid wasting computing resources by continuing training and testing according to the original target model testing plan.

[0068] Taking the positive correlation between the numerical value of the model test result and the model performance as an example, if the current model test result meets the adjustment conditions of the first model testing cycle, it can be that the model test result is greater than or equal to the first adjustment threshold (indicating that the model training effect exceeds expectations); or it can be that the model test result is less than or equal to the second adjustment threshold (indicating that the model training effect does not meet expectations). The first adjustment threshold is greater than the second adjustment threshold.

[0069] Furthermore, the first adjustment threshold and the second adjustment threshold can each be a set of values. That is, for different magnitudes of the current model test results, the model test cycle in the target model test plan can be adjusted by different amounts.

[0070] For example, taking the accuracy rate as the model test result, if the current accuracy rate is 98% at the end of the second model training phase, it indicates that the target training model is performing well. The batch range or model testing cycle for the third model training phase can be adjusted. For instance, it could be adjusted to 81-90 batches, and the model testing cycle could be changed from executing a model test task every two batches to executing a model test task every one batch. If the current accuracy rate is 70% in the third model training phase, it indicates that the target training model's performance is poor and requires a longer period of continuous learning. In this case, the batch range for the third model training phase can be adjusted to 81-150 batches, or the model testing cycle can be changed from executing a model test task every two batches to executing a model test task every three batches.

[0071] Specifically, the absolute value of the difference between the current model test result and at least one historical model test result satisfies the second model test cycle adjustment condition. This can mean that the absolute value of the difference between the current model test result and the historical model test result is greater than or equal to a preset absolute value difference threshold. It should be noted that the model test results being compared here must be consecutive model test results, or model test results with smaller absolute values ​​of difference between corresponding model test steps.

[0072] Specifically, if the absolute value of the difference between the current model test result and the historical model test result is greater than or equal to a preset absolute value threshold, it indicates that the fluctuations between the model test results are very drastic. In this case, the model testing cycle can be appropriately lengthened and the model testing frequency reduced to decrease resource consumption during model testing and allocate more resources to model training, thereby improving training efficiency. Conversely, if the absolute value of the difference between the current model test result and the historical model test result is less than the preset absolute value threshold, it indicates that the fluctuations between the model test results are stabilizing. In this case, the model testing cycle can be appropriately shortened and the model testing frequency increased to achieve the model training objective more quickly, reduce wasted computing resources, and improve training efficiency.

[0073] Furthermore, if the difference between the current model test result and the historical model test result is positive, it indicates that the target training model is still learning rapidly. In this case, the model testing cycle for the current model training phase in the target model testing plan can be extended, or the model testing frequency corresponding to the current model training phase can be reduced to reduce the resource consumption of model testing and allocate more resources to model training, thereby improving model training efficiency.

[0074] If the difference between the current model test result and the historical model test result is negative, it indicates that the target training model is deteriorating drastically. In this case, the testing frequency of the model at the current training stage can be increased to determine whether this drastic change in the model test result is normal data fluctuation or a model training failure. This avoids continuing training and testing according to the original plan when the model training fails, which would result in a larger waste of computing resources.

[0075] In this embodiment, the target model testing plan can be flexibly adjusted according to the real-time situation or changes in the model testing results, so that the model testing can adapt to the actual situation of model training to the greatest extent, improve resource utilization efficiency, and improve model training efficiency.

[0076] Furthermore, after asynchronously and in parallel testing the target test model and obtaining the current model test results, the process also includes: generating at least one parameter to adjust the weights based on the model test results; and adjusting the parameters of the target training model based on the parameter adjustment weights and at least one feedback value from the loss function, reward function, reward model, penalty function, and penalty model used in model training.

[0077] Parameter adjustment weights are used to represent the magnitude of adjustments made to the parameters of the target training model. Increasing the parameter adjustment weights can improve the learning speed of the target training model, while decreasing the parameter adjustment weights can prevent the model from overfitting.

[0078] The feedback value matches at least one of the following: model attributes of the target training model, model training type, and target training task type.

[0079] Based on the model test results, at least one parameter adjustment weight is generated. Specifically, a larger parameter adjustment weight can be set in the early stages of model training or when the model test results do not meet expectations (for example, if the numerical value of the model test result is positively correlated with model performance, it could be that the model test result is less than the first parameter weight adjustment threshold). A smaller parameter adjustment weight is set when the model test results meet expectations (for example, if the numerical value of the model test result is positively correlated with model performance, it could be that the model test result is greater than the second parameter weight adjustment threshold).

[0080] For example, in reinforcement learning post-training, each training data point in each step generates a predicted answer from the target training model. Then, at least one reward function compares the predicted answer with the standard answer, generating a reward value and / or a penalty value. For instance, a correct prediction earns a reward of 1, and an incorrect prediction earns a reward of 0. If the model test results show that the model performance is relatively weak and does not meet expectations, the weights can be adjusted by setting higher parameters to give the model a larger reward on correctly predicted training data, encouraging the target training model to quickly learn the features of correctly predicted data. Alternatively, the weights can be adjusted among multiple reward and penalty functions to achieve a balance, such as increasing the penalty for incorrect predictions. If the model test results indicate that the model performance meets expectations, the reward and / or penalty values ​​can be reduced by adjusting the weights to prevent overfitting.

[0081] In this embodiment, the parameter adjustment weights are flexibly adjusted based on the real-time results of the model test, thereby intervening in the parameter adjustment during the model training process. Throughout the entire model training stage, this can encourage the target training model with relatively weak model performance to learn quickly, and prevent overfitting of the target training model whose model performance has reached the expected level.

[0082] The technical solution of this invention obtains the model testing plan and the current training state of the target training model, determines whether the target training model meets the model testing conditions, and if the conditions are met, replicates the target training model to obtain at least one target test model. The target training model is then trained, and simultaneously, the target test model is asynchronously and in parallel tested. The model training of the target training model is then determined based on the test results. This solves the problem that existing model training and testing methods easily lead to resource bottlenecks, reduced model training efficiency, and even memory overflow, causing model training and testing failures. By executing model testing asynchronously and in parallel, idle time or resources are maximized, improving resource utilization and model training efficiency.

[0083] Example 2

[0084] Figure 2 This is a flowchart of a model training method provided in Embodiment 2 of the present invention. Based on the above embodiments, the present invention further specifies the model testing process.

[0085] like Figure 2 As shown, the method includes:

[0086] S210. Based on at least one of the model attributes, model training type, and target training task type of the target training model, determine the target model test plan corresponding to the target training model from at least two candidate model test plans.

[0087] S220. Based on the model testing cycle in the target model testing plan and the current training step in the current training state of the target training model, determine whether the target training model meets the model testing conditions.

[0088] The process of determining the target model test plan corresponding to the target training model, and the process of determining whether the target training model meets the model test conditions, have been described in the above embodiments, and will not be repeated here.

[0089] S230. If satisfied, then based on the target model test plan and the current training step in the current training state of the target training model, determine at least one test dataset and at least one task priority for model testing.

[0090] Since the model testing plan includes the type and size of the model test dataset and the model testing cycle, the same or different test datasets can be set for different model training stages; the same model training stage can correspond to one or more different test datasets. For example, the test dataset for the first model training stage can be test dataset A, the test dataset for the second model training stage can be test dataset B, the test dataset for the third model training stage can be test datasets A and B, and so on.

[0091] Task priorities can be represented as a hierarchy. When idle computing resources are available, the corresponding task is executed according to the task priority. It's important to note that for model training, the training dataset, task priorities, etc., can be pre-set fixed data. Model training continues based on the pre-set task priorities without waiting for model testing results. For example, the task priority for model training can be set to 5. For model testing, in the first model training phase, the task priority can be set to 1. Therefore, in this first model training phase, model testing is only executed according to the task priority during model training intervals or when current idle resources are insufficient for model training. In the third model training phase, the task priority can be set to 5. Therefore, in this third model training phase, model training and model testing can be executed synchronously to ensure that a model test is completed simultaneously with each step of model training.

[0092] Task priority can also be represented by the number of task executions within a unit period, where the unit period can be the model testing period. In the first model training phase, the model testing period is one test task completed every 5 steps of model training; in this case, the task priority for model testing can be set to 1. In the second model training phase, the model testing period is one test task completed every 3 steps of model training; in this case, the task priority for model testing can be set to 2. In the fourth model training phase, the model testing period is one test task completed every 1 step of model training; in this case, the task priority for model testing can be set to 5. The task priority for model testing can also be set to 6, indicating that a model test needs to be completed halfway through the model training process.

[0093] In this embodiment, the target model testing plan pre-sets corresponding test datasets and task priorities for different model training stages. Based on the current training step in the current training state of the target training model, the current model testing cycle, as well as the test dataset and task priorities for model testing, can be determined.

[0094] In this embodiment, when setting the task priority of model testing for different model training stages of the target model testing plan, it must match the model testing cycle and the model testing frequency corresponding to the model testing cycle.

[0095] Specifically, as the model training phase progresses, the priority of model testing tasks can be gradually increased. This ensures that in the early stages of model training, model testing tasks are performed during training breaks or when resources are idle. This approach does not affect model training efficiency while allowing for timely monitoring of training results, preventing excessive computational resources from being consumed by model testing and thus reducing training efficiency. Furthermore, in the later stages of model training, increasing the priority of model testing tasks allows for the early detection of convergence trends in model performance, enabling decisions to stop training or adjust the training plan. This avoids overfitting and performance degradation, thereby saving computational resources wasted on subsequent redundant training.

[0096] This embodiment provides a specific example of the model testing cycle and task priority corresponding to different model training stages: In the first model training stage, the model testing cycle is once every 5 batches, with the model training task having a priority of 5 and the model testing task having a priority of 1; In the second model training stage, the model testing cycle is once every 3 batches, with the model training task having a priority of 3 and the model testing task having a priority of 1; In the third model training stage, the model testing cycle is once every 2 batches, with the model training task having a priority of 2 and the model testing task having a priority of 1; In the fourth model training stage, the model testing cycle is once per batch, with the model training task having a priority of 1 and the model testing task having a priority of 1; In the fifth model training stage, the model testing cycle is once per batch, with the model training task having a priority of 1 and the model testing task having a priority of 2, meaning that model testing results must be obtained before a batch of model training is completed.

[0097] In this embodiment, since model training and model testing are two separately controlled tasks, under limited computing resources, assigning different task priorities to model training and model testing can achieve the effect of matching the progress of model training and model testing, while maximizing the utilization efficiency of computing resources.

[0098] S240. Based on at least one test dataset and at least one task priority for model testing, determine the target number of test models.

[0099] This embodiment also provides a scheme for determining the number of target test models based on the test dataset and task priority.

[0100] Understandably, deploying additional target test models consumes some memory. However, when there are a large number of target test models, distributed execution of model tests reduces testing time and increases efficiency. Therefore, the number of target test models can be determined based on task priorities and the size of the test dataset.

[0101] Specifically, taking the example of using the same test dataset for model testing across different model training stages, the more target test models there are, the less test data each target test model receives, enabling distributed model testing and improving testing efficiency. Therefore, if the task priority of the model testing task is low, a smaller number of target test models can be determined. This saves memory space and computing resources, prioritizing the execution of model training tasks and maximizing the utilization of fragmented computing resources, thus improving resource utilization. As the task priority of the model testing task increases, the number of target test models can be gradually increased, thereby ensuring model testing efficiency while conserving computing resources. However, when the task priority of the model testing task is high, especially in the example above where the priority of the model training task in the fifth model training stage is 1 and the priority of the model testing task is 2, a larger number of target test models needs to be set to achieve the fastest model testing efficiency.

[0102] S250. Based on the number of target test models, the target training model is replicated to obtain at least one target test model.

[0103] S260. Train the target training model and simultaneously perform asynchronous model testing on the target test model based on at least one test dataset and at least one task priority.

[0104] This embodiment provides a specific implementation method for asynchronous model testing of a target test model.

[0105] Specifically, asynchronous model testing of the target test model, based on at least one test dataset and at least one task priority, can include:

[0106] S261. Split at least one test dataset according to at least one task priority to obtain at least two test subsets, and set weights for each test subset;

[0107] S262. Based on at least one task priority and at least two test subsets, perform asynchronous model testing on at least one target test model to obtain preliminary test results for each test subset.

[0108] S263. Based on the preliminary test results of each test subset and the weights of each test subset, the model test results are obtained.

[0109] The weights of each test subset can be the same, or different weights can be set according to the source of the test data.

[0110] For example, if the test dataset includes 100 test data points, it can be divided into 10 test subsets, each containing 10 test data points, with a weight of 0.1.

[0111] Since the number of target test models is determined based on at least one test dataset and at least one task priority in different model testing cycles, in this embodiment, during different model training phases, each test subset is assigned to at least one target test model according to the number of target test models and the number of test subsets, and model testing is performed separately for each subset.

[0112] Based on the weights of each test subset, the preliminary test results of each test subset are weighted and summed to obtain the model test results corresponding to this model test task.

[0113] S270. Determine whether the training of the target training model is complete based on the model test results.

[0114] The technical solution of this invention selects the target model testing plan that best matches the target training model from multiple candidate model testing plans by using at least one parameter among the model attributes, model training type, and target training task type of the target training model. The current model testing cycle of the target training model is determined by the model testing cycle corresponding to different training stages in the target model testing plan and the current training step of the target training model. Then, based on the current model testing cycle, the current training step, and the interval with the previous testing step, it is determined whether the target training model meets the model testing conditions. When the model testing conditions are met, the test dataset and task priority for model testing are determined according to the target model testing plan and the current training step. Under limited computing resources, different task priorities are allocated to model training and model testing, achieving a match between the progress of model training and model testing, while maximizing the utilization efficiency of computing resources. Determining the number of target test models based on the test dataset and task priorities allows for a balance between computing resource utilization and model testing efficiency under different task priorities. The target training model is replicated according to the number of target test models to obtain the target test model. Model training and testing are performed in parallel. During model testing, the test dataset is distributed to each target test model to obtain the model test results. Finally, the model training is judged as complete based on the model test results. By executing model testing asynchronously and in parallel, idle time or idle resources are maximized, thereby improving resource utilization and model training efficiency.

[0115] Example 3

[0116] Figure 3 This is a schematic diagram of a model training device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes:

[0117] The model testing condition judgment module 310 is used to determine whether the target training model meets the model testing conditions based on the model testing plan and the current training state of the target training model.

[0118] The target training model copying module 320 is used to copy the target training model if the conditions are met, so as to obtain at least one target test model.

[0119] The parallel training and testing module 330 is used to train the target training model and simultaneously test the target test model asynchronously and in parallel. The model training of the target training model is determined based on the test results.

[0120] The technical solution of this invention obtains the model testing plan and the current training state of the target training model, determines whether the target training model meets the model testing conditions, and if the conditions are met, replicates the target training model to obtain at least one target test model. The target training model is then trained, and simultaneously, the target test model is asynchronously and in parallel tested. The model training of the target training model is then determined based on the test results. This solves the problem that existing model training and testing methods easily lead to resource bottlenecks, reduced model training efficiency, and even memory overflow, causing model training and testing failures. By executing model testing asynchronously and in parallel, idle time or resources are maximized, improving resource utilization and model training efficiency.

[0121] Based on the above embodiments, optionally, the model test condition judgment module 310 includes:

[0122] The target model test plan determination unit is used to determine the target model test plan corresponding to the target training model from at least two candidate model test plans based on at least one of the model attributes, model training type and target training task type of the target training model.

[0123] The model testing condition judgment unit is used to determine whether the target training model meets the model testing conditions based on the model testing cycle in the target model testing plan and the current training step in the current training state of the target training model.

[0124] Based on the above embodiments, optionally, the model test condition judgment unit is specifically used for:

[0125] In at least two model testing cycles of the target model testing plan, the current model testing cycle is determined based on the current training step of the target training model;

[0126] Based on the current model testing cycle, the current training step of the target training model, and the interval between the current and previous testing steps, determine whether the target training model meets the model testing conditions.

[0127] Optionally, based on the above embodiments, the apparatus further includes:

[0128] The test dataset and task priority determination unit is used to determine at least one test dataset and at least one task priority for model testing based on the target model test plan and the current training step.

[0129] Parallel training and testing module 330 includes:

[0130] An asynchronous model testing unit is used to perform asynchronous model testing on a target test model based on at least one test dataset and at least one task priority.

[0131] Based on the above embodiments, optionally, the asynchronous model testing unit is specifically used for:

[0132] Split at least one test dataset according to at least one task priority to obtain at least two test subsets, and assign weights to each test subset;

[0133] Based on at least one task priority and at least two test subsets, perform asynchronous model testing on at least one target test model to obtain preliminary test results for each test subset.

[0134] Based on the preliminary test results of each test subset and the weights of each test subset, the model test results are obtained.

[0135] Based on the above embodiments, optionally, the target training model replication module 320 includes:

[0136] The target test model number determination unit is used to determine the target test model number based on at least one test dataset and at least one task priority for model testing.

[0137] The target training model replication unit is used to replicate the target training model based on the number of target test models to obtain at least one target test model.

[0138] Based on the above embodiments, optionally, the parallel training and testing module 330 includes:

[0139] The first model training completion judgment unit is used to determine that if the model test result meets the first model training completion condition, the model parameters corresponding to the target test model are used as the model parameters of the target training model to complete the model training.

[0140] The test result variation pattern determination unit is used to determine the variation pattern of test results based on the current model test results and at least one historical model test results;

[0141] The second model training completion judgment unit is used to determine the target test result from the current model test result and at least one historical model test result if the change pattern of the test result meets the conditions for the completion of the second model training. The target test result is then used as the model parameters of the target training model to complete the model training.

[0142] Optionally, based on the above embodiments, the apparatus further includes:

[0143] The model test cycle adjustment judgment module is used to adjust the model test cycle in the target model test plan if it is determined that the current model test result meets the first model test cycle adjustment condition, or the absolute value of the difference between the current model test result and at least one historical model test result meets the second model test cycle adjustment condition.

[0144] The second model testing condition judgment module is used to determine whether the target training model meets the model testing conditions based on the adjusted model testing period and the current training step in the current training state of the target training model.

[0145] Optionally, based on the above embodiments, the apparatus further includes:

[0146] The parameter adjustment weight determination module is used to generate at least one parameter adjustment weight based on the model test results.

[0147] The target training model parameter adjustment module is used to adjust the parameters of the target training model based on the parameter adjustment weights and at least one feedback value from the loss function, reward function, reward model, penalty function, and penalty model in model training.

[0148] The model training apparatus provided in this embodiment of the invention can execute the model training method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0149] Example 4

[0150] Figure 4A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0151] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0152] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0153] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as model training methods.

[0154] In some embodiments, the model training method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the model training method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the model training method by any other suitable means (e.g., by means of firmware).

[0155] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0156] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable model training device, such that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0157] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0158] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0159] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0160] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0161] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0162] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A model training method, characterized in that, include: Based on the model testing plan and the current training state of the target training model, determine whether the target training model meets the model testing conditions, including: Based on at least one of the model attributes, model training type, and target training task type of the target training model, determine the target model test plan corresponding to the target training model from at least two candidate model test plans; Based on the model testing cycle in the target model testing plan and the current training step in the current training state of the target training model, determine whether the target training model meets the model testing conditions. If satisfied, then based on the target model test plan and the current training steps, determine at least one test dataset and at least one task priority for model testing; The task priority is represented by a level or the number of times the task is executed within the model testing period. As the model training phase progresses, the task priority of the model testing gradually increases. In the early stages of model training, model testing tasks are carried out during model training intervals or when idle resources are available. In the later stages of model training, the priority of model testing tasks is increased to determine whether to stop training or adjust the training plan. The number of target test models is determined based on at least one test dataset and at least one task priority for model testing. If the task priority of the model testing task is low, a smaller number of target test models is determined to save memory space and computing resources. As the task priority of the model testing task increases, the number of target test models is gradually increased. Based on the number of target test models, the target training model is replicated to obtain at least one target test model; The model testing service controls and schedules resources to perform model testing on at least one target test model, wherein the model testing service is independent of the unified training script used for performing model training control and resource scheduling. The target training model is trained, and at the same time, the target test model is tested asynchronously and in parallel using the idle time during the parameter update phase of the model training process and / or the idle computing resources other than those used for model training. The model training of the target training model is completed based on the model test results. The target test model is tested asynchronously and in parallel, including: Asynchronous model testing is performed on the target test model based on at least one test dataset and at least one task priority for model testing.

2. The method according to claim 1, characterized in that, Based on the model testing cycle in the target model testing plan and the current training step in the current training state of the target training model, determine whether the target training model meets the model testing conditions, including: In at least two model testing cycles of the target model testing plan, the current model testing cycle is determined based on the current training step of the target training model; Based on the current model testing cycle, the current training step of the target training model, and the interval between the current and previous testing steps, determine whether the target training model meets the model testing conditions.

3. The method according to claim 1, characterized in that, Asynchronous model testing is performed on the target test model based on at least one test dataset and at least one task priority, including: Split at least one test dataset according to at least one task priority to obtain at least two test subsets, and assign weights to each test subset; Based on at least one task priority and at least two test subsets, perform asynchronous model testing on at least one target test model to obtain preliminary test results for each test subset. Based on the preliminary test results of each test subset and the weights of each test subset, the model test results are obtained.

4. The method according to claim 1, characterized in that, The target training model is replicated to obtain at least one target test model, including: Determine the target number of test models based on at least one test dataset and at least one task priority for model testing. Based on the number of target test models, the target training model is replicated to obtain at least one target test model.

5. The method according to claim 1, characterized in that, Determining whether model training of the target training model is complete based on the model test results includes: If the model test results are determined to meet the conditions for completing the first model training, then the model parameters corresponding to the target test model are used as the model parameters of the target training model to complete the model training. Alternatively, based on the current model test results and at least one historical model test result, determine the pattern of test result changes; If the pattern of test result variation is determined to meet the conditions for completing the training of the second model, then the target test result is determined from the current model test result and at least one historical model test result. The model parameters of the target test model corresponding to the target test result are used as the model parameters of the target training model to complete the model training.

6. The method according to claim 1, characterized in that, The method further includes: If it is determined that the current model test result meets the first model test cycle adjustment condition, or the absolute value of the difference between the current model test result and at least one historical model test result meets the second model test cycle adjustment condition, then the model test cycle in the target model test plan is adjusted. Based on the adjusted model testing period and the current training step in the current training state of the target training model, determine whether the target training model meets the model testing conditions.

7. The method according to claim 1, characterized in that, The method further includes: Generate at least one parameter based on the model test results to adjust the weights; The parameters of the target training model are adjusted based on the parameter adjustment weights and at least one feedback value from the loss function, reward function, reward model, penalty function, and penalty model used in model training.

8. A model training device, characterized in that, include: The model testing condition judgment module is used to determine whether the target training model meets the model testing conditions based on the model testing plan and the current training state of the target training model. The model testing condition judgment module includes: The target model test plan determination unit is used to determine the target model test plan corresponding to the target training model from at least two candidate model test plans based on at least one of the model attributes, model training type and target training task type of the target training model. The model testing condition judgment unit is used to determine whether the target training model meets the model testing conditions based on the model testing cycle in the target model testing plan and the current training step in the current training state of the target training model. The test dataset and task priority determination unit is used to determine at least one test dataset and at least one task priority for model testing based on the target model test plan and the current training step. The task priority is represented by a level or the number of times the task is executed within the model testing period. As the model training phase progresses, the task priority of the model testing gradually increases. In the early stages of model training, model testing tasks are carried out during model training intervals or when idle resources are available. In the later stages of model training, the priority of model testing tasks is increased to determine whether to stop training or adjust the training plan. The number of target test models is determined based on at least one test dataset and at least one task priority for model testing. If the task priority of the model testing task is low, a smaller number of target test models is determined to save memory space and computing resources. As the task priority of the model testing task increases, the number of target test models is gradually increased. The target training model replication module is used to replicate the target training model based on the number of target test models if the conditions are met, so as to obtain at least one target test model. The model testing service controls and schedules resources to perform model testing on at least one target test model, wherein the model testing service is independent of the unified training script used for performing model training control and resource scheduling. The parallel training and testing module is used to train the target training model. At the same time, it uses the idle time during the parameter update phase of the model training process and / or idle computing resources other than those used for model training to asynchronously and in parallel test the target test model. The model training of the target training model is completed based on the model test results. The parallel training and testing module includes: An asynchronous model testing unit is used to perform asynchronous model testing on a target test model based on at least one test dataset and at least one task priority.

Citation Information

Patent Citations

  • Model training method and device

    CN112560988A

  • Material distribution method, device, equipment and medium

    CN119127692A