Model training method, performance duration prediction method and computer program product
By employing a pre-training + fine-tuning method in the performance time prediction model, and using historical data to train the base model and update it periodically, the problems of long training time and limited data volume in existing technologies are solved, achieving higher prediction accuracy and timeliness.
Patent Information
- Application Number
- CN202510994279.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-10-31
AI Technical Summary
In existing technologies, the training method of the performance time prediction model is to reinitialize it at fixed time intervals, which results in long training time, limited data volume, limited model update frequency, and inability to guarantee the accuracy and timeliness of the model.
The pre-training + fine-tuning method is adopted. The base model is trained using historical order data before the pre-training period, and fine-tuned in each time period to incorporate the latest order knowledge and update the model in each time period.
It improves the model's tracking and timeliness, enhances the accuracy of performance time prediction, and reduces computational resource consumption and expectation error.
Smart Images

Figure CN120873601A_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of artificial intelligence technology, and in particular to a model training method, a delivery time prediction method, and a computer program product. Background Technology
[0002] In the logistics and delivery field, accurately predicting order fulfillment time (i.e., the time from when a user places an order to when delivery is completed) is crucial for optimizing operational efficiency, improving user experience, and rationally allocating resources. Currently, fulfillment time prediction models are typically trained using historical order data, and these trained models are then used to predict order fulfillment times. In related technologies, to ensure the timeliness of the trained fulfillment time prediction model, it is common practice to retrain the model at fixed intervals using the latest collected data, resulting in a model suitable for the next time period. This training method initializes the model parameters each time, leading to a long training time when the amount of training data is fixed. Furthermore, the limited training time restricts the amount of training data and the model's update frequency, ultimately failing to guarantee the model's accuracy and timeliness. Summary of the Invention
[0003] To overcome the problems existing in related technologies, this specification provides a model training method, a delivery time prediction method, and a computer program product.
[0004] According to a first aspect of the embodiments of this specification, a model training method is provided, the method being used to train a performance time prediction model, the method comprising:
[0005] For the first time period among multiple time periods in the current pre-training period, the pre-trained model obtained from the pre-training in the current pre-training period is used as the fulfillment time prediction model for the first time period; wherein, the pre-trained model is trained based on order data from historical time periods before the current pre-training period, and the duration of the historical time periods is greater than the duration of any one of the multiple time periods.
[0006] For the non-first time period among multiple time periods in the current pre-training period, obtain the order data of the previous time period of the non-first time period, and use the order data of the previous time period to fine-tune the fulfillment time prediction model of the previous time period to obtain the fulfillment time prediction model of the non-first time period.
[0007] The fulfillment time prediction model for each time period is used to predict the fulfillment time of orders within that time period.
[0008] According to a second aspect of the embodiments of this specification, a method for predicting performance time is provided, the method comprising:
[0009] Obtain the order information for the target order;
[0010] The order information is input into the fulfillment time prediction model corresponding to the time period of the target order to predict the fulfillment time of the target order, wherein the fulfillment time prediction model is trained by the model training method mentioned in the first aspect above.
[0011] According to a third aspect of the embodiments of this specification, a computer program product is provided, including a computer program that, when executed by a processor, implements the methods mentioned in the first and / or second aspects above.
[0012] According to a fourth aspect of the embodiments of this specification, an electronic device is provided, the electronic device including a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the computer program, when executed, implements the methods mentioned in the first and / or second aspects above.
[0013] According to a fifth aspect of the embodiments of this specification, a computer storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the methods mentioned in the first and / or second aspects above.
[0014] The beneficial effects of the embodiments in this specification are as follows: Within each pre-training cycle, a pre-trained model can be trained using a large amount of historical order data prior to that cycle. For the first time period within that pre-training cycle, the pre-trained model can be used as the fulfillment time prediction model for that first time period, used to predict the fulfillment time of orders in that first time period. For time periods other than the first, the fulfillment time prediction model for the previous time period can be fine-tuned using order data from the previous time period to obtain the fulfillment time prediction model for that time period, used to predict the fulfillment time of orders in that time period. The "pre-training + fine-tuning" model training method provided in the embodiments of this specification allows for pre-training on a larger scale of data, enabling the model to absorb sufficient historical information. Based on this, fine-tuning can be performed time-by-time to incorporate the latest order knowledge, improving the model's tracking and timeliness, thereby improving time prediction accuracy and reducing expected error.
[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit the embodiments of this specification. Attached Figure Description
[0016] The accompanying drawings, which are incorporated herein by reference and form part of the embodiments thereof, illustrate embodiments consistent with those described herein and, together with the description, serve to explain the principles of those embodiments.
[0017] Figure 1 This is a schematic diagram illustrating the training of a performance time prediction model in related technologies.
[0018] Figure 2 A flowchart illustrating a model training method as shown in an exemplary embodiment of this specification;
[0019] Figure 3 This is a schematic diagram illustrating a training performance time prediction model as an exemplary embodiment of this specification;
[0020] Figure 4 This is a schematic diagram illustrating the structure of a performance time prediction model as shown in an exemplary embodiment of this specification;
[0021] Figure 5 A flowchart illustrating a performance time prediction scheme as an exemplary embodiment of this specification;
[0022] Figure 6 This is a schematic diagram illustrating a training performance time prediction model as an exemplary embodiment of this specification;
[0023] Figure 7 This is a logic block diagram of an electronic device illustrated in an exemplary embodiment of this specification. Detailed Implementation
[0024] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those described in this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the embodiments described in this specification as detailed in the appended claims.
[0025] The terminology used in the embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of this specification. The singular forms “a,” “the,” and “the” used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0026] It should be understood that although the terms first, second, third, etc., may be used to describe various information in the embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of the embodiments of this specification, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0027] In the logistics and delivery sector, accurately predicting order fulfillment times (i.e., the time from when a user places an order to when delivery is completed) is crucial for optimizing operational efficiency, improving user experience, and allocating resources rationally. For example, in the food delivery scenario, after a user places an order, accurately predicting the delivery time provides the user with a more reliable delivery time estimate, reducing the user's waiting anxiety. Furthermore, the delivery platform can rationally allocate rider tasks based on the predicted delivery time, avoiding situations where there are too many or too few riders in certain areas, thus improving overall delivery efficiency.
[0028] Currently, fulfillment time prediction models are typically trained using historical order data, and these trained models are then used to predict order fulfillment times. Related technologies include... Figure 1 As shown, to ensure the timeliness of the training model for predicting delivery time, it is common practice to retrain the model for the next time period (e.g., T+1 period) at fixed intervals using the latest collected data (e.g., order data for time period T). For example, if the model is retrained every month, the model parameters are initialized each time, and then the model is retrained using the data from the previous month to obtain a prediction model suitable for the next month. This training method re-initializes the model parameters each time (i.e., retrains on the initial model each time), resulting in a long training time when the amount of training data is fixed. Furthermore, the amount of training data is limited by the training time, and the model update frequency is also limited, making it impossible to guarantee the model's accuracy and timeliness. Additionally, re-initializing the model parameters and retraining the model each time consumes significant computational resources.
[0029] For fulfillment time prediction models, both historical orders and recently added orders contain valuable information. The vast amount of historical orders, with their large volume of data and diverse types, provides the model with reliable statistical information and a broad perspective on individual cases. Recently added orders, with their stronger timeliness, can bring more real-time status information to the model. Based on this, the embodiments in this specification provide an incremental learning method. Through a "pre-training + fine-tuning" model, in each pre-training cycle, a pre-trained model can be trained using a large amount of historical order data from before that pre-training cycle. For the first time period within that pre-training cycle, this pre-trained model can be used as the fulfillment time prediction model for that first time period, used to predict the fulfillment time of orders in that first time period. For other time periods, the fulfillment time prediction model for the previous time period can be fine-tuned using order data from the previous time period to obtain the fulfillment time prediction model for that time period, used to predict the fulfillment time of orders in that time period. The "pre-training + fine-tuning" model training method provided in the embodiments of this specification can be pre-trained on a larger scale of data, allowing the model to absorb sufficient historical information. On this basis, it can be fine-tuned on a time-by-time basis to absorb the latest order knowledge, improve the model's tracking and timeliness, and achieve the effect of improving prediction accuracy and reducing expected error.
[0030] The model training method provided in the embodiments of this specification can be used to train a performance time prediction model. This method can be executed by various electronic devices with the computing power required for model training, such as computers, servers, server clusters, etc. The embodiments of this specification do not impose any limitations.
[0031] like Figure 2 As shown, the model training method may include the following steps:
[0032] S202. For the first time period among multiple time periods in the current pre-training period, the pre-trained model of the current pre-training period is used as the fulfillment time prediction model for the first time period; wherein, the pre-trained model is trained based on order data in historical time periods before the current pre-training period, and the duration of the historical time periods is greater than the duration of any one of the multiple time periods.
[0033] Considering the time-sensitivity of training data, pre-trained models can be updated periodically, for example, by periodically pre-training them using a large amount of historical order data. Within each pre-training cycle, the same pre-trained model can be fine-tuned for different time periods to obtain a corresponding delivery time prediction model. For pre-trained models, because they require a large amount of historical data to train a base model, training is time-consuming and consumes significant computing resources; therefore, their training cycle can be set relatively long. For example, a pre-trained model can be updated once a year. For fine-tuning models, since the training objective is to adjust the model using data from the latest time period to allow the model to learn the latest knowledge, to ensure the model's timeliness, its fine-tuning cycle can be set relatively short, such as once a week or once a month.
[0034] Therefore, in step S202, each pre-training period can be divided into multiple time periods. For the first time period of these multiple time periods, the pre-trained model of the current pre-training period can be directly used as the fulfillment time prediction model for that first time period to predict the fulfillment time of orders in that first time period. Considering that the pre-trained model serves as the base model and needs to learn from a sufficient amount of historical data to improve its accuracy and generalization ability, order data from historical time periods prior to the current pre-training period can be obtained to train the pre-trained model. The duration of this historical time period is longer than the duration of any one of the multiple time periods; that is, a longer historical time period can be selected to ensure that the amount of training data for the pre-trained model is sufficiently large.
[0035] S204. For a non-first time period among multiple time periods in the current training cycle, obtain the order data of the previous time period of the non-first time period, and fine-tune the fulfillment time prediction model of the previous time period using the order data of the previous time period to obtain the fulfillment time prediction model of the non-first time period; wherein, the fulfillment time prediction model of each time period is used to predict the fulfillment time of orders in that time period.
[0036] In step S204, for each time period after the first time period within the current pre-training cycle, the order data from the previous time period can be used to fine-tune the fulfillment time prediction model for that previous time period, thus obtaining the fulfillment time prediction model for that time period, to predict the fulfillment time of orders in that time period. Considering that various factors in the logistics and delivery scenario change in real time, thereby affecting the fulfillment time, in order to ensure the timeliness and accuracy of the model, the fulfillment time prediction model for the previous time period can be fine-tuned every short time period using the order data from the previous time period, so that the model can learn the latest knowledge and improve prediction accuracy.
[0037] The order data can be various data related to order fulfillment time, such as order characteristics, merchant characteristics, and characteristics of the delivery capacity (riders, robots, etc.) accepting the order. Order characteristics can include the order's origin and destination, traffic conditions at the origin and destination, delivery distance, etc. Merchant characteristics can include merchant type, food preparation speed, etc., and delivery capacity characteristics can include the number of orders a rider carries, the rider's historical delivery efficiency, etc. Each order carries an actual fulfillment time, which serves as a label for that order and is used for supervised training of the model.
[0038] Because the model is fine-tuned incrementally based on a pre-trained model, model parameters can be reused. Therefore, only a small amount of training data is needed to train a model with high accuracy. Furthermore, due to parameter reuse, the model convergence time is short during each training session, meaning the training time is short. Consequently, it does not require a large amount of computing resources, which can increase the frequency of model updates and improve the model's tracking performance.
[0039] For example, taking the prediction of fulfillment time in the food delivery scenario as an example, such as... Figure 3 As shown, assuming the pre-trained model has a pre-training period of one year, meaning it is updated annually, and the fine-tuning model has a fine-tuning period of one month, meaning it is fine-tuned monthly, the specific training process for the delivery time prediction model is as follows:
[0040] First, all order data from the past year (e.g., 2024) can be collected, including order characteristics (order time, delivery distance, merchant preparation time, etc.) and fulfillment time. This historical data can be used to train a pre-trained model. This pre-trained model can learn long-term fulfillment time patterns, such as the impact of different time periods, delivery patterns in different regions, different delivery capacities, and different traffic conditions on fulfillment time. Then, this pre-trained model can be used as the base model for the current pre-training period (i.e., 2025) to obtain a fulfillment time prediction model for each month of 2025.
[0041] For example, for January 2025, the pre-trained model can be directly used as the delivery time prediction model for that month, to predict the delivery time of takeout orders in January.
[0042] For February 2025, order data from January 2025 can be obtained. The pre-trained model can be fine-tuned using the order data from January 2025 to obtain a delivery time prediction model for February 2025, which can be used to predict the delivery time of takeout orders in February.
[0043] For March 2025, order data for March 2025 can be obtained. The order data for March 2025 can be used to fine-tune the fulfillment time prediction model for February 2025, resulting in the fulfillment time prediction model for March 2025, which can then be used to predict the fulfillment time of takeout orders in March.
[0044] Similarly, for each subsequent month, the previous month's fulfillment time prediction model can be fine-tuned using the previous month's order data to obtain the current month's fulfillment time prediction model.
[0045] Of course, in practical applications, the training period of the pre-trained model and the fine-tuning period of the delivery time prediction model can be flexibly set based on actual needs. For example, the fine-tuning period can be one hour, one week, or one month, etc. Similarly, the pre-training period can be one month, one year, two years, etc., and the embodiments in this specification do not impose any limitations.
[0046] Because pre-trained models are trained on historical data over a longer period, they can learn long-term patterns and improve the model's generalization ability. By fine-tuning the model on a time-by-time basis, the model can dynamically adapt to new data and reflect changes in fulfillment time in a timely manner. Furthermore, it avoids retraining the entire model each time, significantly reducing computational resource consumption and improving model update efficiency. By using the latest data to fine-tune the pre-trained model, it can more accurately predict fulfillment time, improving user experience and operational efficiency.
[0047] Typically, during the training of a model using new data, the model is prone to long-term forgetting, meaning that as the model learns new knowledge, it negatively impacts previously learned knowledge, impairing the overall performance of the model and making it insufficient for learning from long-tailed extreme samples outside the training set. To address this issue, the embodiments in this specification incorporate training strategies to reduce the catastrophic forgetting effect of incremental learning when fine-tuning the model.
[0048] For example, in some embodiments, when fine-tuning the fulfillment time prediction model for the previous time period using order data from the previous time period to obtain a fulfillment time prediction model for a non-first time period, order data from the target time period that is the same as the current time period in historical pre-training periods before the current pre-training period can be obtained. This order data from the previous time period and the order data from the target time period are used as training data in the fine-tuning process to fine-tune the fulfillment time prediction model for the previous time period, thus obtaining a fulfillment time prediction model for a non-first time period. For example, if the current time period is February 2025, the target time period could be February 2024 (i.e., the same month of the previous year). If the current time period is Tuesday of the second week, the target time period could be Tuesday of the previous week, and so on. Since historical data provides long-term background information, while recent time period data reflects the latest trends and changes, combining historical data and recent time period data to fine-tune the model allows it to better learn the latest trends and changes while retaining important information from the historical period, better remembering the characteristics and patterns of the historical period, and helping to reduce catastrophic forgetting.
[0049] In some embodiments, while historical data can enhance the model's memory capacity and reduce catastrophic forgetting, it cannot fully reflect the current logistics and delivery environment and trends. To ensure the fine-tuned model can adapt to the latest changing trends and improve its prediction accuracy, the proportion of order data from the target time period in the total training data can be controlled to be less than that of order data from the previous time period. The total training data includes both order data from the target time period and order data from the previous time period. In other words, by reasonably controlling the ratio of these two types of training data, it can be ensured that the model can better adapt to the latest data changes while learning historical patterns, thus improving the model's adaptability and flexibility.
[0050] In some embodiments, during the fine-tuning of the fulfillment time prediction model for the previous time period using order data from that period, at least some model parameters in the previous period's fulfillment time prediction model can be kept unchanged. To reduce the problem of catastrophic forgetting, some model parameters can be frozen during the model fine-tuning process, keeping these parameters unchanged, i.e., retaining some historical knowledge learned by the model. In this way, the model can retain some existing knowledge while learning new knowledge, reducing catastrophic forgetting. These model parameters can be set based on the specific structure of the model; for example, the model parameters of some basic networks or general networks can be kept unchanged, i.e., retaining some general knowledge learned by the model, thereby improving the model's generalization ability.
[0051] Since delivery time prediction often involves multiple tasks—for example, predicting delivery time while simultaneously predicting the rider's order volume—and these tasks are related (e.g., the rider's order volume affects delivery time), in some embodiments, the delivery time prediction model can be a progressively hierarchical extraction multi-task model. This model includes multiple network layers, each comprising a shared expert network and a task-specific expert network. At least some of the model parameters include some or all of the network parameters of the shared expert network.
[0052] like Figure 4 As shown, the progressive hierarchical extraction multi-task model consists of multiple CGC (Customized Gate Control) structures. Each CGC contains a set of task-specific expert networks, a set of shared expert networks, and a gate network. Each task (e.g., fulfillment time prediction, rider order volume prediction, etc.) has its own specific expert network to learn task-specific features. All tasks share a set of shared expert networks to learn common features between tasks. Each task dynamically selects the outputs of the task-specific and shared experts through a gate network to generate the task's input. After the multiple CGC network layers, a tower network is included. The output of each task is ultimately predicted through an independent tower network (usually a multilayer perceptron, MLP). Considering that the shared expert networks learn some general knowledge, i.e., common features between different tasks, at least some network parameters of the shared experts can be kept unchanged when fine-tuning the model. In this way, the model can retain existing general knowledge while learning new knowledge, thus maintaining high prediction accuracy across different time periods, improving user experience and operational efficiency.
[0053] In some embodiments, when fine-tuning the fulfillment time prediction model for the previous time period using order data from that period, knowledge distillation can be employed to reduce the catastrophic forgetting problem of the model. For example, during training, a pre-trained model can be used as the teacher model, and the fulfillment time prediction model to be fine-tuned can be used as the student model. The teacher model guides the training of the student model. For instance, order data from the previous time period can be input into both the teacher and student models. The teacher model outputs a first predicted fulfillment time as a soft label, and the student model outputs a second predicted fulfillment time. Then, a target loss can be determined based on the difference between the second predicted fulfillment time and the actual fulfillment time of the order data, as well as the difference between the second and first predicted fulfillment times. The model parameters of the student model are adjusted using the target loss to obtain the fulfillment time prediction model for the current time period. When determining the target loss based on the two differences, the weights corresponding to each difference can be set according to actual needs. Through knowledge distillation, the student model can retain the historical knowledge of the teacher model, reducing the forgetting of historical data. Simultaneously, through dual supervision, the student model can predict fulfillment times more accurately.
[0054] During model training, one or more of the above three strategies for reducing catastrophic forgetting (i.e., fine-tuning the model by combining historical data from the same period in the current time period, retaining at least some parameters of the model unchanged during fine-tuning, and knowledge distillation) can be adopted to reduce the problem of catastrophic forgetting in the model.
[0055] In some embodiments, considering that the training process of the pre-trained model requires a large amount of historical order data and involves a large amount of computation, a distributed training method can be used to train the pre-trained model in order to improve training speed and efficiency.
[0056] In some embodiments, a server-parameter architecture can be used for distributed training of the pre-trained model. For example, the model parameters of the pre-trained model can be stored in a server that communicates with multiple computing nodes. Order data within a historical time period can be divided into multiple training data sets and distributed to each of the multiple computing nodes. When training the pre-trained model, each of the multiple computing nodes can obtain the latest model parameters from the server, and then determine the update gradient of the model parameters based on its own training data and the obtained model parameters. The server can receive the update gradients sent by each computing node and use these update gradients to update the model parameters. This process is repeated until the model parameters converge, thus completing the training of the pre-trained model. The trained model parameters can be stored in the server. When the model is fine-tuned later, the model parameters of the pre-trained model can be obtained from the server, and the model can be fine-tuned based on these parameters. By using distributed pre-training, the model's data capacity is expanded, and by utilizing the scaling law, the model's generalization ability is enhanced, thus improving the model's prediction accuracy.
[0057] Based on the same inventive concept, embodiments of this specification also provide a method for predicting fulfillment time. This method can be used to predict fulfillment time. For example, this method can be executed by a logistics and delivery platform. After predicting the fulfillment time for each order, the logistics and delivery platform can send the predicted time to the user's client, where it is displayed. Simultaneously, the logistics and delivery platform can allocate and schedule orders based on the predicted fulfillment time, improving operational efficiency.
[0058] Among them, such as Figure 5 As shown, the method may include the following steps:
[0059] S502, Obtain the order information for the target order;
[0060] After a user places an order, the order information for that target order can be obtained. This order information can include various details related to the order fulfillment time, such as order characteristics, merchant characteristics, and the characteristics of the delivery capacity (rider, robot, etc.) accepting the order. Order characteristics can include the order's origin and destination, traffic conditions at the origin and destination, delivery distance, etc. Merchant characteristics can include merchant type, the merchant's food preparation speed, etc., while delivery capacity characteristics can include the rider's order volume, the rider's historical delivery efficiency, etc.
[0061] S504. Input the order information into the fulfillment time prediction model corresponding to the time period of the target order to predict the fulfillment time of the target order, wherein the fulfillment time prediction model is trained by the model training method described in any of the above embodiments.
[0062] Then, the order information can be input into the fulfillment time prediction model corresponding to the time period of the target order. The fulfillment time prediction model can be used to predict the fulfillment time. The fulfillment time prediction model can be trained by the model training method described in the above embodiments. For details, please refer to the description of the above embodiments, which will not be repeated here.
[0063] The model training method provided in this specification is described below with reference to a specific embodiment.
[0064] Traditional end-to-end fulfillment time prediction models are trained by generating datasets only within a fixed time frame and retraining before each deployment. This training method lacks timeliness and responsiveness, and frequently consumes significant computational resources. To enhance learning and generalization capabilities, this embodiment introduces an incremental learning approach. Through a "pre-training + fine-tuning" model, pre-training is performed on a larger dataset, allowing the model to absorb sufficient historical information. Based on this, fine-tuning is performed on a time-period basis to incorporate the latest order knowledge, improving the model's responsiveness and timeliness, thereby increasing time prediction accuracy and reducing expected error.
[0065] In this embodiment, a delivery time prediction model can be trained using a model training platform, such as... Figure 6 As shown, the model training platform can be divided into a pre-training module, a memory module, and a fine-tuning module. The functions of each module are as follows:
[0066] (1) Pre-training module:
[0067] The fulfillment time prediction model can use the PLE (Progressive Hierarchical Multitask Extraction) model. The pre-training module can acquire a large amount of historical order data to pre-train the PLE model, resulting in a pre-trained model. Training can be performed using either a single-machine or distributed approach. If distributed training is used, a parameter server architecture can be employed to implement distributed training, and the trained model parameters can be stored on the parameter server.
[0068] (2) Memory Module
[0069] Three strategies are combined to mitigate the catastrophic forgetting effect of incremental learning. These three strategies are data replay, parameter transfer, and knowledge distillation. Data replay involves sampling a certain proportion of data from a similar time period to the test set for fine-tuning; parameter transfer freezes the network parameters of the expert-shared network in the pre-trained model; and knowledge distillation uses the pre-trained model as a teacher model to generate soft labels, obtaining additional teacher loss. Specific details of these three strategies can be found in the descriptions in the above embodiments.
[0070] (3) Fine-tuning module
[0071] The parameters of the pre-trained network are read in time period T+1, the model parameters of the network in time period T+2 are read in time period T+1, and so on. Furthermore, only order data from a single time period is used for fine-tuning each time period. After rapid fine-tuning, the model is immediately deployed online to perform time prediction for the next time period.
[0072] To address the issue of long training times in traditional training methods, this embodiment, without reducing the amount of data, adopts a combination of base model and fine-tuning, using parameter reuse. Each model update only requires training with the latest order data, significantly shortening the training time.
[0073] To address the issue of limited data capacity in traditional training methods, this embodiment increases the amount of data while maintaining the same training time. It also performs periodic parallel distributed pre-training, relieving the pressure and limitations on deployment speed and solving the problem of insufficient data. Furthermore, the scaling law is used to reduce model error.
[0074] To address the long-term forgetting problem in traditional training methods, this embodiment designs a memory module, which reduces the risk of catastrophic forgetting in the model and improves the model's performance and robustness.
[0075] Corresponding to the method embodiments provided in the embodiments of this specification, the embodiments of this specification also provide a computer program product, including a computer program that, when executed by a processor, implements the methods mentioned in any of the above embodiments.
[0076] This description also provides an electronic device, such as... Figure 7 The diagram shown is a structural schematic of an electronic device according to an embodiment of this specification, except... Figure 7 In addition to the processor 72 and memory 74 shown, the device may also include other hardware, such as a forwarding chip responsible for processing messages; from a hardware structure perspective, the device may also be a distributed device, possibly including multiple interface cards to extend message processing at the hardware level. The memory 74 stores computer instructions, and when the processor 72 executes the computer instructions, it implements the methods mentioned in any of the above embodiments.
[0077] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0078] Since the parts of the embodiments in this specification that contribute to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, the computer software product is stored in a storage medium and includes several instructions to cause a terminal device to execute all or part of the steps of the methods in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0079] The above description is merely a preferred embodiment of the embodiments of this specification and is not intended to limit the embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this specification should be included within the scope of protection of the embodiments of this specification.
Claims
1. A model training method, said method for training a performance time prediction model, said method comprising: For the first time period among multiple time periods in the current pre-training period, the pre-trained model of the current pre-training period is used as the fulfillment time prediction model for the first time period; wherein, the pre-trained model is trained based on order data from historical time periods before the current pre-training period, and the duration of the historical time periods is greater than the duration of any one of the multiple time periods. For the non-first time period among multiple time periods in the current pre-training period, obtain the order data of the previous time period of the non-first time period, and use the order data of the previous time period to fine-tune the fulfillment time prediction model of the previous time period to obtain the fulfillment time prediction model of the non-first time period. The fulfillment time prediction model for each time period is used to predict the fulfillment time of orders within that time period.
2. The method according to claim 1, characterized in that, The step of fine-tuning the fulfillment time prediction model for the previous time period using order data from the previous time period to obtain the fulfillment time prediction model for the non-first time period includes: Retrieve order data for the target time period that is in the same time period as the current time period from historical pre-training periods before the current pre-training period; By using the order data from the previous time period and the order data from the target time period, the fulfillment time prediction model for the previous time period is fine-tuned to obtain the fulfillment time prediction model for the non-first time period.
3. The method according to claim 2, characterized in that, The proportion of order data in the target time period in the total training data is less than the proportion of order data in the previous time period in the total training data. The total training data includes order data in the target time period and order data in the previous time period.
4. The method according to claim 1, characterized in that, During the process of fine-tuning the fulfillment time prediction model for the previous time period using order data from the previous time period, at least some model parameters in the fulfillment time prediction model for the previous time period remain unchanged.
5. The method according to claim 4, characterized in that, The performance time prediction model is a progressive hierarchical extraction multi-task model, which includes multiple network layers. Each network layer includes a shared expert network and a task-specific expert network. At least some of the model parameters include the network parameters of the shared expert network.
6. The method according to claim 1, characterized in that, The step of fine-tuning the fulfillment time prediction model for the previous time period using order data from the previous time period includes: Using the pre-trained model as the teacher model and the delivery time prediction model to be fine-tuned as the student model, the order data of the previous time period is input into the teacher model and the student model respectively. The teacher model outputs a first predicted fulfillment time, and the student model outputs a second predicted fulfillment time. The target loss is determined based on the difference between the second predicted fulfillment time and the actual fulfillment time of the order data, as well as the difference between the second predicted fulfillment time and the first predicted fulfillment time. The model parameters of the student model are adjusted using the target loss to obtain a prediction model for the fulfillment time of the current time period.
7. The method according to claim 1, characterized in that, The pre-trained model was trained using a distributed training method.
8. The method according to claim 7, characterized in that, The model parameters of the pre-trained model are stored in a server, which communicates with multiple computing nodes. The order data within the historical time period is divided into multiple training data sets, with each computing node corresponding to one training data set. The pre-trained model is trained using the following method: Each of the plurality of computing nodes is used to obtain the latest model parameters from the server and determine the update gradient of the model parameters based on its own training data and the obtained model parameters; The server is used to receive update gradients sent by each computing node and to update the model parameters using the update gradients.
9. A method for predicting performance time, the method comprising: Obtain the order information for the target order; The order information is input into the fulfillment time prediction model corresponding to the time period of the target order to predict the fulfillment time of the target order, wherein the fulfillment time prediction model is trained by the model training method as described in any one of claims 1-8.
10. A computer program product comprising a computer program that, when executed by a processor, implements the method of any one of claims 1 to 9.
Citation Information
Patent Citations
Method and device for predicting delivery time and computer readable storage medium
CN110969274A
Network model training method and device and computer readable storage medium
CN113947196A
Method and system for estimating order fulfillment duration, medium and electronic equipment
CN115345716A
Training method of time prediction model and related equipment
CN116662815A
Incremental training-based call chain anomaly detection model training method and device
CN117291231A