Sequence recommendation method and device
By obtaining the user's historical interaction object sequence and using a large language model to generate text description information, combined with the embedded representation of object identification and text description information, the input sequence recommendation model solves the problem of inaccurate recommendations in the existing technology and improves the accuracy of recommendations. sex.
Patent Information
- Application Number
- CN202410970177.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-10-15
AI Technical Summary
In the existing technology, it is difficult to mine the patterns of user historical interaction object sequences, resulting in inaccurate recommendations.
By obtaining the user's historical interaction object sequence, using a large language model to generate the text description information of the object, and combining the embedded representation of the object identifier and text description information, the sequence recommendation model is input to improve the recommendation accuracy.
It enhances the ability to mine object sequence patterns and improves the accuracy and effect of recommendations.
Smart Images

Figure CN118779529A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computers, and more particularly, to a sequence recommendation method and device. Background Art
[0002] Sequential recommendation is an object sequence composed of various objects that the user has interacted with historically, and recommends the next object that the user may interact with. Objects are also called items, which usually refer to Internet products. For example, the goods on e-commerce websites in marketing scenarios can be physical items such as clothing and cosmetics, or virtual items such as software programs. Users and various objects have several interactive behaviors in the time dimension, such as user purchases, downloads, collections, browsing, etc. Among them, user behavior data may be private data.
[0003] In the prior art, the objects that the user has interacted with historically are arranged in chronological order to form an object sequence, and one or more objects at the next moment are recommended by mining the regularity of the object sequence. Since the regularity of the object sequence is usually difficult to mine, it may lead to incorrect recommendations. Summary of the invention
[0004] One or more embodiments of this specification describe a sequence recommendation method and device, which can improve the accuracy of recommendations.
[0005] In a first aspect, a sequence recommendation method is provided, the method comprising:
[0006] Acquire an object sequence consisting of multiple objects historically interacted by the user; the objects have an object identifier and first feature information corresponding to a plurality of basic attribute features;
[0007] Constructing a prompt text using the first feature information of any object in the object sequence, inputting the prompt text into a large language model to obtain text description information of the object; the text description information at least includes second feature information corresponding to the extended attribute feature;
[0008] Determine a first embedded representation corresponding to an object identifier of each object in the object sequence, and determine a second embedded representation corresponding to text description information of each object;
[0009] The first embedding representation and the second embedding representation respectively corresponding to each object in the object sequence are input into the sequence recommendation model to obtain the target object recommended to the user.
[0010] In a possible implementation manner, the basic attribute features include the object name and the object year; the extended attribute features include the object function, object characteristics, and possible preferences of people who may like the object.
[0011] In a possible implementation, determining the first embedded representation corresponding to the object identifier of each object in the object sequence includes:
[0012] According to the object identifier of any object in the object sequence, a pre-built embedding table of object identifiers and embedded representations is searched to obtain a first embedded representation of the object.
[0013] In a possible implementation, determining the second embedded representation corresponding to the text description information respectively possessed by each object in the object sequence includes:
[0014] The text description information of any object in the object sequence is input into the encoder to obtain a second embedding representation of the object.
[0015] In a possible implementation, the large language model and the sequence recommendation model are jointly trained in the following manner:
[0016] Constructing a prompt text using the first feature information of any object in the sample object sequence, inputting the prompt text into the large language model to obtain text description information of the object and its generation probability;
[0017] Inputting a first embedding representation corresponding to an object identifier of each object in the sample object sequence and a second embedding representation corresponding to text description information into a sequence recommendation model, and obtaining a first probability of recommending a label object corresponding to the sample object sequence from a candidate object set;
[0018] Taking maximizing the first probability as a first training objective, model parameters of the large language model and the sequence recommendation model are adjusted.
[0019] Furthermore, the joint training also includes:
[0020] Inputting first embedding representations corresponding to respective objects in the sample object sequence into the sequence recommendation model to obtain a second probability of selecting the label object from the candidate object set;
[0021] The adjusting the model parameters of the large language model and the sequence recommendation model includes:
[0022] Determining, according to a ratio of the first probability to the second probability, a gradient weight when adjusting the parameters of the large language model;
[0023] A parameter adjustment amount is determined according to the product of the gradient direction and the gradient weight, and the parameters of the large language model are updated according to the parameter adjustment amount.
[0024] Further, if the first probability is greater than the second probability, the gradient direction is a direction that maximizes the generation probability;
[0025] If the first probability is less than the second probability, the gradient direction is a direction that minimizes the generation probability.
[0026] In a second aspect, a sequence recommendation device is provided, the device comprising:
[0027] An acquisition unit, used to acquire an object sequence consisting of a plurality of objects with which the user has historically interacted; the objects have an object identifier and first feature information corresponding to a plurality of basic attribute features;
[0028] a generating unit, configured to construct a prompt text by using the first feature information of any object in the object sequence acquired by the acquiring unit, and input the prompt text into a large language model to obtain text description information of the object; the text description information at least includes second feature information corresponding to an extended attribute feature;
[0029] a representation unit, configured to determine a first embedded representation corresponding to the object identifier of each object in the object sequence acquired by the acquisition unit, and to determine a second embedded representation corresponding to the text description information of each object obtained by the generation unit;
[0030] The recommendation unit is used to input the first embedding representation and the second embedding representation corresponding to each object in the object sequence obtained by the representation unit into the sequence recommendation model to obtain a target object recommended to the user.
[0031] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.
[0032] According to a fourth aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect is implemented.
[0033] Through the method and device provided in the embodiment of this specification, firstly, an object sequence consisting of multiple objects of user historical interaction is obtained; the object has an object identifier and first feature information corresponding to several basic attribute features; then, a prompt text is constructed using the first feature information of any object in the object sequence, and the prompt text is input into a large language model to obtain text description information of the object; the text description information at least includes second feature information corresponding to extended attribute features; then, the first embedding representation corresponding to the object identifier of each object in the object sequence is determined, and the second embedding representation corresponding to the text description information of each object is determined; finally, the first embedding representation and the second embedding representation corresponding to each object in the object sequence are input into a sequence recommendation model to obtain the target object recommended to the user. As can be seen from the above, in the embodiment of this specification, a large language model is used to generate text description information of an object, and the text description information can supplement the object information lacking in traditional sequence recommendation. Not only the first embedding representation corresponding to the object identifier is input into the sequence recommendation model, but also the second embedding representation corresponding to the text description information is input into the sequence recommendation model, which can better mine the regularity of the object sequence, which is conducive to improving the recommendation effect, thereby improving the accuracy of the recommendation. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0035] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification;
[0036] Figure 2 A flow chart of a sequence recommendation method according to an embodiment is shown;
[0037] Figure 3 A schematic diagram showing generation of a detailed text description for a product according to one embodiment;
[0038] Figure 4 A schematic diagram showing generating a first embedded representation and a second embedded representation according to one embodiment;
[0039] Figure 5 A schematic diagram showing a method of using a sequence recommender to recommend products according to an embodiment;
[0040] Figure 6 A schematic diagram showing alignment training of a large language model and a sequence recommender according to one embodiment is shown;
[0041] Figure 7 A schematic block diagram of a sequence recommendation apparatus according to an embodiment is shown. DETAILED DESCRIPTION
[0042] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0043] Figure 1 This is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification. The implementation scenario involves sequence recommendation, that is, based on the object sequence composed of various objects of the user's historical interaction in chronological order, determine the target object recommended to the user. Figure 1 When users visit the Internet, they will have various interactive behaviors with various objects displayed on the Internet. For example, the objects that a user has interacted with in the past on an e-commerce platform are arranged in chronological order, thus forming the user's object sequence. The object sequence includes items A, B, and C arranged in sequence. The user's recent historical behaviors on the e-commerce platform have included browsing, searching, and purchasing, and the items they interacted with include items A, B, and C. Based on the object sequence, the e-commerce platform may recommend products related to items A, B, and C to the user when he visits the platform next time, which will make it easier to obtain positive feedback from the user, such as click-to-browse or conversion to purchase. When an object is available for sale, it can also be called a commodity.
[0044] pass Figure 1 The example of , can help us understand the scenario of sequential recommendation, that is, recommending objects that users may be interested in in the future based on the object sequence of the user's historical interaction. The above objects have a wide range of meanings, including but not limited to items for sale on e-commerce platforms, news on news websites, songs on music websites, etc.
[0045] In real life, people's interests often change over time, and at the same time, the object sequences driven by user interests are also diverse. For example, in a period of time, users are more interested in mobile communication related products such as headphones, mobile phone films, and mobile phones; in another period of time, users are interested in online games and social interactive game-related products. Therefore, at different times, different users, and different scenarios, object sequences present various forms and changes. Since the rules of object sequences are usually difficult to mine, incorrect recommendations may result, that is, the recommended objects often cannot obtain positive feedback from users.
[0046] The embodiments of this specification propose corresponding solutions for improving the accuracy of recommendations in sequence recommendations.
[0047] Research has found that in sequence recommendation, only a small amount of object-related features that can be collected are used as information to describe the object. Without a detailed description of the object, it is difficult to mine the regularity of the object sequence, and therefore it is difficult to make accurate recommendations. In the embodiment of this specification, a large language model is used to generate object-related text as knowledge enhancement to improve the effect of sequence recommendation.
[0048] Among them, the large language model (LLM) is a type of basic model that is trained with a large amount of data to enable it to understand and generate natural language and other types of content to perform various tasks.
[0049] Figure 2 A flowchart of a sequence recommendation method according to an embodiment is shown. The method can be based on Figure 1 The implementation scenario shown in Figure 1 is as follows. Figure 2 As shown, the sequence recommendation method in this embodiment includes the following steps: Step 21, obtaining an object sequence consisting of multiple objects with which the user has interacted historically; the object has an object identifier and first feature information corresponding to several basic attribute features; Step 22, constructing a prompt text using the first feature information of any object in the object sequence, inputting the prompt text into a large language model, and obtaining text description information of the object; the text description information at least includes second feature information corresponding to an extended attribute feature; Step 23, determining the first embedding representation corresponding to the object identifier of each object in the object sequence, and determining the second embedding representation corresponding to the text description information of each object; Step 24, inputting the first embedding representation and the second embedding representation corresponding to each object in the object sequence into the sequence recommendation model, and obtaining the target object recommended to the user. The specific execution method of each of the above steps is described below.
[0050] First, in step 21, an object sequence consisting of multiple objects with which the user has historically interacted is obtained; the object has an object identifier and first feature information corresponding to a number of basic attribute features. It can be understood that the above object sequence is composed of each object in chronological order, and the basic attribute features are some conventional features, and the above first feature information can be directly obtained from the attribute information list of the object.
[0051] In one example, the basic attribute features include object name and object year.
[0052] In this example, the first characteristic information corresponds to the brief information of the object. Taking the object as a product as an example, the basic attribute characteristics include the product name and the product year, wherein the product year can be understood as the year of manufacture of the product or the year of release of the product, etc.
[0053] In the embodiment of this specification, each object of the above historical interaction may correspond to an interaction behavior that occurred within a preset time period, for example, the preset time period is the last day, the last week, or the last month. Optionally, the object is an Internet product, and the interaction includes any one of purchase, download, collection, and browsing. Among them, Internet products have a broad meaning, including various products that require the use or transaction of the Internet, and users can interact with the display objects corresponding to Internet products. For example, a user bought a piece of clothing, downloaded a game, collected a movie, and browsed the details page of a product.
[0054] In the embodiments of the present specification, each object of the user's historical interaction may correspond to the same interactive behavior. For example, each object of the user's interaction is game A, game B, and game C, and the interactive behaviors all correspond to downloading; or, each object of the user's interaction is item A, item B, and item C, and the interactive behaviors are browsing, searching, and purchasing, respectively.
[0055] Then, in step 22, a prompt text is constructed using the first feature information of any object in the object sequence, and the prompt text is input into the large language model to obtain text description information of the object; the text description information at least includes second feature information corresponding to the extended attribute feature. It can be understood that the extended attribute features are some unconventional features, and the second feature information cannot usually be directly obtained from the attribute information list of the object.
[0056] In one example, the extended attribute features include object functions, object characteristics, and possible preferences of people who may like the object.
[0057] In this example, the second feature information corresponds to a detailed description of the object. Taking the object as a product as an example, the extended attribute features include product functions, product highlights, and possible preferences of people who may like the product.
[0058] Figure 3 A schematic diagram showing generating a detailed text description for a product according to an embodiment. Figure 3, each candidate object in the sequence recommendation is specifically a commodity, each commodity has its own corresponding commodity identification (ID), commodity name and commodity year, and a large language model can generate a detailed text description for the commodity, which is also called commodity knowledge. Among them, a prompt word template is provided, which can issue instructions to the large language model to generate a detailed text description for the commodity. The template content can be as follows: "You need to help me as an assistant to summarize which type of people will like a specific commodity and give a detailed description of the commodity. I will provide you with brief information about the commodity in the following json format: {'title':'commodity name', 'year':'commodity year'}. Requirements: You need to reply in the following json format: {'descr ipt ion:'commodity detailed description, including functions, highlights, etc.', 'preferences':'the preferences that people who like this commodity may have'}". By filling the brief information of the commodity into the template, a prompt text can be constructed, and the prompt text is input into the large language model. The large language model will generate a text-based description of the commodity according to the instructions in the prompt text, which may include user preference information. Assuming that the sequence of product IDs of the user's historical interactions is x, the large language model will output the probability p(s\x) of the generated text information s given the sequence x of product IDs of the user's historical interactions, and p(s\x) is differentiable with respect to the parameters of the large language model.
[0059] It should be noted that Figure 3 Only the text description information of a product is obtained for a product. The same can be used for any object in the object sequence. Figure 3 Get the text description information of the object.
[0060] Then, in step 23, the first embedding representation corresponding to the object identifier of each object in the object sequence is determined, and the second embedding representation corresponding to the text description information of each object is determined. It can be understood that the first embedding representation and the second embedding identifier make the related objects closer in the embedding space and the unrelated objects farther in the embedding space, so that the correlation between objects can be represented by the distance between vectors.
[0061] In one example, determining the first embedded representation corresponding to the object identifier of each object in the object sequence includes:
[0062] According to the object identifier of any object in the object sequence, a pre-built embedding table of object identifiers and embedded representations is searched to obtain a first embedded representation of the object.
[0063] In this example, corresponding to the certainty of the object identifier, by searching the pre-built embedding table of object identifiers and embedding representations, it is possible to quickly determine the first embedding representation corresponding to the object identifier of each object in the object sequence, which is suitable for online sequence recommendation scenarios.
[0064] In one example, determining the second embedded representation corresponding to the text description information respectively possessed by each object in the object sequence includes:
[0065] The text description information of any object in the object sequence is input into the encoder to obtain a second embedding representation of the object.
[0066] In this example, corresponding to the uncertainty of the text description information, by inputting the text description information into the encoder, it is possible to accurately determine the second embedding representation corresponding to the text description information of each object in the object sequence.
[0067] Figure 4 FIG. 1 is a schematic diagram showing a method of generating a first embedded representation and a second embedded representation according to an embodiment. Figure 4 , use the encoder to encode the commodity knowledge generated by the large language model to obtain the embedded representation of knowledge r s , where product knowledge is the text description information of the aforementioned object, and the encoder can use the Bert model; according to the product ID, the embedded representation of the product ID is taken out from the embedding table of the product ID id , where the ID of the product is the aforementioned object identifier, and the embedding table of the product ID contains the mapping relationship between the object identifier and the embedded representation, for example, it contains the embedded representation corresponding to ID_0, the embedded representation corresponding to ID_1, and so on. It can be understood that r id That is, the first embedding representation mentioned above, r s That is, the aforementioned second embedded representation. Each object in the object sequence has its own corresponding first embedded representation and second embedded representation.
[0068] Finally, in step 24, the first embedding representation and the second embedding representation corresponding to each object in the object sequence are input into the sequence recommendation model to obtain the target object recommended to the user. It can be understood that the second embedding representation corresponds to the text description information of the object, which is more detailed than the brief information of the object, which is conducive to improving the accuracy of the recommendation.
[0069] Figure 5 FIG. 1 is a schematic diagram showing a method of using a sequence recommender to recommend products according to an embodiment. Figure 5Assume that the sequence of product IDs of the user's historical interactions is x, the sequence of knowledge obtained by the large language model for the products of the user's historical interactions is s, and any candidate recommended product is y. The embedded representation of the product knowledge is r s The embedding representation r corresponding to the product ID id They are input into a sequence recommender, which can be a simple transformer structure sequence recommender. The sequence recommender can be used to obtain the sequence x of product IDs of the given user's historical interactions and the sequence s of knowledge obtained by the user's historical interactions through the large language model. The probability that any candidate recommended product y is interacted by the user is p(y\x,s). The above probability can be used to determine the target object recommended to the user.
[0070] In the embodiment of this specification, the loss function of training can be constructed using the user's actual next interactive product in the training data to perform alignment training on the large language model and the sequence recommender.
[0071] Figure 6 FIG. 1 is a schematic diagram showing alignment training of a large language model and a sequence recommender according to an embodiment. Figure 6 The entire sequence recommendation process can be divided into two parts, one part is the knowledge enhancement and knowledge encoding process, and the other part is the knowledge enhanced sequence recommendation process. The accuracy of the product ID recommended by the model depends not only on the sequence recommender, but also on the large language model. In the embodiment of this specification, it is expected that after adding the content s generated by the large language model, the sequence recommender can predict the ID of the real product with a greater probability than the content s not generated by the large language model. Based on this, the loss function of the training is constructed using the user's real next interactive product in the training data, and the large language model and the sequence recommender are aligned and trained. Among them, alignment training can also be called joint training.
[0072] In one example, the large language model and the sequence recommendation model are jointly trained in the following manner:
[0073] Constructing a prompt text using the first feature information of any object in the sample object sequence, inputting the prompt text into the large language model to obtain text description information of the object and its generation probability;
[0074] Inputting a first embedding representation corresponding to an object identifier of each object in the sample object sequence and a second embedding representation corresponding to text description information into a sequence recommendation model, and obtaining a first probability of recommending a label object corresponding to the sample object sequence from a candidate object set;
[0075] Taking maximizing the first probability as a first training objective, model parameters of the large language model and the sequence recommendation model are adjusted.
[0076] In this example, the parameters in the sequence recommender can be optimized by maximizing the probability p(y\x,s) of the true ID in the training sample.
[0077] Furthermore, the joint training also includes:
[0078] Inputting first embedding representations corresponding to respective objects in the sample object sequence into the sequence recommendation model to obtain a second probability of selecting the label object from the candidate object set;
[0079] The adjusting the model parameters of the large language model and the sequence recommendation model includes:
[0080] Determining, according to a ratio of the first probability to the second probability, a gradient weight when adjusting the parameters of the large language model;
[0081] A parameter adjustment amount is determined according to the product of the gradient direction and the gradient weight, and the parameters of the large language model are updated according to the parameter adjustment amount.
[0082] In this example, the following goal can be achieved: if a content s allows the sequence recommender to predict the ID of a real product with a higher probability, then the large language model is encouraged to generate this content s.
[0083] For example, only the embedding representation corresponding to the product ID is id Input into a sequential recommender, which can obtain the sequence x of product IDs of given user historical interactions. The probability that any candidate recommended product y is interacted by the user is p(y\x). Let the model parameter in the large language model be θ l ,Through mathematical derivation, it is concluded that the ID of the real product in the training sample is used to optimize θ l The formula is as follows:
[0084]
[0085] It can be understood that in the above formula, when p(y|x,s) / p(y|x) is larger, using this formula to optimize the parameters in the recommender can make the probability p(s|x) of the large language model generating content s larger. Therefore, if a content s allows the sequence recommender to predict the ID of the real product with a higher probability, then the large language model is encouraged to generate this content s.
[0086] Further, if the first probability is greater than the second probability, the gradient direction is a direction that maximizes the generation probability;
[0087] If the first probability is less than the second probability, the gradient direction is a direction that minimizes the generation probability.
[0088] In this example, for those s that make the sequence recommender better predict the ID of the real product, the logp(s\x) of these s is made larger. For those s that make the sequence recommender worse predict the ID of the real product, the logp(s\x) of these s is made smaller.
[0089] Through the method provided in the embodiment of this specification, firstly, an object sequence consisting of multiple objects of user historical interaction is obtained; the object has an object identifier and first feature information corresponding to several basic attribute features; then, a prompt text is constructed using the first feature information of any object in the object sequence, and the prompt text is input into a large language model to obtain text description information of the object; the text description information at least includes second feature information corresponding to extended attribute features; then, the first embedding representation corresponding to the object identifier of each object in the object sequence is determined, and the second embedding representation corresponding to the text description information of each object is determined; finally, the first embedding representation and the second embedding representation corresponding to each object in the object sequence are input into a sequence recommendation model to obtain the target object recommended to the user. As can be seen from the above, in the embodiment of this specification, a large language model is used to generate text description information of an object, and the text description information can supplement the object information lacking in traditional sequence recommendation. Not only the first embedding representation corresponding to the object identifier is input into the sequence recommendation model, but also the second embedding representation corresponding to the text description information is input into the sequence recommendation model, which can better mine the regularity of the object sequence, which is conducive to improving the recommendation effect, thereby improving the accuracy of the recommendation.
[0090] In addition, since the large language model has a large amount of world knowledge, using the large language model to generate descriptions about products can supplement the product information that is usually lacking. At the same time, alignment training is used to train the large language model and the sequence recommender, so that the product information generated by the large language model is more suitable for the recommender, thereby improving the recommendation effect.
[0091] According to another aspect of the embodiment, a sequence recommendation device is also provided, and the device is used to execute the method provided in the embodiment of this specification. Figure 7 FIG. 4 is a schematic block diagram of a sequence recommendation device according to an embodiment. Figure 7 As shown, the device 700 includes:
[0092] An acquisition unit 71 is used to acquire an object sequence consisting of multiple objects with which the user has historically interacted; the objects have an object identifier and first feature information corresponding to a plurality of basic attribute features;
[0093] A generating unit 72 is used to construct a prompt text using the first feature information of any object in the object sequence obtained by the obtaining unit 71, and input the prompt text into a large language model to obtain text description information of the object; the text description information at least includes second feature information corresponding to the extended attribute feature;
[0094] The representation unit 73 is used to determine a first embedded representation corresponding to the object identifier of each object in the object sequence obtained by the obtaining unit 71, and to determine a second embedded representation corresponding to the text description information of each object obtained by the generating unit 72;
[0095] The recommendation unit 74 is used to input the first embedding representation and the second embedding representation corresponding to each object in the object sequence obtained by the representation unit 73 into a sequence recommendation model to obtain a target object recommended to the user.
[0096] Optionally, as an embodiment, the basic attribute features include the object name and the object year; the extended attribute features include the object function, object characteristics, and possible preferences of people who may like the object.
[0097] Optionally, as an embodiment, the representation unit 73 is specifically configured to search a pre-constructed embedding table of object identifiers and embedded representations according to an object identifier of any object in the object sequence to obtain a first embedded representation of the object.
[0098] Optionally, as an embodiment, the representation unit 73 is specifically configured to input text description information of any object in the object sequence into an encoder to obtain a second embedded representation of the object.
[0099] Optionally, as an embodiment, the large language model and the sequence recommendation model are jointly trained in the following manner:
[0100] Constructing a prompt text using the first feature information of any object in the sample object sequence, inputting the prompt text into the large language model to obtain text description information of the object and its generation probability;
[0101] Inputting a first embedding representation corresponding to an object identifier of each object in the sample object sequence and a second embedding representation corresponding to text description information into a sequence recommendation model, and obtaining a first probability of recommending a label object corresponding to the sample object sequence from a candidate object set;
[0102] Taking maximizing the first probability as a first training objective, model parameters of the large language model and the sequence recommendation model are adjusted.
[0103] Furthermore, the joint training also includes:
[0104] Inputting first embedding representations corresponding to respective objects in the sample object sequence into the sequence recommendation model to obtain a second probability of selecting the label object from the candidate object set;
[0105] The adjusting the model parameters of the large language model and the sequence recommendation model includes:
[0106] Determining, according to a ratio of the first probability to the second probability, a gradient weight when adjusting the parameters of the large language model;
[0107] A parameter adjustment amount is determined according to the product of the gradient direction and the gradient weight, and the parameters of the large language model are updated according to the parameter adjustment amount.
[0108] Further, if the first probability is greater than the second probability, the gradient direction is a direction that maximizes the generation probability;
[0109] If the first probability is less than the second probability, the gradient direction is a direction that minimizes the generation probability.
[0110] Through the device provided in the embodiment of this specification, first, the acquisition unit 71 acquires an object sequence consisting of multiple objects of user historical interaction; the object has an object identifier and first feature information corresponding to several basic attribute features; then the generation unit 72 constructs a prompt text using the first feature information of any object in the object sequence, inputs the prompt text into the large language model, and obtains the text description information of the object; the text description information at least includes the second feature information corresponding to the extended attribute feature; then the representation unit 73 determines the first embedded representation corresponding to the object identifier of each object in the object sequence, and determines the second embedded representation corresponding to the text description information of each object; finally, the recommendation unit 74 inputs the first embedded representation and the second embedded representation corresponding to each object in the object sequence into the sequence recommendation model to obtain the target object recommended to the user. As can be seen from the above, in the embodiment of this specification, the text description information of the object is generated using a large language model, and the text description information can supplement the object information lacking in the traditional sequence recommendation. Not only the first embedded representation corresponding to the object identifier is input into the sequence recommendation model, but also the second embedded representation corresponding to the text description information is input into the sequence recommendation model, which can better mine the regularity of the object sequence, which is conducive to improving the recommendation effect, thereby improving the accuracy of the recommendation.
[0111] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 The method described.
[0112] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 2 The method described.
[0113] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0114] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A sequence recommendation method, the method comprising: Get an object sequence consisting of multiple objects of the user's historical interactions; The object has an object identifier and first feature information corresponding to a plurality of basic attribute features; Constructing a prompt text using the first feature information of any object in the object sequence, inputting the prompt text into a large language model to obtain text description information of the object; the text description information at least includes second feature information corresponding to the extended attribute feature; Determine a first embedded representation corresponding to an object identifier of each object in the object sequence, and determine a second embedded representation corresponding to text description information of each object; The first embedding representation and the second embedding representation respectively corresponding to each object in the object sequence are input into the sequence recommendation model to obtain the target object recommended to the user.
2. The method of claim 1, wherein: The basic attribute features include the object name and the object year; the extended attribute features include the object function, object characteristics, and possible preferences of people who may like this object.
3. The method of claim 1, wherein: The determining of the first embedded representation corresponding to the object identifier of each object in the object sequence includes: According to the object identifier of any object in the object sequence, a pre-built embedding table of object identifiers and embedded representations is searched to obtain a first embedded representation of the object.
4. The method of claim 1, wherein: The determining of the second embedded representation corresponding to the text description information respectively possessed by each object in the object sequence includes: The text description information of any object in the object sequence is input into the encoder to obtain a second embedding representation of the object.
5. The method of claim 1, wherein: The large language model and the sequence recommendation model are jointly trained in the following manner: Constructing a prompt text using the first feature information of any object in the sample object sequence, inputting the prompt text into the large language model to obtain text description information of the object and its generation probability; Inputting a first embedding representation corresponding to an object identifier of each object in the sample object sequence and a second embedding representation corresponding to text description information into a sequence recommendation model, and obtaining a first probability of recommending a label object corresponding to the sample object sequence from a candidate object set; Taking maximizing the first probability as a first training objective, model parameters of the large language model and the sequence recommendation model are adjusted.
6. The method of claim 5, wherein: The joint training also includes: Inputting first embedding representations corresponding to respective objects in the sample object sequence into the sequence recommendation model to obtain a second probability of selecting the label object from the candidate object set; The adjusting the model parameters of the large language model and the sequence recommendation model includes: Determining, according to a ratio of the first probability to the second probability, a gradient weight when adjusting the parameters of the large language model; A parameter adjustment amount is determined according to the product of the gradient direction and the gradient weight, and the parameters of the large language model are updated according to the parameter adjustment amount.
7. The method of claim 6, wherein: If the first probability is greater than the second probability, the gradient direction is a direction that maximizes the generation probability; If the first probability is less than the second probability, the gradient direction is a direction that minimizes the generation probability.
8. A sequence recommendation device, comprising: An acquisition unit, used to acquire an object sequence consisting of multiple objects of historical user interactions; The object has an object identifier and first feature information corresponding to a plurality of basic attribute features; a generating unit, configured to construct a prompt text by using the first feature information of any object in the object sequence acquired by the acquiring unit, and input the prompt text into a large language model to obtain text description information of the object; the text description information at least includes second feature information corresponding to an extended attribute feature; a representation unit, configured to determine a first embedded representation corresponding to the object identifier of each object in the object sequence acquired by the acquisition unit, and to determine a second embedded representation corresponding to the text description information of each object obtained by the generation unit; The recommendation unit is used to input the first embedding representation and the second embedding representation corresponding to each object in the object sequence obtained by the representation unit into the sequence recommendation model to obtain a target object recommended to the user.
9. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 7.
10. A computing device comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Object recommendation method and apparatus, electronic device, and readable storage medium
WO2026175316A1
