Task processing model training method and device and storage medium
By adjusting the loss function and weight matrix and gradually replacing the old data set and model parameters, the high cost and knowledge forgetting problems of task processing models when facing new features are solved, and adapting to new features and storage optimization is achieved.
Patent Information
- Application Number
- CN202410868204.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-11-26
AI Technical Summary
The existing task processing model needs to be retrained when facing new features, resulting in high time costs, computational costs and may lead to knowledge forgetting and increased memory usage.
By using pre-save data sets and model parameters, combining new data sets and model parameters, adjusting the loss function to meet the threshold conditions, gradually replacing the old data sets and model parameters, adding the weight matrix of the new features, and weighting processing, Data that adapts to new features.
It reduces training time and calculation costs, alleviates the problem of knowledge forgetting, effectively controls the memory usage, and achieves smooth adaptation to new features.
Smart Images

Figure CN119025883A_ABST
Abstract
Description
Technical Field
[0001] The present invention discloses a method, device and storage medium for training a task processing model in the field of artificial intelligence technology. Background Art
[0002] Artificial intelligence technologies such as artificial neural networks have been widely used to handle a variety of tasks or businesses such as search engines, intelligent recommendations, image recognition, speech processing, and autonomous driving. Summary of the invention
[0003] On the one hand, a method for training a task processing model is disclosed, which may include: running the task processing model according to a first data set stored in a memory and model parameters trained using the first data set to obtain a first result set; running the task processing model according to a second data set and the model parameters to obtain a second result set, for each first data in the first data set, the second data set includes corresponding second data, the second data set includes the first data and has at least one feature not involved in the first data set; determining a first loss according to the first result set and the second result set; determining a second loss according to the second result set and a true value result set about the second data set; and replacing the first data set stored in the memory with at least a portion of the second data set when the first loss and the second loss meet a predetermined threshold condition.
[0004] In one or more embodiments, the method may further include: if the first loss and the second loss do not satisfy the threshold condition, adjusting the model parameters; running the task processing model according to the second data set and the adjusted model parameters to obtain a third result set;
[0005] Redetermine the first loss based on the first result set and the third result set; redetermine the second loss based on the third result set and the true value result set; and if the redetermined first loss and second loss meet the threshold condition, replace the first data set and model parameters stored in the memory with at least a portion of the second data set and the adjusted model parameters, respectively.
[0006] In one or more embodiments, the method may further include: generating a second weight matrix by adding at least one column of weight values corresponding to the at least one feature on the basis of the first weight matrix for the first data set, wherein the initial value of each newly added weight value in the second weight matrix depends on the mean value of the weight values from the first weight matrix in the row where the newly added weight value is located; generating a third weight matrix for the second data set by normalizing the second weight matrix; and weighting the data in the second data set using the third weight matrix. For example, in the case where the first loss and the second loss do not meet the threshold condition, at least one weight value in the third weight matrix may be adjusted.
[0007] In one or more embodiments, the method may further include: adjusting the weight of the first loss according to a decay base and the current number of model parameter adjustments. For example, the decay base is 0.98.
[0008] In one or more embodiments, the task processing model may include at least one deep residual network.
[0009] In one or more embodiments, the tasks processed by the task processing model may include but are not limited to at least one of classification tasks and regression tasks, for example, may include but are not limited to at least one of search engines, data classification, income prediction, intelligent recommendation, image processing, audio processing, physical experiment data analysis, etc.
[0010] On the other hand, a device for training a task processing model is also disclosed, which may include: a memory storing a first data set, the task processing model, and one or more instructions executable by a processor; and at least one processor implementing the operations in the above method when executing the one or more instructions.
[0011] On the other hand, a computer-readable storage medium is also disclosed, on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the operations in the above method are implemented.
[0012] On the other hand, a computer program product is also disclosed, including a computer program or instructions, which implement the operations in the above method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 An example of a process of training a task processing model according to an embodiment of the present disclosure is shown.
[0014] Figure 2 An example of a process of training a task processing model according to an embodiment of the present disclosure is shown.
[0015] Figure 3 An example of a process of training a task processing model according to an embodiment of the present disclosure is shown.
[0016] Figure 4 An example of a method for training a task processing model according to an embodiment of the present disclosure is shown.
[0017] Figure 5 An example of a method for training a task processing model according to an embodiment of the present disclosure is shown.
[0018] Figure 6 An example of an apparatus for training a task processing model according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0019] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. In the accompanying drawings, the same or corresponding parts are given the same symbols, and their description will not be repeated.
[0020] For a task processing model built based on artificial intelligence technologies such as artificial neural networks, for example, a pre-prepared data set can be used to adjust the parameters of the task processing model through multiple iterations to train the task processing model. Then, the trained task processing model can be used to process tasks based on actual task input data.
[0021] In data processing, the "feature" of data usually refers to the observable attributes of the object represented by the data, and each attribute can be represented by at least a part of the data; the "feature dimension" of data (also referred to as "dimension" in this article) usually refers to the number of observable attributes of the object represented by the data. If the data in the data set are represented in the form of a two-dimensional table, each row in the two-dimensional table can correspond to an item of data in the data set, and each column can correspond to a feature of the data in the data set.
[0022] like Figure 1As shown, for example, for a task processing model 100 of a search engine that can be used at least for searching for vehicles, the data set 110 initially used to train the task processing model may include data corresponding to "vehicle A", "vehicle B", "vehicle C", etc., respectively, and the data in the data set 100 may include one or more features of features such as "vehicle" (for example, used to identify the name, model, code, etc. of the vehicle), "color" (for example, representing the main body color of the vehicle), "number of passengers" (for example, representing the number of passengers of the vehicle), and "number of compartments" (for example, representing the number of compartments of the vehicle). For example, the feature dimension of the data representing "vehicle A" in the data set 100 (hereinafter also referred to as "data A", similarly, the data representing "vehicle B" is also referred to as "data B", and so on) is 4 (that is, the data A contains 4 features that can represent the vehicle), wherein the value of the feature "vehicle" is "A", the value of the feature "color" is "black", the value of the feature "number of passengers" is "5", and the value of the feature "number of compartments" is "3".
[0023] like Figure 1 As shown, after the task processing model 100 is trained using the data in the data set 110 , the task processing model 100 can be deployed and used for at least a part of a search engine having a function such as searching for vehicles.
[0024] The data used to construct the task processing model 100 and the model parameters 130 of the task processing model 100 obtained by training the task processing model 100 using the data set 110 can be stored in the memory 120, wherein the memory 120, for example, may include but is not limited to one or more removable storage media (such as optical disks, etc.) for recording the data used to construct the task processing model 100 and the model parameters 130 of the task processing model 100, one or more memories in one or more devices (such as one or more personal computers, one or more network servers, etc.) for deploying and / or executing the task processing model 100 to at least realize, for example, a search engine function or at least provide, for example, a search engine service, etc.
[0025] For a task processing model 100 that has been trained and deployed, the task or business data actually received may be different from the training data (or sample data) with a fixed and stable data distribution state in the data set 100 initially used to train the task processing model, but may be in the form of a continuous data stream with a non-stationary data distribution state, for example. Moreover, the task or business data actually provided to the task processing model 100 may change with the actual application scenario of the task processing model 100 and the user's behavior pattern, for example, starting to include one or more features not involved in the data in the data set 110. Such new features may come from a new data source different from the data set 110 or other external factors, and the emergence of such new features may not be foreseen during the use of the data set 110 to train the task processing model 100.
[0026] For example, with the development and popularization of new energy vehicles, search engine users may begin to pay attention to whether the power type of a vehicle is fuel-powered, hybrid, or pure electric. As a result, the input data actually provided to the search engine may begin to include new features such as "power type", which may not be foreseen during the training of the task processing model 100 using the data set 110, resulting in the task processing model 100 being unable to provide satisfactory output.
[0027] To this end, for example, a new data set may be designed to retrain the task processing model 100, wherein the data in the new data set includes new features that are not covered by the data in the data set 100 (such as the above-mentioned “power type”).
[0028] However, such retraining usually requires high time costs, operating costs, and computing costs. Moreover, retraining with data containing new features may cause "catastrophic knowledge forgetting" in the retrained task processing model 100, that is, the retrained task processing model 100 may completely cover or forget the knowledge of data that does not involve new features (such as the above-mentioned "power type") previously obtained through training with the data set 100, which may cause the performance of the task processing model 100 to decline rapidly. If the task processing model is trained using the data set 100 and a new training data set, considering that retraining may be required in the future, it is necessary to always keep all used training data sets in the memory, which results in an increasing amount of memory occupied.
[0029] Figure 2 and Figure 3An exemplary process 200 and subprocess 300 of training a task processing model according to an embodiment of the present disclosure are schematically shown. Thus, the task processing model can be trained for new features with relatively less training time, relatively low computing cost and as little memory usage as possible, while mitigating the catastrophic forgetting of the old knowledge originally learned by the task processing model that does not involve the new features.
[0030] For example, for a task processing model 100 for a search engine that can be used to search for vehicles, Figure 1 As shown, after initially training the task processing model 100 using the dataset 110 , the model parameters 130 of the task processing model 100 and the dataset 110 may be stored in the memory 120 together.
[0031] In order to enable the task processing model 100 to process data with new features (e.g., the “power type” described above) that are not covered by the data in the dataset 100, the task processing model 100 may be executed. Figure 2 The exemplary process 200 shown in FIG. Figure 2 As shown, the pre-saved data set 110 and model parameters 130 may be read from the memory 120 first, and the task processing model 100 may be run according to the read data set 110 and model parameters 130 to obtain the result set 205 output by the task processing model 100 .
[0032] Then, the task processing model 100 may be run according to the new data set 210 and the model parameters 130, thereby obtaining a result set 215 output by the task processing model 100, wherein for each data in the data set 110, the data set 210 may contain corresponding data, the data in the data set 210 may include the corresponding data in the data set 110, and may have one or more features not involved in the data in the data set 110. For example, Figure 1 and Figure 2 As shown, for the data corresponding to “Vehicle A” in data set 110 , data corresponding to “Vehicle A” may also be included in data set 210 , and the data in data set 210 also has a new feature “power type” that is not involved in the data in data set 110 .
[0033] Next, if Figure 2As shown, a loss evaluation 220 may be performed based on the result set 205 and the result set 215 to determine a loss 225. For example, any appropriate loss function such as KL divergence (also known as relative entropy or information divergence) may be used to determine the loss 225 based on the similarity between the result set 205 and the result set 215. For example, in the loss evaluation 220, the result set 205 and the result set 215 may be first processed using a temperature coefficient having a value other than 1 and a normalized exponential function (softmax), so that the result of the result set 205 processed by the normalized exponential function is used as a soft label and the result of the result set 215 processed by the normalized exponential function is used as a soft prediction result, and then the loss 225 is determined based on the soft label and the soft prediction result using any appropriate loss function such as KL divergence.
[0034] On the other hand, Figure 2 As shown, a loss evaluation 230 may be performed based on the result set 215 and the true result set 240 about the data set 210, thereby determining a loss 235. For example, any appropriate loss function such as a cross entropy loss may be used to determine the loss 235 based on the similarity between the result set 215 and the true result set 240. For example, in the loss evaluation 230, the result set 215 may be first processed using a temperature coefficient with a value of 1 and a normalized exponential function, or using an argmax function, etc., to obtain a hard prediction result, and then the true result set 240 is used as a hard label, and based on the hard label and the hard prediction result, any appropriate loss function such as a cross entropy loss may be used to determine the loss 235.
[0035] Next, the value L of the loss 225 can be determined in the determination 250. 1,0 and the value L of loss 235 2,0 Whether the predetermined threshold condition is met. For example, the value L of the loss 225 can be 1,0 and the value L of loss 235 2,0 , to determine the total loss L0 = k0 * L 1,0 +(1-k0)*L 2,0 , where k0 is an appropriate value in the interval [0,1]. Then, for example, when the total loss L0 is less than a predetermined loss threshold, it is determined that the loss value L225 1,0 and the value L of loss 235 2,0 A predetermined threshold condition is satisfied.
[0036] At the loss value of 225 L 1,0 and the value L of loss 235 2,0 When the predetermined threshold condition is satisfied (the determination result of determination 250 is “yes”), processing 260 may be executed to replace the data set 110 previously stored in the memory 120 with at least a portion of the data set 210 .
[0037] At the loss value of 225 L 1,0 and the value L of loss 235 2,0 If the predetermined threshold condition is not satisfied (the determination result of determination 250 is “No”), sub-process 300 may continue to be executed.
[0038] like Figure 3 As shown, in the subprocess 300, the processing 310 is first performed to adjust the model parameters of the task processing model 100, thereby obtaining the adjusted model parameters 320. Then, the task processing model 100 is run according to the adjusted model parameters 320 and the data set 210, thereby obtaining the result set 330 output by the task processing model 100.
[0039] Next, a loss assessment 340 may be performed based on the result set 205 and the result set 330, thereby determining a loss 350. Similar to the loss assessment 220, in the loss assessment 340, for example, any appropriate loss function such as KL divergence may be used to determine the loss 350 based on the similarity between the result set 205 and the result set 330. For example, in the loss assessment 340, the result set 205 and the result set 330 may be first processed using a temperature coefficient having a value other than 1 and a normalized exponential function (softmax), so that the result of the result set 205 processed by the normalized exponential function is used as a soft label and the result of the result set 330 processed by the normalized exponential function is used as a soft prediction result, and then the loss 350 is determined based on the soft label and the soft prediction result using any appropriate loss function such as KL divergence.
[0040] On the other hand, Figure 3 As shown, a loss evaluation 360 may be performed based on the result set 330 and the true result set 240 to determine a loss 370. For example, any appropriate loss function such as a cross entropy loss may be used to determine the loss 370 based on the similarity between the result set 330 and the true result set 240. For example, in the loss evaluation 360, the result set 330 may be first processed using a temperature coefficient with a value of 1 and a normalized exponential function, or using an argmax function, etc., to obtain a hard prediction result, and then the true result set 240 is used as a hard label, and any appropriate loss function such as a cross entropy loss is used to determine the loss 370 based on the hard label and the hard prediction result.
[0041] Next, the value L of the loss 350 can be determined in decision 380 1,i and the loss value L of 370 2,i Whether the predetermined threshold condition is met, where i is a natural number representing the number of iterations of the training process, and its initial value is 1. For example, the value L of the loss 350 can be 1,i and the loss value L of 370 2,i, to determine the total loss L i =k i *L i,1 +(1-k i )*L i,2 , where k i is an appropriate value in the interval [0,1]. Then, for example, in the total loss L i If the loss is less than a predetermined loss threshold (the threshold may be the same as the loss threshold in the aforementioned determination 250), the value L of the loss 350 is determined. 1,i and the loss value L of 370 2,i A predetermined threshold condition is satisfied.
[0042] At a loss of 350 L 1,i and the loss value L of 370 2,i When a predetermined threshold condition is met (the judgment result of judgment 380 is "yes"), processing 390 can be executed to replace the data set 110 previously stored in the memory 120 with at least a portion of the data set 210, and to replace the model parameters 130 previously stored in the memory 120 with the adjusted model parameters 320.
[0043] At a loss of 350 L 1,i and the loss value L of 370 2,i If the predetermined threshold condition is not met (the result of judgment 380 is "No"), the sub-process 300 can be re-executed to start a new iteration of the training process, and the value i representing the number of iterations is increased by 1. This is repeated until the value L of 350 is lost in a certain iteration of the sub-process 300. 1,i and the loss value L of 370 2,i Until a predetermined threshold condition is satisfied (the determination result of determination 380 is "yes").
[0044] In the above process 200 and sub-process 300, the output results of the task processing model 100 for the data set 110 previously used to train the task processing model 100 are used as soft labels in the loss assessment, and the true value result set 240 about the data set 210 containing new features is used as the hard label in the loss assessment, and then the model parameters are continuously adjusted according to the results of the loss assessment, so that the task processing model 100 is trained to maintain the knowledge learned through the previous training process while learning in an incremental manner the newly added features that are not involved or not considered in the previous training process. In this way, not only can the time cost and computational cost of training the task processing model 100 be reduced, but also the catastrophic forgetting of the old knowledge that was originally learned and does not involve new features by the task processing model 100 can be effectively alleviated.
[0045] In addition, if Figure 2 and Figure 3 As shown, after each training is completed, that is, after the process 260 or the process 390 is executed, only at least a part of the set of data containing both new and old features (for example, at least a part of the data set 210) can be saved in the memory 120, without having to save all the new and old data (data set 110 and data set 210) in the memory 120. In this way, the storage space of the memory 120 can be occupied as little as possible, thereby effectively controlling the growth of the storage space occupied by the memory 120.
[0046] Additionally, in one or more embodiments, Figure 2 The process of 200 or Figure 3 In the sub-process 300 , the data in the data set 210 may be weighted before providing the data set 210 to the task processing model 100 .
[0047] The weight matrix used for weighting the data in the data set 110 in the task processing model 100 (or the input layer of the task processing model 100) is denoted as W. Then, according to the number of new features involved in the data in the data set 210 but not involved in the data in the data set 110, a corresponding number of one or more columns of weight values can be added to the weight matrix W, thereby obtaining a new weight matrix, wherein the initial value of each newly added weight value can be based on the average of all weight values in the row where the newly added weight value is located that are derived from the weight matrix W. Then, the new weight matrix can be normalized to obtain a weight matrix W' used for weighting the data in the data set 210 before providing the data set 210 to the task processing model 100.
[0048] For example, for Figures 1 to 3 In the example shown, in the case of adding a new feature ("power type"), the weight matrix W' for the data set 210 can be determined as follows:
[0049]
[0050] in, n represents the number of columns in the weight matrix W for the data set 110, that is, the number of "old" features involved in the data in the data set 110, normt = n / (n+1). Further, if the data in the data set 210 has k new features added relative to the data in the data set 110, the weight matrix W' for the data set 210 can be determined as follows:
[0051]
[0052] At this time, normt=n / (n+k).
[0053] By using the weight matrix W' to weight the data in the data set 210 and then providing it to the task processing model 100, the task processing model 100 can be more smoothly adapted to the data with new features. In one embodiment, such weighted processing can also be implemented in the input layer of the task processing model 100, so that the processing model 100 itself has the ability to adapt to the newly added features.
[0054] Accordingly, at least one weight value in the weight matrix W' may be adjusted in the process 310 of adjusting parameters in the subprocess 300, or in a separate process before providing the data set to the task processing model 100 in the subprocess 300. In the case where the above-mentioned weighting process is integrated into the input layer of the task processing model 100, the process 310 of adjusting parameters in the subprocess 300 may include adjusting at least one weight value in the weight matrix W', and the adjusted model parameters 320 may include the adjusted weight matrix W'.
[0055] Additionally, in one or more embodiments, Figure 3 The value L of the loss 350 is determined in the determination 380 of the sub-process 300. 1,i and the loss value L of 370 2,i If the predetermined threshold condition is met, the attenuation coefficient α can be used to adjust the value L for the loss 350 1,i K i For example, the total loss L i =α i *k i *L i,1 +(1-α i *k i )*L i,2 , where k i is an appropriate value in the interval [0,1], i is a natural number representing the number of iterations of the training process, and its initial value is 1.
[0056] In the early stages of training, the decay coefficient α can be set to a relatively large value, such as 0.98, which can help speed up training, for example, making the total loss L i The loss value L can be controlled to be below the predetermined loss threshold value, which is beneficial to improving the accuracy of the task processing model 100. As the number of training iterations increases, the value L of the loss 350 can be controlled to be below the predetermined loss threshold value. i,1 In the total loss L i Thus, the “new” task processing model 100 after a new iteration of training can reduce its dependence on the “old” task processing model 100 before the iteration, thereby helping to enhance the independence of the task processing model 100.
[0057] In the above, the exemplary process of training the task processing model according to the embodiment of the present disclosure is described by taking the task processing model 100 of the search engine that can be used to search for vehicles as an example. However, depending on the implementation of the task layer of the task processing model 100, the task processing model 100 can be used to process other tasks, including one or more types of tasks in regression tasks and classification tasks, and the above training process can still be applied.
[0058] For example, the task processing model 100 may be a processing model for intelligent recommendation in an e-commerce platform. For example, the intelligent recommendation in the e-commerce platform may only focus on product information in the initial stage, but as the business develops, the user's behavior data becomes a new input feature. Accordingly, for example, the features involved in the data in the data set 110 may include features related to the product itself, such as product model, product parameters, product price, etc., while the data in the data set 210 may also involve features related to the user's behavior, such as the user's attention time for a certain type of product (for example, the browsing time of the corresponding page), the user's attention frequency for a certain type of product (for example, the number of browsing times of the corresponding page), and the user's purchase record for related categories of products, which are not involved in the data in the data set 110. Then, the task processing model 100 can be trained by applying the above-mentioned exemplary process 200 and subprocess 300, so that the task processing model 100 can smoothly adapt to the new features and can effectively process both new and old data.
[0059] As another example, the task processing model 100 may be a processing model for data classification. For example, for the task processing model 100 for music classification, the features involved in the data in the data set 110 may include features such as the melody, rhythm, singer name, and era of the music, while the data in the data set 210 may also involve features not involved in the data in the data set 110, such as the age group of the audience of the music, the listening period of the music, and the application scenario of the music. Then, the task processing model 100 may be trained by applying the above-mentioned exemplary process 200 and sub-process 300, so that the task processing model 100 can smoothly adapt to the new features and can effectively process both new and old data.
[0060] For another example, the task processing model 100 may be a processing model for personal income prediction. For example, the features involved in the data in the data set 110 may include features such as age, gender, occupation, etc., while the data in the data set 210 may also involve features such as sideline jobs, investments, etc. that are not involved in the data in the data set 110. Then, the task processing model 100 may be trained by applying the above-mentioned exemplary process 200 and subprocess 300, so that the task processing model 100 can smoothly adapt to new features and can effectively process both new and old data.
[0061] For another example, the task processing model 100 may be a processing model for experimental data analysis. For example, the features involved in the data in the data set 110 may include features about the position of the measurement object sensed by sensors such as photoelectric sensors, capacitive sensors, and ultrasonic sensors, while the data in the data set 210 may also involve features about the position of the measurement object sensed by contact sensors, proximity sensors, and GPS (Global Positioning System) that are not involved in the data in the data set 110. Then, the task processing model 100 may be trained by applying the above-mentioned exemplary process 200 and subprocess 300, so that the task processing model 100 can smoothly adapt to the new features and can effectively process both new and old data.
[0062] That is, in different embodiments, the task processing model 100 may not be limited to Figures 1 to 3 The task processing model of the search engine that can be used to search for vehicles in the example can also be used for various other tasks such as data classification, income prediction, intelligent recommendation, image processing, audio processing, experimental data analysis, etc., and the training processes 200 and 300 according to the embodiments of the present disclosure can still be applicable. The types of tasks that the task processing model 100 can handle may include but are not limited to regression tasks and classification tasks. The training processes 200 and 300 according to the embodiments of the present disclosure are not limited to the implementation method and implementation purpose of the task processing model 100.
[0063] Figure 4 An exemplary method 400 for training a task processing model according to an embodiment of the present disclosure is shown, wherein the types of tasks that the task processing model can handle may include but are not limited to regression tasks and classification tasks, and the tasks that can be processed may include but are not limited to search engines, data classification, income prediction, intelligent recommendation, image processing, audio processing, experimental data analysis, etc.
[0064] like Figure 4 As shown, the method 400 may include step 410 , step 420 , step 430 , step 440 and step 450 .
[0065] In step 410, the task processing model (e.g., task processing model 100) can be run based on a first data set (e.g., data set 110) stored in a memory (e.g., memory 120) and model parameters (e.g., parameter model 130) trained using the first data set to obtain a first result set (e.g., result set 205).
[0066] In step 420, the task processing model may be run according to a second data set (e.g., data set 210) and the model parameters (e.g., model parameters 130) to obtain a second result set (e.g., result set 215), wherein for each first data in the first data set, the second data set includes corresponding second data, the second data including the first data and having at least one feature not involved in the first data set (e.g., Figures 1 to 3 "Power Type" in the .
[0067] At step 430 , a first loss (eg, loss 215 ) can be determined (eg, by process 220 ) based on the first result set (eg, result set 205 ) and the second result set (eg, result set 215 ).
[0068] In step 440, a second loss (e.g., loss 235) can be determined (e.g., by process 230) based on the second result set (e.g., result set 215) and the true result set (e.g., true result set 240) regarding the second data set.
[0069] In step 450, when the first loss (e.g., loss 215) and the second loss (e.g., loss 235) satisfy a predetermined threshold condition (e.g., the judgment result of judgment 250 is "yes"), the first data set (e.g., data set 110) stored in the memory (e.g., memory 120) can be replaced (e.g., through processing 260) with at least a portion of the second data set (e.g., data set 210).
[0070] like Figure 4 and Figure 5 As shown, when the first loss (e.g., loss 215) and the second loss (e.g., loss 235) do not meet the predetermined threshold conditions (e.g., the judgment result of judgment 250 is "no"), method 400 may also include steps 510, 520, 530, 540 and 550.
[0071] In step 510, the model parameters may be adjusted (eg, the adjusted model parameters 320 obtained by process 310).
[0072] In step 520, the task processing model (eg, task processing model 100) may be run based on the second data set (eg, data set 210) and the adjusted model parameters (eg, model parameters 320) to obtain a third result set (eg, result set 330).
[0073] In step 530 , the first loss may be re-determined (eg, re-determined loss 350 obtained through process 340 ) based on the first result set (eg, result set 205 ) and the third result set (eg, result set 330 ).
[0074] In step 540, the second loss may be re-determined (eg, re-determined loss 370 obtained through process 360) based on the third result set (eg, result set 330) and the true value result set (eg, true value result set 240).
[0075] In step 550, when the re-determined first loss (e.g., loss 350) and second loss (e.g., loss 370) satisfy the threshold condition (e.g., the judgment result of judgment 380 is "yes"), the first data set (e.g., data set 110) and model parameters (e.g., model parameters 130) stored in the memory can be replaced (e.g., through processing 390) with at least a portion of the second data set (e.g., data set 210) and the adjusted model parameters (e.g., model parameters 320), respectively.
[0076] When the re-determined first loss (e.g., loss 350) and second loss (e.g., loss 370) satisfy the threshold condition (e.g., the judgment result of judgment 380 is "yes"), method 400 can return to step 510 to adjust the model parameters again (e.g., obtain the re-adjusted model parameters 320 through processing 310) and start a new round of iteration.
[0077] In method 400 according to an embodiment of the present disclosure, the output result (e.g., result set 205) of the task processing model for the first data set (e.g., data set 110) previously used to train the task processing model is used as a soft label in loss assessment, and the true value result set (true value result set 240) about the data set (e.g., data set 210) containing new features is used as a hard label in loss assessment, and then the model parameters are continuously adjusted according to the result of loss assessment, so that the task processing model is trained to learn incrementally while maintaining the knowledge learned through the previous training process to adapt to the newly added features that were not involved or considered in the previous training process. In this way, not only can the time cost and computational cost of training the task processing model be reduced, but also the catastrophic forgetting of the old knowledge originally learned and not involving new features by the task processing model can be effectively alleviated.
[0078] In addition, in the method 400 according to the embodiment of the present disclosure, after each training is completed, in step 450 or step 550, only at least a portion of the set of data containing both new and old features (for example, at least a portion of the data set 210) is saved to the memory, without having to save all new and old data (for example, the data set 110 and the data set 210) to the memory. In this way, the storage space of the memory can be occupied as little as possible, thereby effectively controlling the growth of the storage space occupied by the memory.
[0079] In one or more embodiments, in method 400, a second weight matrix (e.g., weight matrix W) may be generated by adding at least one column of weight values corresponding to the at least one feature to the first weight matrix (e.g., weight matrix W) used for the first data set (e.g., data set 110). ), and by normalizing the second weight matrix (for example, by ), to generate a third weight matrix (e.g., weight matrix W') for the second data set, and then use the third weight matrix (e.g., weight matrix W') to weight the data in the second data set (e.g., data set 210). In one embodiment, this process can be integrated into the input layer of the task processing model (e.g., task processing model 100).
[0080] Accordingly, in method 400, when the first loss (e.g., loss 225 or loss 350) and the second loss (e.g., loss 235 or loss 370) do not satisfy the threshold condition (e.g., when the judgment result of judgment 250 for loss 225 and loss 235 is "no", or when the judgment result of judgment 380 for loss 350 and loss 370 is "no"), at least one weight value in the third weight matrix (e.g., weight matrix W') is adjusted. For example, when the process of weighting the second data set (e.g., data set 210) using the third weight matrix (e.g., weight matrix W') is integrated into the input layer of the task processing model (e.g., task processing model 100), adjusting the model parameters in step 510 may include adjusting at least one weight value in the third weight matrix.
[0081] By using the third weight matrix (eg, weight matrix W') to weight the data in the second data set (eg, data set 210) and then providing it to the task processing model, the task processing model can more smoothly adapt to data with new features.
[0082] In one or more embodiments, in method 400, the weight of the first loss (e.g., the value L of loss 350) may also be adjusted according to the decay base (e.g., the decay coefficient α) and the number of times the current model parameter (e.g., model parameter 130 or model parameter 320) is adjusted. i,1 ).
[0083] In the early stages of training, the decay coefficient can be set to a relatively large value, such as 0.98, which can help accelerate training, for example, to quickly converge the total loss to below a predetermined loss threshold, and to improve the accuracy of the task processing model. As the number of training iterations gradually increases, the weight of the first loss (for example, the value L of the loss 350) can be controlled to be i,1 ) in the total loss gradually decreases. As a result, the "new" task processing model after a new iteration of training can reduce its dependence on the "old" task processing model before the iteration, thereby helping to enhance the independence of the task processing model.
[0084] Figure 6 An exemplary apparatus 600 for training a task processing model according to an embodiment of the present disclosure is shown, and the exemplary apparatus 600 may include one or more processors 610. According to different embodiments, the one or more processors 610 may include a central processing unit (CPU) or other types or forms of processing units with data processing capabilities and / or instruction execution capabilities.
[0085] like Figure 6 As shown, the exemplary apparatus 600 may further include a memory 620, in which the first data set (e.g., data set 110), the task processing model (e.g., task processing model 100), and at least one or more instructions 630 that can be executed by the one or more processors 610 are stored. When the one or more instructions 630 are executed by the one or more processors 610, the operations or steps in the exemplary method 400 are implemented.
[0086] According to different embodiments, the memory 620 may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0087] In addition, the exemplary apparatus 600 may also include input devices, output devices, and various interfaces (not shown), and these devices and interfaces may be interconnected via a bus system and / or other forms of connection mechanisms. According to different embodiments, the input device may include, for example, a keyboard, a mouse, a touch screen, etc., the output device may include, for example, a display, a speaker, a printer, etc., and the various interfaces may include wired or wireless interfaces for connecting or communicating with other external devices or networks, etc.
[0088] In different embodiments, the exemplary device 600 may be a personal computer, a network server, a mobile phone, a smart terminal, etc.
[0089] In addition to the above-mentioned methods and apparatus, embodiments of the present disclosure may also include a computer program product, which includes computer program instructions, which, when executed by a processor, cause the processor to perform the steps of at least one of the exemplary methods according to embodiments of the present disclosure.
[0090] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations in the method of an embodiment of the present disclosure. The programming language may include an object-oriented programming language, such as Java, C++, Python, etc., and also includes a conventional procedural programming language, such as the "C" language or a similar programming language. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0091] In addition, embodiments of the present disclosure may also include a computer-readable storage medium, such as a computer-readable non-temporary storage medium, on which program instructions are stored, which, when executed by a processor, cause the processor to perform the steps of at least one of the exemplary methods of embodiments of the present disclosure.
[0092] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. Examples of readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0093] The basic principle of the present disclosure is described above in conjunction with specific embodiments. However, it should be pointed out that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, rather than limitation, and the aforementioned details do not limit the present disclosure to the necessity of adopting the aforementioned specific details to be implemented.
[0094] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The word "such as" used here refers to the phrase "such as but not limited to", and can be used interchangeably with it.
[0095] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0096] In this document, modifiers such as "first", "second", etc. without quantifiers are intended to distinguish different elements / components / circuits / modules / devices / steps, and are not used to emphasize the order, positional relationship, importance, priority, etc. In contrast, modifiers such as "first", "second", etc. with quantifiers can be used to emphasize the order, positional relationship, importance, priority, etc. of different elements / components / circuits / modules / devices / steps.
[0097] The above description is given for the purpose of illustration and description. This description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for training a task processing model, include: Running the task processing model according to a first data set stored in a memory and model parameters trained using the first data set to obtain a first result set; Running the task processing model according to a second data set and the model parameters to obtain a second result set, wherein for each first data in the first data set, the second data set includes corresponding second data, the second data includes the first data and has at least one feature not involved in the first data set; determining a first loss based on the first result set and the second result set; determining a second loss based on the second result set and a set of true value results about the second data set; as well as In the case that the first loss and the second loss meet a predetermined threshold condition, the first data set stored in the memory is replaced with at least a portion of the second data set.
2. The method according to claim 1, further comprising: include: When the first loss and the second loss do not satisfy the threshold condition, adjusting the model parameter; running the task processing model based on the second data set and the adjusted model parameters to obtain a third result set; re-determining the first loss based on the first result set and the third result set; re-determining the second loss according to the third result set and the true value result set; as well as When the re-determined first loss and second loss satisfy the threshold condition, the first data set and model parameters stored in the memory are replaced with at least a portion of the second data set and the adjusted model parameters, respectively.
3. The method according to claim 1 or 2, further comprising: include: Generate a second weight matrix by adding at least one column of weight values corresponding to the at least one feature to the first weight matrix for the first data set, wherein an initial value of each newly added weight value in the second weight matrix depends on an average of weight values in the row where the newly added weight value is located that are derived from the first weight matrix; generating a third weight matrix for the second data set by normalizing the second weight matrix; as well as The data in the second data set is weighted using the third weight matrix.
4. The method according to claim 3, further comprising: include: When the first loss and the second loss do not satisfy the threshold condition, at least one weight value in the third weight matrix is adjusted.
5. The method according to any one of claims 1 to 4, further comprising: include: The weight of the first loss is adjusted according to the decay base and the current number of model parameter adjustments.
6. The method according to any one of claims 1 to 5, in, The task types processed by the task processing model include at least one of classification tasks and regression tasks, and / or the task processing model is used for at least one of the following: search engines, data classification, income prediction, intelligent recommendation, image processing, audio processing, and physical experiment data analysis.
7. The method according to any one of claims 1 to 6, in, The task processing model includes at least one deep residual network.
8. A device for training a task processing model, include: A memory storing the first data set, the task processing model, and one or more instructions executable by the processor; as well as At least one processor implements the operations in the method of any one of claims 1 to 7 when executing the one or more instructions.
9. A computer-readable storage medium having a computer program or instruction stored thereon, wherein the computer program or instruction, when executed by a processor, implements the operations in the method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program or instructions, which, when executed by a processor, implement the operations in the method of any one of claims 1 to 7.
