Interaction quantity causal contribution prediction method and device, and storage medium
By generating codes through counterfactual intervention and performing feature extraction and iterative causal propagation, the problem of false correlation of causal effects in label effect evaluation is solved, and the accurate quantification of unbiased causal contribution is achieved, supporting the optimization of marketing copy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-12
- Publication Date
- 2026-03-17
AI Technical Summary
Existing label effect evaluation methods struggle to capture the complex nonlinear interaction features in high-dimensional label data, leading to spurious correlations in causal effects and inaccurate evaluations.
By performing counterfactual intervention on the target label to generate a unique code, feature extraction and reparameterized sampling are performed, causal propagation is iterated and additional latent variables are concatenated, and the decoder output is used to predict the interaction quantity, removing the interference of confounding variables and accurately quantifying the causal contribution.
It enables the accurate quantification of the unbiased causal contribution of target tags to interaction volume without actual ad placement, providing an explainable and actionable basis for marketing copy optimization.
Smart Images

Figure CN121685017A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to an interactive quantity causal contribution prediction method, device and storage medium. BACKGROUND
[0002] To efficiently generate marketing content, the operation personnel usually abstract product characteristics, target group characteristics and brand strategies into structured tags. The core goal of tag effect evaluation is to accurately identify the real causal correlation between tag activation and marketing effect (such as interactive quantity and conversion rate), so as to provide reliable decision basis for tag selection.
[0003] The current mainstream tag effect evaluation method is a statistical regression model. However, such model presets a linear relationship between the tag and the effect, and it is difficult to capture the complex nonlinear interaction features in high-dimensional tag data, resulting in that the causal effect estimated by the model is a false correlation between the tag and the effect, rather than a real causal effect that the tag activation directly leads to the change of the effect, and the tag effect evaluation is inaccurate. SUMMARY
[0004] The main purpose of the present application is to provide an interactive quantity causal contribution prediction method, device and storage medium, aiming at solving the technical problem of how to improve the accuracy of tag effect evaluation.
[0005] To solve the above problems, the present application provides an interactive quantity causal contribution prediction method, which comprises:
[0006] Performing a counterfactual intervention operation on a target tag in a tag set based on a preset intervention value to generate an intervention tag code; Performing feature extraction and reparameterization sampling on the intervention tag code and the environment variable code to obtain an intervention-after causal latent variable; Performing iterative causal propagation on the intervention-after causal latent variable, and splicing the intervention-after causal latent variable and the additional latent variable after propagation to obtain an intervention-after latent variable; Performing result prediction on the intervention-after latent variable based on a decoder to obtain an intervention-after predicted interactive quantity; Determining the arithmetic mean value of the intervention-after predicted interactive quantity and the difference value of the initial predicted interactive quantity as the average causal effect of the target tag.
[0007] In an embodiment, the step of performing a counterfactual intervention operation on a target tag in a tag set based on a preset intervention value to generate an intervention tag code comprises: Matching the tag set and a preset tag dictionary to determine the tag dimension value and the tag index of each tag; arranging the label dimension values in the order of the label indexes to obtain label one-hot encodings corresponding to the label set; determining a target index position of the target label in the one-hot encodings, modifying a target label dimension value corresponding to the target index position to the preset intervention value to obtain the intervention label encodings.
[0008] In an embodiment, the step of performing feature extraction and reparameterization sampling on the intervention label encodings and the environmental variable encodings to obtain post-intervention causal latent variables comprises: concatenating the intervention label encodings and the environmental variable vector, inputting a fusion feature vector obtained by concatenation into a pre-trained conditional prior network to perform linear transformation to obtain a mean vector and a log variance vector of the causal latent variables; performing square root processing on the log variance vector to obtain a standard deviation vector; performing element-wise multiplication on the standard deviation vector and a noise vector, and performing element-wise addition of the multiplication result and the mean vector to obtain the post-intervention causal latent variables.
[0009] In an embodiment, the step of performing iterative causal propagation on the post-intervention causal latent variables, and concatenating the post-propagation post-intervention causal latent variables and additional latent variables to obtain post-intervention latent variables comprises: based on a pre-trained adjacency matrix and an iteration mechanism, performing causal update on the post-intervention causal latent variables to obtain updated post-intervention causal latent variables, and the causal update formula is: , wherein, f j is a 2-layer fully connected neural network, is random noise generated by an encoder, is a latent variable sub-vector corresponding to label j of the i-th sample in the t-th iteration, is the adjacency matrix; concatenating the updated post-intervention causal latent variables and the additional latent variables according to feature dimensions to obtain the post-intervention latent variables.
[0010] In an embodiment, the step of performing result prediction on the post-intervention latent variables based on a decoder to obtain post-intervention predicted interaction quantities comprises: inputting the post-intervention latent variables into the decoder, performing feature extraction on the post-intervention latent variables based on a feature extraction layer to obtain high-dimensional features; performing feature mapping and nonlinear activation on the high-dimensional features based on an output mapping layer to obtain the post-intervention predicted interaction quantities.
[0011] In one embodiment, the method for predicting the causal contribution of the interaction quantity further includes: The latent variables after intervention are input into the decoder, and based on the self-attention mechanism of the decoder, the features in the latent variables after intervention are transformed into text semantic vectors. Based on a pre-defined scenario rule base and the semantic vector of the text, optimized text is generated.
[0012] In one embodiment, the method for predicting the causal contribution of the interaction quantity further includes: The total loss is obtained by weighting and summing the loss from copywriting reconstruction, interaction volume prediction, KL divergence, DAG acyclic constraint, sparse regularization, label supervision, and counterfactual causality. The parameters of the encoder, causal layer, decoder, and conditional prior network are updated based on the total loss until a preset stopping condition is reached.
[0013] In one embodiment, before the step of weighted summation of the copywriting reconstruction loss, interaction volume prediction loss, KL divergence loss, DAG acyclic constraint loss, sparse regularization loss, label supervision loss, and counterfactual causality loss to obtain the total loss, the method for predicting the causal contribution of interaction volume further includes: Based on the mean square error between the predicted and actual interaction volume after counterfactual intervention, the interaction volume debiasing loss is determined. The vector difference between the intervention latent variable and the original latent variable is determined as the latent variable debiasing loss; The counterfactual causality loss is obtained by weighted summing of the interaction quantity debiasing loss and the latent variable debiasing loss.
[0014] Furthermore, to achieve the above objectives, this application also proposes a device for predicting the causal contribution of interaction quantities, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the method for predicting the causal contribution of interaction quantities as described above.
[0015] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the prediction method for the causal contribution of interaction quantities as described above.
[0016] This application provides a method for predicting the causal contribution of interaction volume. By performing counterfactual intervention on the target tag to generate a unique code, and then obtaining accurate post-intervention causal latent variables through feature extraction and reparameterized sampling, the method injects the real correlation between tags and splices in additional latent variables through iterative causal propagation to form a complete post-intervention latent variable. Finally, the decoder outputs the predicted interaction volume, and the average causal effect is obtained by calculating the mean and comparing it with the initial value. The entire process can eliminate the interference of confounding variables without actual ad placement, accurately quantifying the unbiased causal contribution of the target tag to the interaction volume, and providing an interpretable and actionable decision-making basis for marketing copy optimization. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic diagram of the first process for predicting the causal contribution of interaction quantities in this application; Figure 2 A diagram illustrating the framework for the prediction method of causal contributions of interaction quantities in this application; Figure 3 A second flowchart illustrating the prediction method for the causal contribution of interaction volume in this application; Figure 4 This is a schematic diagram of the hardware operating environment involved in the prediction method of causal contribution of interaction quantity in the embodiments of this application.
[0020] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0022] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0023] To achieve the above objectives, this application proposes a method for predicting the causal contribution of interaction volume. The method includes: performing counterfactual intervention on target labels in a label set based on a preset intervention value to generate intervention label codes; performing feature extraction and reparameterized sampling on the intervention label codes and environmental variable codes to obtain post-intervention causal latent variables; performing iterative causal propagation on the post-intervention causal latent variables, and concatenating the propagated post-intervention causal latent variables with additional latent variables to obtain post-intervention latent variables; predicting the outcome of the post-intervention latent variables based on a decoder to obtain the post-intervention predicted interaction volume; and determining the difference between the arithmetic mean of the post-intervention predicted interaction volume and the initial predicted interaction volume as the average causal effect of the target label.
[0024] To efficiently generate marketing content, operations personnel typically abstract product characteristics, target audience features, and brand strategies into structured tags. The core objective of tag effectiveness evaluation is to accurately identify the true causal relationship between tag activation and marketing results (such as interaction volume and conversion rate), providing a reliable basis for tag selection.
[0025] The current mainstream method for evaluating the effectiveness of tags is the statistical regression model. However, such models assume a linear relationship between tags and effects, making it difficult to capture the complex nonlinear interaction characteristics in high-dimensional tag data. Furthermore, they do not explicitly model confounding variables such as advertising channels, user groups, and marketing budgets. In a causal inference framework, these confounding variables can simultaneously affect tag selection and marketing effectiveness. If left uncontrolled, the tag effect estimated by the model is a spurious correlation between tags and effects, rather than a true causal effect where tag activation directly leads to changes in effects, resulting in inaccurate tag effectiveness evaluation.
[0026] This application provides a method for predicting the causal contribution of interaction volume. By performing counterfactual intervention on the target tag to generate a unique code, and then obtaining accurate post-intervention causal latent variables through feature extraction and reparameterized sampling, the method injects the real correlation between tags and splices in additional latent variables through iterative causal propagation to form a complete post-intervention latent variable. Finally, the decoder outputs the predicted interaction volume, and the average causal effect is obtained by calculating the mean and comparing it with the initial value. The entire process can eliminate the interference of confounding variables without actual ad placement, accurately quantifying the unbiased causal contribution of the target tag to the interaction volume, and providing an interpretable and actionable decision-making basis for marketing copy optimization.
[0027] It should be noted that the executing entity in this embodiment can be a computing service device with network communication and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or apparatus capable of performing the above functions. The following description uses a device for predicting the causal contribution of interaction quantities as an example to illustrate this embodiment and the subsequent embodiments.
[0028] Based on this, embodiments of this application provide a method for predicting the causal contribution of interaction quantities, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the method for predicting the causal contribution of interaction quantities in this application.
[0029] In this embodiment, the method for predicting the causal contribution of the interaction quantity includes steps S10 to S50: Step S10: Perform counterfactual intervention on the target labels in the label set based on the preset intervention value to generate intervention label codes.
[0030] Please refer to Figure 2 , Figure 2 This is a diagram illustrating the architecture of a generative causal model. Counterfactual Causal VAE (CFI-VAE) is an end-to-end generative causal model whose core objective is to learn the unbiased causal effect of counterfactual interventions on structured labels on user interaction volume. The model consists of four tightly coupled sub-modules: Encoder: which processes the input text... ,Label Environment variables Joint encoding as latent variables Causal Layer: A subset of latent variables corresponding to the labels. Modeling a learnable causal graph structure; Decoder: reconstructing the text separately. With predicted interaction volume Counterfactual intervention reasoning and loss calculation module: Performed on each label dimension during the training phase. Intervention generates counterfactual predictions and calculates causal losses.
[0031] It's important to note that counterfactual intervention is a causal inference method based on counterfactual thinking. Its core is to quantify the causal effect of an intervention by constructing hypothetical scenarios of "what would have happened if a certain intervention hadn't occurred." For example, in the actual scenario, a user sees recommended content A, resulting in 10 interactions; in the counterfactual scenario, if the user didn't see recommended content A (the intervention was removed), the interaction might be 5; the causal effect is that the intervention (recommended content A) increased the interaction by 5. By comparing the actual and counterfactual results, confounding factors such as user preferences and time effects can be eliminated, directly quantifying the net impact of the intervention on the outcome. The mathematical basis of counterfactual intervention is the potential outcomes theory, whose core formula is: Causal effect = Y intervention(x) Ycontrol(x) is the observed outcome (real world) under intervention x, Ycontrol(x) is the potential outcome (counterfactual world) without intervention x, and the causal effect is the difference between the two, i.e., the net effect of the intervention on the outcome.
[0032] In this embodiment, the user selects the label dimension j of interest and sets the intervention value (e.g., ...). Forward reasoning constructs intervention labels The target tags can be user-selected or pre-defined. Retrieve the tag set. One-hot encoding The dimension is K×1, where K is the total number of tags, such as co-branded IP, purslane ingredient, and suitable for sensitive skin, corresponding to a 3D code [1, 0, 0]. A counterfactual intervention is performed, modifying only... The dimension value corresponding to the target label j is 2. For example, if the target label is purslane, the corresponding dimension is 2. [2] Change to 1, and keep the other label dimensions consistent with the initial encoding to generate the post-intervention label encoding.
[0033] In one feasible implementation, step S10 includes steps S11 to S13: Step S11: Match the tag set with the preset tag dictionary to determine the tag dimension value and tag index of each tag; Step S12: Arrange the tag dimension values according to the order of the tag index to obtain the tag one-hot encoding corresponding to the tag set; In this implementation, a global tag dictionary is predefined, specifying all possible tag dimensions and their corresponding indices, and the tag set is traversed. The tag dictionary is matched, and the value of each tag dimension is marked as 1 if it exists and 0 if it does not exist. The marked results are arranged by dimension according to the index order of the tag dictionary, generating a one-hot encoded vector of dimension K×1. K represents the total number of tags. For example, the tag dictionary is: {0: co-branded IP, 1: purslane ingredient, 2: suitable for sensitive skin} (K=3), and the tag set is... : Contains only "Co-branded IP", mapping tags: Co-branded IP (index 0) = 1, Purslane ingredient (index 1) = 0, Suitable for sensitive skin (index 2) = 0, generates unique heat codes. : [1,0,0].
[0034] Step S13: Determine the target index position of the target label in the one-hot encoding, modify the target label dimension value corresponding to the target index position to the preset intervention value, and obtain the intervention label encoding.
[0035] In this embodiment, based on the target label j, the global label dictionary is matched to determine its target index position idx_j in the one-hot encoding vector; the initial one-hot encoding is then read. The counterfactual intervention modifies only the value at the target index position, leaving all other index positions unchanged. The modified values are then arranged in index order to generate the post-intervention label code eU(j). One-hot encoding transforms discrete labels into fixed-dimensional vectors using dictionary mapping and binary labeling. The counterfactual intervention modifies only the vector dimension corresponding to the target label, reusing the initial code for all other dimensions, ensuring that only the target label is changed while other conditions remain unchanged.
[0036] For example, target label j is the purslane component, corresponding to global dictionary index 1; initial encoding [1, 0, 0], only the value of index 1 is modified from 0 to 1, while the other indices (0, 2) remain unchanged; the code eU(j) after intervention is [1, 1, 0].
[0037] Step S20: Perform feature extraction and reparameterized sampling on the intervention label code and environmental variable code to obtain the causal latent variables after intervention.
[0038] It should be noted that environmental variables refer to external scene features, other than copywriting and structured tags, that affect user interaction but are not controlled by the model, such as KOL follower count, advertising budget, and posting time. Post-intervention causal latent variables are a subset of low-dimensional latent variables that only carry the causal characteristics of the tags after intervention.
[0039] In this embodiment, environmental variables are divided into discrete and continuous variables based on their data type. Discrete variables take values from a finite number of discrete categories, while continuous variables take values from continuous numerical values. A global value dictionary is constructed for each discrete variable, mapping all possible categories to unique indices and recording the total number of categories for each discrete variable, i.e., the one-hot encoding dimension of that variable. Global statistics for all continuous variables, such as minimum and maximum values, are pre-calculated based on the training dataset as a normalization benchmark. The concatenation rules for the environmental variable vectors are determined, such as discrete variables first, followed by continuous variables, and the total dimension D of the final environmental variable vector is preset. EFor discrete environment variables, the original values are matched with the global value dictionary to determine their corresponding index positions. A one-hot vector with the same dimension as the total number of categories for that variable is generated, with a value of 1 at the index position and 0 at the other positions. The one-hot vectors of all discrete variables are concatenated along the dimension direction in a preset order to generate the total vector of discrete environment variables. For continuous environment variables, the min-max normalization method is used to map the original values to the 0-1 interval. The calculation formula is: normalized value = (original value - global minimum value) / (global maximum value - global minimum value). The normalized value of each continuous variable is converted into a one-dimensional vector. The one-dimensional vectors of all continuous variables are concatenated in a preset order to generate the total vector of continuous environment variables. The total vector of discrete environment variables and the total vector of continuous environment variables are concatenated along the dimension direction according to the preset concatenation rules to generate the final environment variable vector, completing the environment variable encoding.
[0040] The post-intervention label encoding and environmental variable encoding are concatenated and input into a pre-trained conditional prior network; the conditional prior network learns the label U, environment E, and causal latent variables based on the training data. Conditional distribution , for intervention label The conditional prior network, in combination with environmental variables, outputs the corresponding causal latent variable distribution. Optionally, the conditional prior network is a 2-layer MLP (Multilayer Perceptron), with the first layer consisting of 128 neurons using the ReLU activation function, and the second layer outputting the mean and log-variance that match the dimensions of the causal latent variables.
[0041] The mean and log-variance of the post-intervention causal latent variables were generated through reparameterized sampling. .
[0042] Step S30: Iteratively propagate the post-intervention causal latent variables, and concatenate the propagated post-intervention causal latent variables and additional latent variables to obtain the post-intervention latent variables.
[0043] In this embodiment, due to the potential causal relationship between tags, a trained causal layer propagates the causal relationship of the initial intervention causal latent variables, ensuring that the latent variables after intervention not only include the direct effect of tag j, but also its indirect causal effect on other tags, thus aligning with the interaction logic of tags in real marketing scenarios. The K×K adjacency matrix A learned during the training phase is obtained, and the matrix elements A... j,k The strength of the causal influence of label k on label j is represented by A2,3=0.6, which means that the positive influence of purslane on sensitive skin is 0.6. Using the N-round iteration mechanism determined in the training phase, the latent variable subvectors corresponding to each label in the causal latent variables after intervention are updated causally to obtain the causal latent variables after intervention after causal relationship optimization.
[0044] During training, the rules of DAG acyclic constraint and L1 sparse regularization are embedded into the network structure and parameters of the causal layer. During inference and propagation, no additional loss calculation is required. The constraint effect can be reflected simply by calling the trained parameters, ensuring that the latent variables after propagation do not exhibit causal loops and retain only the key causal relationships.
[0045] During the training phase, the NOTEARS algorithm applies a DAG constraint to the adjacency matrix A, constructing an acyclic loss term. After squaring the elements of adjacency matrix A, matrix exponentiation is performed, and the sum of the diagonal elements of the resulting matrix is calculated. Finally, the total number of labels is subtracted. If the causal relationship corresponding to matrix A contains a cycle (e.g., label A influences label B, and label B in turn influences label A), the sum of the diagonal elements will be greater than K, resulting in a positive loss term. If there is no cycle, the sum of the diagonal elements equals K, and the loss term is 0. The acyclic loss is incorporated into the model's total loss, and the gradient descent algorithm minimizes the total loss, ultimately converging to an acyclic structure. The matrix contains only non-zero elements corresponding to unidirectional causal relationships (e.g., only elements related to label A influencing label B, and label B influencing label C are non-zero). There are no elements with reverse influence; all elements that could potentially cause cycles become 0 or extremely small, having no real impact. After training, the causal layer stores the adjacency matrix A that meets the acyclic requirement. Based on the trained adjacency matrix A, linear weighting and non-linear mapping are performed.
[0046] During the training phase, L1 sparse regularization is introduced, which calculates the sum of the absolute values of all elements in the adjacency matrix A. In gradient descent optimization, L1 regularization prioritizes compressing elements with small values into 0. Since these small non-zero elements increase the regularization loss, and the optimization objective is to minimize the total loss, the model automatically removes these elements representing weak associations, retaining only elements with larger values representing strong causal relationships. For example, training data shows a significant causal influence between the purslane ingredient label and the "suitable for sensitive skin" label; therefore, the elements in the matrix corresponding to this relationship will be retained as non-zero values. Conversely, the co-branded IP label and the "suitable for sensitive skin" label have no real causal relationship, so the corresponding matrix elements will be compressed into 0. The final trained adjacency matrix A is a sparse matrix, with most elements being 0, and only a few elements corresponding to key causal relationships being non-zero, and the magnitude of the non-zero elements reflects the strength of the causal relationship. The propagation and update of latent variables during inference relies on a trained sparse matrix A. When calculating the update value of the latent variable for each label, the latent variables of related labels are weighted and summed. The summation range only includes the labels corresponding to the non-zero elements in matrix A, thus naturally eliminating the influence of redundant associations.
[0047] Step S40: Based on the decoder, predict the outcome of the latent variables after the intervention to obtain the predicted interaction amount after the intervention.
[0048] In this embodiment, the decoder has two branches: the text branch is a 2-layer Transformer decoder used to reconstruct the text semantics; the interaction quantity branch, after mean pooling of the complete latent variables, outputs the predicted interaction quantity through a 2-layer MLP. The latent variables are pooled using mean pooling to compress them into a global feature vector, which is then input into a two-layer MLP. The first layer uses the ReLU activation function to extract features, and the second layer uses the Sigmoid activation function to obtain multidimensional predicted interaction values, such as likes, comments, shares, and favorites.
[0049] In one feasible implementation, step S40 includes steps S41-S42: Step S41: Input the latent variables after intervention into the decoder, and extract features from the latent variables after intervention based on the feature extraction layer to obtain high-dimensional features.
[0050] In this implementation, mean pooling is performed on the latent variables after intervention, taking the arithmetic mean of all dimensions of the latent variables to compress the high-dimensional vector into a 1-dimensional global feature vector. The first layer, the MLP, is a feature extraction layer containing a predetermined number of neurons, using ReLU as the activation function. The 1-dimensional global feature vector is input into this layer, and the ReLU activation function filters out invalid negative feature signals, retaining only positive and valuable features. Simultaneously, through weighted calculation by neurons, the simple global features are transformed into high-dimensional, complex, nonlinear features. This improvement from global basic features to high-dimensional effective features adapts to the complex requirements of interaction prediction.
[0051] Step S42: Based on the output mapping layer, perform feature mapping and nonlinear activation on the high-dimensional features to obtain the predicted interaction amount after intervention.
[0052] In this embodiment, the second layer MLP is the output mapping layer. The number of neurons is consistent with the interaction dimension. For example, if there are four dimensions such as like, comment, forward, and favorite, then four neurons are set. The activation function is Sigmoid. The high-dimensional nonlinear features output by the first layer are mapped to the probability values corresponding to each interaction dimension. The output value of each dimension is compressed to the [0,1] interval by the Sigmoid activation function. The value in this interval is the probability of the interaction behavior occurring.
[0053] The output mapping layer contains a P×D learnable weight matrix, where D is the high-dimensional feature dimension and P is the interaction dimension. Each output neuron is connected to all input neurons via weights. Matrix multiplication is performed on the high-dimensional feature vector and the weight matrix, and then bias terms are added to obtain a P-dimensional linear output vector. For example, if the high-dimensional features are 128-dimensional and the interaction is 4-dimensional, then the 128-dimensional features are projected into a 4-dimensional linear result through a 4×128 weight matrix, with each dimension corresponding to the original linear score of a class of interaction behavior.
[0054] For each element in the P-dimensional vector obtained by linear mapping, a Sigmoid activation is performed. The activated P-dimensional vector has each element with a value between [0,1], which can be directly interpreted as the probability of the corresponding interactive behavior occurring. For example, the 4-dimensional output [0.75, 0.42, 0.36, 0.58] represents a 75% probability of liking, a 42% probability of commenting, a 36% probability of forwarding, and a 58% probability of saving, respectively.
[0055] Step S50: The difference between the arithmetic mean of the predicted interaction volume after intervention and the initial predicted interaction volume is determined as the average causal effect of the target label.
[0056] In this embodiment, initial predicted interaction volume (baseline state) and post-intervention predicted interaction volume (counterfactual state) are generated. The generation logic for both types of results is consistent. The initial latent variable without label intervention (generated by joint encoding of initial copy, initial label, and environmental variables) is input into the decoder, and the initial predicted interaction volume is output, representing the expected interaction effect of the copy without enabling the target label, serving as the baseline for causal comparison. The post-intervention latent variable with only the target label enabled (generated through label intervention, causal layer propagation, and latent variable concatenation) is input into the same decoder, and the single-intervention predicted interaction volume is output, representing the counterfactual expected interaction effect after enabling the target label.
[0057] Since latent variables are generated through reparameterized sampling, the predicted interaction amount after a single intervention may be affected by noise and cannot represent the true effect of the label. Randomness is eliminated through multiple sampling. A fixed number of samplings is set, and random noise is regenerated for each sampling. The intervention label is repeatedly constructed, generating latent variables and decoder prediction processes multiple times, resulting in M independent predicted interaction amounts after intervention. The arithmetic mean of the M results is calculated, and the sum of all post-intervention interaction amounts is divided by the number of samplings to obtain the average predicted interaction amount after intervention. By offsetting the random error of a single sampling, the results more closely reflect the statistical regularities of real-world scenarios.
[0058] The average causal effect of the target label is calculated by subtracting the initial predicted interaction from the average predicted interaction after intervention. A positive difference indicates that the label can positively increase interaction, and the larger the value, the stronger the effect. A difference close to 0 indicates that the label has no real causal effect. A negative difference indicates that the label will inhibit interaction. The calculation formula is as follows: ; Where M refers to the number of samplings of the latent variable, and the predicted interaction volume after intervention is the user interaction volume (such as the quantitative value of dimensions like likes, comments, and reposts) predicted by the model after the forced activation of label j. This represents the sum of predicted interactions obtained from M samplings after intervention, divided by M to obtain the average; the initial predicted interaction amount. It is the initial interaction volume predicted by the model without any intervention on the label, serving as a benchmark for comparing causal effects.
[0059] In one feasible implementation, a reusable tag-causal effect knowledge base is constructed based on the average causal effect of each target tag. A target scenario is selected, and fields such as the tag's unique identifier, tag name, tag category, average causal effect value, sampling number, confidence interval, environmental variable characteristics, model version, and calculation timestamp for each tag within that scenario are obtained. A preset normalization algorithm is called to map causal effect values of different dimensions to the [-1,1] interval, eliminating differences in numerical magnitude. A tag basic information table, a causal effect core table, and a relational information table are created, and relationships between tables are established using the tag's unique identifier as a foreign key. The data pool to be added to the database is traversed, and a unique knowledge base entry ID is generated for each data entry. The data is written to the corresponding data tables according to the field mapping rules. A mapping relationship table between entry IDs and tag unique identifiers is established and stored in a relational database. When new causal effect data, model iterations, or changes in environmental variables are detected, an update process is automatically triggered. The database is checked to see if the tag entry exists. If it exists, the new version overwrites the original data; otherwise, a new entry is generated and added to the database. After the update is completed, the index structure is updated. Based on the tag causal effect knowledge base, the average causal effect value of each copy tag in various scenarios can be determined.
[0060] In one feasible implementation, the user selects a target marketing scenario on the interactive interface, obtains the user-selected scenario identifier, and filters the applicable scenario list containing tags from the tag library to form a dedicated tag pool for that scenario. The user is then shown the scenario-specific tag list; alternatively, the user can manually select tags or the system can automatically generate recommended tags, forming a set of tags to be calculated. For each tag in the set to be calculated, using the tag's unique identifier and scenario identifier as search criteria, the corresponding average causal effect value, confidence interval, calculation version, and other related data are retrieved from the knowledge base. Tags without matching data in the knowledge base are marked as having no causal effect and supplemented with default values, such as a causal effect value of 0.
[0061] Extract the causal effect values of all selected labels, first calculate their arithmetic sum to obtain the base value of the combined causal effect; retrieve the interaction coefficient of the label combination from the knowledge base, multiply the base value by the interaction coefficient, and correct for the deviation caused by synergy / cancellation between labels. An interaction coefficient > 1 represents a synergistic enhancement effect, and an interaction coefficient < 1 represents a cancellation effect. Generate visualization results, such as a bar chart to show the effect of a single label and a pie chart to show the composition of the combined effect; display the visualized label combination causal effect report on the user interface.
[0062] Optionally, when determining the interaction coefficient, copywriting records containing tag combinations under each marketing scenario are extracted from the campaign logs. These records are grouped by scenario and tag combination dimensions, and valid samples that meet the campaign volume target (e.g., single-combination campaigns ≥ preset number of times) are selected. Simultaneously, the individual causal effect value of each tag within these samples is retrieved from the tag-causal effect knowledge base to construct a structured dataset containing scenario information, a list of tag combinations, actual interaction effect values, and single-tag causal effect values. For each tag combination in the dataset, the causal effect values of all single tags within the combination are summed to obtain the theoretical interaction value considering only the cumulative effect of single tags. Then, based on the differences in interaction patterns across different scenarios, scenario weights (i.e., the ratio of the average interaction volume in that scenario to the global average interaction volume) are used to calibrate the theoretical value to ensure that the theoretical value is compatible with the scenario. The interaction coefficient is obtained by dividing the actual interaction effect value of each tag combination by the calibrated theoretical interaction value.
[0063] In this embodiment, a unique code is generated by performing counterfactual intervention on the target tag. After feature extraction and reparameterized sampling, a precise causal latent variable after intervention is obtained. Then, through iterative causal propagation, the real correlation between tags is injected and additional latent variables are spliced to form a complete latent variable after intervention. Finally, the decoder outputs the predicted interaction volume. The average causal effect is obtained by calculating the mean and comparing it with the initial value. The entire process can remove the interference of confounding variables without actual delivery, accurately quantifying the unbiased causal contribution of the target tag to the interaction volume, and providing an interpretable and implementable decision-making basis for marketing copy optimization.
[0064] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description and will not be repeated hereafter. Based on this, step S20 may include steps S21 to S23: Step S21: The intervention label encoding and environmental variable vector are concatenated, and the concatenated fusion feature vector is input into the pre-trained conditional prior network for linear transformation to obtain the mean vector and log-variance vector of the causal latent variables.
[0065] In this embodiment, the intervention label encoding and the environmental variable vector are concatenated. All elements of the intervention label encoding are arranged in order first, and all elements of the environmental variable vector are arranged in order second to generate a fused feature vector. The intervention features of the label and the environmental scene features are integrated into a single input, ensuring that the subsequent network can learn the association between the two types of features at the same time.
[0066] The fused feature vectors are input into a conditional prior network, which is a 2-layer MLP (fully connected neural network). The first layer's input dimension equals the intervention label encoding dimension K plus the environmental variable vector dimension D. EThe sum of the two layers results in a fixed output dimension of 128; the second layer has a 128-dimensional input and an output dimension that is the preset dimension D of the causal latent variables. Z The result is twice that of the previous layer. The fused feature vector is input into the first fully connected layer. This layer performs a linear transformation between the fused feature vector and the pre-trained weight matrix, and adds a bias vector to obtain the initial calculation result. The ReLU activation function is applied to the initial calculation result, retaining only positive values and setting negative values to 0, outputting an intermediate feature vector. The intermediate feature vector is then input into the second fully connected layer. This layer performs a linear transformation between the intermediate feature vector and the pre-trained weight matrix, and adds a bias vector to obtain the total output vector. The total output vector is then split by dimension, and the top D values are taken. Z The numerical values of each dimension are used as the mean vector of the causal latent variables after intervention, and the result is taken as D. Z The numerical values of each dimension serve as the log-variance vector of the causal latent variables after intervention. Through two layers of nonlinear transformation, the model learns the mapping relationship between the fusion characteristics of the intervention label and environmental variables and the distribution parameters of the causal latent variables. At the same time, the output is split to ensure that the mean and log-variance can independently represent the distribution characteristics of the latent variables.
[0067] Step S22: Take the square root of the logarithmic variance vector to obtain the standard deviation vector.
[0068] Step S23: Multiply the standard deviation vector and the noise vector element by element, and add the result of the multiplication element by element to the mean vector to obtain the causal latent variable after intervention.
[0069] In this embodiment, each element of the logarithmic variance vector is individually subjected to an exponential operation to convert the logarithmic variance into an actual variance value, ensuring that all calculated variance values are non-negative, resulting in a variance vector with the same dimension as the original vector. A vector with dimension D is randomly generated from a standard normal distribution with a mean of 0 and a variance of 1. Z A noise vector of dimension ×1, with dimensions identical to the mean and variance vectors, is used to introduce random fluctuations. The square root of each element in the variance vector is taken to obtain the standard deviation vector; then, the standard deviation vector and the noise vector are multiplied element-wise, and the result is added element-wise to the mean vector to generate a vector of dimension D. Z The initial intervention causal latent variable is ×1. First, the distribution of the latent variable is defined using the mean and variance. Then, specific instances of the latent variable are generated by combining a fixed-distribution random noise. This allows the random sampling process to be decomposed into a combination of defined distribution parameters and fixed noise. The gradient can be backpropagated to the model through the two optimizable parameters, mean and variance, solving the problem that gradients cannot be calculated when directly sampling, leading to the inability to optimize the model.
[0070] Step S30 may include steps S31 to S33: Step S31: Based on the pre-trained adjacency matrix and iterative mechanism, perform causal updates on the post-intervention causal latent variables to obtain the updated post-intervention causal latent variables, wherein the causal update formula is: , f j It is a 2-layer fully connected neural network. Random noise generated for the encoder, Let be the latent variable sub-vector corresponding to label j of the i-th sample in the t-th iteration. The adjacency matrix is defined as follows; Step S32: The updated post-intervention causal latent variable and the additional latent variable are concatenated according to the feature dimension to obtain the post-intervention latent variable.
[0071] In this embodiment, an N-round iterative mechanism determined during the training phase is used to perform causal updates on the latent variable subvectors corresponding to each label in the causal latent variables after intervention, using the following formula: ; in, This is a pre-trained 2-layer fully connected neural network responsible for fitting non-linear causal mappings between labels; The random noise generated by the encoder is reused, consistent with that generated during the training phase. Let be the latent variable sub-vector corresponding to label j of the i-th sample in the t-th iteration. Let A be the adjacency matrix. A fixed-round iteration mechanism (e.g., 5 rounds) is used, determined during the training phase, to update the latent variable sub-vectors corresponding to each label in the post-intervention causal latent variables one by one. During each update round, for the latent variable sub-vector of a certain label j, the contributions of all other labels k through the weighted sum of corresponding elements in the adjacency matrix A are first collected. The collected result, along with reused encoder random noise, is input into a pre-trained 2-layer MLP bound to label j. The MLP fits the complex nonlinear causal mapping relationship between labels. Through multiple iterations, the causal effect of the target label is gradually transmitted to other related labels, achieving complete propagation of the causal relationship. Throughout the iterative propagation process, the DAG acyclic constraint learned during training effectively avoids causal loops where label A influences label B, and label B in turn influences label A. L1 sparse regularization automatically eliminates redundant weak causal associations, retaining only key causal relationships, making the propagated latent variables more interpretable and effective.
[0072] In this embodiment, the latent variable space of the CFI-VAE model comprises two parts: causal latent variables, corresponding to label-related causal features; and additional latent variables, corresponding to semantic information of the text itself, environmental noise, and other features that do not involve label causal relationships. The additional latent variables are derived from the decomposition of the initial latent variables. The initial latent variables are generated by the encoder jointly encoding the initial text, initial labels, and environmental variables, resulting in initial causal latent variables and initial additional latent variables. Since the additional latent variables do not involve causal relationships between labels, they remain completely unchanged throughout the counterfactual intervention on the target label j, ensuring the stability of non-causal features.
[0073] The optimized post-intervention causal latent variables are concatenated with the initial additional latent variables according to feature dimensions. For example, if the optimized post-intervention causal latent variables are 48-dimensional and the initial additional latent variables are 16-dimensional, the concatenation will result in a total of 64-dimensional latent variables, which is exactly the same as the total dimensions of the latent variables used in the training phase. After concatenation, the complete post-intervention latent variables are obtained. These variables include both direct and indirect causal features brought about by enabling label j, while retaining non-causal features such as text semantics and environmental noise. They can be directly input into the decoder to generate the predicted interaction volume and optimized text after the intervention.
[0074] Based on the first embodiment of this application, in the third embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 It may also include steps A10 to A20: Step A10: Input the latent variables after intervention into the decoder, and based on the self-attention mechanism of the decoder, transform the features in the latent variables after intervention into text semantic vectors.
[0075] In this embodiment, the latent variables after intervention are expanded in data dimension according to pre-set rules. The 64-dimensional latent variables are repeated a certain number of times, which is equal to the maximum length of the text, to form a new matrix. The number of rows in the matrix is equal to the maximum length of the text, while the number of columns remains unchanged at 64, ensuring that this matrix meets the requirements of the Transformer decoder for the length of the input sequence. A preset position encoding matrix is then used, and the position encoding matrix is fused with the previously expanded sequence feature matrix to obtain sequence features containing position information.
[0076] The sequence features containing location information are input into the self-attention processing layer. A linear transformation generates three matrices for different purposes: a query matrix, a key matrix, and a value matrix. The dimensions of these three matrices are identical to the input sequence feature matrix. Association weights are calculated between the three matrices; higher weights indicate a stronger association between the sequence features at the corresponding position and features at other positions. The value matrices are then weighted and summed according to the calculated weights to obtain the self-attention feature matrix, completing the association filtering between label causal features and text semantic features. This self-attention feature matrix is then input into a feedforward neural network consisting of two fully connected layers. The first layer has a predetermined number of processing units, which, after processing with a specific activation function, transform the 64-dimensional features into 1024-dimensional intermediate features. The second layer has 5120 processing units, further transforming the 1024-dimensional intermediate features into 5120-dimensional high-dimensional semantic features, ultimately outputting the result of the first layer's decoding.
[0077] The initial text fragment vector is read from memory. Using this initial text vector as a reference standard, it serves as the key and value matrices in the cross-attention calculation. The result of the first-layer decoding is used as the query matrix. A cross-attention weight matrix is generated using the same weight calculation method as for self-attention. Layer normalization is then applied to the cross-attention feature matrix to eliminate inconsistent feature distributions, resulting in the optimized text semantic vector.
[0078] Step A20: Generate optimized copy based on the preset scene rule base and the semantic vector of the copy.
[0079] In this embodiment, semantic vectors are input into a pre-defined single-layer fully connected network. Through processing by this network, each semantic vector is converted into a raw score vector corresponding to the dictionary size, forming a raw score matrix equal to the maximum length of the text multiplied by the dictionary size. A probability transformation is then performed on the vector at each position in the raw score matrix, converting the raw score in each vector into a probability value between 0 and 1, resulting in a probability distribution matrix. Each value in the matrix represents the probability of selecting a particular word at the corresponding position.
[0080] The system reads the identifiers of the target marketing scenario from user input or preset configuration files, and calls the pre-stored scenario rule base. The rule base contains tone templates, popular tag sets, emoji sets, and other content corresponding to different scenarios. The cleaned text fragment sequence is input into the scenario adaptation model, which performs semantic integration according to the rules of the corresponding scenario. The integrated natural language text is stored in the form of a string, and the final optimized copy is output.
[0081] Based on the first embodiment of this application, in the fourth embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description and will not be repeated hereafter. Furthermore, steps B10 to B20 may also be included: Step B10: The total loss is obtained by weighted summation of the copywriting reconstruction loss, interaction volume prediction loss, KL divergence loss, DAG acyclic constraint loss, sparse regularization loss, label supervision loss, and counterfactual causality loss. In this embodiment, for each label dimension, while keeping the values of other label dimensions unchanged, the value of that dimension is modified individually to construct the label set after intervention for that dimension. The constructed post-intervention label set is input into the conditional prior network being trained. The network learns the feature patterns corresponding to the intervention labels and generates intervention latent variables after only the label dimension has changed. These latent variables only reflect the feature changes after the intervention of the target label dimension, while other conditions remain consistent with the original state. The intervention latent variables are input into the causal layer, and feature propagation is performed through the learned adjacency matrix A (encoding causal dependencies between labels), allowing the intervention latent variables to incorporate the real causal relationships between labels, resulting in post-intervention label latent variables. This post-intervention label latent variable is concatenated with the separated non-causal latent variables and input into the decoder for decoding, generating post-intervention counterfactual text and post-intervention counterfactual interaction volume.
[0082] Before step B10, the method may further include: determining the interaction volume debiasing loss based on the mean square error between the predicted interaction volume after counterfactual intervention and the actual interaction volume; determining the vector difference between the intervention latent variable and the original latent variable as the latent variable debiasing loss; and weighting and summing the interaction volume debiasing loss and the latent variable debiasing loss to obtain the counterfactual causal loss.
[0083] The original reconstructed text generated by the decoder is obtained and transformed into a feature vector of the same dimension as the original text vector. Methods such as mean squared error, cosine distance, and cross-entropy are used to calculate the difference between the reconstructed text vector and the original text vector, yielding the text reconstruction loss. The closer the semantics of the reconstructed text is to the original text, the smaller the loss value; the greater the semantic deviation, the higher the loss value. The reconstructed text generated by the model is forced to retain the core semantics of the original text, preventing the generated text from deviating from the original meaning.
[0084] Extract the original interaction volume predicted by the model, ensuring that its numerical format and dimensions are completely consistent with the actual interaction volume; select a suitable difference measurement method for numerical regression, such as mean squared error or mean absolute error, to calculate the numerical deviation between the original interaction volume and the actual interaction volume, obtain the interaction volume prediction loss, and enable the model to learn the real correlation between the copy, tags and interaction volume, thus ensuring the accuracy of the interaction volume prediction results.
[0085] The posterior distribution of the latent variables generated by the model and the prior distribution given by the conditional prior network are extracted separately. The distance between the two distributions is calculated using the KL divergence method to obtain the KL divergence loss. The closer the posterior distribution is to the prior distribution, the smaller the loss value; the more severe the deviation of the distribution, the higher the loss value. KL divergence loss can constrain the distribution of latent variables to conform to the business scenario rules and avoid the latent variable features from deviating from the true label / environment constraints.
[0086] Cycle detection is performed on the current adjacency matrix A, such as calculating the power of the matrix and finding closed-loop paths, to identify whether there are cyclic causal relationships. If a cycle is detected, a penalty value is calculated based on the number of cycles and the strength of the causal relationship; the more cycles and the stronger the causal relationship, the higher the penalty value. If there are no linear cycles, the penalty value is 0, and the penalty value is determined as the DAG acyclic constraint loss. The closer the adjacency matrix is to an acyclic structure, the smaller the loss value. If a cycle exists, the loss value increases. This loss forces the adjacency matrix to conform to the irreversibility of the true causal relationship, avoiding illogical cyclic causality.
[0087] Traverse all elements of the adjacency matrix A, calculate the sum of the absolute values of the non-zero elements, and impose a penalty on weakly correlated elements with excessively small values. The smaller the element value and the more numerous the elements, the higher the penalty value. Core strongly correlated elements do not incur additional penalties. The penalty value is determined as a sparse regularization loss. The sparser the adjacency matrix (the fewer redundant causal relationships), the smaller the loss value. The denser the matrix, the higher the loss value. This loss can eliminate meaningless weak causal relationships between labels, allowing the adjacency matrix to retain only core causal relationships, thus improving interpretability.
[0088] The latent variables corresponding to the labels are input into the MLP and transformed into predicted label vectors of the same dimension as the original one-hot encoded vectors. The difference between the predicted label vectors and the original label one-hot encoded vectors is calculated using loss methods for classification tasks (such as cross-entropy). This difference value is the label supervision loss, which ensures that the encoded label latent variables can accurately restore the original label features and avoid the loss or distortion of label information during the encoding process.
[0089] The counterfactual causality loss consists of interaction volume debiasing loss and latent variable debiasing loss, with frequency inverse weights introduced to adjust the loss weights. The predicted interaction volume after counterfactual intervention is extracted, and its numerical deviation from the actual interaction volume (e.g., mean squared error) is calculated; this deviation is the interaction volume debiasing loss. The vector difference between the intervention latent variable and the original latent variable is calculated; this difference is the latent variable debiasing loss. The frequency of each label in the training data is statistically analyzed. For low-frequency long-tail labels, a larger weight (e.g., the inverse of frequency) is applied when calculating their counterfactual causality loss; for high-frequency labels, a smaller weight is applied. The weighted interaction volume debiasing loss and latent variable debiasing loss are summed to obtain the final loss value, allowing the model to focus more on learning the causal effects of long-tail labels and mitigating the bias of uneven data distribution.
[0090] Step B20: Update the parameters of the encoder, causal layer, decoder, and conditional prior network according to the total loss until a preset stopping condition is reached.
[0091] In this embodiment, all the aforementioned sub-losses are assigned different weights according to business requirements, and the weighted sum is used to obtain the total loss value of the model. Starting from the total loss value, the gradient of each network parameter with respect to the total loss is calculated along the backward path of the decoder, causal layer, encoder, and conditional prior network. The values of all parameters are adjusted according to the gradient descent rule to gradually reduce the total loss. The process of forward calculation of loss and backward parameter update is repeated until the total loss value stabilizes at a low level and no longer decreases significantly, or reaches the preset number of training epochs. At this point, the model is considered to have converged, and the optimized full model parameters are obtained, including all weights and bias parameters of the encoder, causal layer, decoder, and conditional prior network.
[0092] In this embodiment, counterfactual intervention, through simulation with a single label dimension intervention and other conditions remaining unchanged, eliminates confounding biases between labels and the environment, and between labels themselves, allowing the model to learn the true causal impact of labels on interaction volume. The model is constrained from multiple dimensions, including copy generation, prediction accuracy, and causal structure, avoiding model bias caused by single-objective optimization. Backpropagation achieves end-to-end optimization of all module parameters, ensuring that the encoder, causal layer, decoder, and other modules work collaboratively. The final output model possesses both generative capabilities and the ability to accurately quantify the causal effects of labels.
[0093] This application provides a device for predicting the causal contribution of interaction quantities, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method for predicting the causal contribution of interaction quantities in Embodiment 1 above.
[0094] The following is for reference. Figure 4 The diagram illustrates a structural schematic of a predictive device suitable for implementing the causal contribution prediction of interaction quantities in the embodiments of this application. The predictive device for the causal contribution prediction of interaction quantities in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, personal digital assistants (PDAs), tablet computers (PADs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The illustrated device for predicting the causal contribution of interactive quantities is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0095] like Figure 4As shown, the device for predicting the causal contribution of interactive quantities may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The random access memory 1004 also stores various programs and data required for the operation of the device for predicting the causal contribution of interactive quantities. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the predictor of interactive quantity causal contributions to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows predictor devices for interactive quantity causal contributions with various systems, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented or possessed alternatively.
[0096] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0097] The interaction quantity causal contribution prediction device provided in this application, employing the interaction quantity causal contribution prediction method in the above embodiments, can solve the technical problem of how to improve the accuracy of label effect evaluation. Compared with the prior art, the beneficial effects of the interaction quantity causal contribution prediction device provided in this application are the same as the beneficial effects of the interaction quantity causal contribution prediction method provided in the above embodiments, and other technical features in the interaction quantity causal contribution prediction device are the same as the features disclosed in the method of the previous embodiment, and will not be repeated here.
[0098] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0099] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0100] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the method for predicting the causal contribution of interaction quantities in the above embodiments.
[0101] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.
[0102] The aforementioned computer-readable storage medium may be included in a device for predicting the causal contribution of interaction quantities; or it may exist independently and not assembled into a device for predicting the causal contribution of interaction quantities. The aforementioned computer-readable storage medium carries one or more programs that, when executed by the device for predicting the causal contribution of interaction quantities, cause the device to: perform counterfactual intervention operations on target labels in a label set based on preset intervention values, generating intervention label codes; extract features and reparameterize samples from the intervention label codes and environmental variable codes to obtain post-intervention causal latent variables; perform iterative causal propagation on the post-intervention causal latent variables, and concatenate the propagated post-intervention causal latent variables with additional latent variables to obtain post-intervention latent variables; predict the outcome of the post-intervention latent variables based on a decoder to obtain the post-intervention predicted interaction quantity; and determine the difference between the arithmetic mean of the post-intervention predicted interaction quantity and the initial predicted interaction quantity as the average causal effect of the target label.
[0103] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the client computer, partially on the client computer, as a standalone software package, partially on the client computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the client computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0104] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0105] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0106] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for performing the above-described method for predicting the causal contribution of interaction quantities, thereby solving the technical problem of how to improve the accuracy of label effect evaluation. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the method for predicting the causal contribution of interaction quantities provided in the above embodiments, and will not be repeated here.
[0107] The above descriptions are merely some embodiments of this application and do not limit the patent scope of this application. Any equivalent structural transformations made based on the technical concept of this application and the content of this specification and drawings, or direct / indirect applications in other related technical fields, are included within the patent protection scope of this application. Similarly, applications in other related technical fields are also included within the patent processing scope of this application.
Claims
1. A method for predicting interactive causal contributions, characterized in that, The prediction method of the interaction amount causal contribution comprises: An counterfactual intervention operation is performed on a target label in a label set based on a preset intervention value to generate an intervention label encoding; Feature extraction and reparameterization sampling are performed on the intervention label encoding and an environmental variable encoding to obtain post-intervention causal latent variables; The post-intervention causal latent variables are iteratively propagated, and the post-intervention causal latent variables and additional latent variables after propagation are spliced to obtain post-intervention latent variables; A result prediction is performed on the post-intervention latent variables based on a decoder to obtain post-intervention predicted interaction amounts; An arithmetic mean of the post-intervention predicted interaction amounts and a difference value of an initial predicted interaction amount are determined as an average causal effect of the target label.
2. The method of claim 1, wherein, The step of performing an counterfactual intervention operation on a target label in a label set based on a preset intervention value to generate an intervention label encoding comprises: The label set and a preset label dictionary are matched to determine label dimension values and label indexes of each label; The label dimension values are arranged in the order of the label indexes to obtain label one-hot encodings corresponding to the label set; A target index position of the target label in the one-hot encodings is determined, and a target label dimension value corresponding to the target index position is modified to the preset intervention value to obtain the intervention label encoding.
3. The method for predicting the causal contribution of interaction quantities as described in claim 1, characterized in that, The step of performing feature extraction and reparameterization sampling on the intervention label encoding and an environmental variable encoding to obtain post-intervention causal latent variables comprises: The intervention label encoding and an environmental variable vector are spliced, and a fusion feature vector obtained by splicing is input into a pre-trained conditional prior network to perform linear transformation to obtain a mean vector and a log variance vector of the causal latent variables; The log variance vector is square-root processed to obtain a standard deviation vector; The standard deviation vector and a noise vector are multiplied element by element, and the multiplication result is added to the mean vector element by element to obtain the post-intervention causal latent variables.
4. The method for predicting the causal contribution of interaction quantities as described in claim 1, characterized in that, The step of performing iterative causal propagation on the post-intervention causal latent variables and splicing the post-intervention causal latent variables and additional latent variables after propagation to obtain post-intervention latent variables comprises: The post-intervention causal latent variables are updated based on a pre-trained adjacency matrix and an iteration mechanism to obtain updated post-intervention causal latent variables, and a causal update formula is: , wherein f j is a 2-layer fully connected neural network, is random noise generated by the encoder, is the latent variable vector for the i-th sample corresponding to label j in the t-th iteration, is the adjacency matrix; The updated post-intervention causal latent variables and the additional latent variables are spliced according to feature dimensions to obtain the post-intervention latent variables.
5. The method of claim 1, wherein, The step of performing a result prediction on the post-intervention latent variables based on a decoder to obtain post-intervention predicted interaction amounts comprises: The post-intervention latent variables are input into the decoder, and feature extraction is performed on the post-intervention latent variables based on a feature extraction layer to obtain high-dimensional features; Feature mapping and nonlinear activation are performed on the high-dimensional features based on an output mapping layer to obtain the post-intervention predicted interaction amounts.
6. The method of claim 1, wherein, The prediction method of the interaction amount causal contribution further comprises: The post-intervention latent variables are input into the decoder, and features in the post-intervention latent variables are converted into copy semantic vectors based on a self-attention mechanism of the decoder; Generate an optimized script based on the preset scene rule base and the script semantic vector.
7. The method for predicting the causal contribution of interaction quantities as described in claim 1, characterized in that, The prediction method of the interactive amount causal contribution further comprises: The total loss is obtained by weighted summation of the script reconstruction loss, the interactive amount prediction loss, the KL divergence loss, the DAG acyclic constraint loss, the sparse regularization loss, the label supervision loss, and the counterfactual causal loss. The parameters of the encoder, the causal layer, the decoder, and the conditional prior network are updated according to the total loss until a preset stopping condition is reached.
8. The method of claim 7, wherein the interaction is determined by a plurality of interaction variables, and the plurality of interaction variables are determined by a plurality of interaction variables. Before the step of obtaining the total loss by weighted summation of the script reconstruction loss, the interactive amount prediction loss, the KL divergence loss, the DAG acyclic constraint loss, the sparse regularization loss, the label supervision loss, and the counterfactual causal loss, the prediction method of the interactive amount causal contribution further comprises: An interactive amount debiasing loss is determined based on the mean square error between the predicted value of the interactive amount after the counterfactual intervention and the real interactive amount; A vector difference between the intervention latent variable and the original latent variable is determined as a latent variable debiasing loss; The interactive amount debiasing loss and the latent variable debiasing loss are weighted and summed to obtain the counterfactual causal loss.
9. An interactional quantity causal contribution prediction device characterized by, The prediction device of the interactive amount causal contribution comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the prediction method of the interactive amount causal contribution according to any one of claims 1 to 8.
10. A storage medium, characterized by The storage medium is a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the prediction method of the interactive amount causal contribution according to any one of claims 1 to 8.
Citation Information
Patent Citations
Face feature decoupling representation method and device with causal effect transmission and medium
CN120047983A
Data classification fairness enhancement method and device based on causal intervention
CN120632447A
Data processing method and related equipment
CN120672152A
Multi-user-oriented smart home resource conflict negotiation and distribution method
CN120979867A