Cold start recommendation method combining anti-fact enhancement and neural process
By combining counterfactual enhancement and neural processes, counterfactual samples are generated, which solves the problem of data sparsity in cold-start recommendation, improves recommendation efficiency and accuracy, and solves the difficulty of user preference learning caused by limited interactive data in the existing technology.
Patent Information
- Application Number
- CN202410737665.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-24
AI Technical Summary
The existing technology ignores the problem of data sparsity in cold-start recommendation. Especially when interactive data is limited, it is difficult to effectively learn user preferences, resulting in low recommendation efficiency.
Combining counterfactual enhancement and neural processes, it alleviates data sparsity by generating counterfactual samples, improves the model's ability to understand causal relationships, and complements the original recommendation model through an enhanced network with a multi-layer perceptron structure to optimize user-item interaction data. , improve recommendation efficiency.
It effectively improves the efficiency of item recommendation in cold start scenarios, enhances the generalization ability and stability of the model, can better understand the causal mechanism behind the data, reduces the learning of false patterns, and improves the accuracy of recommendations.
Smart Images

Figure CN118690195A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, and in particular to a cold start recommendation method combining counterfactual enhancement and neural process. Background Art
[0002] Recommender systems have been widely introduced in various online applications involving e-commerce, news, and social media platforms. Despite its success in learning user preferences, accurately modeling cold-start users remains a key challenge due to the extremely scarce cold-start user interactions. Previous studies have mainly alleviated the reliance on interaction information by introducing auxiliary information, such as content features (e.g., user profiles), social networks, and cross-domain information. However, it is still crucial to quickly understand the preferences of cold-start users after only a small number of interactions are collected. Meta-learning and neural processes are widely used in cold-start recommendation tasks due to their ability to quickly adapt to sparse interactions. Compared with meta-learning, neural processes additionally introduce a characterization of uncertainty by learning the complex distribution of data, providing powerful expression capabilities for cold-start recommendations. Although neural processes provide an effective training idea for cold-start scenarios, they still ignore another challenge of recommender systems - data sparsity.
[0003] Data sparsity refers to the fact that the proportion of user-item interaction data is very small relative to the number of possible user-item combinations. It is a common phenomenon in recommendation systems and deserves more attention in cold start scenarios. One way to alleviate data sparsity is to perform data augmentation by generating additional data samples to enrich user-item interactions. Among them, counterfactual augmentation combines data augmentation with the framework of causal inference. Compared with the method of augmenting data using correlation, it can help the model better understand the causal mechanism behind the data and improve the effectiveness of the augmented data.
[0004] The neural process is a statistical framework for estimating and inferring the distribution of complex data. It is inspired by Gaussian processes and uses deep neural networks to parameterize and approximate the probability distribution of data based on Gaussian processes. Each task is regarded as an instance of a random process (i.e., a sample function). The neural process models the distribution of the function and learns general knowledge on the training task to quickly reason on the test task. When using the neural process for cold-start recommendation tasks, each user is usually regarded as a task. The distribution of the function defined in the neural process reflects the common characteristics of the users, and the uncertainty between different instantiations reflects the uncertainty of the users, i.e., individual differences.
[0005] A counterfactual is a hypothesis about something that has not happened based on something that has happened. The classic question involved is "What if another event happens?" The method of applying counterfactual reasoning in data augmentation technology is usually called counterfactual augmentation, and it is expected that the augmented data can contain more causal information and be more reliable. The purpose of counterfactual augmentation is to generate samples that are similar to but different from the original data points, so as to simulate possible intervention effects and enhance the model's generalization ability for unseen situations. For example, in natural language processing applications, counterfactual augmentation may involve artificial modification of text so that the text label becomes another preset label, but at the same time prohibits unnecessary editing. Such data augmentation can help the model reduce its reliance on semantically irrelevant features and improve the model's generalization ability in new fields. Counterfactual augmentation helps improve the model's generalization ability for unseen data and reduce the learning of false patterns by generating counterfactual samples, thereby improving the stability and interpretability of the model.
[0006] One method in the prior art to solve the cold start recommendation problem using a neural process framework includes: treating each user as a function instance. If all user interactions are represented as and further divide it into support sets and queryset During the training process, we hope to be able to predict the user's preference in the query set when the support set is given, so as to better fit the test process. The corresponding joint distribution can be expressed as:
[0007]
[0008] In order to solve this process, variational inference is used to derive the lower bound of the above evidence:
[0009]
[0010] in, is the true posterior of the latent variable given the support set, and are the variational posterior of the latent variable after the given support set and all the data, respectively. The first term in the evidence lower bound is the reconstruction term, which reflects the degree of fit of the model to the data; the second term measures the deviation of the latent representation from the variational posterior after the given support set and all the data.
[0011] On this basis, a global pool is additionally introduced to measure the correlation between users, based on which the decoder parameters specific to each user can be obtained. Describes the representation of K cluster centers, and D is the dimension of the representation. The latent representation z obtained by each user decoder interacts with A to obtain the soft clustering division of the user.
[0012] The disadvantages of the above-mentioned prior art method of using a neural process framework to solve the cold start recommendation problem include: the method usually solves the cold start recommendation problem under the framework of meta-learning or neural process, and only uses limited user interaction data for learning. The neural process emphasizes the adaptability and flexibility of the model when facing new tasks, and the neural process additionally characterizes global uncertainty and prediction uncertainty by learning the distribution of representation functions. This method ignores the core problem in the cold start scenario - data sparsity. Learning user preferences with limited interaction data is itself a difficult task. Summary of the invention
[0013] An embodiment of the present invention provides a cold start recommendation method combining counterfactual enhancement and neural process to effectively improve the efficiency of item recommendation in cold start scenarios.
[0014] In order to achieve the above object, the present invention adopts the following technical scheme.
[0015] A cold-start recommendation method combining counterfactual enhancement and neural processing, comprising:
[0016] Initialize the parameters of the enhanced network;
[0017] Input the user's original interaction data into the encoder in the original recommendation model to obtain latent variables;
[0018] Passing the latent variable through the enhanced network to obtain an enhanced importance variable, sampling the enhanced importance variable to obtain an enhanced indicator variable;
[0019] Applying the enhanced indicator variable to the original interaction data to obtain enhanced interaction data, calculating the overall loss function of the original recommendation model, and updating the enhanced network according to the overall loss function;
[0020] The enhanced interaction data is used as the input of the original recommendation model, and the above process is repeated. When the training converges, the final enhanced data of the original interaction data is obtained. The original recommendation model is retrained by combining the final enhanced data with the original interaction data to obtain the final prediction model, which is used to recommend items in the cold start scenario.
[0021] Preferably, the step of initializing parameters of the enhanced network includes:
[0022] A multilayer perceptron is used as the structure of the enhanced network aug(·), the parameters of the enhanced network aug(·) are set according to the parameters of the original recommendation model, and the parameters of the enhanced network aug(·) are initialized.
[0023] Preferably, the step of inputting the original interaction data of the user into the encoder in the original recommendation model to obtain latent variables includes:
[0024] Original recommended model f rec Based on the neural process framework, it contains encoder q φ and decoder p θ The two-part network structure, namely f rec (·)=p θ (q φ (·)), the user's entire interactive information is represented as r, and r is input into the encoder q of the original recommendation model. φ , and get the hidden variable z.
[0025] Preferably, the step of obtaining an enhanced importance variable by passing the latent variable through an enhanced network, and sampling the enhanced importance variable to obtain an enhanced indicator variable comprises:
[0026] The hidden variable z is passed through the enhanced network to obtain the enhanced importance variable t=aug(x), the enhanced importance variable t is sampled, and the indicator variable is reparameterized using Gumbel Softmax, so that the gradient is back-propagated during the sampling process, and a Gumbul random number g is generated for each probability value. i ~Gumbel[0,1], adds random numbers to the probability values and selects the number with the maximum probability as the sampling value, which is called Gumbel-Max. Its formula is described as:
[0027] arg max[g i +logt i ]
[0028] where g i is the Gumbul random number, t i is the i-th element in the corresponding importance variable t;
[0029] Gumbel-Softmax uses softmax as a continuous differentiable approximation of argmax, namely:
[0030]
[0031] Among them, τ is the temperature parameter of softmax, M is the dimension of the indicator vector, each dimension in the indicator vector corresponds to an item, and the dimension is equal to the number of items. The discrete value of Gumbel-Max is used in the forward pass, and the continuous value of Gumbel-Softmax is used in the back propagation.
[0032] The i To enhance one dimension of the indicator variable e, all dimensions of e iComposition enhancement indicator variable e.
[0033] Preferably, the step of applying the enhanced indicator variable to the original interaction data to obtain enhanced interaction data, calculating the overall loss function of the original recommendation model, and updating the enhanced network according to the overall loss function includes:
[0034] Apply the enhanced indicator variable to the original interaction data to obtain the enhanced interaction data
[0035] The counterfactual data sample Further divided into support sets and queryset and exists f rec It is expected that the user’s preference in the query set can be predicted given the support set, f rec The prediction distribution expression of is:
[0036]
[0037] in For user preference representation:
[0038] Based on the variational inference mechanism, we can derive the lower bound of the above formula:
[0039]
[0040] in, is the true posterior of the latent variable z given the support set, and are the variational posterior of the latent variables after a given support set and all data, respectively, using the variational posterior The first term in the evidence lower bound is the reconstruction term, which reflects the degree of fit of the model to the data; the second term measures the deviation of the latent representation from the variational posterior given the support set and all the data;
[0041] Calculate the overall loss function of the original recommendation model:
[0042]
[0043] According to the overall loss function of the original recommendation model Update the enhanced network aug(·).
[0044] It can be seen from the technical solutions provided by the above embodiments of the present invention that the present invention focuses on cold start tasks and directly acts on items in the item set, avoiding information loss in the mapping process. Counterfactual enhancement technology is used to alleviate the data sparsity of the recommendation scenario, effectively improving the efficiency of item recommendation in cold start situations.
[0045] Additional aspects and advantages of the present invention will be given in part in the following description, which will become obvious from the following description, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] 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.
[0047] Figure 1 A processing flow chart of a cold start recommendation method combining counterfactual enhancement and neural process provided by an embodiment of the present invention;
[0048] Figure 2 A processing flow chart of a cold start recommendation method combining counterfactual enhancement and neural process proposed in an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0050] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or coupling. The term "and / or" used herein includes any unit and all combinations of one or more associated listed items.
[0051] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless defined as herein.
[0052] To facilitate understanding of the embodiments of the present invention, several specific embodiments will be further explained below with reference to the accompanying drawings, and each embodiment does not constitute a limitation on the embodiments of the present invention.
[0053] Counterfactual augmentation: It is a data augmentation method based on causal reasoning. It artificially modifies the samples in the data set to generate samples that are similar to but different from the original data points, so as to simulate possible intervention effects and enhance the model's generalization ability for unseen situations.
[0054] Neural Process: A statistical framework that uses neural networks to parameterize and approximate data distributions in Gaussian processes, and is used to handle complex data structures that are difficult to model with traditional statistical methods. Neural processes are able to estimate the uncertainty of their predictions based on contextual observations and generate predictions in a very computationally efficient way.
[0055] Cold start recommendation: It is a key issue in the recommendation system, which involves how to provide accurate recommendations for new users (user cold start) or new items (item cold start). Due to the lack of sufficient historical interaction data in the system, these newly added entities are difficult to be effectively recommended through traditional recommendation methods such as collaborative filtering.
[0056] The embodiment of the present invention proposes a cold-start recommendation method that combines counterfactual enhancement and neural processes. The counterfactual reasoning strategy is used to explore the potential causal relationship between the interaction data and the recommendation results, rather than just considering the associated statistical information in the data. On this basis, new counterfactual data samples are generated to alleviate data sparsity. This method is usually called a counterfactual enhancement method. Introducing a counterfactual enhancement strategy in a cold-start recommendation method based on neural processes can help the model better understand the causal mechanism behind the data, and to a certain extent increase the diversity of the data, which helps the model learn a more generalized feature representation, and then combine the counterfactual enhancement samples with the original data to jointly train the cold-start recommendation model, thereby improving the generalization ability of the model in cold-start situations.
[0057] The implementation principle diagram of a cold start recommendation method combining counterfactual enhancement and neural process proposed in an embodiment of the present invention is as follows: Figure 1 The specific processing flow is as shown in Figure 2 As shown, the processing steps include the following:
[0058] Step S10: Initialize parameters of the enhanced network aug(·).
[0059] The structure of the enhanced network is a multi-layer perceptron. The present invention combines the enhanced network with the neural process to perform counterfactual enhancement to alleviate the cold start recommendation problem. The enhanced network and the original recommendation model are complementary to each other. The learning of the enhanced network depends on the implicit representation z obtained by the original recommendation model. u , the original recommendation model can be further optimized in combination with the enhanced results.
[0060] The role of the augmented network is to obtain the augmented interaction between the user and the item (described in S20 and S30) to alleviate data sparsity. Considering that the augmented item is not a factual interaction, it can be called counterfactual augmentation.
[0061] The enhanced network is composed of multiple layers of perceptrons, and its parameters include the number of perceptron layers and the number of neurons in each layer. Different network parameter settings have different effects on learning effects. The encoder architecture of the enhanced network is similar to that of the original recommendation model. Therefore, the parameters of the enhanced network can be set and initialized according to the network parameters of the decoder in the original recommendation model.
[0062] Step S10: Input the user's original interaction data into the encoder in the original recommendation model to obtain latent variables.
[0063] Original recommended model f rec Based on the neural process framework, it contains encoder q φ and decoder p θ The two-part network structure, namely f rec (·)=p θ (q φ (·)).
[0064] Represent all interaction information of each user as r, and input r into the encoder q in the original recommendation model. φ , and get the hidden variable z. The hidden variable z is obtained by the encoder q φ The input mutual information r is encoded, and it is usually assumed that the encoder output follows a Gaussian distribution z~N(μ,σ 2 ]), so the encoder output is the mean μ and variance σ of the Gaussian distribution 2 , through the reparameterization method, Gaussian noise ∈ is sampled from the standard normal distribution N(0,I) and the latent variable z = μ + σ⊙∈ is calculated. This reparameterization technique makes the sampling process of the latent variable z a function of the mean and variance, thereby ensuring the return of the training gradient.
[0065] Step S20: The latent variable z is passed through the enhancement network to obtain an enhanced importance variable t=aug(z), and the enhanced importance variable t is sampled to obtain an enhanced indicator variable e.
[0066] Step S30: Applying the enhanced indicator variable to the original interaction data can obtain enhanced interaction data The above interaction data is a counterfactual data sample.
[0067] The counterfactual data sample Further divided into support set and queryset and exists f rec It is expected that the user’s preference in the query set can be predicted given the support set, f rec The prediction distribution expression of is:
[0068]
[0069] in For user preference representation:
[0070] Based on the variational inference mechanism, we can derive the lower bound of the above formula:
[0071]
[0072] in, is the true posterior of the latent variable z given the support set, and are the variational posterior of the latent variables after a given support set and all data, respectively, using the variational posterior The first term in the evidence lower bound is the reconstruction term, which reflects the degree of fit of the model to the data; the second term measures the deviation of the latent representation from the variational posterior given the support set and all the data;
[0073] Calculate the overall loss function of the original recommendation model:
[0074]
[0075] According to the overall loss function of the original recommendation model The enhanced network aug(·) is updated to obtain new enhanced samples. rec (·) is fixed and only the parameters of the enhanced network aug(·) are trained.
[0076] The enhanced interaction data r is used as the input of the original recommendation model, and the above process is repeated. When the training converges (such as reaching the predetermined number of iterations), the final enhanced sample indicator variable e is obtained, and then the final enhanced data of the original interaction data is obtained. The final enhancement number is combined with the original interaction data to retrain the original recommendation model and obtain the final prediction model.
[0077] The process of retraining the recommendation model with the final enhanced data: First, use r and e to get the enhanced interaction data The enhanced interaction data is used as the input of the neural process-based recommendation model. The model architecture includes an encoder q φ (·) and decoder p θ (·),use As the recommendation loss, the parameters of the encoder and decoder are learned by Adam gradient descent.
[0078] Then, the above-mentioned final prediction model can be used to recommend items in the cold start scenario. The recommendation method based on the neural process can be used to solve the cold start recommendation problem because its meta-learning mechanism is suitable for small sample learning tasks. The model retrained after enhancement still has the ability to solve the cold start problem, and because the counterfactual enhancement mechanism takes into account the data sparsity problem in the cold start environment, the present invention can obtain a better recommendation effect.
[0079] Specifically, the above step S20 includes: If the indicator variable e is to be obtained according to the importance variable t, a simple and intuitive way is to use Bernoulli sampling, that is, e~Bernoulli(t). However, the Bernoulli sampling process is not differentiable, which will result in the inability to update the enhanced network according to the gradient of the loss function. Therefore, the present invention uses Gumbel Softmax to reparameterize the indicator variable so that the gradient can be back-propagated during the sampling process. Specifically, a Gumbul random number g is first generated for each probability value i ~Gumbel[0,1], add it to the probability value, and select the number with the maximum probability as the sampling value, which is called Gumbel-Max, and its formula is described as:
[0080] arg max[g i +log t i ]
[0081] where g i is the Gumbul random number, t i is the i-th element in the corresponding importance variable t.
[0082] However, the argmax operation is still non-differentiable, so Gumbel-Softmax uses softmax as a continuously differentiable approximation of argmax, namely:
[0083]
[0084] Where τ is the temperature parameter of softmax, which controls the smoothness or sharpness of the output distribution. When τ approaches 0, the distribution sampled from Gumbel-Softmax is similar to the one-hot distribution, which is the same as the Bernoulli distribution. M is the dimension of the indicator vector. In the present invention, since each dimension in the indicator vector corresponds to an item, the dimension is equal to the number of items. Therefore, the sampling process can be reparameterized by using the discrete value of Gumbel-Max in the forward pass and the continuous value of Gumbel-Softmax in the back propagation.
[0085] Specifically, the above step S30 includes: if the goal of the cold start recommendation algorithm based on the neural process is to maximize the lower bound of evidence obtained according to variational reasoning, its general form can be expressed as minimizing the following loss function:
[0086]
[0087] in, Represents all data of the current user. They represent the support set and query set obtained by dividing the current user interaction data, respectively, and z is the latent representation obtained by the encoder. Since the role of the enhanced item is to make the originally unrecommended items be successfully recommended, that is, to improve the generalization of the recommendation model, in the present invention, the constraints on the enhanced items are still implemented through the loss function of the original recommendation model, that is, when the enhanced item acts on the original interaction to obtain the enhanced interaction After that, it is sent into the original recommendation model to obtain the loss function
[0088] In addition, since the set of items is large, as few items as possible should be selected as enhanced items, thus an additional constraint on the number of enhanced items is added. len (e) = ∑ i e i The two parts work together to obtain the overall loss function The hyperparameters Balances the relationship between enhancement constraints and recommendation losses.
[0089] The algorithm description of the cold start recommendation method combining counterfactual enhancement and neural process is shown in Table 1:
[0090]
[0091]
[0092] In summary, the embodiment of the present invention proposes a cold start recommendation method that combines counterfactual enhancement and neural processes. The counterfactual reasoning strategy is used to explore the potential causal relationship in the neural process, rather than just considering the associated statistical information in the data, and on this basis, counterfactual enhancement samples are generated. It is expected that the introduction of enhanced samples can make the items that originally failed to be recommended be successfully recommended. Therefore, the counterfactual reasoning strategy can help the model better understand the causal mechanism behind the data, and the introduction of enhanced samples can alleviate data sparsity and help improve the generalization ability of the model.
[0093] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present invention.
[0094] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.
[0095] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0096] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A cold start recommendation method combining counterfactual enhancement and neural process, characterized in that: include: Initialize the parameters of the enhanced network; Input the user's original interaction data into the encoder in the original recommendation model to obtain latent variables; Passing the latent variable through the enhancement network to obtain an enhanced importance variable, sampling the enhanced importance variable to obtain an enhanced indicator variable; Applying the enhanced indicator variable to the original interaction data to obtain enhanced interaction data, calculating the overall loss function of the original recommendation model, and updating the enhanced network according to the overall loss function; The enhanced interaction data is used as the input of the original recommendation model, and the above process is repeated. When the training converges, the final enhanced data of the original interaction data is obtained. The original recommendation model is retrained by combining the final enhanced data with the original interaction data to obtain the final prediction model, which is used to recommend items in the cold start scenario.
2. The method according to claim 1, characterized in that The step of initializing parameters of the enhanced network includes: A multilayer perceptron is used as the structure of the enhanced network aug(·), the parameters of the enhanced network aug(·) are set according to the parameters of the original recommendation model, and the parameters of the enhanced network aug(·) are initialized.
3. The method according to claim 1, characterized in that The user's original interaction data is input into the encoder in the original recommendation model to obtain latent variables, including: Original recommended model f rec Based on the neural process framework, it contains encoder q φ and decoder p θ The two-part network structure, namely f rec (·)=p θ (q φ (·)), the user's entire interactive information is represented as r, and r is input into the encoder q of the original recommendation model. φ , and get the hidden variable z.
4. The method according to claim 3, characterized in that The step of obtaining an enhanced importance variable by passing the latent variable through an enhanced network and sampling the enhanced importance variable to obtain an enhanced indicator variable comprises: The hidden variable z is passed through the enhancement network to obtain the enhanced importance variable t=aug(z), the enhanced importance variable t is sampled, and the indicator variable is reparameterized using Gumbel Softmax, so that the gradient is back-propagated during the sampling process, and a Gumbul random number g is generated for each probability value. i ~Gumbel[0,1], adds random numbers to the probability values and selects the number with the maximum probability as the sampling value, which is called Gumbel-Max. Its formula is described as: argmax[g i +logs i ] where g i is the Gumbul random number, t i is the i-th element in the corresponding importance variable t; Gumbel-Softmax uses softmax as a continuous differentiable approximation of argmax, namely: Among them, τ is the temperature parameter of softmax, M is the dimension of the indicator vector, each dimension in the indicator vector corresponds to an item, and the dimension is equal to the number of items. The discrete value of Gumbel-Max is used in the forward pass, and the continuous value of Gumbel-Softmax is used in the back propagation; The i To enhance one dimension of the indicator variable e, all dimensions of e i Composition enhancement indicator variable e.
5. The method according to claim 4, characterized in that The step of applying the enhanced indicator variable to the original interaction data to obtain enhanced interaction data, calculating the overall loss function of the original recommendation model, and updating the enhanced network according to the overall loss function includes: Apply the enhanced indicator variable to the original interaction data to obtain the enhanced interaction data The counterfactual data sample Further divided into support set and queryset and exists f rec It is expected that the user’s preference in the query set can be predicted given the support set, f rec The prediction distribution expression of is: in To indicate user preferences; Based on the variational inference mechanism, we can derive the lower bound of the above formula: in, is the true posterior of the latent variable z given the support set, and are the variational posterior of the latent variables after a given support set and all data, respectively, using the variational posterior The first term in the evidence lower bound is the reconstruction term, which reflects the degree of fit of the model to the data; the second term measures the deviation of the latent representation from the variational posterior given the support set and all the data; Calculate the overall loss function of the original recommendation model: According to the overall loss function of the original recommendation model Update the enhanced network aug(·).
