A generative recommendation method, device, equipment and medium based on user preference

By constructing a user item feedback matrix and using knowledge distillation methods, discrete prompts are converted into continuous prompt vectors, and weights are calculated in combination with attention mechanisms to generate personalized prompt vectors, which solves the problem that the recommendation results in the existing technology do not meet user preferences, and achieves a higher degree of user preference fit.

CN119782608APending Publication Date: 2025-04-08BEIJING KNOWLEDGE ATLAS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411829658.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing generative recommendation technology is difficult to effectively learn the relationship between users, resulting in the generated recommendation results that do not meet user preferences.

Method used

By obtaining the user's historical behavior data, a user's item feedback matrix is ​​constructed and decomposed into user embedding vectors and item embedding vectors. Then, discrete prompts are converted into continuous prompt vectors using the knowledge distillation method and decomposed into multiple prompt components. The attention mechanism is used to calculate the weight of each prompt component, obtain a personalized prompt vector, and finally generate a recommendation result that meets user preferences.

Benefits of technology

By encoding user preferences into the prompt component and using attention mechanism weighted calculations, recommendation results that are highly consistent with user preferences can be generated, solving the problem that the recommendation results in the prior art do not meet user preferences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782608A_ABST
    Figure CN119782608A_ABST
Patent Text Reader

Abstract

The present invention relates to a generative recommendation method, device, equipment and medium based on user preferences, belonging to the field of generative recommendation technology. The generative recommendation method includes: obtaining historical behavior data of users; constructing a user-item feedback matrix and discrete prompts according to the historical behavior data, decomposing the user-item feedback matrix into a user embedding vector and an item embedding vector, converting the discrete prompts into a continuous prompt vector, and decomposing the continuous prompt vector into multiple prompt components; using the user embedding vector as a query function, and using an attention mechanism to calculate the weight of each continuous prompt component according to the query function to obtain a weight vector; performing weighted calculation on the prompt component according to the weight vector to obtain a personalized prompt vector; and generating a recommendation result according to the personalized prompt vector. The present invention realizes the generation of a recommendation result with a high degree of fit with user preferences according to a personalized vector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of generative recommendation, and in particular relates to a generative recommendation method, device, equipment and medium based on user preference. Background Art

[0002] Generative large model recommendation technology is a generative recommendation system based on large-scale language model technology. It can learn the potential distribution of users and items, generate new recommended content or simulate user preferences to provide richer and more personalized recommendation results. This technology has significant advantages in processing complex and high-dimensional user behavior data, and can automatically discover and recommend new content that users may be interested in without a large amount of explicit user feedback.

[0003] Existing generative recommendation technologies usually use LLM pre-trained knowledge to recommend items in zero-shot or few-shot settings, by training a large language model by adding user and item IDs to a discrete prompt template. However, the gap between ID-type data and natural language text-type data in the recommendation system makes it difficult for large models to learn the relationship between users, and there is a technical problem that the generated recommendation results do not meet user preferences. Summary of the invention

[0004] In view of the above analysis, embodiments of the present invention aim to provide a generative recommendation method, apparatus, device and medium based on user preferences, so as to solve one or more of the above problems existing in the prior art.

[0005] The object of the present invention is achieved in that:

[0006] A first aspect of the present invention provides a generative recommendation method based on user preferences, comprising:

[0007] Obtain user's historical behavior data;

[0008] for constructing a user-item feedback matrix and discrete prompts according to the historical behavior data, decomposing the user-item feedback matrix into a user embedding vector and an item embedding vector, converting the discrete prompts into a continuous prompt vector, and decomposing the continuous prompt vector into a plurality of prompt components;

[0009] The user embedding vector is used as a query function, and the weight of each prompt component is calculated using an attention mechanism according to the query function to obtain a weight vector; the prompt components are weighted according to the weight vector to obtain a personalized prompt vector;

[0010] Generate a recommendation result according to the personalized prompt vector.

[0011] Furthermore, the historical behavior data includes user ID, item ID, and interaction behavior.

[0012] Furthermore, decomposing the user-item feedback matrix into a user embedding vector and an item embedding vector includes: using a matrix decomposition method to embed users and items based on the sparsity of the user-item feedback matrix to obtain a user embedding vector representing user preferences and an item embedding vector representing item features.

[0013] Furthermore, decomposing the continuous prompt vector into a plurality of prompt components includes: determining a user's preference dimension based on the item embedding vector, and decomposing the continuous prompt vector into prompt components representing different preference dimensions according to the preference dimension.

[0014] Furthermore, the weight of each prompt component is calculated using the attention mechanism according to the query function, including: calculating the element-by-element product of the query function and the attention vector to obtain the focused query; calculating the similarity between the focused query and each prompt component, and performing normalization processing to obtain the weight of each prompt component.

[0015] Furthermore, generating a recommendation result according to the personalized prompt vector includes: using a pre-trained large prediction model to predict the user's interactive behavior according to the personalized prompt vector, and explaining the prediction result.

[0016] Furthermore, the pre-training process of the large prediction model includes: constructing an input sequence, the input sequence includes the user's historical behavior data and task prompts, the task prompts include discrete prompts, continuous prompt vectors and personalized prompt vectors; constructing a target sequence, the target sequence includes predicted recommendation results and explanations of the predicted results; constructing a loss function, using negative log-likelihood loss as the loss function; model training, using the task alternation training method to batch train the model, and dynamically adjusting the model parameters to optimize the loss function.

[0017] A second aspect of the present invention provides a generative recommendation device based on user preferences, comprising:

[0018] The acquisition module is used to obtain the user's historical behavior data;

[0019] A data processing module, configured to construct a user-item feedback matrix and discrete prompts according to the historical behavior data, decompose the user-item feedback matrix into a user embedding vector and an item embedding vector, convert the discrete prompts into a continuous prompt vector, and decompose the continuous prompt vector into a plurality of prompt components;

[0020] A weighted calculation module, used to use the user embedding vector as a query function, calculate the weight of each prompt component according to the query function using an attention mechanism to obtain a weight vector; perform weighted calculation on the prompt component according to the weight vector to obtain a personalized prompt vector;

[0021] A generating module is used to generate a recommendation result according to the personalized prompt vector.

[0022] According to a third aspect of the present invention, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the generative recommendation method based on user preference described in any one of the embodiments is implemented.

[0023] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the generative recommendation method based on user preferences described in any one of the embodiments.

[0024] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0025] The generative recommendation method based on user preferences provided by the present invention uses a knowledge distillation method to distill discrete prompts into continuous prompt vectors and decompose them into multiple prompt components, and then uses an attention mechanism to map the embedding vectors representing user preferences to the prompt components. Through weighted summation, a personalized prompt vector that can be processed by a model that meets user preferences is obtained, so that the model can generate recommendation results that are highly consistent with user preferences based on the personalized vectors. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0027] Figure 1 A flowchart of a generative recommendation method based on user preferences provided in Example 1 of the present invention;

[0028] Figure 2 A schematic diagram of a generative recommendation device based on user preferences provided in Embodiment 2 of the present invention;

[0029] Figure 3 This is a schematic diagram of the electronic device architecture provided in Example 3 of the present invention. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. It should be noted that, in the absence of conflict, the embodiments and features in the embodiments disclosed in this disclosure can be combined, separated, interchanged and / or rearranged with each other. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0031] Example 1

[0032] A specific embodiment of the present invention, as Figure 1 As shown, a generative recommendation method based on user preferences is disclosed, comprising:

[0033] S1. Obtain the user's historical behavior data.

[0034] In this embodiment, the historical behavior data includes user ID, item ID, and interactive behaviors, such as click, purchase, rating, and other interactive behaviors.

[0035] S2. construct a user-item feedback matrix and discrete prompts according to the historical behavior data, decompose the user-item feedback matrix into a user embedding vector and an item embedding vector, convert the discrete prompts into a continuous prompt vector, and decompose the continuous prompt vector into multiple prompt components;

[0036] In this embodiment, a matrix decomposition method is used to embed users and items based on the sparsity of the user-item feedback matrix to obtain a user embedding vector representing user preferences and an item embedding vector representing item features. Since discrete prompts lack flexibility and usually require manual production, the quality of model generation cannot be guaranteed. Therefore, a knowledge distillation method is used to convert discrete prompts into continuous prompt vectors to achieve global sharing with all users. Then, the user's preference dimension is determined based on the item embedding vector, and the continuous prompt vector is decomposed into prompt components representing different preference dimensions according to the preference dimension, so as to generate personalized prompts for different users.

[0037] S3. Use the user embedding vector as a query function, and use the attention mechanism to calculate the weight of each prompt component according to the query function to obtain a weight vector; perform weighted calculation on the prompt components according to the weight vector to obtain a personalized prompt vector.

[0038] In this embodiment, the user embedding vector is used as the query function to effectively encode the user preference into the prompt component; the attention-based architecture is used to focus on the prompt component. is a learnable attention vector, M is the number of prompt components, D is the dimension of the user embedding vector, and the focused query is obtained by calculating the element-by-element product of the query function and the attention vector, which is expressed as: λ = q(x)⊙A. The focused query enables the model to focus on the most important aspects of the user's historical behavior data. Then, the similarity between the focused query and each prompt component is calculated and normalized to obtain the weight of each prompt component, which is expressed as:

[0039] α i =softmax(cos(λ,K)), where i∈M represents the learnable key value corresponding to the prompt component. Since the weight vector is continuously updated during the training process, the model can update the user embedding representation instead of being fixed on a single representation. The weight vector can be used to weight the prompt component according to the query being followed. The obtained personalized prompt vector is expressed as:

[0040] Among them, P i Represents a prompt component.

[0041] In some embodiments, in order to reduce mutual interference between prompt components, it also includes using QR decomposition to orthogonally initialize P, K, and A.

[0042] S4. Generate a recommendation result according to the personalized prompt vector.

[0043] Exemplarily, after obtaining the personalized prompt vector through step S3, a pre-trained large prediction model can be used to predict the user's interactive behavior based on the personalized prompt vector, as well as to explain the prediction result.

[0044] The pre-training process of the large prediction model includes:

[0045] Constructing an input sequence, wherein the input sequence includes historical behavior data of the user and task prompts, wherein the task prompts include discrete prompts, continuous prompt vectors, and personalized prompt vectors;

[0046] Constructing a target sequence, wherein the target sequence includes a predicted recommendation result and an explanation of the predicted result;

[0047] Construct a loss function and use negative log-likelihood loss as the loss function;

[0048] Model training, use the task alternation training method to batch train the model and dynamically adjust the model parameters to optimize the loss function.

[0049] Compared with the prior art, the generative recommendation method based on user preferences provided in this embodiment uses a knowledge distillation method to distill discrete prompts into continuous prompt vectors and decompose them into multiple prompt components, and then uses an attention mechanism to map the embedding vectors representing user preferences to the prompt components. Through weighted summation, a personalized prompt vector that can be processed by a model that meets user preferences is obtained, thereby enabling the model to generate recommendation results that are more consistent with user preferences based on the personalized vectors.

[0050] Example 2

[0051] This embodiment provides a generative recommendation device based on user preferences, such as Figure 2 As shown, including:

[0052] The acquisition module is used to obtain the user's historical behavior data;

[0053] A data processing module, configured to construct a user-item feedback matrix and discrete prompts according to the historical behavior data, decompose the user-item feedback matrix into a user embedding vector and an item embedding vector, convert the discrete prompts into a continuous prompt vector, and decompose the continuous prompt vector into a plurality of prompt components;

[0054] A weighted calculation module, used to use the user embedding vector as a query function, calculate the weight of each prompt component according to the query function using an attention mechanism to obtain a weight vector; perform weighted calculation on the prompt component according to the weight vector to obtain a personalized prompt vector;

[0055] A generating module is used to generate a recommendation result according to the personalized prompt vector.

[0056] Example 3

[0057] This embodiment provides an electronic device, such as Figure 3 As shown, it includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the generative recommendation method based on user preferences as described in any of the above embodiments is implemented.

[0058] Example 4

[0059] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the generative recommendation method based on user preference as described in any of the above embodiments is implemented.

[0060] Computer readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0061] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0062] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0063] 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 within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A generative recommendation method based on user preferences, characterized in that: include: Obtain user's historical behavior data; Constructing a user-item feedback matrix and discrete prompts according to the historical behavior data, decomposing the user-item feedback matrix into a user embedding vector and an item embedding vector, converting the discrete prompts into a continuous prompt vector, and decomposing the continuous prompt vector into a plurality of prompt components; The user embedding vector is used as a query function, and the weight of each prompt component is calculated by using an attention mechanism according to the query function to obtain a weight vector; the prompt components are weighted according to the weight vector to obtain a personalized prompt vector; Generate a recommendation result according to the personalized prompt vector.

2. The generative recommendation method based on user preference according to claim 1, characterized in that: The historical behavior data includes user ID, item ID, and interaction behavior.

3. The generative recommendation method based on user preference according to claim 1, characterized in that: Decomposing the user-item feedback matrix into a user embedding vector and an item embedding vector comprises: Using the matrix decomposition method, users and items are embedded based on the sparsity of the user-item feedback matrix to obtain a user embedding vector representing user preferences and an item embedding vector representing item features.

4. The generative recommendation method based on user preferences according to claim 3, characterized in that: Decomposing the continuous hint vector into a plurality of hint components comprises: A user preference dimension is determined based on the item embedding vector, and the continuous prompt vector is decomposed into prompt components representing different preference dimensions according to the preference dimension.

5. The generative recommendation method based on user preference according to claim 1, characterized in that: The step of calculating the weight of each prompt component using an attention mechanism according to the query function comprises: Calculating the element-by-element product of the query function and the attention vector to obtain an attended query; The similarity between the query being concerned and each prompt component is calculated, and normalized to obtain the weight of each prompt component.

6. The generative recommendation method based on user preference according to claim 1, characterized in that: Generating a recommendation result according to the personalized prompt vector includes: A pre-trained large oracle model is used to predict the user's interactive behavior based on the personalized prompt vector, and an explanation of the prediction result is given.

7. The generative recommendation method based on user preference according to claim 6, characterized in that: The pre-training process of the large prediction model includes: Constructing an input sequence, wherein the input sequence includes historical behavior data of the user and task prompts, wherein the task prompts include discrete prompts, continuous prompt vectors, and personalized prompt vectors; Constructing a target sequence, wherein the target sequence includes a predicted recommendation result and an explanation of the predicted result; Construct a loss function and use negative log-likelihood loss as the loss function; Model training, use the task alternation training method to batch train the model and dynamically adjust the model parameters to optimize the loss function.

8. A generative recommendation device based on user preferences, characterized in that: The device comprises: The acquisition module is used to obtain the user's historical behavior data; A data processing module, configured to construct a user-item feedback matrix and discrete prompts according to the historical behavior data, decompose the user-item feedback matrix into a user embedding vector and an item embedding vector, convert the discrete prompts into a continuous prompt vector, and decompose the continuous prompt vector into a plurality of prompt components; A weighted calculation module, used to use the user embedding vector as a query function, calculate the weight of each prompt component according to the query function using an attention mechanism to obtain a weight vector; perform weighted calculation on the prompt component according to the weight vector to obtain a personalized prompt vector; A generating module is used to generate a recommendation result according to the personalized prompt vector.

9. An electronic device, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the generative recommendation method based on user preference as claimed in any one of claims 1 to 7 is implemented.

10. A storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the generative recommendation method based on user preferences described in any one of claims 1 to 7 is implemented.