A cross-domain causal inference-based out-of-distribution recommendation model and a training method

CN118364173BActive Publication Date: 2026-09-11SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410490809.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-23
Publication Date
2026-09-11
Estimated Expiration
2044-04-23

AI Technical Summary

Technical Problem

然而,从数据中学习因果结构的问题仍然存在:(1)数据稀疏性:数据稀疏性会使推荐系统难以学习正确的因果结构

Benefits of technology

[0073] (1) This invention can utilize the data-rich source domain to help the data-sparse target domain learn its causal invariant preference embedding, thereby helping the model improve its accuracy in predicting the probability of user-item interaction in an out-of-distribution environment; and predict the items that users like by capturing users' personalized preferences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118364173B_ABST
    Figure CN118364173B_ABST
Patent Text Reader

Abstract

This invention discloses an out-of-distribution recommendation model and training method based on cross-domain causal inference, relating to the field of computer information recommendation technology. It includes a user domain-specific embedding component, a user domain-shared embedding component, an item embedding component, a causal inference module, and a prediction component. The user domain-specific embedding component includes a user implicit attribute embedding component and a user domain-specific preference embedding component; the user domain-shared embedding component includes a user domain-shared preference generator and a user domain-shared preference discriminator; the item embedding component includes an item embedding generator; the causal inference module includes a directed acyclic graph constraint and an embedding reconstruction module; and the prediction component includes a user embedding vector fusion module and an interaction probability prediction module. This invention utilizes the rich source domain knowledge to help the data-sparse target domain learn the causal structure from user attributes to user preferences, thereby mitigating the negative impact of data sparsity on the out-of-distribution recommendation performance of the recommendation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer information recommendation technology, and in particular to an out-of-distribution recommendation model and training method based on cross-domain causal inference. Background Technology

[0002] Recommender systems aim to alleviate information overload by providing personalized recommendations based on users' historical interaction records. Existing methods typically assume that the training and testing datasets have the same distribution, but this may not hold true in reality. In fact, the distribution of user preferences changes with user attributes. For example, as a user's income increases, their food preference while traveling might change from hamburgers to wine. User preferences learned from outdated interaction data and user attributes can lead to inaccurate recommendations, negatively impacting user experience. Therefore, improving the out-of-distribution generalization performance of recommender systems has become a pressing issue.

[0003] Research on out-of-distribution generalization in recommender systems is limited. Some existing methods treat out-of-distribution generalization in recommender systems as a data debiasing problem, but these methods do not explicitly consider the more common situation in the real world: changes in user attributes. Since the causal structure reflecting the user preference generation process can remain unchanged in the data distribution shift, recommender systems can capture the user preference generation process that is independent of the data distribution by learning the causal structure. Therefore, some methods solve the problem of changes in user attributes through causal inference, such as automatically learning the causal structure from the data through a directed acyclic constraint. However, the problems of learning the causal structure from the data still exist: (1) Data sparsity: Data sparsity makes it difficult for recommender systems to learn the correct causal structure. On the one hand, data sparsity increases the risk of model overfitting; on the other hand, data sparsity may lead to confusion between causality and correlation; (2) Difficulty in obtaining explicit attributes: Learning the causal structure from the data requires the dataset to contain explicit attributes of users and items. However, due to the privacy restrictions imposed by various platforms, it is difficult to obtain this data, which makes it difficult for recommender systems to learn the expressions of users and items. While we can encode user ID information as an implicit attribute, ensuring that the correct implicit attribute is encoded for the user remains a problem. Summary of the Invention

[0004] The purpose of this invention is to provide an out-of-distribution recommendation model and training method based on cross-domain causal inference. The aim is to use the data-rich source domain to help the data-sparse target domain learn the causal structure from user attributes to user preferences, thereby mitigating the negative impact of data sparsity on the out-of-distribution recommendation performance of the recommendation model.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] On the one hand, this invention proposes an out-of-distribution recommendation model based on cross-domain causal inference, including a user domain-specific embedding component for generating and learning user domain-specific embedding vectors;

[0007] User-domain shared embedding components for user-domain shared embedding vectors;

[0008] Item embedding component used to generate and learn item embedding vectors;

[0009] A causal inference module for learning the causal structure from user attributes to user preferences;

[0010] A predictive component used to predict the probability of user interaction with items;

[0011] The user domain-specific embedding components include user implicit attribute embedding components and user domain-specific preference embedding components;

[0012] The user implicit attribute embedding component generates corresponding implicit attribute embeddings from the user's ID information;

[0013] The user domain-specific preference embedding component embeds the user's implicit attributes to generate user domain-specific preference embeddings;

[0014] The user domain shared embedding component includes a user domain shared preference generator and a user domain shared preference discriminator;

[0015] The user domain shared preference generator is used to generate user domain shared preference embeddings;

[0016] The user domain shared preference discriminator is used to determine which domain the domain shared preference embedding comes from;

[0017] The item embedding component includes an item embedding generator, which generates a corresponding embedding from the item's number information;

[0018] The causal inference module includes a directed acyclic graph constraint and an embedded reconstruction module;

[0019] The directed acyclic graph constraint is used to ensure that the causal structure is directed acyclic;

[0020] The embedded reconstruction module is used to learn the causal structure from user attributes to user preferences;

[0021] The prediction component includes a user embedding vector fusion module and an interaction probability prediction module;

[0022] The user embedding vector fusion module fuses user domain-specific preference embeddings and domain-shared causal invariant preference embeddings to form the final user embedding;

[0023] The interaction probability prediction module predicts the user-item interaction probability based on the end-user embedding and item embedding.

[0024] On the other hand, this invention proposes a training method for an out-of-distribution recommendation model based on cross-domain causal inference, comprising the following steps:

[0025] S1: Obtain user information, item information, and user-item interaction records; the user information includes the user ID, and the item information includes the item ID;

[0026] S2: Preprocess the information in S1 to form a test set and a training set, and build a prediction model;

[0027] S3: User ID is used to obtain user domain-specific embedding through user domain-specific embedding component; User ID is used to obtain user domain-shared embedding through user domain shared embedding component; Item ID is used to obtain item embedding through item embedding component;

[0028] S4: Input the user implicit attribute embedding and the user domain shared embedding into the causal inference module to obtain the user domain shared causal invariant preference embedding;

[0029] S5: Input user domain-specific embeddings, user domain-shared causal invariant preference embeddings, and item embeddings into the prediction model to obtain interaction probability predictions;

[0030] S6: Train the prediction model using the training set to obtain the trained model;

[0031] S7: Input the test set data into the trained model to obtain the end-user-item interaction probability.

[0032] This recommendation model can be used on online shopping platforms, enabling them to provide personalized recommendations to users, saving them search time and improving their user experience.

[0033] In another embodiment of the present invention, the information preprocessing method in S2 is as follows:

[0034] Define m rows n s Columns and m rows n t The two user-item interaction information matrices are listed, and each element of the matrix is... and This indicates whether there is an interaction between user u and item i, with 1 representing interaction and 0 representing no interaction.

[0035] Wherein, U = {u1, u2, ..., u} is defined. m Let} be a set of users, with size m; define A collection of items from the source domain. Let n be the set of items in the source and target domains, with sizes n respectively. s and n t .

[0036] In another embodiment of the present invention, S3 includes the following steps:

[0037] User ID o u User implicit attribute embedding in the source domain Embedding implicit attributes of users in the target domain

[0038]

[0039]

[0040] User implicit attribute embedding in the source domain Implicit User Attribute Embedding in the Target Domain Generating domain-specific embeddings from user source domains Domain-specific embeddings of the target domain

[0041]

[0042] User implicit attribute embedding in the source domain Embedding implicit attributes of users in the target domain Generate user domain shared embedding

[0043]

[0044]

[0045] Determine user domain shared embedding using a user domain shared preference discriminator c From which field:

[0046]

[0047] Source Domain Item Number and the item number of the target area Generate source domain item embedding Embedding of items in the target area

[0048]

[0049]

[0050] The user domain-specific embedded component, the user domain-shared embedded component, and the item embedded component are all fully connected layers; where ou ∈{0,1} m Number the user. Number the source domain item. Number the items in the target area. For the embedded dimension, All of these are weights of the fully connected layer. Used to specify u c Which field does it come from? When the discriminator cannot determine u c When the source is specified, it indicates that the embedding is domain-shared.

[0051] In another embodiment of the present invention, the causal inference module in S4 is:

[0052]

[0053] Where A is a 2K×2k adjacency matrix, and each node is a dimension of user attributes or user preferences; || represents a vector concatenation operation, and ∈ represents noise signal; For the reconstructed embedding, the last k dimensions are used as the user domain shared causal invariant preference embedding u. cau ;

[0054] The directed acyclic constraint on A is:

[0055] Tr(e A⊙A -k = 0;

[0056] min||A [k+1:2k,1:k] ||1;

[0057]

[0058] The causal inference module is optimized using the following expression:

[0059]

[0060] Where ⊙ represents element-wise multiplication, Tr(·) is the trace of the matrix, γ1, γ2, and γ3 are the weights of each loss term, and A [:,i] Let A be the i-th column of matrix A. T L is the transpose of the matrix. rec For reconstruction loss, L dag For directed acyclic constraints, L a2p To constrain the loss function in A to allow edges to run only from user attribute nodes to user preference nodes, L pnr To constrain user preference nodes in A from being used as the loss function of the root node, L cau To optimize the loss function of the causal inference module, N is the number of training samples, and H... iThis is the reconstructed embedding of the i-th training sample.

[0061] In another embodiment of the present invention, S5 includes the following steps:

[0062] User-source domain-specific embedding u s Domain-specific embedding of the target domain t And user domain sharing causal invariant preference embedding u cau Generate source domain end-user embedded u cs Embedded with end users in the target domain ct for:

[0063] u cs =h s (u s ||u cau );

[0064] u ct =h t (u t ||u cau );

[0065] Source domain end-user embedded u cs Embedded with end users in the target domain ct Source domain items embedded i s Target domain item embedding i t Generate predicted source domain interaction probabilities Interaction probability with the predicted target domain for:

[0066]

[0067]

[0068] Among them, h s For the source domain embedded fusion module, h t For the target domain's embedded fusion module, f s For the interaction prediction module in the source domain, f t This is an interaction prediction module for the target domain.

[0069] In another embodiment of the present invention, in S6, the cross-entropy loss function L is used to optimize the training model:

[0070]

[0071] in, To train the loss function for user domain shared embeddings, L cau Here, ||θ||² is the loss function for the causal inference module, and ||θ||² is the regularization term. This is a record of real interactions in the source domain. For the actual interaction records in the target domain, λ1, λ2, λ3, and λ4 are the weights of each item.

[0072] Compared with the prior art, the present invention has the following beneficial effects:

[0073] (1) This invention can utilize the data-rich source domain to help the data-sparse target domain learn its causal invariant preference embedding, thereby helping the model improve its accuracy in predicting the probability of user-item interaction in an out-of-distribution environment; and predict the items that users like by capturing users' personalized preferences.

[0074] (2) This invention extends causal structure learning from explicit attributes to implicit attributes, enriching the application scenarios of recommendation systems based on causal reasoning;

[0075] (3) The present invention adopts a collaborative filtering model, which learns embeddings for both users and items from the historical interaction data of users and items, and can capture the degree of personalized preference of different users for items.

[0076] (4) This invention can help online service platforms such as online shopping platforms or online movie platforms improve the performance of personalized recommendations, thereby improving the user experience. Attached Figure Description

[0077] Figure 1 This is a schematic diagram of the prediction model structure of the present invention;

[0078] Figure 2 This is a schematic diagram of the training method of the present invention. Detailed Implementation

[0079] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0080] Personalized preferences refer to the unique likes and inclinations an individual exhibits when faced with choices. In the context of personalized recommendation systems, these preferences typically refer to the degree to which a user likes a specific item, service, or content. These preferences may be based on the user's interests, experiences, emotions, values, or other personal characteristics. In this embodiment, personalized preferences refer to the different degrees of liking different users for the same item, and consequently, the different probabilities of them choosing to purchase or use that item. For example, when faced with the same piece of clothing, different users will have different degrees of liking for it due to differences in their preferred colors and styles. Therefore, we need to capture users' personalized preferences to predict the items they will like.

[0081] Out-of-distribution recommendation refers to the behavior of a recommendation model making recommendations to users when faced with test data distributed differently from the training data. The out-of-distribution generalization problem in recommendation systems arises because user behavior and preferences can change over time, seasons, and trends, leading to a discrepancy between the distribution of online user behavior and the distribution of offline training data. Therefore, we need to understand the causal relationships that generate user preferences to improve the out-of-distribution recommendation performance of the model.

[0082] In recommender systems, data sparsity refers to the phenomenon where there are a large number of zero values ​​(i.e., users have not interacted with any items) in the user-item interaction matrix. This sparsity occurs because users typically only interact with a small subset of items (such as ratings, purchases, and clicks), while having no direct interaction records with the majority of items.

[0083] Cross-domain recommendation refers to using data and knowledge from one domain (source domain) to improve the recommendation performance in another domain (target domain) within a recommender system. This method is particularly suitable for situations where data in the target domain is sparse or where there is insufficient data in a new domain for effective recommendations. The core idea of ​​cross-domain recommendation is to transfer information from the source domain to the target domain through inter-domain correlations, thereby solving the cold start problem and improving the accuracy and diversity of the recommender system.

[0084] Example 1:

[0085] Please see Figure 1 An out-of-distribution recommendation model based on cross-domain causal inference includes a user domain-specific embedding component for generating and learning user domain-specific embedding vectors;

[0086] User-domain shared embedding components for user-domain shared embedding vectors;

[0087] Item embedding component used to generate and learn item embedding vectors;

[0088] A causal inference module for learning the causal structure from user attributes to user preferences;

[0089] A predictive component used to predict the probability of user interaction with items;

[0090] The user domain-specific embedding component includes a user implicit attribute embedding component and a user domain-specific preference embedding component; the user domain-specific embedding component ensures the uniqueness of user preferences across domains, and sets up a user domain-specific preference encoder in each domain to capture user domain-specific preferences.

[0091] The user implicit attribute embedding component generates corresponding implicit attribute embeddings from the user's ID information;

[0092] The user domain-specific preference embedding component embeds the user's implicit attributes to generate user domain-specific preference embeddings;

[0093] The user domain shared embedding component extracts the user's domain shared preferences from the user's implicit attributes. Through an adversarial training process between the domain shared preference encoder and the domain discriminator, it is ensured that the domain shared preferences are domain-independent attributes. The user domain shared embedding component includes a user domain shared preference generator and a user domain shared preference discriminator.

[0094] The user domain shared preference generator is used to generate user domain shared preference embeddings;

[0095] The user domain shared preference discriminator is used to determine which domain the domain shared preference embedding comes from;

[0096] The item embedding component includes an item embedding generator, which generates a corresponding embedding from the item's number information;

[0097] The causal inference module includes a directed acyclic graph constraint and an embedded reconstruction module.

[0098] The directed acyclic graph constraint is used to constrain the causal structure to have the property of being directed acyclic. By modeling the causal structure through the directed acyclic graph constraint, the causal structure learned from domain-shared preferences is also domain-shared. In this way, knowledge from the source domain can be used to help improve the model's out-of-distribution recommendation performance in the target domain.

[0099] The embedded reconstruction module is used to learn the causal structure from user attributes to user preferences;

[0100] The prediction component includes a user embedding vector fusion module and an interaction probability prediction module;

[0101] The user embedding vector fusion module fuses user domain-specific preference embeddings and domain-shared causal invariant preference embeddings to form the final user embedding;

[0102] The interaction probability prediction module predicts the user-item interaction probability based on the end-user embedding and item embedding. Specifically, it infers the user's interaction probability with the item by utilizing the user's domain-shared causal invariant preferences, the user's domain-specific preferences, and the item embedding.

[0103] Example 2:

[0104] Please see Figure 1 - Figure 2 A training method for an out-of-distribution recommendation model based on cross-domain causal inference includes the following steps:

[0105] S1: Obtain user information, item information, and user-item interaction records; the user information includes the user ID, and the item information includes the item ID;

[0106] The specific methods for obtaining this information are as follows:

[0107] We use web scraping technology to retrieve information about books and movies viewed by users from the internet, and record user ratings for these books and movies. Then, we assign a unique identifier to each user and item to uniquely identify them. Each data entry can be recorded as a triple (user ID, item ID, rating).

[0108] The datasets are from Douban and Tencent. The Douban dataset collects user interaction records between books and movies, while the Tencent dataset collects user interaction records between videos and articles, as shown in Tables 1 and 2.

[0109] Table 1. Statistical information of the dataset

[0110]

[0111] Table 2. Attributes and descriptions of Douban data.

[0112]

[0113]

[0114] Table 3. Attributes and Descriptions of Tencent Data

[0115]

[0116] S2: The information in S1 is preprocessed using the following methods to form a test set and a training set, and a prediction model is constructed.

[0117] Use U={u1,u2,…,u m} represents a user set of size m; using Let n represent the sets of items in the source domain and the target domain, respectively. s and n t Define m rows n s Columns and m rows n t The two "user-item interaction information" matrices are listed, and each element of the matrix... and This indicates whether there is an interaction between user u and item i.

[0118] For each dataset's interaction matrix, a model is trained using observable user interaction records. The trained model is then used to predict unobserved values ​​in the interaction matrix. Due to user sparsity, this embodiment only retains users with at least 10 ratings and their historical interactions, resulting in the final dataset used for model training. To train the model, each user's data is divided into training, validation, and test sets in an 8:1:1 ratio. For training stability, ratings between 1 and 3 are considered "dislike" and recorded as 0, while ratings between 4 and 5 are considered "like" and recorded as 1.

[0119] On two datasets, experiments were first conducted in an Independent and Identically Distributed (IID) scenario, where training and test data were obtained through random sampling. Then, two Out-of-Distribution (OOD) recommendation scenarios were set up:

[0120] (1) User degree bias: Active users on the platform interact with various types of items, and active users will have smoother feature embeddings, which will lead to incorrect recommendations from the model. In this setting, this embodiment randomly samples training data from the original dataset and mainly uses users with high degree of sampling (more interactions) from the original dataset as test data.

[0121] (2) User attribute bias: User attributes change over time, for example, a user's income may increase. In this setting, the dataset is divided into two parts based on the user's gender, and then training is performed by randomly sampling from the original dataset, with the ratio of the two parts adjusted in the test set.

[0122] User degree bias setting (OOD#1) was experimented on two datasets, while user attribute bias setting (OOD#2) was experimented on only the Tencent dataset.

[0123] S3: User ID is used to obtain user domain-specific embedding through user domain-specific embedding component; User ID is used to obtain user domain-shared embedding through user domain shared embedding component; Item ID is used to obtain item embedding through item embedding component;

[0124] For each user u, there are two embedding methods: one is user-domain-specific embedding u. s and u t Another type is user-domain shared embedding u c .

[0125] First, by user ID o u User implicit attribute embedding in the source domain Embedding implicit attributes of users in the target domain

[0126]

[0127]

[0128] Secondly, implicit user attribute embedding in the source domain Implicit User Attribute Embedding in the Target Domain Generating domain-specific embeddings from user source domains Domain-specific embeddings of the target domain

[0129]

[0130] User implicit attribute embedding in the source domain Embedding implicit attributes of users in the target domain Generate user domain shared embedding

[0131]

[0132]

[0133] Third, determine the user domain shared embedding u c From which field:

[0134]

[0135] Source Domain Item Number Target area item number Generate item embedding

[0136]

[0137] The user domain-specific embedded component, the user domain-shared embedded component, and the item embedded component are all fully connected layers; where o u ∈{0,1} m Number the user. Number the source domain item. Number the items in the target area. For the embedded dimension, All are weights of the fully connected layer. Through model learning, the user and item embedding components map users and items to the same shallow space, enabling the model to capture the interaction between shallow features of users and items to predict user preferences for items. Used to specify u c Which field does it come from? When the discriminator cannot determine u c When the source is specified, it indicates that the embedding is domain-shared.

[0138] S4: Input the user implicit attribute embedding and the user domain shared embedding into the causal inference module to obtain the user domain shared causal invariant preference embedding;

[0139] In this embodiment, a graph G with 2k nodes is encoded into a weighted adjacency matrix A of size 2k×2k, where A ij This represents the causal effect of node i on node j. Each node represents a dimension of the user's implicit attribute or user preference embedding. The embedding reconstruction formula for learning the causal structure is as follows:

[0140]

[0141] In the formula: This is a vector concatenation operation, where ∈ represents noise signal; This is the reconstructed embedding. When this formula holds, graph G correctly represents the causal relationship between user implicit attributes and user preferences. Using implicit attributes for causal learning has two advantages: the model does not depend on the user's explicit attributes, so its use is not restricted by privacy policies; and the model can mine latent user attributes from the data, enabling more accurate modeling of causal structures. In this embodiment, the last k dimensions are used as the user domain shared causal invariant preference embedding u. cau ;

[0142] The directed acyclic constraint on A is:

[0143] Tr(e A⊙A -k = 0;

[0144] min||A [k+1:2k,1:k] ||1;

[0145]

[0146] The causality module is optimized using the following loss function:

[0147]

[0148] In the formula: γ1, γ2 and γ3 are the weights of each loss, and Tr(·) is the trace of the matrix.

[0149] S5: Input user domain-specific embeddings, user domain-shared causal invariant preference embeddings, and item embeddings into the prediction model to obtain interaction probability predictions;

[0150] First, it is necessary to obtain the final embedding of the user and the final embedding of the item; this embodiment embeds the user's domain-specific preference embedding and the domain-shared causal invariant preference embedding. cau The embedded fusion module h, which connects the inputs to the source domain of the fusion layer, is used for this purpose. s and the target domain embedded fusion module h tIn order to obtain the final user preference embedding u cs and u ct .

[0151] Secondly, the fusion layer can be considered an attention layer, preserving both user domain-specific preferences and domain-shared preferences, and automatically balancing their importance. The specific process is as follows:

[0152] u cs =h s (u s ||u cau );

[0153] u ct =h t (u t ||u cau );

[0154] Ultimately, the source domain end-user embeds u cs Embedded with end users in the target domain ct Source domain items embedded i s Target domain item embedding i t Generate predicted source domain interaction probabilities Interaction probability with the predicted target domain The process is as follows:

[0155]

[0156]

[0157] In the formula: ∥ represents the vector concatenation operation, h s h t f s and f t All of them are mapping functions, and are essentially a fully connected layer.

[0158] S6: The prediction model is trained using the training set to obtain the trained model; in this embodiment, the model is optimized using gradient descent, and the cross-entropy loss function L is used to optimize the model during the training process.

[0159]

[0160] In the formula: To train the loss function for user domain shared embeddings, L cau Let ||θ||2 be the loss function of the causal inference module. These are the actual interaction records of the source and target domains, respectively, with λ1, λ2, λ3, and λ4 representing the weights of each item.

[0161] S7: Input the test set data into the trained model to obtain the final user-item interaction probability. After the model is trained, use the test set data to test the model's performance. Input the user ID and item ID, and the model predicts the probability of the user interacting with the item. Compare this predicted probability with the actual interaction results to determine whether the model can correctly learn the user's personalized preferences.

[0162] This invention utilizes data-rich source domains to help data-sparse target domains learn their causal invariant preference embeddings, thereby improving the accuracy of the model in predicting user-item interaction probabilities in out-of-distribution environments; and predicts user-like items by capturing users' personalized preferences.

[0163] To evaluate the model's performance in predicting scores, the data obtained above were input into the model, and the hit rate (HR@5, HR@10) and normalized discounted cumulative return (NDCG@5, NDCG@10) were used as evaluation metrics. The results, shown in Table 4, indicate that the above predictions are highly accurate and relatively stable.

[0164] Table 4 Recommendation Results

[0165]

[0166] Table 5 shows the differences in recommendation performance of the model under different distribution shift environments. The results demonstrate that the present invention can maintain good recommendation performance under different degrees of distribution shift.

[0167] Table 5. Stability Test Results (HR@10)

[0168]

[0169] This invention differs from traditional causal inference-based recommendation methods. It leverages knowledge from other domains to mitigate the impact of data sparsity in the target domain, helping the model learn correct causal relationships and reducing the influence of outdated interaction records. This not only improves the model's out-of-distribution recommendation capabilities but also extends causal structure learning to the implicit attribute level.

Claims

1. A cross-domain causal inference based out-of-distribution recommendation model, characterized in that, This includes user domain-specific embedding components, user domain shared embedding components, item embedding components, causal inference modules, and prediction components; The user domain-specific embedding components include user implicit attribute embedding components and user domain-specific preference embedding components; The user implicit attribute embedding component generates corresponding implicit attribute embeddings from the user's ID information; The user domain-specific preference embedding component embeds the user's implicit attributes to generate user domain-specific preference embeddings; The user domain shared embedding component includes a user domain shared preference generator and a user domain shared preference discriminator; The user domain shared preference generator is used to generate user domain shared preference embeddings; The user domain shared preference discriminator is used to determine which domain the domain shared preference embedding comes from; The item embedding component includes an item embedding generator, which generates a corresponding embedding from the item's number information; The causal inference module includes a directed acyclic graph constraint and an embedding reconstruction module; user implicit attribute embeddings and user domain shared embeddings are input into the causal inference module to obtain user domain shared causal invariant preference embeddings; the causal inference module is as follows: ; in, 2 An adjacency matrix of size, where each node represents a dimension of user attributes or user preferences; , This is a vector concatenation operation. This is a noise signal; For the reconstructed embedding, put the following Dimension as a user domain shared causal invariant preference embedding ; right The directed acyclic constraint is: ; ; ; The causal inference module is optimized using the following expression: ; in, For element-wise multiplication, The trace of the matrix, , and As the weight of each loss, For matrix The List, This is the transpose of the matrix. To reconstruct the loss, For directed acyclic constraints, To constrain The loss function allows edges to run only from user attribute nodes to user preference nodes. To constrain The user preference node in the data cannot be used as the loss function of the root node. To optimize the loss function of the causal inference module, N The number of training samples. For the first Reconstructed embeddings of training samples; The directed acyclic graph constraint is used to constrain the causal structure to be directed acyclic; The embedded reconstruction module is used to learn the causal structure from user attributes to user preferences; The prediction component includes a user embedding vector fusion module and an interaction probability prediction module; The user embedding vector fusion module fuses user domain-specific preference embeddings and domain-shared causal invariant preference embeddings to form the final user embedding; The interaction probability prediction module predicts the user-item interaction probability based on the end-user embedding and item embedding.

2. A training method for an out-of-distribution recommendation model based on cross-domain causal inference, utilizing the out-of-distribution recommendation model based on cross-domain causal inference as described in claim 1, characterized in that, Includes the following steps: S1: Obtain user information, item information, and user-item interaction records; the user information includes the user ID, and the item information includes the item ID; S2: Preprocess the information in S1 to form a test set and a training set, and build a prediction model; S3: User ID is used to obtain user domain-specific embedding through user domain-specific embedding component; User ID is used to obtain user domain-shared embedding through user domain shared embedding component; Item ID is used to obtain item embedding through item embedding component; Includes the following steps: User ID Generate user implicit attribute embeddings Embedding implicit attributes of users in the target domain : ; ; User implicit attribute embedding in the source domain Implicit user attribute embedding in the target domain Generating domain-specific embeddings from user source domains Domain-specific embeddings of the target domain : ; ; User implicit attribute embedding in the source domain Embedding implicit attributes of users in the target domain Generate user domain shared embedding : ; ; Use a user domain shared preference discriminator to determine user domain shared embedding. From which field: ; Source Domain Item Number and the item number of the target area Generate source domain item embedding Target domain item embedding : ; ; The user domain-specific embedded component, the user domain-shared embedded component, and the item embedded component are all fully connected layers; among them Number the user. Number the source domain item. Number the items in the target area, with superscript. For this embedding to originate from the source domain, superscript The embedding originates from the target domain. For the embedded dimension, , , , , , , , All of these are weights of the fully connected layer; Used to specify user domain shared embedding Which field does it come from, and when the discriminator cannot determine that... When the source is specified, it indicates that the embedding is domain-shared; S4: Input the user implicit attribute embedding and the user domain shared embedding into the causal inference module to obtain the user domain shared causal invariant preference embedding; S5: Input user domain-specific embeddings, user domain-shared causal invariant preference embeddings, and item embeddings into the prediction model to obtain interaction probability predictions; S6: Train the prediction model using the training set to obtain the trained model; S7: Input the test set data into the trained model to obtain the end-user-item interaction probability.

3. The training method for an out-of-distribution recommendation model based on cross-domain causal inference according to claim 2, characterized in that, In S2, the information preprocessing method is as follows: Define m lines Columns and m rows The two user-item interaction information matrices are listed, and each element of the matrix is... and users respectively and items Is there any interaction between them? Among them, the definition For a set of users, the size is ;definition A collection of items from the source domain. The set of items in the source and target domains, with sizes respectively. and .

4. The training method for an out-of-distribution recommendation model based on cross-domain causal inference according to claim 2, characterized in that, S5 includes the following steps: User-source domain-specific embedding Domain-specific embedding of the target domain And user domain sharing causal invariant preference embedding Generate source domain end-user embedding Embedded with end users in the target domain for: ; ; Source Domain End-User Embedding Target domain end-user embedding Source domain item embedding Target domain item embedding Generate predicted source domain interaction probabilities Interaction probability with the predicted target domain for: ; ; in, For the embedded fusion module of the source domain, For embedding and fusion modules in the target domain, For the interaction prediction module of the source domain, This is an interaction prediction module for the target domain.

5. The training method for an out-of-distribution recommendation model based on cross-domain causal inference according to claim 2, characterized in that, In S6, the cross-entropy loss function L is used to optimize the training model: ; in, To train the loss function for user domain shared embeddings, For the loss function of the causal inference module, For regularization terms, This is a record of real interactions in the source domain. For real-world interaction records in the target domain, , , and The weights of each item.