Model data processing system

By training a general language model on a cloud server and co-processing template information, terminal devices can generate models suitable for different recommendation tasks, solving the problem of excessive resource consumption on terminal devices and achieving faster model generation and higher accuracy.

CN114942843BActive Publication Date: 2026-03-27ALIBABA (CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Terminal devices consume excessive resources when configuring multiple recommendation models, and existing technologies struggle to effectively reduce resource consumption.

Method used

A general language model is trained on a cloud server and its template information corresponding to different recommendation tasks is configured into the terminal device. The terminal device is then optimized to generate an applicable recommendation model, reducing the number of models and parameters and lowering the consumption of computing resources.

Benefits of technology

It reduces memory consumption on terminal devices, lowers computational resource consumption, and improves the generation speed and accuracy of recommendation models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114942843B_ABST
    Figure CN114942843B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a model data processing system, which comprises a terminal device and a cloud server. The cloud server trains a language model and configures the converged language model to the terminal device. The terminal device optimizes template information according to historical behavior text describing user behavior and the language model that has been trained to convergence, to generate a recommendation model comprising the language model and the optimized template information. The terminal device only needs to configure a general language model and template information corresponding to different recommendation tasks locally, and the terminal device does not need to configure a separate recommendation model for each recommendation service. Since the template information contains fewer parameters, the loss of memory resources on the terminal device can be reduced. At the same time, the key processing process of the terminal device is to optimize the first template information containing a small amount of parameters, and in the optimization process, the loss of computing resources in the terminal device is also reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a model data processing system. BACKGROUND

[0002] Personalized recommendation has been applied to many scenarios. For example, in a shopping scenario, a user can be recommended goods according to the user's purchase behavior; for example, in a chat scenario, a user can be recommended goods according to the user's chat content.

[0003] In the prior art, a recommendation model can be used to implement recommendation, and the recommendation model corresponds to a scene one by one, that is, a shopping scenario corresponding recommendation model is used to implement goods recommendation, and a chat scenario corresponding recommendation model is used to implement recommendation in a chat process. In practice, a terminal device often needs to be configured with multiple recommendation models suitable for different scenarios. Multiple model configurations increase the resource consumption of the terminal device.

[0004] Therefore, while ensuring that different recommendation tasks can be implemented, how to reduce the resource consumption of the terminal device has become a problem to be solved. SUMMARY

[0005] Therefore, the embodiments of the present application provide a model data processing system to reduce the resource consumption of the terminal device.

[0006] In a first aspect, the embodiments of the present application provide a model data processing system, comprising: a terminal device and a cloud server.

[0007] The cloud server is configured to train a language model according to training text, and configure a converged language model and first template information corresponding to a first recommendation task into the terminal device.

[0008] The terminal device is configured to obtain first historical behavior text describing user behavior and the first template information.

[0009] The first template information is optimized according to the first historical behavior text and the language model to obtain a first recommendation model comprising the optimized first template information and the language model, and the first recommendation model corresponds to the first recommendation task.

[0010] In a second aspect, the embodiments of the present application provide another model data processing system, comprising: a terminal device and a cloud server.

[0011] The cloud server is configured to train a language model according to training text, and configure a converged language model and template information corresponding to a recommendation task into the terminal device.

[0012] The terminal device is configured to acquire a first historical behavior text describing user behavior, a description text of a candidate recommended object corresponding to the first historical behavior text, and template information corresponding to the recommended task;

[0013] The template information is optimized according to the first historical behavior text, the description text, a classification layer, and a feature extraction layer in the language model;

[0014] The classification layer and the optimized template information are set to have the same parameters to obtain a recommended model including the optimized template information, the classification layer, and the feature extraction layer, the recommended model corresponding to the recommended task.

[0015] The model data processing system provided by the embodiment of the present application includes a terminal device and a cloud server. The cloud server trains a language model and configures the converged language model to the terminal device. The terminal device acquires a first historical behavior text describing user behavior and first template information corresponding to a first recommended task. Then, the first template information is optimized according to the first historical behavior text and the language model trained to convergence to generate a first recommended model including the language model and the optimized first template information, the first recommended model being suitable for the first recommended task.

[0016] In the above process, through the cooperative processing of the terminal device and the cloud server, a general language model and multiple template information corresponding to different recommended tasks are configured on the terminal device, and a separate recommended model does not need to be configured for each recommended task. The number of models and the number of model parameters stored in the terminal device are greatly reduced, and the consumption of the memory of the terminal device can be reduced. Compared with training a complete recommended model, the optimization of the template information includes fewer parameters, and therefore, the terminal device only needs to collect a small amount of training samples and optimize the template information locally, and the consumption of the computing resources of the terminal device in the optimization process is reduced.

[0017] In addition, the language model is pre-trained by the cloud server and can be directly used, and therefore, in the process of generating the first recommended model, the terminal device focuses on optimizing the first template information. Since the number of parameters in the first template information is smaller, the data processing pressure of the terminal device in the optimization process can be reduced, and the generation speed of the recommended model can be improved.

[0018] In addition, since the historical behavior text is universal, the behavior of the user in different scenarios can be understood by the terminal device, that is, the behavior described by the first historical behavior text can participate in the optimization of the template information and the generation of the model, and the accuracy of the recommended model can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0020] Figure 1 A structural schematic diagram of a data processing system provided for an embodiment of the present application is provided.

[0021] Figure 2 A structural schematic diagram of a model data processing system provided for an embodiment of the present application is provided.

[0022] Figure 3 A flowchart of a template information optimization method provided for an embodiment of the present application is provided.

[0023] Figure 4 A structural schematic diagram of a recommendation model suitable for a generative recommendation task provided for an embodiment of the present application is provided.

[0024] Figure 5 A flowchart of another template information optimization method provided for an embodiment of the present application is provided.

[0025] Figure 6 A flowchart of still another template information optimization method provided for an embodiment of the present application is provided.

[0026] Figure 7 A flowchart of still another template information optimization method provided for an embodiment of the present application is provided.

[0027] Figure 8 A structural schematic diagram of a recommendation model suitable for a discriminative recommendation task provided for an embodiment of the present application is provided. DETAILED DESCRIPTION

[0028] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.

[0029] The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the description of the application and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be understood that the terms "and / or," "at least one of," and "one or more of" as used herein refer to and encompass any one of the items in the list, any combination of two or more of the items in the list, and / or all of the items in the list.

[0030] It should also be noted that, as used in the specification and the appended claims, the article "a", "an" and "the" are used expansively and each is to be given the same meaning, that is, to refer to one or more instances of whatever the subject is of the footage. Similarly, the terms "another", "at least one", and "one or more" are each to be construed to mean one or more unless explicitly stated otherwise.

[0031] Depending on the context, the word "if" as used herein can be interpreted to mean "when" or "while" or "in response to determining" or "in response to identifying." Similarly, the phrase "if it is determined" or "if an identified (statement of a condition or event) is" can be interpreted to mean "when it is determined" or "in response to determining" or "when an identified (statement of a condition or event) is" or "in response to identifying (statement of a condition or event)."

[0032] It is further noted that the terms "comprise", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0033] Some embodiments of the application will now be described in detail in connection with the accompanying drawings. From the following description, a person skilled in the art will emerge that the described embodiments and features of the embodiments can be combined with each other, as far as they are not in conflict with each other. In addition, the sequence of steps in the method embodiments described below is merely an example and is not strictly limited.

[0034] Before the embodiments provided by the application are described in detail, a common recommendation model training and configuration process can be described first.

[0035] As Figure 1The data processing system shown, different application programs (Application, APP for short) installed on terminal devices in the system can use different recommendation models to perform different recommendation tasks, thereby providing different recommendation services for users. Among them, the recommendation task can be the recommendation task in the shopping scene or in the chat scene mentioned in the background technology. In practice, the recommendation model can obtain the historical behavior generated by the user as a training sample. And a common form of historical behavior is the form of identification information. For example, for a historical behavior "user A purchases goods B", its form of identification information can be expressed as "001 purchases 002". Since the identification information is not universal in different scenarios, that is, in different recommendation tasks, "001" can correspond to different users, and "002" can also correspond to different goods, so that different behaviors generated by the user in different scenarios may not be accurately understood by the recommendation model.

[0036] In order to improve the above situation, in practice, it is necessary to collect the historical behavior in the form of identification information generated by the user in different recommendation tasks respectively, and then train the recommendation model suitable for each recommendation task using the historical behavior in the form of identification information generated in each recommendation task. This makes the APP be able to perform how many kinds of recommendation tasks, how many recommendation models need to be trained, and the multiple recommendation models will also be encapsulated in the APP. At this time, the more recommendation services, the more models encapsulated in the APP, that is, the number of recommendation models to be configured in the terminal device. For the APP containing multiple recommendation tasks, this model accumulation not only makes it difficult to meet the requirement of software simplification, but also because multiple models are configured in the terminal device, the terminal device needs to store a large number of model parameters, which increases the consumption of memory in the terminal device.

[0037] Among them, since the calculation amount of the recommendation model training process is large, the training of the recommendation model is usually performed by the cloud server in the data processing system, and then the recommendation model trained by the cloud server is configured to the terminal device along with the installation of the APP. In addition, in order to ensure the training effect of each recommendation model, a large number of historical behaviors in the form of identification information suitable for the recommendation model are also needed. At this time, it will also increase the difficulty of sample collection, and further prolong the training period of the recommendation model.

[0038] In order to improve the above various problems, a data processing system provided by an embodiment of the present application can be used, such as Figure 2The overall working idea of the data processing system is as follows: the cloud server first trains a general language model applicable to different recommendation services. Then the general language model and the template information corresponding to different recommendation tasks are configured to the terminal device. Further, the terminal device optimizes the template information corresponding to different recommendation tasks by using the feature extraction and text generation capabilities of the general language model. Finally, the general language model and the optimized template information are configured on the terminal device. The terminal device can obtain a recommendation model applicable to different recommendation tasks by combining the language model and the optimized template information. In practice, the recommendation task can be a generative recommendation task or a discriminative recommendation task. The recommendation model executing the generative recommendation task outputs text information, and the recommendation model executing the discriminative recommendation task outputs a classification result. The specific content of different recommendation tasks can be referred to the relevant description below.

[0039] As can be seen from the above description, the data processing system shown in Figure 2 The data processing system shown in actually also a kind of end-cloud collaborative model data processing system. When the recommendation task is a generative recommendation task, the collaborative working process of the terminal device and the cloud server in the system can be in detail as follows:

[0040] The cloud server can collect text data generated by different users in any scenario as training text, and train a general language model by unsupervised training. The general language model can be configured to the terminal device. Alternatively, the language model trained to convergence and the template information corresponding to different recommendation tasks can be encapsulated in the APP providing recommendation services at the same time, so that the general language model and the multiple template information can be configured to the terminal device together in response to the installation of the APP.

[0041] Further, the terminal device collects the historical behavior text of the user and the template information corresponding to any recommendation task as the input of the general language model, uses the feature extraction capability of the general language model to extract and fuse the features of the model input, uses the generation capability of the language model to generate predicted behavior text based on the feature fusion result, and optimizes the template information based on the predicted behavior text to obtain the optimized template information. Finally, the terminal device can combine the template information and the language model to obtain a recommendation model applicable to the recommendation task. And when optimizing the template information, the parameters of the general language model remain unchanged. Alternatively, the template information can be in text form or feature vector form.

[0042] It should be noted that, from the perspective of protecting personal privacy, the collected historical behavior text will also be filtered to remove the private information, so that the terminal device obtains historical behavior text without user private information.

[0043] In this embodiment, through the cooperative work of the terminal device and the cloud server, the terminal device is configured with a general language model and a plurality of template information corresponding to different recommendation tasks, the number and parameters of the models configured in the terminal device are greatly reduced, and the consumption of the memory in the terminal device can be reduced. Compared with training a complete recommendation model, the optimized template information contains fewer parameters, therefore, the terminal device only needs to collect a small amount of training samples and optimize the template information locally, and the consumption of the computing resources in the terminal device is also reduced in the optimization process. In addition, since the input of the general language model is text, and the text is universal, the historical behavior text in the form of text generated in any recommendation task can be understood by the language model, and the optimization of the template information can be completed using the historical behavior text, and the difficulty of collecting training samples is also reduced.

[0044] Taking an online shopping APP as an example, the action objects of different generative recommendation tasks can be embodied as buyers or sellers, and in order to describe clearly, the common generative recommendation tasks are explained directly using buyers or sellers as follows:

[0045] The search term recommendation task is to recommend a search term displayed in the search box on the home page of the online shopping APP to a buyer. The product recommendation task is to recommend a product displayed on the home page or the search result page of the shopping APP to a buyer according to the search term input by the buyer. The product recommendation task can also be to recommend other products to a seller in response to the product listing operation of the seller, and the product is used to guide the seller to list a new product. The product recommendation task based on the dialogue is to recommend a product to a buyer during a chat process according to the chat content between the buyer and the customer service of the seller.

[0046] In the execution of the above product recommendation tasks, specifically, the candidate recommended products can be obtained first, and then each candidate recommended product is classified, and the classification result indicates whether the buyer or the seller will click each candidate recommended product and the probability of clicking the candidate recommended product. Then, in one case, it can be determined whether to display the candidate recommended product according to the probability, and in another case, the candidate recommended products can also be sorted according to the probability to display the sorting result. The above classification process can be considered as a subtask in the product recommendation task, and this subtask can be considered as a discriminative task.

[0047] Optionally, when recommending a product to a buyer or a seller, an explanation script for the product can also be generated, which is used to explain the reason why the buyer or the seller is interested in the product. The generation of the explanation script is also an explanatory text generation task, and this task can also be considered as a subtask in the product recommendation task, and this subtask can be considered as a generative task.

[0048] For each generative recommendation task described above, the corresponding template information can be understood as follows:

[0049] When the recommendation task is a dialog-based product recommendation task, the corresponding template information can be "The product that the buyer may purchase is __". When the recommendation task is a product recommendation task for a merchant, the corresponding template information can be "The product that the merchant may list is __". When the recommendation task is a search term recommendation task, the corresponding template information can be "The buyer may search for __". When the recommendation task is an explanatory text generation task, the corresponding template information can be "The buyer may purchase product A, and the reason is __".

[0050] In practice, the recommendation model configured in the terminal device to perform the generative recommendation task can generate behavior text of the next step of the user, and the generation time of the behavior text of the next step is later than the first historical behavior text. And the behavior text of the next step can include content that does not appear in the historical behavior text and the template information.

[0051] Based on the above description, after the terminal device is configured to converge, the working focus of the terminal device is to optimize the template information, and the specific process of optimization can be understood in combination with the following flowcharts. In practice, since different generative recommendation tasks have different template information, the optimization process for each template information is the same, so any generative recommendation task can be taken as an example to describe the optimization process of the corresponding template information. In order to make the description clear, this any generative recommendation task can be referred to as a first recommendation task, the corresponding template information is referred to as a first template information, the model performing the first recommendation task is referred to as a first recommendation model, and the historical behavior text used when optimizing the first template information is referred to as a first historical behavior text.

[0052] Figure 3 A flowchart of a template information optimization method provided by an embodiment of the present application. The template information optimization method provided by the embodiment of the present application can be executed by a terminal device used by a user. In this embodiment, the first template information can be in the form of text. As shown in the figure, the method can include the following steps: Figure 3

[0053] S101, obtaining a first historical behavior text describing user behavior and a first template information corresponding to the first recommendation task.

[0054] When the APP is installed on the terminal device, the terminal device can collect historical behavior of the user in the APP in a historical time period, thereby obtaining historical behavior text in the form of text describing the historical behavior.

[0055] ​For the behavior described in the first historical behavior text, taking an online shopping APP as an example, it can be different behaviors generated by the user when using different services provided by the online shopping APP including recommendation services in a period of time. For example, the first historical behavior text can describe the search behavior, click behavior, browsing behavior, payment behavior and the like generated by the user when using the wine reservation service, transportation service, medical service, lending financial service and the like provided by the online shopping APP. Each historical behavior text can be composed of an action and an action result. For example, the historical behavior text is "user A purchases commodity B", wherein "purchase" is the behavior and "commodity B" is the action result.

[0056] At the same time, in response to the installation of the APP, the terminal device can also obtain first template information corresponding to the first recommendation task. The first template information can also be encapsulated in the APP. And the semantics of the first template information is used to reflect the task content of the first recommendation task. Wherein, the first recommendation task can be considered as a recommendation service provided by the online shopping APP for the user or a sub-service in a certain recommendation service, such as the above-mentioned product recommendation task for the user, search word recommendation task, explanatory text generation task, and dialog-based product recommendation task and the like.

[0057] S102, optimizing the first template information according to the first historical behavior text and the converged language model.

[0058] Further, the terminal device can also input the first historical behavior text in the form of text and the first template information into the language model already configured locally, and generate a prediction result by the language model. Optionally, the structure of the language model can be as shown in Figure 4 Based on this model structure, the generation process of the prediction result can be described as: the feature extraction layer in the language model respectively extracts features from the first template information and the first historical behavior text in the form of text, and fuses the extracted feature vectors, and then the generation layer in the language model generates a prediction result according to the fusion result. Wherein, the prediction result output by the language model is the predicted behavior text of the next behavior of the user. That is, the language model can analyze the first historical behavior text of the user to obtain personalized data such as the user's behavior habit and commodity preference, and then use the first template information as guide information to guide the generation of the prediction result.

[0059] Then, the terminal device can optimize the first template information according to the difference between the obtained second historical behavior text and the prediction result. Optionally, the optimization manner can be adjusting the textual description manner of the first template information according to the difference size, under the condition that the semantics is unchanged. The generation time of the second historical behavior text is later than that of the first historical behavior text, and thus the second historical behavior text is the real result of the next behavior of the user. Therefore, the difference between the second historical behavior text and the prediction result is the optimization direction of the first template information. The optimization of the first template information is stopped when the difference between the second historical behavior text and the prediction result meets the requirement. In the template information optimization process, the parameters of the language model remain unchanged.

[0060] It should be noted that, in practice, considering that the text cannot be directly input into the language model, the first template information and the first historical behavior text in the text form can be first converted into word vectors, and then the converted word vectors are input into the language model. Therefore, the "text input into the language model" described in the embodiments of the present application is actually the word vector of the text input into the language model.

[0061] In the present embodiment, compared with training a complete recommendation model, the optimization of the template information contains fewer parameters, and thus the terminal device only needs to collect a small amount of historical behavior texts and optimize the template information locally, the calculation amount in the optimization process is small, and the consumption of the computing resources in the terminal device is reduced. In addition, since the input of the general language model is text, and the text is universal, the historical behavior text in the text form generated under any recommendation task can be understood by the language model, and the use of this historical behavior text can reduce the collection difficulty of the training samples and quickly complete the optimization of the template information.

[0062] Optionally, the first template information can also be in the form of a feature vector, which can be referred to as a first template vector. The word vector corresponding to the first template information in the text form can be optimized as an initial template vector in the first template vector.

[0063] At this time, the first template information is optimized according to the difference between the second historical behavior text and the prediction result, and thus the first template information is more suitable for the next behavior of the user. Figure 3The process in the illustrated embodiment is similar. The optimization process of the first template vector by the terminal device can be described as follows: The first template vector and the first historical behavior text are input into the language model configured locally on the terminal device. The feature extraction layer in the language model extracts feature vectors from the two input parts respectively. The extracted feature vectors are fused, and then the generation layer in the language model generates a prediction result based on the fusion result. Next, the terminal device can calculate a loss value based on the difference between this prediction result and the second historical behavior text, and adjust the elements in the first template vector based on this loss value through backpropagation and gradient descent. During the adjustment of elements, the parameters of the language model remain unchanged. Furthermore, since the first template vector is a more abstract feature vector, it is easier for the language model to understand than the first template information in text form, making the optimization of the first template vector easier and more effective.

[0064] Regardless of whether the first template information is in text or vector form, both the feature vector extracted by the language model and the first template vector include multiple feature vectors. Therefore, when the first template information is a first template vector, in order to further reduce the computational load during feature fusion and reduce the consumption of terminal device computing resources during optimization, the language model can optionally fuse the feature vectors in the following manner:

[0065] The first feature extraction layer in the language model fuses each feature vector of the first historical text with each feature vector in the first template vector to obtain a first fused feature vector. Simultaneously, it fuses the feature vectors in the first template vector with each other to obtain a second fused feature vector. Both the first and second fused feature vectors still contain multiple feature vectors. Then, the second feature extraction layer in the language model fuses the feature vectors in the first fused feature vector with each other, and fuses the feature vectors in the second fused feature vector with each other again. Each of the first and second feature extraction layers contains at least one layer, and the second feature extraction layer follows the first feature extraction layer.

[0066] The above is actually a step-by-step fusion method: the first feature extraction layer first fuses the feature vectors of each first historical behavior text with the first template vector, and simultaneously fuses the feature vectors in the first template vector together; the second feature extraction layer then fuses the feature vectors of different historical behavior texts together, and simultaneously fuses the feature vectors in the first template vector together again. This process can also be achieved using... Figure 4 Understand the model structure shown.

[0067] Optionally, when the first template information is in the form of text, the language model can also fuse in the above-mentioned two-step manner, i.e., the first feature extraction layer first fuses the feature vectors of each first historical behavior text and the first template information respectively, and simultaneously fuses the feature vectors of the first template information with each other; the second feature extraction layer then fuses the feature vectors of different historical behavior texts with each other, and simultaneously fuses the feature vectors of the first template information with each other again, so as to improve the calculation speed of feature fusion.

[0068] In Figure 3 In the optimization process provided by the embodiment shown, the difference between the prediction result output by the language model and the second historical behavior text indicates the accuracy of the first template information, i.e., whether the template information needs to be further optimized. In order to improve the optimization speed of the first template information, Figure 5 The flowchart of another template information optimization method provided by the embodiment of the application is shown. In the embodiment, the first template information can be a first template vector. As shown in the figure, Figure 5 The method can include the following steps:

[0069] S201, obtaining a first historical behavior text for describing user behavior and first template information corresponding to a first recommendation task.

[0070] The execution process of step S201 can refer to the related description in the above-mentioned embodiments, which will not be described here. In the embodiment, the first template information can specifically be in the form of a feature vector, i.e., a first template vector.

[0071] S202, obtaining a first template text corresponding to the first recommendation task.

[0072] The first template text is also encapsulated in the APP, and when the APP is installed, the terminal device can obtain the first template text. The first template text corresponds to the first recommendation task and has the same semantics as the first template vector. For example, the semantics of the first template vector is "the user may purchase a product A, because ____, and the first template text can be "The user purchases a product named A, because ____".

[0073] S203, inputting the first historical behavior text, the first template text and the first template vector into a language model, so as to fuse the feature vectors of the first historical behavior text and the first template text and the first template vector by the language model.

[0074] Then, the first historical behavior text, the first template text and the first template vector are input into the language model, more specifically, the word vectors of the first historical behavior text, the first template text and the first template vector are input into the language model, so that the feature extraction layers in the language model respectively extract features of the three, and then the extracted feature vectors and the first template vector are fused.

[0075] As shown in the language model shown in Figure 4 The feature vectors of the first historical behavior text, the first template text and the first template vector extracted by the language model are each composed of multiple feature vectors. In order to improve the feature fusion speed, a step-by-step fusion method can also be used: the first feature extraction layer of the language model first fuses the feature vectors of the first template text and each of the first historical behavior texts with each feature vector in the first template vector to obtain third fusion feature vectors, and simultaneously fuses the first template vector with each other to obtain a fourth fusion vector; the second feature extraction layer of the language model further fuses the feature vectors in the third fusion feature vectors with each other, and simultaneously fuses the feature vectors in the fourth fusion feature vectors with each other again.

[0076] S204, obtaining a prediction result generated by the language model according to the fusion result.

[0077] S205, adjusting elements in the first template vector according to a difference between the prediction result and a second historical behavior text, the second historical behavior text being generated later than the first historical behavior text.

[0078] Finally, the language model can generate a prediction result according to the fusion result obtained by step-by-step fusion. Optionally, the prediction result can be generated by a generation layer in the language model. As in the embodiment shown in Figure 3 The terminal device can calculate a loss value according to a difference between the prediction result and a second historical behavior text, and then adjust the elements in the first template vector based on the loss value by means of back propagation and gradient descent. The word vector corresponding to the first template information in text form can be used as an initial template vector in the first template vector for optimization. It should be noted that the parameters of the first feature extraction layer, the second feature extraction layer and the generation layer in the language model remain unchanged during the above optimization process.

[0079] In addition, the process of the embodiment can also be combined with the language model understanding shown in Figure 4 Compared with the embodiment shown in Figure 3 In the embodiment, the first template text is newly introduced as an input of the language model. In order to distinguish from the input of the language model in the embodiment shown in Figure 3 The first template text is represented by a dashed box.

[0080] In this embodiment, after obtaining the first historical behavior text and the first template vector, the first template text can also be obtained. The first template vector and the first template text have the same semantics, that is, they can reflect the task content of the first recommendation task. Therefore, the first template text plays a guiding role in generating the prediction result of the language model, so that the difference between the generated prediction result and the second historical behavior text is smaller, thereby improving the optimization speed of the first template vector.

[0081] In addition, when the first template information is embodied in the form of text, the first template text can also be introduced at this time. At this time, the language model can still use the above-mentioned step-by-step fusion manner to fuse the feature vectors, and optimize the first template information according to the generated prediction result.

[0082] The process of feature fusion can be that the first feature extraction layer in the language model respectively fuses each feature vector of the first historical behavior text and the first template text with the word vector of the first template information in the form of text to obtain a third fusion feature vector, and simultaneously fuses the word vectors of the first template information in the form of text with each other to obtain a fourth fusion feature vector. The third fusion feature vector and the fourth fusion feature vector each still consist of multiple feature vectors. Then, the second feature extraction layer in the language model is used to mutually fuse each feature vector in the third fusion feature vector, and simultaneously mutually fuse each feature vector in the fourth fusion feature vector again.

[0083] In summary, for a terminal device that has configured a language model with training convergence, it can obtain multiple recommendation models on the basis of configuring the optimized template information corresponding to different generative tasks, and the number of model parameters is greatly reduced, thereby reducing the loss of memory resources in the terminal device. As for the template information optimization process, in one case, the first historical behavior text and the first template information can be used as the input of the language model, and the first template information can be optimized according to the prediction result output by the language model, thereby generating a first recommendation model containing the language model and the optimized first template information. The first template information is in the form of text or feature vector. Since the template information contains fewer parameters, the loss of computing resources on the terminal device can also be reduced in the optimization process. In another case, the first historical behavior text, the first template text and the first template information can be used as the input of the language model, the first template information can be optimized, and finally a first recommendation model can be obtained. The first template text is used to guide the generation direction of the prediction result, which reduces the loss of the terminal device while improving the optimization speed of the first template information.

[0084] It should be noted that, optionally, for the optimization process of the template information in each of the above embodiments, the template information can be continuously optimized as the user continuously generates new historical behavior text, that is, the real-time update of the recommendation model is realized. Considering that template optimization requires a certain amount of time, the terminal device can also reduce the optimization frequency of the template, that is, the optimization of the template information is performed periodically.

[0085] The first recommendation task in each of the above embodiments is a generative recommendation task, that is, the recommendation result is generated by the language model itself, and is not selected from the alternative recommendation result. In addition, in practice, there can also be a discriminative recommendation task, that is, a second recommendation task. Compared with the generative recommendation task, the discriminative recommendation task can be understood as a classification task, that is, the recommendation model is used to classify the alternative recommendation object, and the classification result is used to indicate whether the alternative recommendation object is displayed to the user. Then, for the APP as shown in the above embodiment, the terminal device and the cloud server in the APP can obtain a recommendation model suitable for the discriminative task through collaborative work. Figure 2 As shown in the model data processing system of the terminal cloud collaboration, the terminal device and the cloud server in the system obtain a recommendation model suitable for the discriminative task through collaborative work.

[0086] For such a discriminative task, the collaborative work process of the terminal device and the cloud server in the system can be described as follows:

[0087] The cloud server first trains a general language model, and configures the general language model to the terminal device. Further, the terminal device collects the historical behavior text of the user, the description text of the alternative recommendation object corresponding to the historical behavior text, and the template information of different discriminative recommendation tasks as inputs of the general language model, uses the feature extraction layer in the general language model to perform feature extraction and feature fusion on the model inputs, and uses the classification layer to generate a classification result based on the feature fusion result. The classification result is used as a basis for optimizing the template information to obtain optimized template information. Then, the classification layer and the second optimized template information are set to have the same parameters, that is, the parameters of the two are shared. The second optimized template information is in the form of a feature vector. And when optimizing the template information, the parameters of the general language model remain unchanged. Finally, the terminal device can combine the optimized template information, the classification layer, and the feature extraction layer in the language model to form a recommendation model. Optionally, the template information can be in the form of text or a feature vector. And in response to the installation of the APP, the classification layer can be configured to the terminal device together with the language model and the template information.

[0088] In the online shopping APP, the alternative recommendation object can be selected according to the historical behavior text and the sales of each commodity in the online shopping APP. The description text of the alternative recommendation object is used to describe the name, brand, specification and other detail information of the selected alternative recommendation object. The classification result output by the classification layer indicates whether the user will click on the alternative recommendation object. The recommendation task can be considered as a recommendation service provided by the online shopping APP or a sub-service in a certain recommendation service. For example, when the recommendation task is a commodity recommendation task for buyers, the template information can be “the commodity that the buyer may click is ____”.

[0089] In this embodiment, through the cooperative processing of the terminal device and the cloud server, the terminal device is configured with a general language model and a plurality of template information corresponding to different discriminative recommendation tasks, which can reduce the consumption of memory in the terminal device. Moreover, the optimized template information contains fewer parameters, so the consumption of computing resources in the terminal device is also reduced in the optimization process. In addition, since the input of the general language model is text, and the text is universal, the historical behavior text in the form of text generated under any recommendation task can be understood by the language model, so the optimization of the template information can be completed using this historical behavior text, and the difficulty of collecting training samples is also reduced.

[0090] In practice, the recommendation model configured in the terminal device to perform the discriminative recommendation task can output the classification result of the alternative recommendation object corresponding to the behavior text of the next step of the user, which indicates whether the user will click or purchase the alternative recommendation object.

[0091] Based on the above description, after the terminal device is configured to converge, the working focus of the terminal device is the optimization of the template information, and the specific process of optimization can be understood in combination with the following flowcharts. In practice, different discriminative recommendation tasks also have different template information, and the optimization process of each template information is the same, so the optimization process of the corresponding template information can be described taking any discriminative recommendation task as an example. In order to make the description clear, this any discriminative recommendation task can be referred to as a second recommendation task, the template information corresponding to the second recommendation task is referred to as a second template information, the model performing the second recommendation task is referred to as a second recommendation model, and the historical behavior text used to optimize the second template information is still referred to as a first historical behavior text.

[0092] Then Figure 6 The flowchart of another template information optimization method provided by the embodiment of the application. This method can also be executed by the terminal device. In this embodiment, the second template information can be in the form of text. As shown in Figure 6 The method can include the following steps:

[0093] S301, acquire the first historical behavior text for describing the user behavior, the description text of the candidate recommended object corresponding to the first historical behavior text, and the second template information corresponding to the second recommendation task.

[0094] The specific meanings of the first historical behavior text and the description text can be referred to the description in the related embodiments described above, which will not be repeated here. Meanwhile, the second template information corresponding to the second recommendation task can also be acquired, and the template information is configured into the terminal device together with the language model. The semantics of the second template information is the specific task content of the second recommendation task. Optionally, when the APP runs on the terminal device, the second template information encapsulated in the APP can be configured into the terminal device.

[0095] S302, optimize the second template information according to the feature extraction layer in the first historical behavior text, the description text and the language model.

[0096] Further, the terminal device can input the first historical behavior text, the description text and the second template information in the form of text into the language model configured locally, and then output the classification result by the classification layer. The language model can optimize the second template information by using the classification result.

[0097] For the generation of the classification result, the language model can perform feature extraction and feature fusion on the first historical behavior text, the description text and the second template information respectively, so as to output the feature fusion result by the language model. The classification layer outputs the classification result according to the feature fusion result. That is, the feature extraction layer in the language model can realize the analysis of the first historical behavior text and the description text of the user by feature extraction, so as to obtain the personalized data such as the behavior habit and the commodity preference of the user, and the classification layer outputs the classification result according to the second template information in the feature fusion result.

[0098] For the optimization of the second template information, since the classification result output by the language model is the predicted behavior text of the next behavior of the user, the terminal device can also acquire the second historical behavior text generated later than the first historical behavior text, and the real result of the next behavior of the user is the behavior and the behavior result described in the second historical behavior text. Therefore, the terminal device can optimize the second template information according to the difference between the classification result and the second historical behavior text. Optionally, the optimization process can be to adjust the description method of the second template information according to the difference size in the case of the same semantics.

[0099] Compared with training a complete recommendation model, the optimization of the template information in this embodiment contains fewer parameters, and therefore, the terminal device only needs to collect a small amount of historical behavior text and optimize the template information locally, the amount of calculation in the optimization process is less, and the loss of computing resources in the terminal device is reduced. In addition, since the input of the general language model is text, and the text is universal, the historical behavior text in the form of text generated under any recommendation task can be understood by the language model, and the use of this historical behavior text can reduce the difficulty of collecting training samples while quickly completing the optimization of the template information.

[0100] Alternatively, the second template information can also be in the form of a feature vector, referred to as a second template vector. At this time, the second template vector is obtained by inputting the text form of the second template information into the language model, and the language model extracts the feature vector of the text form of the second template information. Figure 6 Similar to the process in the embodiment shown, the optimization process of the terminal device for the second template vector is: inputting the description text, the second template vector and the first historical behavior text into the language model, so that the feature extraction layer in the language model extracts the feature vector respectively, and then fusing the extracted feature vectors. Then, the classification layer classifies the candidate recommendation object corresponding to the first historical behavior text according to the fusion result. Since the classification result output by the classification layer is used to predict the next behavior of the user, the terminal device can also obtain a second historical behavior text generated later than the first historical behavior text, and the true result of the next behavior of the user is the behavior and behavior result described in the second historical behavior text, therefore, the terminal device can calculate a loss value according to the difference between the classification result and the second historical behavior text, and adjust the elements in the second template vector by gradient descent and back propagation using the loss value. Wherein, the word vector corresponding to the text form of the second template information can be used as the initial second template vector, and the elements are adjusted on this basis. And in the above element adjustment process, the parameters of the first feature extraction layer and the second feature extraction layer in the language model are fixed and unchanged.

[0101] Compared with the word vector corresponding to the text form of the second template information, the second template vector is a more abstract feature vector, which is easier for the language model to understand, so that the optimization of the second template vector is easier and the optimization effect is better.

[0102] No matter whether the second template information is in the form of text or vector, the feature vectors extracted by the language model and the second template vector each include a plurality of feature vectors, in order to further reduce the amount of calculation in the feature fusion process and reduce the loss of computing resources of the terminal device in the optimization process, optionally, when the second template information is the second template vector, the language model can fuse the feature vectors in the following manner:

[0103] The first feature extraction layer in the language model is configured to fuse each feature vector included in the first historical text and the description text respectively with each feature vector in the second template vector to obtain a fifth fused feature vector, and to fuse the feature vectors in the second template vector with each other to obtain a sixth fused feature vector. The fifth fused feature vector and the sixth fused feature vector each still include a plurality of feature vectors. Subsequently, the second feature extraction layer in the language model is configured to fuse the feature vectors in the fifth fused feature vector with each other, and to fuse the feature vectors in the sixth fused feature vector with each other again.

[0104] It should be noted that when the second template information is in the form of text, the language model can also perform the step-by-step fusion in the above manner, i.e., the first feature extraction layer of the language model first fuses the feature vectors of each of the first historical behavior text and the description text respectively with the feature vectors of the second template information, and simultaneously fuses the feature vectors in the second template information with each other; and the second feature extraction layer of the language model then fuses the feature vectors of the historical behavior text and the description text with each other again, and simultaneously fuses the feature vectors in the second template information with each other again, so as to improve the calculation speed of feature fusion.

[0105] In Figure 6 In the optimization process provided in the embodiment shown, the difference between the classification result output by the language model and the second historical behavior text indicates the accuracy of the second template information, i.e., whether the template information needs to be further optimized. In order to improve the optimization speed of the second template information, Figure 7 A flowchart of another template information optimization method provided in the embodiment of the present application is shown. In the embodiment, the second template information can be a second template vector. As shown in Figure 8 The method can include the following steps:

[0106] S401, obtaining a first historical behavior text for describing a user's behavior, a description text of a candidate recommended object corresponding to the first historical behavior text, and a second template vector corresponding to a second recommendation task.

[0107] The execution process of step S401 can refer to the related description in the above embodiments, which will not be repeated here.

[0108] S402, obtaining a second template text corresponding to the second recommendation task.

[0109] Similar to the second template vector, the second template text is also encapsulated in the APP, and the terminal device can obtain the second template text after the APP is installed on the terminal device. The second template text corresponds to the second recommendation task and has the same semantics as the second template vector. For example, the semantics of the second template vector can be "The product that the buyer is likely to click is ____, and the second template text can be "The user may click a product named ____".

[0110] S403, input the first historical behavior text, the description text, the second template vector and the second template text into the language model, so that the language model fuses the feature vectors of the first historical behavior text, the description text and the second template text respectively and the second template vector.

[0111] Further, the first historical behavior text, the second template text and the description text can be input into the language model, more specifically, the word vectors of the three are input into the language model, so that the language model extracts feature vectors from the word vectors of the three respectively, and then fuses the extracted feature vectors and the second template vector input into the language model.

[0112] Wherein, the feature vectors of the first historical behavior text, the description text and the second template text respectively and the second template vector are composed of multiple feature vectors. In order to improve the calculation speed of feature fusion, the step-by-step fusion mode can also be used: the first feature extraction layer in the language model fuses each feature vector of the first historical behavior text, the second template text and the description text respectively and the second template vector to obtain the seventh fusion feature vector, and fuses the second template vector with each other to obtain the eighth fusion vector; the second feature extraction layer in the language model fuses each feature vector in the seventh fusion feature vector with each other, and fuses each feature vector in the eighth fusion feature vector with each other again.

[0113] S404, obtaining the classification result output by the classification layer according to the fusion result.

[0114] S405, adjusting the elements of the second template vector according to the difference between the classification result and the second historical behavior text, and the generation time of the second historical behavior text is later than that of the first historical behavior text.

[0115] The execution process of steps S404-S405 can be referred to the related description in the above embodiments, which will not be repeated here.

[0116] In the above element adjustment process, the parameters of the first feature extraction layer and the second feature extraction layer in the language model are fixed and unchanged. The process of the present embodiment can also be combined with the second recommendation model understanding shown in Figure 8 Compared withFigure 7 In the embodiment shown, a second template text is newly introduced as the input of the model in this embodiment. In order to distinguish the input of the model in this embodiment from the input of the model in the embodiment shown in FIG. 1, the second template text is represented by a dashed box. Figure 7

[0117] In this embodiment, after obtaining the first historical behavior text, the description text and the second template vector, the second template text can also be obtained. The second template vector and the second template text have the same semantics, i.e., can reflect the task content of the second recommendation task. Therefore, the second template text plays a guiding role in generating the prediction result of the language model, so that the difference between the generated prediction result and the second historical behavior text is smaller, thereby improving the optimization speed of the second template vector.

[0118] In the embodiment shown in FIG. 1, the first template information is embodied in the form of a text. In the embodiment shown in FIG. 2, the second template information is also embodied in the form of a text. Figure 7 On the basis of introducing the second template text in the embodiment shown, optionally, when the second template information is embodied in the form of a text, at this time, the language model can still use the above-mentioned step-by-step fusion manner to fuse the feature vectors, and optimize the first template information according to the generated prediction result.

[0119] The process of feature fusion can be: the first feature extraction layer in the language model respectively fuses each feature vector of the first historical behavior text, the description text and the second template text with the word vector of the second template information to obtain a seventh fused feature vector, and simultaneously fuses the word vector of the second template information with each other to obtain an eighth fused feature vector. The seventh fused feature vector and the eighth fused feature vector each still consist of multiple feature vectors. Then, the second feature extraction layer in the language model fuses each feature vector in the seventh fused feature vector with each other and simultaneously fuses each feature vector in the eighth fused feature vector with each other again.

[0120] ​In summary, for the terminal device which has been configured with the language model with training convergence, it can obtain multiple recommended models based on the configuration of the template information optimized by different discriminative tasks respectively corresponding to the optimization, and the number of model parameters is greatly reduced, thereby reducing the loss of memory resources in the terminal device. For the template information optimization process, in one case, the first historical behavior text, the description text and the second template information can be taken as the input of the language model, and the second template information is optimized according to the classification result output by the language model, thereby generating the second recommended model containing the feature extraction layer in the language model, the optimized second template information and the classification layer. The classification layer and the optimized second template information have the same parameters. The second template information is in the form of text or feature vector. Since the template information contains fewer parameters, the loss of computing resources on the terminal device can also be reduced in the optimization process. In another case, the first historical behavior text, the description text, the second template text and the second template information can be taken as the input of the language model to optimize the second template information, and finally obtain the second recommended model. The second template text is used to guide the generation direction of the prediction result, which reduces the loss of the terminal device while improving the optimization speed of the second template information.

[0121] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A model data processing system, characterized by, Comprise: Terminal device and cloud server; The cloud server is used for training a language model according to training text; configuring the converged language model and the first template information corresponding to the first recommendation task into the application installed in the terminal device, the application comprising a plurality of recommendation models including the first recommendation model, the plurality of recommendation models sharing the same language model; The terminal device is used for obtaining a first historical behavior text for describing user behavior and the first template information; According to the first historical behavior text and the language model, the first template information is optimized to obtain the first recommendation model comprising the optimized first template information and the language model, the first recommendation model corresponding to the first recommendation task, the user behavior comprising behaviors generated by the user using the plurality of recommendation models, and one first historical behavior text for uniquely identifying one behavior generated by the user using any recommendation model.

2. The system of claim 1, wherein, The first template information comprises a first template vector; The terminal device is used for inputting the first historical behavior text into the language model to fuse the feature vector of the first historical behavior text and the first template vector by the language model; Obtaining a prediction result generated by the language model according to the fusion result; According to the difference between the prediction result and the second historical behavior text, the elements in the first template vector are optimized, and the generation time of the second historical behavior text is later than that of the first historical behavior text.

3. The system of claim 2, wherein, The terminal device is also used for obtaining a first template text corresponding to the first recommendation task, the first template text and the first template vector being semantically identical; The first historical behavior text, the first template text and the first template vector are input into the language model to fuse the respective feature vectors of the first historical behavior text and the first template text and the first template vector by the language model.

4. The system of claim 3, wherein, The first feature extraction layer in the language model is used for fusing the respective feature vectors of the first historical behavior text and the first template text with the first template vector to obtain a fusion feature vector; The second feature extraction layer in the language model is used for fusing the respective feature vectors in the fusion feature vector, and the second feature extraction layer is after the first feature extraction layer.

5. The system of any one of claims 1 to 4, wherein, The first recommendation model generates a behavior text of the next step behavior of the user, and the generation time of the next step behavior text is later than that of the first historical behavior text.

6. The system of claim 1, wherein, The terminal device is also used for obtaining a description text of an alternative recommendation object corresponding to the first historical behavior text and second template information corresponding to a second recommendation task; According to the first historical behavior text, the description text, the classification layer and the feature extraction layer in the language model, the second template information is optimized, The classification layer and the second template information after optimization are set to have the same parameters to obtain a second recommendation model including the classification layer, the second template information after optimization, and a feature extraction layer in the language model, the second recommendation model corresponding to the second recommendation task.

7. The system of claim 6, wherein, The second template information includes a second template vector. The terminal device inputs the first historical behavior text, the description text, and the second template vector into a feature extraction layer in the language model to fuse respective feature vectors of the first historical behavior text and the description text and the second template vector by the feature extraction layer. A classification result output by the classification layer according to the fusion result is obtained. According to a difference between the classification result and a second historical behavior text, an element in the second template vector is adjusted, the second historical behavior text being generated later than the first historical behavior text.

8. The system of claim 7, wherein, The terminal device further inputs a second template text corresponding to the second recommendation task into the feature extraction layer in the language model, the second template text and the second template vector being semantically identical. The terminal device further inputs a second template text corresponding to the second recommendation task into the feature extraction layer in the language model, the second template text and the second template vector being semantically identical.

9. The system of any one of claims 6 to 8, wherein, The second recommendation model outputs a classification result of an alternative recommendation object corresponding to a behavior text of a next step of the user, the behavior text of the next step being generated later than the first historical behavior text.

10. A model data processing system, characterized by, The second recommendation model outputs a classification result of an alternative recommendation object corresponding to a behavior text of a next step of the user, the behavior text of the next step being generated later than the first historical behavior text. The second recommendation model outputs a classification result of an alternative recommendation object corresponding to a behavior text of a next step of the user, the behavior text of the next step being generated later than the first historical behavior text. The second recommendation model outputs a classification result of an alternative recommendation object corresponding to a behavior text of a next step of the user, the behavior text of the next step being generated later than the first historical behavior text. The second recommendation model outputs a classification result of an alternative recommendation object corresponding to a behavior text of a next step of the user, the behavior text of the next step being generated later than the first historical behavior text. The second recommendation model outputs a classification result of an alternative recommendation object corresponding to a behavior text of a next step of the user, the behavior text of the next step being generated later than the first historical behavior text. ​

Citation Information

Patent Citations

  • Fine tuning method and device for a language model, computing equipment and storage medium

    CN113468877A