A recommendation system correction method fusing world knowledge of a large language model

By incorporating world knowledge from a large language model into a recommendation system correction method, and utilizing a multimodal expert network module and cross-entropy loss function for optimization, the system addresses the adaptability issues of various biases in recommendation systems, achieving efficient and personalized recommendations in different scenarios.

CN120045792BActive Publication Date: 2026-03-24BEIJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing recommendation systems suffer from poor model adaptability and unstable performance when facing various types of biases due to their reliance on unbiased data. Furthermore, debiasing algorithms that rely on unbiased data also suffer from poor adaptability and large variance in results.

Method used

This paper proposes a recommendation system correction method that integrates world knowledge from a large language model. By acquiring an open-source dataset, the method guides the large language model to generate item descriptions and user preference inferences using pre-set prompt word templates and context learning techniques. The method combines a multimodal expert network module for encoding and optimization to generate the final representations of users and items, and uses the cross-entropy loss function for model optimization.

Benefits of technology

Without relying on unbiased data, a general bias correction for recommendation systems is achieved, improving the flexibility and accuracy of the model. It can generate high-quality personalized descriptions in different recommendation scenarios, eliminate the inherent bias in user behavior data, and capture users' true preferences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045792B_ABST
    Figure CN120045792B_ABST
Patent Text Reader

Abstract

The application discloses a recommendation system rectification method fusing a large language model world knowledge, and comprises the following steps: obtaining an open source data set of a recommendation system to generate a training set; guiding a large language model to generate description information of an item and preference reasoning of a user through the training set combined with context learning technology; encoding the description information of the item and the preference reasoning of the user through a pre-trained text encoder to generate a first encoding vector, and encoding IDs of the user and the item to generate a second encoding vector; inputting the first encoding vector and the second encoding vector into a multi-modal expert network module to obtain final representations of the user and the item; inputting the final representations of the user and the item into a prediction layer to obtain a prediction value, and then optimizing the multi-modal expert network module through a cross-entropy loss function; and rectifying the recommendation system through the optimized multi-modal expert network module. Inherent bias in user behavior data is eliminated, real preferences of the user are captured, and the recommendation system rectification is completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of large language models and recommender systems, and specifically relates to a method for correcting biases in recommender systems that integrates world knowledge from large language models. Background Technology

[0002] To quickly extract valuable information from massive amounts of data, recommender systems enable interaction between users and information, achieving great success in fields such as e-commerce and film and television platforms. However, due to various biases in the user behavior generation process, such as popularity bias, selection bias, and exposure bias, the data fails to accurately reflect users' true preferences. Therefore, blindly fitting data without considering these biases can lead to a series of problems, including suboptimal modeling and the long-tail effect. By deeply analyzing the biases in recommender systems and studying bias-correcting recommendation algorithms, we can effectively capture users' true preferences, thereby improving the performance of recommender systems.

[0003] In recent years, the research on bias correction algorithms has become an important research direction in the field of recommender systems. Early bias correction algorithms mainly focused on eliminating specific types of biases. These methods primarily eliminated the influence of specific biases through inverse bias scores, prior knowledge, and other methods. Although these methods have mitigated the impact of data bias on recommendation results to some extent, they still have significant limitations. First, bias correction methods targeting specific biases rely on experts' understanding of the mechanisms that generate those biases, thus lacking universality when facing some difficult-to-define biases. Second, in real-world recommender scenarios, various data biases are often intertwined (for example, user purchasing behavior may be simultaneously influenced by popularity bias and exposure bias), making bias correction algorithms targeting specific biases challenging in practical applications. Therefore, improving the universality of bias correction algorithms to cope with various confusing biases (including known and unknown biases) in real-world situations has become an important problem that urgently needs to be solved in the recommender field.

[0004] Current researchers are dedicated to developing general debiasing algorithms, aiming to create models that simultaneously address multiple types of bias. These methods primarily rely on unbiased experimental data, utilizing knowledge distillation, meta-learning, and other techniques to achieve debiasing algorithms for various biases. While these methods have achieved some success, they all depend on unbiased data, which is constructed using a random logging strategy, requiring significant experimental and manual costs. In the long run, this can harm the interests of platforms and users. Furthermore, due to the low coverage and limited quantity of unbiased data, debiasing algorithms relying on unbiased data suffer from poor adaptability and high variance in results.

[0005] The above problems make it difficult for existing methods to achieve good results in addressing the challenge of bias correction in recommender systems. Summary of the Invention

[0006] To address the aforementioned shortcomings in existing technologies, this invention provides a method for correcting biases in recommendation systems that integrates world knowledge from a large language model. This method solves the problems of poor model adaptability and unstable performance caused by reliance on unbiased experimental data in existing technologies.

[0007] To achieve the aforementioned objectives, the technical solution adopted by this invention is: a method for correcting biases in a recommendation system that integrates knowledge from a large language model world, comprising the following steps:

[0008] S1. Obtain the open-source dataset for the recommendation system and generate a training set;

[0009] S2. Based on preset prompt word templates, the large language model is guided to generate item description information and user preference inferences through training set combined with context learning technology;

[0010] S3. Encode the description information of items and the user's preference inference through a pre-trained text encoder to generate a first encoding vector. Input the training set into the embedding layer to encode the IDs of users and items to generate a second encoding vector.

[0011] S4. Input the first encoding vector and the second encoding vector into the multimodal expert network module to obtain the final representation of the user and the item;

[0012] S5. Input the final representations of users and items into the prediction layer to obtain the predicted values. Compare the predicted values ​​with the labels in the training set, and then optimize the multimodal expert network module through the cross-entropy loss function.

[0013] S6. Correct the bias of the recommendation system by using the optimized multimodal expert network module.

[0014] Furthermore, in S1, the open-source dataset of the recommender system includes an open-source movie dataset and an open-source e-commerce platform dataset. Each piece of data in the dataset contains the user's historical behavior, the name, category, and features of the product, and each piece of data is labeled with a corresponding tag.

[0015] Furthermore: In S2, the preset prompt word templates include prompt word templates for inferring user preferences and prompt word templates for describing item information;

[0016] Among them, in the prompt word template for user preference inference, the instruction is the task that needs to be completed by the large language model, the example is two or three given user behavior data and their corresponding analysis results, and the request is the text description of the user behavior data that needs to be requested.

[0017] In the prompt word template for the description information of the item, the instruction is the task that needs to be completed by the large language model. The example is two or three given movie data and their corresponding supplementary description information. The request is the movie description that needs to be requested.

[0018] Furthermore, in S4, the multimodal expert network module includes a fusion submodule and several expert networks, and the types of expert networks include text expert networks, collaborative expert networks, and hybrid expert networks.

[0019] Further: In step S4, the method for obtaining the final representation of the user and the item is specifically as follows:

[0020] The fusion submodule combines the outputs of all expert networks according to the gating network, and integrates unbiased textual information provided by the world knowledge of the large language model and collaborative information generated based on user behavior to generate the final representation of users and items. final ;

[0021]

[0022] In the formula, h i Let g be the output of the i-th expert network, M be the number of expert networks, and g be the output of the i-th expert network. i The weight of the i-th expert network is expressed as follows:

[0023] g i =softmax(W g h i +b g )

[0024] In the formula, softmax(·) is the Softmax function, and W g Let b be the weight matrix of the gated network. g is the bias vector of the gated network.

[0025] The beneficial effects of the above-mentioned further scheme are as follows: the gating network in the fusion sub-module learns the features of the input data to determine which expert modules should be activated and the degree of their respective contributions. The core of the gating network in achieving probability distribution selection is that it can dynamically adjust the importance weight of each expert module according to the input, thereby ensuring that the model can make the optimal choice in different scenarios.

[0026] Furthermore, the text expert network is structured as a multilayer perceptron network, with the first encoding vector as its input and the embedding vector of a custom dimension as its output. The specific expression for the text expert network is:

[0027]

[0028] In the formula, t is the first encoding vector. The vectors are the input layers of the text expert network. Let W be the vector of the (l-1)th layer of the text expert network, LeakyReLU(·) be the activation function, and W be the vector of the (l-1)th layer. t (l) Let be the weight matrix of the l-th layer in the text expert network. Let be the bias vector of the l-th layer in the text expert network. Let be the hidden layer vector of the l-th layer in the text expert network.

[0029] The benefits of the above-mentioned further approach are as follows: the text expert network is responsible for further encoding the vectors, identifying potential product attributes, consumer preferences, and other factors, thereby assisting in building a more accurate recommendation system. Simultaneously, using LeakyReLU as the activation function helps maintain gradient flow, avoiding the "dead zone" problem that may occur with traditional activation functions, thus promoting a more efficient training process.

[0030] Furthermore, the structure of the collaborative expert network is a multilayer perceptron network, the input of the collaborative expert network is the second encoding vector, and the output of the collaborative expert network is an embedding vector with a custom dimension. The specific expression for a collaborative expert network is:

[0031]

[0032] In the formula, u is the second encoding vector. The vectors for the input layer of the collaborative expert network. Let L be the vector of the (l-1)th layer of the collaborative expert network, and LeakyReLU(·) be the activation function. Let be the weight matrix of the l-th layer in the collaborative expert network. Let L be the bias vector of the l-th layer in the collaborative expert network. Let be the hidden layer vector of the l-th layer in the collaborative expert network.

[0033] The beneficial effects of the above-mentioned further scheme are as follows: the collaborative expert network focuses on the interaction behavior between users and items, and is responsible for further encoding the vectors of users and items, revealing the patterns and relationships hidden behind these interactions. At the same time, using LeakyReLU as the activation function helps to maintain gradient flow and avoid the "dead zone" problem that may occur with traditional activation functions, thereby promoting a more efficient training process.

[0034] Furthermore: the hybrid expert network employs a contrastive learning method to calculate the vectors of users and items, specifically as follows:

[0035] Within the training batch, positive and negative sample pairs are constructed. The first and second encoding vectors corresponding to the same user and the initial user vector are regarded as positive examples, while the first and second encoding vectors of the user and the initial user vectors of other users are regarded as negative examples. Based on the dot product similarity as a metric, the similarity between positive examples and the contrast between negative examples are narrowed, and the fusion of multimodal information is achieved in a fine-grained manner to encode and generate vectors of users and items.

[0036] The beneficial effects of the above-mentioned further scheme are as follows: Hybrid expert networks can simultaneously coordinate textual semantic information and user behavior patterns. By bringing the textual features and collaborative features of the same user closer together and separating the textual features and collaborative features of different users, hybrid expert networks can achieve fine-grained fusion of multimodal information, including text and user behavior data. Unbiased textual information is used as auxiliary information to correct biases in collaborative information and improve the personalization and accuracy of the recommendation system.

[0037] Further: In step S5, the predicted value is obtained. The specific expression is:

[0038]

[0039] In the formula, σ(·) is the Sigmoid function. This is the final representation vector of the item. This is the user's final representation vector.

[0040] Furthermore: In step S5, the method for optimizing the multimodal expert network module using the cross-entropy loss function is as follows:

[0041]

[0042] L final =α*L1+β*L2+γ*L3

[0043] In the formula, y u,i For data labels, The predicted value is α, the first hyperparameter, β, and γ, respectively. n For user representation on the recommendation side, t n For the text representation of the text side corresponding to user n, the similarity is measured by the dot product similarity, t k v represents the text representation corresponding to user k on the text side. m For the item representation on the recommendation side, t m For the text representation of item m, t o Let N be the text representation of item o on the text side, M be the total number of users, and L be the total number of items. finalL1 is the overall loss function of the method, L2 is the prediction loss function of the fusion submodule based on the output of the text expert network and the collaborative expert network, L3 is the contrast loss function of the user side in the hybrid expert network, and L4 is the contrast loss function of the item side in the hybrid expert network.

[0044] The beneficial effects of this invention are as follows: This invention provides a method for correcting biases in a recommendation system that integrates knowledge from a large language model world, and has the following effects:

[0045] (1) Unlike traditional bias correction algorithms, this invention provides a new technical approach for the research of bias correction algorithms, namely, integrating external knowledge to mitigate the impact of data bias on recommendation results. This invention is the first to propose a bias correction algorithm for recommendation systems that integrates world knowledge from a large language model, solving the problem of achieving general bias correction for recommendation systems without relying on unbiased experimental data.

[0046] (2) When traditional large language models are applied to recommendation systems, they typically require significant resources for fine-tuning to adapt to specific application scenarios. This not only increases development costs but also limits the model's flexibility and transferability. To address this challenge, this invention designs prompt word templates using in-context learning technology. The background information within the context guides the large language model to understand the recommendation scenario, enabling it to automatically adjust its output based on the provided background information without altering its original parameters. Guided by the prompt word templates, the model can quickly understand the current recommendation scenario and generate high-quality, personalized descriptive information in both text generation and user preference reasoning tasks, making this invention easily transferable to various recommendation scenarios.

[0047] (3) This invention realizes the mining and alignment of world knowledge and user behavior data of large language model through multimodal expert network module, eliminates the inherent bias in user behavior data, thereby capturing the user's true preferences and completing the correction of the recommendation system.

[0048] (4) This invention can be applied to various recommendations without relying on unbiased data, and has broad application prospects. Attached Figure Description

[0049] Figure 1 This is a flowchart of a recommendation system correction method that integrates world knowledge from a large language model, according to the present invention.

[0050] Figure 2 A diagram illustrating the prompt word template for inferring user preferences.

[0051] Figure 3 This is an illustration of a prompt template for item description information. Detailed Implementation

[0052] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0053] like Figure 1 As shown, in one embodiment of the present invention, a method for correcting biases in a recommendation system that integrates knowledge from a large language model world includes the following steps:

[0054] S1. Obtain the open-source dataset for the recommendation system and generate a training set;

[0055] S2. Based on preset prompt word templates, the large language model is guided to generate item description information and user preference inferences through training set combined with context learning technology;

[0056] S3. Encode the description information of items and the user's preference inference through a pre-trained text encoder to generate a first encoding vector. Input the training set into the embedding layer to encode the IDs of users and items to generate a second encoding vector.

[0057] S4. Input the first encoding vector and the second encoding vector into the multimodal expert network module to obtain the final representation of the user and the item;

[0058] S5. Input the final representations of users and items into the prediction layer to obtain the predicted values. Compare the predicted values ​​with the labels in the training set, and then optimize the multimodal expert network module through the cross-entropy loss function.

[0059] S6. Correct the bias of the recommendation system by using the optimized multimodal expert network module.

[0060] This invention aims to break down the information cocoon of recommendation systems by leveraging the general world knowledge and reasoning capabilities of large language models, thereby correcting biases and improving the prediction accuracy and fairness of recommendation systems.

[0061] In S1, the open-source dataset of the recommendation system includes an open-source movie dataset and an open-source e-commerce platform dataset. Each piece of data in the dataset contains the user's historical behavior, the name, category, and features of the product, and each piece of data is labeled with a corresponding tag.

[0062] In this embodiment, the present invention divides the dataset into a training set and a validation set, and uses whether a user has rated or clicked on a certain product as a label, which can complete the training and validation of the multimodal expert network module.

[0063] In S2, the preset prompt word templates include prompt word templates for inferring user preferences and prompt word templates for describing item information;

[0064] Among them, in the prompt word template for user preference inference, the instruction is the task that needs to be completed by the large language model, the example is two or three given user behavior data and their corresponding analysis results, and the request is the text description of the user behavior data that needs to be requested.

[0065] like Figure 2 As shown in this embodiment, the prompt word template for user preference inference describes the task that needs to be completed by the large language model, for example: "Given a user as {{user description}}, the user's movie viewing history over a period of time is listed below: {{user history}}. Analyze user preferences (considering factors such as movie category, release date, {{scene-specific factors}}, etc.). Please provide a clear explanation based on the detailed information of the user's browsing history and other relevant factors." Examples are two to three given user behavior data and their corresponding human analysis results, for example: "Example A: User is {{user description}}, the user's movie viewing history over a period of time is listed below: {{user history}}. Response A: After analysis, the user's preference is {{user preference}}, the reasoning is as follows: {{user preference}}." The request is a text description of the user behavior data currently being requested, for example: "User is {{user description}}, the user's movie viewing history over a period of time is listed below: {{user history}}, please analyze the user's preferences."

[0066] In the prompt word template for the description information of the item, the instruction is the task that needs to be completed by the large language model. The example is two or three given movie data and their corresponding supplementary description information. The request is the movie description that needs to be requested.

[0067] like Figure 3 As shown in this embodiment, the prompt word template for the item's description information describes the task that the large language model needs to complete, such as: "Please introduce the movie {{movie name}} and accurately describe its attributes (including but not limited to movie category, release date, {{scene-specific factors}}, etc.)". An example is two or three given movie data entries and their corresponding supplementary description information, such as: "Example A: The movie that needs supplementary information is {{movie name}}. Response A: After analysis, its supplementary information is {{movie category}, {release date}, {scene-specific factors}}". The request is the movie description currently being requested, such as: "The movie that needs supplementary information is {{movie name}}".

[0068] In this embodiment, the prompt word template designed in this invention utilizes in-context learning technology to guide the large language model to generate descriptions of items and inferences about user preferences through background information in the context. To improve the online service efficiency of the recommendation system, this process is completed offline, and the generated content can be stored locally for multiple uses.

[0069] In step S3, the pre-trained text encoder can select language models with different parameter sizes and languages ​​based on the context. The text encoder encodes the original text into a fixed-length vector. Through a multi-layer neural network structure, the pre-trained encoder can capture complex semantic relationships, contextual dependencies, and long-distance dependencies in the text. These pre-trained weights can serve as a starting point, helping the model adapt to new tasks more quickly without needing to train from scratch. Furthermore, the hot-swappable pre-trained text encoder can better adapt to different recommendation scenarios. For example, a Chinese language model can be used as the text encoder in Chinese recommendation scenarios, while an English language model can be used in English recommendation scenarios. In real-time recommendation scenarios, a text encoder with fewer parameters is used to reduce the dimensionality of the vector, reducing storage overhead and accelerating the model's response speed. In accuracy-critical recommendation scenarios, a text encoder with more parameters is used to ensure that deeper textual information is encoded into the vector.

[0070] In this embodiment, the embedding layer is a single-layer perceptron. The input dimension is the number of items and users, and the output is a custom hidden layer dimension. By mapping discrete user IDs and item IDs to embedding vectors, the embedding layer significantly reduces the model's parameter size compared to one-hot encoding, especially when dealing with large-scale categories or vocabulary. This not only improves training efficiency but also reduces the risk of overfitting. Furthermore, the introduction of the embedding layer makes the model more easily extensible; with the addition of new IDs, the embedding matrix can be simply expanded without redesigning the entire model structure.

[0071] In step S4, the multimodal expert network module includes a fusion submodule and several expert networks. The types of expert networks include text expert networks, collaborative expert networks, and hybrid expert networks. The fusion submodule combines the outputs of multiple experts through a gating network, integrating unbiased textual information provided by the world knowledge of the large language model with collaborative information generated based on user behavior to generate the final item representation and user representation.

[0072] In step S4, the method for obtaining the final representation of the user and the item is as follows:

[0073] The fusion submodule combines the outputs of all expert networks according to the gating network, and integrates unbiased textual information provided by the world knowledge of the large language model and collaborative information generated based on user behavior to generate the final representation of users and items. final ;

[0074]

[0075] In the formula, h i Let g be the output of the i-th expert network, M be the number of expert networks, and g be the output of the i-th expert network. i The weight of the i-th expert network is expressed as follows:

[0076] g i =softmax(W g h i +b g )

[0077] In the formula, softmax(·) is the Softmax function, and W g Let b be the weight matrix of the gated network. g is the bias vector of the gated network.

[0078] In this embodiment, the gating network in the fusion submodule learns the features of the input data to determine which expert modules should be activated and the degree of their respective contributions. The core of the gating network's probability distribution selection lies in its ability to dynamically adjust the importance weight of each expert module according to the input, thereby ensuring that the model can make the optimal choice in different scenarios.

[0079] The text expert network is structured as a multilayer perceptron network. Its input is a first encoding vector, and its output is an embedding vector with a custom dimension. The specific expression for the text expert network is:

[0080]

[0081]

[0082] In the formula, t is the first encoding vector. The vectors are the input layers of the text expert network. Let W be the vector of the (l-1)th layer of the text expert network, LeakyReLU(·) be the activation function, and W be the vector of the (l-1)th layer. t (l) Let be the weight matrix of the l-th layer in the text expert network. Let be the bias vector of the l-th layer in the text expert network. Let be the hidden layer vector of the l-th layer in the text expert network.

[0083] In this embodiment, the text expert network is specifically designed for processing text data. It is responsible for further encoding vectors and identifying potential product attributes, consumer preferences, and other factors, thereby assisting in building a more accurate recommendation system. Simultaneously, using LeakyReLU as the activation function helps maintain gradient flow and avoids the "dead zone" problem that may occur with traditional activation functions, thus promoting a more efficient training process. The expression for the LeakyReLU function is as follows:

[0084]

[0085] In the formula, x represents the input data.

[0086] The collaborative expert network is structured as a multilayer perceptron network. Its input is a second encoding vector, and its output is an embedding vector with a custom dimension. The specific expression for a collaborative expert network is:

[0087]

[0088] In the formula, u is the second encoding vector. The vectors for the input layer of the collaborative expert network. Let L be the vector of the (l-1)th layer of the collaborative expert network, and LeakyReLU(·) be the activation function. Let be the weight matrix of the l-th layer in the collaborative expert network. Let L be the bias vector of the l-th layer in the collaborative expert network. Let be the hidden layer vector of the l-th layer in the collaborative expert network.

[0089] In this embodiment, the collaborative expert network focuses on the interaction behavior between users and items, and is responsible for further encoding the vectors of users and items to reveal the patterns and relationships hidden behind these interactions. Meanwhile, using LeakyReLU as the activation function helps maintain gradient flow and avoids the "dead zone" problem that may occur with traditional activation functions, thereby promoting a more efficient training process.

[0090] The hybrid expert network uses a contrastive learning method to calculate the vectors of users and items. Specifically, this method is as follows:

[0091] Within the training batch, positive and negative sample pairs are constructed. The first and second encoding vectors corresponding to the same user, along with the initialized user vector, are considered positive examples. The first and second encoding vectors of a user, along with the initialized user vectors of other users, are considered negative examples. Based on dot product similarity as a metric, the similarity between positive examples and the contrast between negative examples are narrowed, achieving fine-grained fusion of multimodal information to encode and generate vectors for users and items. The working principle of the hybrid expert network is as follows:

[0092] First, within the same batch, taking the user side as an example, for each user i, we will have the vector t of the same user i. i With user vector u in the recommender space i Considered as a positive example (t) i ,u i For each user i, the vector t of the same user i is... i Compared with other user vectors u in the recommendation space j Considered as negative pairs (t) i ,u j ).

[0093] Next, using dot product similarity as a metric, we achieve multimodal information fusion between the text space and the collaborative space by minimizing the distance between positive examples and maximizing the distance between negative examples. The loss function is modeled as follows:

[0094]

[0095] Among them, u i For user representation on the recommendation side, t i For the text representation corresponding to user i, similarity is measured by dot product similarity, t k Let N be the text representation of item k on the text side, and N be the total number of users.

[0096] Hybrid expert networks can simultaneously coordinate textual semantic information and user behavior patterns. By bringing the textual and collaborative features of the same user closer together and separating the textual and collaborative features of different users, hybrid expert networks can achieve fine-grained fusion of multimodal information, including text and user behavior data. Unbiased textual information is used as auxiliary information to correct biases in collaborative information, thereby improving the personalization and accuracy of the recommendation system.

[0097] In step S5, the predicted value is obtained. The specific expression is:

[0098]

[0099] In the formula, σ(·) is the Sigmoid function. This is the final representation vector of the item. This is the user's final representation vector.

[0100] In this embodiment, the present invention compares the predicted values ​​with the labels in the dataset, optimizes the model using the cross-entropy loss function and the contrastive loss function of hybrid expert modeling, and completes the model correction and training.

[0101] In step S5, the method for optimizing the multimodal expert network module using the cross-entropy loss function is as follows:

[0102]

[0103] L final =α*L1+β*L2+γ*L3

[0104] In the formula, y u,i For data labels, The predicted value is α, the first hyperparameter, β, and γ, respectively. n For user representation on the recommendation side, t n For the text representation of the text side corresponding to user n, the similarity is measured by the dot product similarity, t k v represents the text representation corresponding to user k on the text side. m For the item representation on the recommendation side, t m For the text representation of item m, t o Let N be the text representation of item o on the text side, M be the total number of users, and L be the total number of items. final L1 is the overall loss function of the method, L2 is the prediction loss function of the fusion submodule based on the output of the text expert network and the collaborative expert network, L3 is the contrast loss function of the user side in the hybrid expert network, and L4 is the contrast loss function of the item side in the hybrid expert network.

[0105] The beneficial effects of this invention are as follows: This invention provides a method for correcting biases in a recommendation system that integrates knowledge from a large language model world, and has the following effects:

[0106] (1) Unlike traditional bias correction algorithms, this invention provides a new technical approach for the research of bias correction algorithms, namely, integrating external knowledge to mitigate the impact of data bias on recommendation results. This invention is the first to propose a bias correction algorithm for recommendation systems that integrates world knowledge from a large language model, solving the problem of achieving general bias correction for recommendation systems without relying on unbiased experimental data.

[0107] (2) When traditional large language models are applied to recommendation systems, they typically require significant resources for fine-tuning and training to adapt to specific application scenarios. This not only increases development costs but also limits the model's flexibility and transferability. To address this challenge, this invention designs prompt word templates using contextual learning technology. The background information within the context guides the large language model to understand the recommendation scenario, enabling it to automatically adjust its output based on the provided background information without altering its original parameters. Guided by the prompt word templates, the model can quickly understand the current recommendation scenario and generate high-quality, personalized descriptive information in both text generation and user preference reasoning tasks, making this invention easily transferable to various recommendation scenarios.

[0108] (3) This invention realizes the mining and alignment of world knowledge and user behavior data of large language model through multimodal expert network module, eliminates the inherent bias in user behavior data, thereby capturing the user's true preferences and completing the correction of the recommendation system.

[0109] (4) This invention can be applied to various recommendations without relying on unbiased data, and has broad application prospects.

[0110] In the description of this invention, it should be understood that the terms "center," "thickness," "upper," "lower," "horizontal," "top," "bottom," "inner," "outer," and "radial," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying the relative importance or the number of technical features implicitly specified. Therefore, a feature defined by "first," "second," and "third" may explicitly or implicitly include one or more of that feature.

Claims

1. A method for correcting biases in a recommender system that integrates world knowledge from a large language model, characterized in that, Includes the following steps: S1. Obtain the open-source dataset for the recommendation system and generate a training set; S2. Based on preset prompt word templates, the large language model is guided to generate item description information and user preference inferences through training set combined with context learning technology; S3. Encode the description information of items and the user's preference inference through a pre-trained text encoder to generate a first encoding vector. Input the training set into the embedding layer to encode the IDs of users and items to generate a second encoding vector. S4. Input the first encoding vector and the second encoding vector into the multimodal expert network module to obtain the final representation of the user and the item; S5. Input the final representations of users and items into the prediction layer to obtain the predicted values. Compare the predicted values ​​with the labels in the training set, and then optimize the multimodal expert network module through the cross-entropy loss function. S6. Correct the bias of the recommendation system using the optimized multimodal expert network module; In S4, the multimodal expert network module includes a fusion submodule and several expert networks. The types of expert networks include text expert networks, collaborative expert networks, and hybrid expert networks. In step S4, the method for obtaining the final representation of the user and the item is as follows: The fusion submodule combines the outputs of all expert networks based on the gating network, and integrates unbiased textual information provided by the world knowledge of the large language model with collaborative information generated based on user behavior to generate the final representation of users and items. : In the formula, For the first i The output of an expert network M For the number of expert networks, For the first i The weights of each expert network are expressed as follows: In the formula, For the Softmax function, Here is the weight matrix of the gated network. is the bias vector of the gated network; In step S5, the method for optimizing the multimodal expert network module using the cross-entropy loss function is as follows: * In the formula, For data labels, For predicted values, As the first hyperparameter, This is the second hyperparameter. This is the third hyperparameter. For user representation on the recommendation side, For text side and user n The corresponding text representations are similar to each other using dot product similarity. For text side and user k The corresponding text representation, v m For the item representation on the recommendation side, For text-side items m The corresponding text representation, For text-side items o The corresponding text representation, N M represents the total number of users, and M represents the total number of items. The loss function for the entire method. This is the prediction loss function used by the fusion submodule to make predictions based on the outputs of the text expert network and the collaborative expert network. Let be the contrastive loss function on the user side in a hybrid expert network. Let be the contrastive loss function on the item side in a hybrid expert network.

2. The method for correcting biases in a recommendation system that integrates world knowledge from a large language model according to claim 1, characterized in that, In S1, the open-source dataset of the recommendation system includes an open-source movie dataset and an open-source e-commerce platform dataset. Each piece of data in the dataset contains the user's historical behavior, the name, category, and features of the product, and each piece of data is labeled with a corresponding tag.

3. The method for correcting biases in a recommendation system that integrates world knowledge from a large language model according to claim 1, characterized in that, In S2, the preset prompt word templates include prompt word templates for inferring user preferences and prompt word templates for describing item information; Among them, in the prompt word template for user preference inference, the instruction is the task that needs to be completed by the large language model, the example is two or three given user behavior data and their corresponding analysis results, and the request is the text description of the user behavior data that needs to be requested. In the prompt word template for the description information of the item, the instruction is the task that needs to be completed by the large language model. The example is two or three given movie data and their corresponding supplementary description information. The request is the movie description that needs to be requested.

4. The method for correcting biases in a recommendation system that integrates world knowledge from a large language model according to claim 1, characterized in that, The text expert network is structured as a multilayer perceptron network. Its input is a first encoding vector, and its output is an embedding vector with a custom dimension. The specific expression for the text expert network is: In the formula, t This is the first encoded vector. The vectors are the input layers of the text expert network. For Text Expert Network l The vector of layer -1, For activation function, For the first in the text expert network l The weight matrix of the layer, For the first in the text expert network l Layer bias vector, For the first in the text expert network l Hidden layer vectors of a layer.

5. The method for correcting biases in a recommendation system that integrates world knowledge from a large language model according to claim 1, characterized in that, The collaborative expert network is structured as a multilayer perceptron network. Its input is a second encoding vector, and its output is an embedding vector with a custom dimension. The specific expression for a collaborative expert network is: In the formula, u This is the second encoding vector. The vectors for the input layer of the collaborative expert network. For collaborative expert networks l The vector of layer -1, For activation function, For the first in the collaborative expert network l The weight matrix of the layer, For the first in the collaborative expert network l Layer bias vector, For the first in the collaborative expert network l Hidden layer vectors of a layer.

6. The method for correcting biases in a recommender system that integrates world knowledge from a large language model according to claim 1, characterized in that, The hybrid expert network uses a contrastive learning method to calculate the vectors of users and items. Specifically, this method is as follows: Within the training batch, positive and negative sample pairs are constructed. The first and second encoding vectors corresponding to the same user and the initial user vector are regarded as positive examples, while the first and second encoding vectors of the user and the initial user vectors of other users are regarded as negative examples. Based on the dot product similarity as a metric, the similarity between positive examples and the contrast between negative examples are narrowed, and the fusion of multimodal information is achieved in a fine-grained manner to encode and generate vectors of users and items.

7. The method for correcting biases in a recommendation system that integrates world knowledge from a large language model according to claim 6, characterized in that, In step S5, the predicted value is obtained. The specific expression is: In the formula, For the Sigmoid function, This is the final representation vector of the item. This is the user's final representation vector.

Citation Information

Patent Citations

  • Knowledge base question generation method based on hybrid expert model and joint learning

    CN113127623A

  • Recommendation system click prediction method based on feature selection depolarization

    CN117272130A