Marketing copy generation method, device, and storage medium
By combining marketing copy, structured tags, and environmental variable information with a causal reasoning generation model, this technology solves the problem of being unable to predict the causal effect of tag combinations in existing technologies. It generates optimized marketing copy and quantifies interaction volume, achieving intelligent marketing copy optimization and decision-making upgrades.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DONSON TIMES INFORMATION TECH CO LTD
- Filing Date
- 2026-02-12
- Publication Date
- 2026-05-29
AI Technical Summary
Existing tag-driven marketing copy generation methods cannot accurately predict the causal effect of tag combinations on interaction metrics before actual campaigns, making it difficult to output optimized copy with high interaction potential.
By acquiring original marketing copy, structured tags, and environmental variable information, and inputting them into a trained causal reasoning generation model, counterfactual reasoning is performed to generate optimized marketing copy, and the predicted interaction volume is calculated. A joint representation of content semantics, strategy tags, and contextual factors is constructed, and the causal dependencies between tags are explicitly modeled.
It enables real-time quantitative evaluation of the effects of tag interference strategy changes without the need for actual ad placement, generates optimized marketing copy that aligns with the intent of the new strategy, improves the rationality and usability of the generated results, provides a closed-loop feedback loop of "strategy-content-effect", and enhances the intelligence level and decision-making efficiency of marketing copy optimization.
Smart Images

Figure CN121684072B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language generation technology, and in particular to a marketing copy generation method, device and storage medium. Background Technology
[0002] In digital marketing copy generation and optimization scenarios, a tag-driven large language model is commonly used to generate marketing copy, relying on post-launch observation data to retrospectively analyze the relationship between tags and user interaction effects. However, this approach cannot virtually intervene in tag combinations during the copy generation stage, nor can it accurately predict their causal effects on interaction metrics. Therefore, it is difficult to directly output optimized copy with high interaction potential without actual campaign deployment.
[0003] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0004] The main purpose of this application is to provide a marketing copy generation method, device and storage medium, which aims to solve the technical problem that tag-driven copy generation methods cannot predict the causal effect of tag combinations on interaction metrics before campaign deployment.
[0005] To achieve the above objectives, embodiments of this application provide a marketing copy generation method, the marketing copy generation method comprising:
[0006] Obtain the original marketing copy, structured tags, and environmental variable information to be optimized;
[0007] The original marketing copy, the structured tags, and the environmental variable information are input into the trained causal reasoning generation model;
[0008] In response to a user’s virtual intervention instruction on at least one target intervention tag in the structured tags, the causal reasoning generation model performs counterfactual reasoning to generate an optimized marketing copy corresponding to the virtual intervention instruction and calculates the predicted interaction volume corresponding to the optimized marketing copy. The virtual intervention instruction is used to indicate that the state of the target intervention tag be modified to a set value.
[0009] Output the optimized marketing copy and the predicted interaction volume.
[0010] In one embodiment, the step of inputting the original marketing copy, the structured tags, and the environmental variable information into a trained causal reasoning generation model includes:
[0011] The original marketing copy was segmented to obtain a sequence of word identifiers;
[0012] Encode the word identifier sequence to obtain the text semantic embedding corresponding to the original marketing copy;
[0013] The structured tags are one-hot encoded to generate tag vectors;
[0014] The environmental variable information is encoded to generate an environmental encoding vector;
[0015] The text semantic embedding, the label vector, and the environment encoding vector are concatenated to generate a joint input representation;
[0016] The joint input representation is fed into the trained causal reasoning generative model.
[0017] In one embodiment, the step of responding to a user's virtual intervention instruction on at least one target intervention tag in the structured tags, performing counterfactual reasoning through the causal reasoning generation model to generate optimized marketing copy corresponding to the virtual intervention instruction, and calculating the predicted interaction volume corresponding to the optimized marketing copy includes:
[0018] Obtain a joint input representation generated based on the original marketing copy, the structured tags, and the environmental variable information;
[0019] The joint input representation is subjected to feature compression processing to generate initial latent variables;
[0020] Based on the initial latent variables, and combined with the label state changes corresponding to the virtual intervention instructions, counterfactual latent variables are generated;
[0021] The counterfactual latent variables are decoded to generate the optimized marketing copy corresponding to the virtual intervention instruction, and the predicted interaction volume corresponding to the optimized marketing copy is calculated.
[0022] In one embodiment, the step of generating counterfactual latent variables based on the initial latent variables and the label state changes corresponding to the virtual intervention instructions includes:
[0023] Based on the virtual intervention instructions, determine the target intervention label to be intervened and the post-intervention status of the target intervention label;
[0024] Based on the pre-defined causal dependencies between the structured tags, the causal impact path of the intervention of the target intervention tag on the initial latent variable is calculated.
[0025] Based on the causal influence path, determine the sub-vectors corresponding to the target intervention label and other structured labels affected by the target intervention label in the initial latent variables;
[0026] The inferred states of the post-intervention state and the affected labels are converted into corresponding label embedding vectors, and the label embedding vectors are written into the sub-vectors to obtain the counterfactual latent variables.
[0027] In one embodiment, the step of decoding the counterfactual latent variable to generate the optimized marketing copy corresponding to the virtual intervention instruction includes:
[0028] Obtain the semantic embedding of the text generated based on the original marketing copy encoding;
[0029] The counterfactual latent variable is decoded using the causal reasoning generation model to generate a new text semantic embedding corresponding to the virtual intervention instruction;
[0030] According to the preset weight coefficients, the text semantic embedding and the new text semantic embedding are weighted and fused to obtain the faithful text semantic embedding;
[0031] The fidelity text semantic embedding is subjected to autoregressive decoding to generate candidate text sequences;
[0032] Calculate the semantic similarity between each candidate text sequence and the original marketing copy, and adjust the score of the autoregressive decoding path based on the semantic similarity.
[0033] Based on the score of the constrained and adjusted autoregressive decoding path, the optimized marketing copy is determined using a bundle search strategy.
[0034] In one embodiment, the step of calculating the predicted interaction volume corresponding to the optimized marketing copy includes:
[0035] The counterfactual latent variables are sampled multiple times to generate multiple sets of different counterfactual latent variable samples;
[0036] Based on each set of counterfactual latent variable samples, corresponding interaction volume prediction values are generated through regression prediction processing to obtain multiple interaction volume prediction samples.
[0037] Calculate the average value of the multiple interaction volume prediction samples, and use the average value as the predicted interaction volume corresponding to the optimized marketing copy.
[0038] In one embodiment, after the step of calculating the average value of the plurality of interaction volume prediction samples and using the average value as the predicted interaction volume corresponding to the optimized marketing copy, the marketing copy generation method further includes:
[0039] Based on the initial latent variables, obtain the baseline interaction volume prediction value corresponding to the original marketing copy when no virtual intervention is performed;
[0040] Based on the predicted interaction volume and the baseline predicted interaction volume, calculate the average causal effect of the target intervention label corresponding to the virtual intervention instruction;
[0041] The average causal effect is converted into a tag value score corresponding to the target intervention tag, and the average causal effect, the tag value score, the optimized marketing copy, and the predicted interaction volume are output together.
[0042] In one embodiment, prior to the step of inputting the original marketing copy, the structured tags, and the environmental variable information into the trained causal reasoning generation model, the marketing copy generation method further includes:
[0043] Obtain a training dataset, which includes multiple historical marketing samples. Each historical marketing sample includes historical marketing copy, corresponding historical structured tags, historical environmental variable information, and historical user interaction volume tags.
[0044] The historical marketing copy, historical structured tags, and historical environmental variable information in each of the historical marketing samples are encoded to generate historical text semantic embedding, historical tag vector, and historical environment encoding vector;
[0045] The semantic embeddings of each historical text, the corresponding historical tag vectors, and the environment encoding vectors are concatenated to obtain the training input representations corresponding to each historical marketing sample.
[0046] Each of the training input representations and the corresponding historical user interaction volume labels are input into the causal inference generation model. A joint loss function is constructed using the interaction volume prediction error loss and the causal loss. The model parameters are iteratively updated through the backpropagation algorithm.
[0047] When the value of the joint loss function converges to a preset threshold, or the number of iterations reaches a preset upper limit, the trained causal reasoning generation model is obtained.
[0048] This application embodiment also provides a marketing copy generation device, the marketing copy generation device including: 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 marketing copy generation method as described above.
[0049] This application embodiment also provides a storage medium, which is a computer-readable storage medium, and stores a computer program thereon. When the computer program is executed by a processor, it implements the steps of the marketing copy generation method described above.
[0050] One or more technical solutions proposed in this application have at least the following technical effects:
[0051] This application constructs a joint representation integrating content semantics, strategy tags, and contextual factors by inputting the original marketing copy, structured tags, and environmental variable information into a trained causal reasoning generation model. This enables the model to comprehensively perceive the multidimensional characteristics of the marketing scenario. By responding to users' virtual intervention commands on structured tags, the model performs counterfactual reasoning internally, generating optimized marketing copy that aligns with the new strategy intent and simultaneously calculating the corresponding predicted interaction volume. This allows for real-time quantitative evaluation of the effect of tag interference on strategy changes without the need for actual campaign deployment. Furthermore, by explicitly modeling the causal dependencies between tags and constraining the latent variable space structure in the causal reasoning generation model, the application ensures that counterfactual intervention follows business logic, avoiding the generation of semantically contradictory or strategically conflicting copy, thus improving the rationality and usability of the generated results. In addition, by outputting the predicted interaction volume and optimized copy together, the application provides users with a closed-loop feedback loop of "strategy-content-effect," achieving an upgrade from experience-driven to data-driven intelligent marketing decision-making. This significantly improves the intelligence level, decision-making efficiency, and controllability of marketing copy optimization. Attached Figure Description
[0052] Figure 1 This is a flowchart illustrating the first embodiment of the marketing copy generation method of this application.
[0053] Figure 2 This is a flowchart illustrating the second embodiment of the marketing copy generation method of this application.
[0054] Figure 3 This is a flowchart illustrating the third embodiment of the marketing copy generation method for this application.
[0055] Figure 4 A simplified flowchart is provided for Embodiment 3 of the marketing copy generation method of this application;
[0056] Figure 5 This is a schematic diagram of the hardware operating environment for the marketing copy generation device involved in the marketing copy generation method in this application embodiment.
[0057] 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
[0058] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0059] 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.
[0060] In digital marketing copy generation and optimization scenarios, a tag-driven large language model is commonly used to generate marketing copy, relying on post-launch observation data to retrospectively analyze the relationship between tags and user interaction effects. However, this approach cannot virtually intervene in tag combinations during the copy generation stage, nor can it accurately predict their causal effects on interaction metrics. Therefore, it is difficult to directly output optimized copy with high interaction potential without actual campaign deployment.
[0061] In view of the above problems, this application proposes a marketing copy generation method, which involves obtaining original marketing copy to be optimized, structured tags, and environmental variable information; inputting the original marketing copy, the structured tags, and the environmental variable information into a trained causal reasoning generation model; responding to a user's virtual intervention instruction on at least one target intervention tag in the structured tags, performing counterfactual reasoning through the causal reasoning generation model to generate optimized marketing copy corresponding to the virtual intervention instruction, and calculating the predicted interaction volume corresponding to the optimized marketing copy, wherein the virtual intervention instruction is used to instruct the state of the target intervention tag to be modified to a set value; and outputting the optimized marketing copy and the predicted interaction volume.
[0062] This application provides a solution that, by inputting original marketing copy, structured tags, and environmental variable information into a trained causal reasoning generation model, constructs a joint representation integrating content semantics, strategy tags, and contextual factors, enabling the model to comprehensively perceive the multidimensional characteristics of the marketing scenario. By responding to users' virtual intervention commands on structured tags, counterfactual reasoning is executed within the model, generating not only optimized marketing copy that aligns with the new strategy intent but also simultaneously calculating the corresponding predicted interaction volume. This allows for real-time quantitative evaluation of the effect of tag interference on strategy changes without requiring actual deployment. Furthermore, by explicitly modeling the causal dependencies between tags and constraining the latent variable space structure in the causal reasoning generation model, it ensures that counterfactual intervention follows business logic, avoiding the generation of semantically contradictory or strategically conflicting copy, thus improving the rationality and usability of the generated results. In addition, by outputting the predicted interaction volume and optimized copy together, a closed-loop feedback loop of "strategy-content-effect" is provided to users, achieving an upgrade from experience-driven to data-driven intelligent marketing decision-making, significantly improving the intelligence level, decision-making efficiency, and controllability of marketing copy optimization.
[0063] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a computer, mobile phone, cloud platform node, server, etc., or an electronic device or marketing copy generation system capable of performing the above functions. The following description uses a marketing copy generation system as an example to illustrate this embodiment and the subsequent embodiments.
[0064] The marketing copy generation method of the first embodiment proposed in this application can be found in [reference needed]. Figure 1 The method includes steps S10 to S40:
[0065] Step S10: Obtain the original marketing copy, structured tags, and environmental variable information to be optimized.
[0066] It should be noted that structured tags refer to a set of discrete attribute tags associated with the original marketing copy, used to characterize the dimensions of the marketing strategy, such as "whether it is a collaboration with an IP", "whether it emphasizes price discounts", "whether it is aimed at people with sensitive skin", etc. Each structured tag has a clear semantic meaning and value (such as 0 / 1 or an enumerated value).
[0067] Environmental variable information refers to external contextual factors that influence user interaction behavior but are not directly related to the copy content, such as the advertising platform, time window (e.g., during the 618 shopping festival), user profile statistical characteristics (e.g., the age distribution of the target audience), KOL's number of followers, image and text matching degree, or historical interaction baseline, etc.
[0068] Original marketing copy can be manually entered through the user interface, imported from a specified format file, automatically retrieved from the accompanying copy management system, or synchronously obtained from other business systems via API. Structured tags can be generated by users selecting preset tags on the interface, or automatically extracted and completed by the system based on the original marketing copy content using a rule engine or classification model. Environmental variable information can be obtained from advertising platform logs, CRM (Customer Relationship Management) systems, or real-time data streams, and then standardized before being used as model input.
[0069] As an example, when a user uploads a skincare product description such as "gentle formula, suitable for daily use", the system can automatically identify its implicit tag "suitable for sensitive skin = 1" and combine it with environmental variables such as the current advertising platform being platform A and the current time being during the 618 promotion to construct a complete input triple.
[0070] Since marketing effectiveness is influenced by multiple factors, relying solely on copywriting content while ignoring tagging strategies and environmental context will lead to optimization directions deviating from actual business scenarios. Therefore, obtaining the original marketing copy to be optimized, structured tags, and environmental variable information can prevent the generation of "pure language optimization" copy that is detached from business logic, thereby improving the feasibility of marketing copy optimization results and the accuracy of interaction prediction.
[0071] Step S20: Input the original marketing copy, the structured tags, and the environmental variable information into the trained causal reasoning generation model.
[0072] It should be noted that the causal reasoning generative model is a deep neural network that integrates causal structural constraints and generative modeling capabilities. It includes an encoder, a causal intervention layer, a latent variable representation module, a text decoder, and an interaction quantity regression prediction head, which can simulate counterfactual effects of tag intervention while maintaining the semantic fidelity of the text.
[0073] The causal reasoning generative model can employ a variational autoencoder (VAE) architecture to explicitly model the joint distribution of labels, marketing copy, and environmental variables in the latent variable space, and encode the pre-defined causal dependencies between labels using a directed acyclic graph (DAG). When the original marketing copy, structured labels, and environmental variable information are input into the trained causal reasoning generative model, the original marketing copy is first encoded into text semantic embeddings by a pre-trained language model (such as Qwen-3), the structured labels are converted into label vectors through an embedding layer, and the environmental variable information is encoded into environmental encoding vectors through a multilayer perceptron. Finally, the text semantic embeddings, label vectors, and environmental encoding vectors are concatenated as the overall input to the model.
[0074] Specifically, step S20 includes steps S210 to S260:
[0075] Step S210: Perform word segmentation on the original marketing copy to obtain a word identifier sequence.
[0076] Step S220: Encode the word identifier sequence to obtain the text semantic embedding corresponding to the original marketing copy.
[0077] Step S230: Perform one-hot encoding on the structured tags to generate tag vectors.
[0078] Step S240: Encode the environmental variable information to generate an environmental encoding vector.
[0079] Step S250: Concatenate the text semantic embedding, the label vector, and the environment encoding vector to generate a joint input representation.
[0080] Step S260: Input the joint input representation into the trained causal reasoning generation model.
[0081] In this embodiment, step S20 includes a data processing and model input stage. In the data processing stage, the original marketing copy is first encoded, and a pre-trained language model (e.g., Qwen-3-14B-Base) is used as a tokenizer to process the input original marketing copy. Perform word segmentation, and uniformly truncate or pad to the maximum sequence length, for example, the maximum sequence length. This yields the lexical identifier sequence. Next, the encoder of this pre-trained language model extracts the hidden states of the last layer of the lexical identifier sequence. This serves as the semantic embedding of the original marketing copy; simultaneously, it fully preserves the original token ID sequence. This is used for semantic alignment in the subsequent mixed decoding stage to ensure that the core brand information of the marketing copy is not lost.
[0082] For tag encoding, the original structured tags contain multiple dimensions, such as skincare benefits, co-branded IP, and suitability for sensitive skin. Each dimension is a binary discrete variable, taking values of 0 or 1. To adapt to the implementation of counterfactual intervention logic, the system converts the original structured tags into one-hot vectors, obtaining tag vectors. This vector will serve as an explicit control signal in the causal deduction process.
[0083] As an example, the original structured label dimension is Convert it to one-hot vector form, that is, the tag vector corresponding to the structured tag is ( ).
[0084] Environmental variable information contains multiple confounding control variables (such as KOL follower count, whether there is a major promotion, and image / text relevance). During the processing of environmental variable information, continuous variables can be normalized, while discrete variables can be one-hot encoded. After this processing, all environmental variable features are concatenated or mapped through a multilayer perceptron to ultimately generate a unified environmental coding vector. This environment encoding vector can be used for conditional prior modeling to improve the robustness of causal effect estimation.
[0085] Finally, based on the text semantic embedding, label vector, and environment encoding vector obtained after the above encoding process, a joint input representation is constructed. Specifically, the label vector... With environment encoding vector Broadcast along the sequence length dimension to Line, with text semantic embedding Concatenate to form a unified input matrix This joint input indicates That is, it serves as the input for the causal reasoning generative model.
[0086] Step S30: In response to a user's virtual intervention instruction on at least one target intervention tag in the structured tags, counterfactual reasoning is performed through the causal reasoning generation model to generate optimized marketing copy corresponding to the virtual intervention instruction, and the predicted interaction volume corresponding to the optimized marketing copy is calculated. The virtual intervention instruction is used to instruct the state of the target intervention tag to be modified to a set value.
[0087] It should be noted that virtual intervention commands are hypothetical operation commands initiated by the user. Virtual intervention commands are hypothetical operation commands actively initiated by the user to specify a new value for a structured label (such as changing "joint IP" from 0 to 1). Essentially, they perform a do operation on that node (i.e., the corresponding dimension label) in the causal graph. The causal reasoning generation model is required to simulate the counterfactual outcome of "if this labeling strategy had been adopted"; the post-intervention state is the set value of the structured label in the counterfactual scenario.
[0088] Counterfactual reasoning is a core concept in causal inference. It answers the question: if a cause (such as the status of a dimension label) changes while the actual conditions remain unchanged, how will the result (such as the amount of user interaction) change?
[0089] Predicted interaction volume is an estimate by a causal inference generative model of the user interaction effect (such as the number of likes, comments, shares, or overall index) that an optimized marketing copy would achieve if it were deployed.
[0090] The counterfactual reasoning process includes: based on the joint input representation, the encoder of the causal reasoning generation model outputs initial latent variables, which are explicitly divided into multiple subspaces in the latent space, corresponding to structured labels, original marketing copy semantics, and environmental variables, respectively; subsequently, based on the virtual intervention command issued by the user, the target intervention label is determined, and based on the preset directed acyclic graph (DAG) causal structure between labels (referred to as the preset causal graph), all downstream labels directly or indirectly affected by the target intervention label are identified; then, the sub-vectors in the initial latent variables corresponding to the target intervention label and its downstream labels are located; the post-intervention state corresponding to the target intervention label (e.g., "joint IP=1") and the derived affected label state (e.g., "price sensitivity=high") are converted into fixed-dimensional embedding vectors and overwritten to the corresponding sub-vector positions, while the dimensions of the remaining latent variables remain unchanged, thereby generating the adjusted counterfactual latent variable representation.
[0091] To further reduce prediction fluctuations caused by the randomness of latent variables, the counterfactual latent variable is reparameterized multiple times to generate multiple independent latent variable samples. On the one hand, each sampling result is input into a text decoder. During the decoding process, the semantic embedding of the original marketing copy is weighted and fused with the text semantic embedding corresponding to the original marketing copy according to a preset weight coefficient (such as 0.7). Combined with a bundle search strategy and semantic similarity constraints, an optimized marketing copy that is semantically coherent and retains the core brand information is generated. On the other hand, each sampling result is input into the interaction volume regression prediction head in parallel, and the corresponding interaction volume prediction value is output respectively, forming multiple interaction volume prediction samples. Finally, the average value of these samples is used as the predicted interaction volume corresponding to the optimized marketing copy.
[0092] As an example, when a user issues a virtual intervention command to change the "Co-branded IP" tag from 0 to 1, the causal inference generation model not only updates the sub-vector corresponding to "Co-branded IP" in the initial latent variables (e.g., the [64:96]th dimension), but also identifies its direct downstream node "price sensitivity" based on the preset directed acyclic graph (DAG) between tags, and deduces that the tag state should be adjusted from "low" to "high"; correspondingly, the model synchronously updates the sub-vector corresponding to "price sensitivity" in the initial latent variables (e.g., the [96:128]th dimension). Based on this, the decoder-generated optimized marketing copy highlights new strategic elements such as "B Co-branded Limited Edition" while naturally incorporating expressions consistent with price perception, such as "light luxury experience," avoiding the semantic conflict of "co-branded but emphasizing low price." Simultaneously, the interaction volume regression head predicts that the number of likes for this optimized marketing copy is approximately 18% higher than the interaction volume of the original marketing copy, reflecting the positive causal effect of the co-branding strategy on the target audience.
[0093] Step S40: Output the optimized marketing copy and the predicted interaction volume.
[0094] In this embodiment, the output includes displaying optimized marketing copy and predicted interaction volume (such as an estimated 1250 likes) in the user interface; it can also provide a comparison view of multiple different tag combination schemes, and support users to roll back or combine different tag intervention strategies.
[0095] As an example, when the system outputs the result "Optimize marketing copy, expected number of likes is 1250", it simultaneously displays the corresponding "Co-branded IP" intervention tag, along with an upward arrow and the percentage increase, to help users intuitively understand the intervention value of the corresponding tag.
[0096] In this implementation, by jointly modeling structured tags, environmental variables, and copy content, and introducing a counterfactual intervention mechanism based on causal graphs, the incremental effect of tag strategies is quantified while generating optimized marketing copy. This solves the problem that traditional copy generation methods cannot predict the causal effect of tag combinations on interaction metrics before launch, thereby achieving interpretable, interventionable, and predictable intelligent marketing copy generation, significantly improving the business orientation and decision-making efficiency of content optimization.
[0097] Based on the above embodiments of this application, in the second embodiment of this application, the same or similar content as the above embodiments can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Before step S20, the marketing copy generation method further includes steps S201 to S205:
[0098] Step S201: Obtain the training dataset, which includes multiple historical marketing samples. Each historical marketing sample includes historical marketing copy, corresponding historical structured labels, historical environmental variable information, and historical user interaction volume labels.
[0099] It should be noted that historical marketing samples refer to real data records collected from actual marketing activities. Historical marketing copy is product description or promotional content in natural language form. Historical structured tags are strategic discrete attributes associated with the copy (such as "whether it is co-branded with an IP" or "whether it emphasizes price discounts"). Historical environmental variable information includes contextual factors such as the advertising platform, time period, and statistical characteristics of the target audience. Historical user interaction tags are quantifiable behavioral indicators (such as the number of likes, comments, and conversion rates) used to supervise the model to learn the mapping relationship between tag interference strategies and interaction effects.
[0100] Step S202: Encode the historical marketing copy, historical structured tags, and historical environmental variable information in each of the historical marketing samples to generate historical text semantic embedding, historical tag vector, and historical environment encoding vector.
[0101] In this embodiment, historical marketing copy is converted into historical text semantic embeddings through an encoder of a pre-trained language model (such as Qwen-3); historical structured tags are mapped into historical tag vectors through one-hot encoding or embedding layers; continuous variables in historical environmental variable information are normalized, and discrete variables are one-hot encoded, then compressed into historical environmental encoding vectors through a multilayer perceptron. The specific encoding processing methods for the original marketing copy, structured tag set, and environmental variable information can be referred to in the previous embodiments, and will not be repeated in this embodiment.
[0102] Step S203: Concatenate the semantic embedding of each historical text, the corresponding historical tag vector, and the environment encoding vector to obtain the training input representation corresponding to each historical marketing sample.
[0103] In this embodiment, the semantic embeddings of each historical text, the corresponding historical label vectors, and the environment encoding vectors are concatenated along the feature dimension to form a unified training input representation, which serves as the forward input to the causal reasoning generation model. The specific construction method of the joint input representation in the preceding embodiments can be referred to, and will not be repeated in this embodiment.
[0104] Step S204: Input each of the training input representations and the corresponding historical user interaction volume labels into the causal inference generation model, construct a joint loss function with interaction volume prediction error loss and causal loss, and iteratively update the model parameters through the backpropagation algorithm.
[0105] It should be noted that causal loss refers to the structural constraint imposed on the latent variable space based on the pre-defined causal dependencies between structured labels (usually represented as a directed acyclic graph, DAG). Its purpose is to ensure that the model explicitly models the causal mechanism between labels in the latent space, rather than just learning the correlation. This causal loss can be achieved through structural causal models (SCM), backdoor adjustment terms, or latent variable decoupling regularization.
[0106] It should be noted that the interaction volume prediction error loss refers to the difference between the model's output predicted interaction volume value and the actual historical user interaction volume label. It is usually used as the mean squared error (MSE) or mean absolute error (MAE) as the loss function to drive the learning of the regression prediction head.
[0107] Step S205: When the value of the joint loss function converges to a preset threshold, or the number of iterations reaches a preset upper limit, the trained causal reasoning generation model is obtained.
[0108] In this embodiment, the model performs two tasks simultaneously: firstly, it reconstructs and optimizes the text using a decoder (implicit in latent variable modeling); secondly, it predicts interaction volume using a regression head and calculates causal loss based on causal priors. The model iteratively updates all trainable parameters through backpropagation and an optimizer (such as Adam) until the corresponding convergence condition is met.
[0109] As an example, when a historical sample contains the text "gentle cleanser, suitable for daily use", the tag "suitable for sensitive skin = 1", the environment "Platform A + Spring Promotion", and the interaction tag "number of likes = 1280", the system encodes it as a joint input representation and supervises the model learning: if there are several pre-"co-branded IP = 1", then the predicted interaction volume should increase reasonably, and the association between the latent variables "co-branded IP" and downstream tags such as "price sensitivity" should conform to the preset causal graph.
[0110] In this embodiment, by constructing a training dataset containing real interactive feedback and simultaneously optimizing the interaction volume prediction capability and causal structure consistency during the training phase, the causal reasoning generation model not only has high-precision counterfactual generation capability, but also ensures that the intervention logic conforms to business common sense. This training mechanism effectively solves the fundamental defect of traditional generation models that "only fit correlations and cannot support strategy deduction", providing a reliable foundation for subsequent interpretable optimization.
[0111] Based on the above embodiments of this application, in the third embodiment of this application, the same or similar content as the above embodiments can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 Step S30 includes steps S310 to S340:
[0112] Step S310: Obtain the joint input representation generated based on the original marketing copy, the structured tags, and the environmental variable information.
[0113] It should be noted that the joint input representation refers to the unified input matrix formed by concatenating the textual semantic embedding of the original marketing copy, the vector representation of the structured tags, and the encoded vector of the environmental variables along the feature dimension. As the front-end input of the causal reasoning generation model, it carries complete context and strategy information.
[0114] Step S320: Perform feature compression processing on the joint input representation to generate initial latent variables.
[0115] It should be noted that the initial latent variables are low-dimensional continuous vectors output by the encoder of the causal inference generative model. They are used to compactly represent the joint semantics of the joint input representation in the latent space. Their dimension is usually much smaller than the original input (i.e., the joint input representation) and they are designed to support subsequent causal intervention operations.
[0116] First, it should be noted that the variational autoencoder (VAE) is the core causal reasoning engine of the system, which specifically includes three sub-modules: the encoder, the causal layer, and the decoder. These three sub-modules are connected in sequence and work together to complete the end-to-end processing from joint input representation to causal perceptual representation and then to multi-target output.
[0117] Feature compression can be implemented using the encoder of a Counterfactual VAE. The encoder network specifically comprises a multi-layer Transformer or MLP structure, used to map the preprocessed joint input representation (including text semantic embeddings, label vectors, and context encoding vectors) into low-dimensional continuous latent variables. This process not only outputs the posterior distribution parameters (mean) With variance It also introduces prior distributions conditioned on structured labels and environmental variables. ,in Represents a structured label vector. This represents the environment encoding vector.
[0118] Specifically, the conditional prior is implemented by a separate prior network, whose structure is symmetrical to the encoder, and the receiver... and As input, the output is the prior mean. With variance During the training phase, the model minimizes the posterior distribution. with conditional priors The KL divergence terms between them constrain the latent space structure, such that the same policy configuration (i.e., the same...) and Samples are clustered in the latent space, while different label combinations are decoupled. This mechanism ensures that when performing virtual intervention during the inference phase, only the structured label input in the prior network needs to be modified. This allows the generation of counterfactual latent variables that conform to the semantics of the new strategy, without relying on the original marketing copy content, thus providing a well-structured and controllable implicit space foundation for causal inference.
[0119] As an example, when the input contains structured tags such as "co-branded IP=1" and "suitable for sensitive skin=0", the encoder will map these structured tags 0 to a specific region of the latent variables, while the semantic embedding of the marketing copy occupies another independent subspace, thus ensuring that the core semantics of the marketing copy are not destroyed when interfering with a certain structured tag.
[0120] Step S330: Based on the initial latent variables and combined with the label state changes corresponding to the virtual intervention instructions, generate counterfactual latent variables.
[0121] It should be noted that counterfactual latent variables refer to the implicit state representation of "if the new labeling strategy had been adopted" assumed within the causal inference generation model after the execution of a virtual intervention operation (i.e., do-operation). It retains both the original marketing copy and environmental variable information and reflects the causal propagation effect caused by the intervention.
[0122] In this embodiment, the process of generating counterfactual latent variables can be implemented through the Causal Layer of a variational autoencoder. The Causal Layer specifically operates on the subset of latent variables corresponding to structured labels, explicitly modeling the causal dependencies between structured labels, and ensuring the interpretability and acyclicity of the learned causal graph through causal structure constraints. Specifically, firstly, the target intervention label and its post-intervention state are determined according to the virtual intervention instruction; then, based on the preset DAG causal structure between labels, the set of downstream structured labels directly affected by the intervention label is derived; subsequently, the post-intervention states of the target intervention label and the affected labels are converted into embedding vectors through a preset label embedding mapping, and the values of the corresponding sub-vectors in the initial latent variables are replaced, while the rest remain unchanged. Optionally, after replacing the values of the corresponding sub-vectors in the initial latent variables, a causal consistency check can be further performed to ensure that the updated initial latent variables do not violate the preset causal dependencies between structured labels.
[0123] As an example, when a user changes the "co-branded IP" from 0 to 1, the system identifies that "price sensitivity" may increase based on the causal graph. Therefore, it simultaneously adjusts the "price sensitivity" label status from "low" to "high" and updates the sub-vectors corresponding to these two labels in the initial latent variables, thereby generating counterfactual latent variables that conform to causal logic.
[0124] Specifically, step S330 includes steps S3310 to S3340:
[0125] Step S3310: Based on the virtual intervention instruction, determine the target intervention label to be intervened and the post-intervention status of the target intervention label.
[0126] Step S3320: Based on the preset causal dependencies between the structured labels, calculate the causal impact path of the intervention of the target intervention label on the initial latent variable.
[0127] Step S3330: Based on the causal influence path, determine the sub-vectors corresponding to the target intervention label and other structured labels affected by the target intervention label in the initial latent variables.
[0128] Step S3340: Convert the post-intervention state and the deduced state of the affected labels into corresponding label embedding vectors, and write the label embedding vectors into the sub-vectors to obtain the counterfactual latent variables.
[0129] It should be noted that the causal influence path refers to the set of all downstream labels reachable along the directed edges in the DAG starting from the target intervention label. The states of these downstream structured labels will undergo chain changes due to the intervention of the target intervention label, and need to be updated synchronously in the latent variables to maintain causal consistency. A sub-vector refers to a continuous-dimensional subset of the initial latent variables that is explicitly associated with a specific structured label. This subset is decoupled during the model training phase through causal constraints, so that each structured label or combination of structured labels has an independent latent space region, which facilitates precise intervention without interfering with other semantic components.
[0130] In this embodiment, the system first parses the structured tags that are selected or modified in the user interface, extracts their identifiers and new values as target intervention tags and post-intervention states; then, it uses a preloaded causal graph to perform graph traversal (such as depth-first search) to identify all downstream nodes directly affected by the intervention; next, it locates the sub-vector positions of each relevant tag through a preset structured tag-latent variable mapping table; finally, it calls the shared tag embedding layer to convert the post-intervention state (such as 1) and the derived affected tag state (such as "price sensitivity = high" mapped to 1) into fixed-dimensional embedding vectors, and directly overwrites them to the corresponding sub-vector positions, while keeping the dimensions of other latent variables unchanged, thereby generating counterfactual latent variables that conform to causal logic.
[0131] In this implementation, by explicitly modeling the causal dependencies between structured tags and implementing the linked updates of the target intervention tag and its causal descendants in the latent variable space, the logical completeness and semantic rationality of the counterfactual intervention are ensured. This avoids internal state contradictions caused by isolated modification of a single structured tag (such as "emphasizing skin care" but "not suitable for sensitive skin"), thereby improving the strategic consistency of generated marketing copy and the causal credibility of predicted interaction volume, providing users with a truly explainable copy generation service.
[0132] Step S340: Decode the counterfactual latent variable to generate the optimized marketing copy corresponding to the virtual intervention instruction, and calculate the predicted interaction volume corresponding to the optimized marketing copy.
[0133] In this embodiment, the decoding process can be implemented using a variational autoencoder's decoder. The decoder includes two parallel output branches: the first output branch is used to reconstruct the semantics of the text, ensuring the linguistic coherence of the generated content; the second output branch is used to predict user interaction volume (such as likes, comments, etc.), providing a quantitative basis for causal effect calculation and interaction effect prediction. Specifically, when reconstructing the semantics of the optimized marketing copy, the counterfactual latent variable is input into the text decoder, and mixed semantic fusion is performed by combining it with the token_id sequence of the original marketing copy. For example, a weighted average or gating mechanism is used for mixed semantic fusion, and semantic similarity constraints (such as cosine similarity) are introduced in the autoregressive generation process to limit the decoding path from deviating too far from the original semantics. Finally, the optimized marketing copy is generated through bundle search. When predicting user interaction volume, the counterfactual latent variable is input into the interaction volume regression prediction head (such as a multilayer perceptron), and the predicted value of user interaction volume is output. The final predicted interaction volume is obtained by performing multiple random samplings on the updated initial latent variable and taking the average of the prediction results.
[0134] In this implementation, the three modules, Encoder, Causal Layer, and Decoder, work together to enable the system to simultaneously support counterfactual intervention, interaction volume prediction, and copy generation within a unified framework, providing a consistent and reliable internal representation for the upper-layer hybrid decoding and causal attribution interfaces.
[0135] As an example, when generating optimized marketing copy under the intervention of "Co-branded IP=1", the causal reasoning generation model may output "B co-branded limited edition, a must-have for trendy players", and predict the number of likes to be 1320; if there is no intervention, the baseline interaction volume prediction value is 1080. From this, the average causal effect corresponding to this intervention label can be further calculated as +240, or the average causal effect corresponding to this intervention label can be output as increased by 22%.
[0136] In this embodiment, by explicitly modeling the causal intervention path in the latent variable space and decomposing counterfactual reasoning into three stages—compression, intervention, and decoding—it not only achieves precise control over the structured tag intervention strategy but also ensures the semantic fidelity of the generated content and the stability of interactive prediction. Compared to end-to-end black-box generation methods, this implementation can clearly separate intervention strategy variables and content variables, supporting interpretable counterfactual simulation. This provides marketers with optimization suggestions for data credibility, significantly improving the business adaptability and decision support value of the marketing copy generation system.
[0137] As one possible implementation, step S340 includes steps S3410 to S3460:
[0138] Step S3410: Obtain the text semantic embedding generated based on the original marketing copy encoding.
[0139] It should be noted that text semantic embedding refers to the context-aware vector representation obtained after the original marketing copy is encoded by a pre-trained language model (such as Qwen-3), which fully preserves key information such as brand keywords, core product selling points, and language style.
[0140] Step S3420: Decode the counterfactual latent variable using the causal reasoning generation model to generate a new text semantic embedding corresponding to the virtual intervention instruction.
[0141] It should be noted that the new text semantic embedding is a semantic representation that reflects the intent of the intervention strategy, generated by a decoder from counterfactual latent variables. This new text semantic embedding encodes new content features derived from the tag-based intervention and expected to be reflected in optimized marketing copy.
[0142] The decoder of the causal reasoning generative model includes an output branch specifically for reconstructing the semantic representation of the text. In this output branch, counterfactual latent variables are taken as input and mapped through a series of neural network layers (such as fully connected layers and Transformer decoding layers) to the same vector space as the original text semantic embedding, thereby outputting a new text semantic embedding.
[0143] Step S3430: According to the preset weight coefficient, the text semantic embedding and the new text semantic embedding are weighted and fused to obtain the faithful text semantic embedding.
[0144] As an example, semantic embedding of the generated new text The text semantic embedding corresponding to the original token_id sequence is weighted according to a preset weight coefficient, for example... By merging, a high-fidelity text semantic embedding is obtained:
[0145]
[0146] in, This refers to faithful text semantic embedding; This refers to the text semantic embedding corresponding to the original token_id sequence; α is a preset weight coefficient used to control the strength of the intervention intention and the proportion of original text semantics preserved.
[0147] It should be noted that, Specifically, this refers to the unmodified original text semantic embedding used in the inference stage of the causal reasoning generative model, serving as the semantic anchor for hybrid decoding, which is equivalent to the aforementioned steps. In this implementation, the suffix "raw" is used to emphasize that it comes from the original, uninterrupted marketing copy coding results, fully preserving the core brand information.
[0148] Step S3440: Perform autoregressive decoding on the fidelity text semantic embedding to generate candidate text sequences.
[0149] It should be noted that fidelity text semantic embedding is text semantic embedding (i.e., the first embodiment). This stage is denoted as ) and new text semantic embedding The weighted fusion result is used to preserve the brand information and core selling points of the original marketing copy to the greatest extent possible, while ensuring that the label intervention is effective.
[0150] In this embodiment, autoregressive decoding refers to using the faithful text semantic embedding as the initial context or condition, and combining it with the fully preserved original token_id sequence for semantic alignment. The text is generated word by word using the decoder of the pre-trained language model (such as the decoder of Qwen-3), and each generation depends on all previously generated words.
[0151] Specifically, the faithful text semantic embedding is used as the input to the decoder as the cue vector, and decoding parameters are set, such as temperature=0.8, to control the diversity of the generated text. The decoding process generates multiple possible word sequences as candidate text sequences, providing the basic input for subsequent constraint adjustment and bundle search strategies based on semantic similarity.
[0152] Step S3450: Calculate the semantic similarity between each candidate text sequence and the original marketing copy, and adjust the score of the autoregressive decoding path based on the semantic similarity.
[0153] It should be noted that semantic similarity is used to quantify the degree of semantic deviation of the generated content. This semantic similarity is linearly or non-linearly incorporated into the decoding score of the pre-trained language model to form a constrained path score, thereby guiding the beam search to favor the high-fidelity direction.
[0154] In this embodiment, the scoring adjustment of the autoregressive decoding path refers to adding an additional constraint based on semantic similarity to the scoring logic of the decoder in selecting the next word. By rewarding the generation path with high similarity and penalizing the generation path with low similarity, the generated content is guided to not deviate from the core information of the original marketing copy in terms of semantics. This satisfies the tag intervention requirements while preserving the brand tone and the core selling points of the copy to the greatest extent.
[0155] As an example, the faithful text semantic embedding is input into the Qwen-3 decoder, using a beam search (width 5) decoding strategy with temperature=0.8, and semantic similarity constraints are introduced into the scoring. The adjusted path scoring formula is as follows:
[0156]
[0157] in, It is the logarithm of the generation probability of the pre-trained language model itself, when generating the next word. At that time, pre-trained language models such as Qwen-3 will output the generation probability of the word, and the logarithm is obtained. Its function is to ensure that the generated optimized marketing copy has natural and fluent language expression; It is a semantic similarity constraint term, where It is the semantic embedding of the currently generated part of the text. It is the semantic embedding of the text corresponding to the original marketing copy. By calculating the cosine similarity between the two, the semantic deviation between the current generated content and the original marketing copy is quantified. β is a weight coefficient used to balance the two goals of "language fluency" and "semantic fidelity". It can be flexibly set according to the actual marketing scenario needs. For example, in scenarios where it is necessary to strongly retain the original marketing copy, the value of β can be appropriately increased.
[0158] Step S3460: Based on the score of the constrained and adjusted autoregressive decoding path, determine the optimized marketing copy using a bundle search strategy.
[0159] It should be noted that the bundle search strategy is a search algorithm that maintains multiple high-scoring generation paths during the autoregressive decoding process, in order to improve text quality while ensuring generation efficiency.
[0160] In this embodiment, the beam search not only sorts paths based on the generation probability of the language model itself, but also takes into account the path score adjusted by semantic similarity constraints, thereby achieving joint optimization of "language fluency" and "semantic fidelity".
[0161] Specifically, at each generation step, the decoder calculates the score of all candidate words and retains the top K highest-scoring paths (K being the bundle width); these paths are continuously expanded until a complete sentence is generated. Finally, the output is selected from all completed candidate sequences with the highest total score.
[0162] In this embodiment, the beamwidth is set to 5, which strikes a good balance between generation speed and diversity: too small a beamwidth may cause the optimal path to be missed, while too large a beamwidth will significantly increase computational overhead. By setting a reasonable beamwidth, the system can explore a sufficient number of high-quality candidates within a limited time, avoid getting trapped in local optima, and ensure that the generated results have good semantic coherence and policy consistency.
[0163] Furthermore, since this implementation method introduces dynamic semantic similarity constraints, the score differences between different paths are more obvious, enabling the beam search to more effectively filter out high-quality text sequences that both conform to the intervention intention and are close to the style of the original copy, thereby improving the stability and reliability of the overall generation effect.
[0164] As another feasible implementation, step S340 includes steps S3470~S3490:
[0165] Step S3470: Sample the counterfactual latent variable multiple times to generate multiple sets of different counterfactual latent variable samples.
[0166] Step S3480: Based on each group of counterfactual latent variable samples, generate corresponding interaction quantity prediction values through regression prediction processing to obtain multiple interaction quantity prediction samples.
[0167] Step S3490: Calculate the average value of the multiple interaction volume prediction samples, and use the average value as the predicted interaction volume corresponding to the optimized marketing copy.
[0168] It should be noted that the purpose of sampling the counterfactual latent variable multiple times is to reduce the prediction variance caused by the randomness of the latent variable and improve the stability of the prediction results. After each sampling, an interaction quantity prediction value is generated independently through the regression prediction head (such as MLP), thereby obtaining a set of prediction samples. Taking the average value as the final predicted interaction quantity can effectively approximate the true expected value.
[0169] In this embodiment, the above process can be understood as a simulation experiment of the "post-intervention world". By repeatedly perturbing the latent variable space, the change distribution of the interaction quantity is observed, and the mean value is used to represent the most likely result.
[0170] Understandably, counterfactual latent variables are typically samples of a probability distribution (such as a Gaussian distribution). A single sample is random and may lead to unstable prediction results. By sampling multiple times independently, a series of possible states under this changing distribution can be obtained, thus more comprehensively reflecting the potential outcome space after intervention.
[0171] Specifically, step S3490 is followed by steps S3491 to S3493:
[0172] Step S3491: Based on the initial latent variables, obtain the baseline interaction volume prediction value corresponding to the original marketing copy when no virtual intervention is performed.
[0173] Step S3492: Based on the predicted interaction volume and the baseline predicted interaction volume, calculate the average causal effect of the target intervention label corresponding to the virtual intervention instruction.
[0174] Step S3493: Convert the average causal effect into a tag value score corresponding to the target intervention tag, and output the average causal effect, the tag value score, the optimized marketing copy, and the predicted interaction volume together.
[0175] It should be noted that the baseline interaction volume prediction value refers to the interaction volume prediction result obtained by forward inference of the same causal inference generation model based on the original marketing copy, the original structured tag set, and environmental variable information, without performing any virtual intervention operations; this value serves as a control group to quantify the actual contribution of the intervention tag strategy.
[0176] As an example, performing interventions on the label dimension The system predicts pre-interaction volume multiple times using counterfactual methods. To reduce errors, the average value is calculated as the predicted interaction amount; simultaneously, a baseline interaction amount is generated based on the initial latent variables. Then, the average causal effect is calculated:
[0177]
[0178] Where M is the number of latent variable samplings, used to reduce measurement error; Indicates target intervention label The average incremental effect of the intervention.
[0179] Furthermore, the system will This is converted into an intuitive tag value score (such as "+240" or "22% increase"), and output along with the generated optimized marketing copy and predicted interaction volume, enabling users to quickly understand "which tag is the most valuable" and thus make efficient decisions.
[0180] This implementation method, by introducing multi-sampling prediction and causal effect estimation mechanisms, not only achieves accurate prediction of engagement volume for optimized marketing copy, but also realizes a key shift from "black box generation" to "explainable decision-making." The system can not only output the expected interaction effect of new copy, but also quantify the incremental contribution of each tag intervention, clearly answering "which tag change had what effect." This explainable output based on average causal effects transforms the previously invisible impact of strategies into transparent and intuitive causal insights, significantly enhancing the system's decision support capabilities while increasing user trust in and willingness to adopt the generated results.
[0181] For example, to help understand the implementation process of the marketing copy generation method obtained by combining this embodiment with the above embodiments, please refer to... Figure 4 , Figure 4 A simplified flowchart illustrating a method for generating marketing copy is provided, specifically:
[0182] The system first acquires the marketing copy X, structured tags U, environmental variables E, and corresponding user interaction volume Y. The marketing copy X is then input into the encoder of a pre-trained language model (such as Qwen-3) to generate corresponding text semantic embeddings. The structured tag U is converted into a tag vector via one-hot encoding. Continuous variables in environmental variable E are normalized, and discrete variables are encoded using one-hot encoding. These are then mapped to an environmental encoding vector via a multilayer perceptron. Subsequently, , and Concatenate along the feature dimensions to form a joint input representation And input it into the causal reasoning generative model.
[0183] It should be noted that Y serves as a supervisory signal during the training phase to optimize the model's interaction prediction capability; during the inference phase, the system, based on the same marketing copy X, structured labels U, and environmental variable E as inputs, generates the baseline interaction prediction value in the original state through causal inference to generate the model's forward inference. And combined with the predicted interaction volume generated after virtual intervention. The average causal effect of the target intervention label is calculated to quantify the effect improvement brought about by the strategy change.
[0184] When users issue targeted intervention tags When a virtual intervention instruction is given (e.g., changing the "joint IP" label from 0 to 1), the causal reasoning generative model executes the counterfactual intervention interface. Operation. Specifically, first in the model's encoder, the raw input representation... After processing by the encoding network, the mean of the initial latent variables is output. With variance The initial latent variables were obtained by sampling using the reparameterization technique. Then, in the causal layer of the model, based on the pre-defined structural causal model (SCM), the initial latent variables are... Decompose and separate the subspaces related to structured tags. and the corresponding subspaces of the rest Subsequently, SCM was used to... Perform causal intervention to generate new causal latent variables and with Merging yields counterfactual latent variables .
[0185] The counterfactual latent variable It is fed into the decoder to reconstruct the semantic embedding of the new text. And predict the corresponding interaction volume. Simultaneously, the hybrid semantic fidelity decoder embeds new text semantics. Semantic embedding of text corresponding to the original marketing copy The text is fused according to preset weight coefficients to generate a faithful semantic embedding, which is then input into the Qwen-3 decoder for autoregressive generation. During the decoding process, a beam search strategy (beam width of 5) is adopted, and semantic similarity constraints are introduced into the path scoring to ensure that the generated content retains the core semantics of the original text while maintaining linguistic fluency.
[0186] Finally, the system outputs optimized marketing copy corresponding to the virtual intervention commands. and its predicted interaction volume It allows users to evaluate the effectiveness of copy generated by different tag combinations without the need for actual ad placement, enabling efficient and explainable intelligent marketing decisions.
[0187] In training mode, by constructing do( Calculate causal loss using a virtual intervention operation with a value of 0). This enhances the model's ability to model the causal effects of labels; in inference mode, a set of target intervention labels can be selected to construct do( Calculate the predicted counterfactual campaign effect for a counterfactual scenario where the value is 0 / 1. Counterfactual copywriting Furthermore, the mean causal effect (ACE) corresponding to the virtual intervention operation (i.e. the target intervention label) is calculated to provide an interpretable basis for marketing copy optimization.
[0188] This application provides a marketing copy generation device, which includes: 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, which are executed by the at least one processor to enable the at least one processor to perform the marketing copy generation method in the first embodiment described above.
[0189] The following is for reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing the marketing copy generation device of the embodiments of this application. The marketing copy generation device in the embodiments of this application may include various hardware and software components for implementing the marketing copy generation method. Figure 5 The marketing copy generation device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0190] like Figure 5 As shown, the marketing copy generation device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the marketing copy generation device. The processing unit 1001, the ROM 1002, and the RAM 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 the I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, 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 marketing copy generation device to communicate wirelessly or wiredly with other devices to exchange data. While the figures show marketing copy generation devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0191] 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.
[0192] The marketing copy generation device provided in this application, employing the marketing copy generation method in the above embodiments, can solve the technical problem that tag-driven copy generation methods cannot predict the causal effect of tag combinations on interaction metrics before deployment. Compared with the prior art, the beneficial effects of the marketing copy generation device provided in this application are the same as those of the marketing copy generation method provided in the above embodiments, and other technical features in this marketing copy generation device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0193] 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.
[0194] 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.
[0195] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the marketing copy generation method in the above embodiments.
[0196] 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, 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 fiber, 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, 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.
[0197] The aforementioned computer-readable storage medium may be included in the marketing copy generation device; or it may exist independently and not assembled into the marketing copy generation device.
[0198] The aforementioned computer-readable storage medium carries one or more programs that, when executed by a marketing copy generation device, cause the marketing copy generation device to: acquire the original marketing copy to be optimized, structured tags, and environmental variable information; input the original marketing copy, the structured tags, and the environmental variable information into a trained causal reasoning generation model; respond to a user's virtual intervention instruction on at least one target intervention tag in the structured tags, perform counterfactual reasoning through the causal reasoning generation model to generate an optimized marketing copy corresponding to the virtual intervention instruction, and calculate the predicted interaction volume corresponding to the optimized marketing copy, wherein the virtual intervention instruction is used to instruct the state of the target intervention tag to be modified to a set value; and output the optimized marketing copy and the predicted interaction volume.
[0199] 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 user's computer, partially on the user's computer, as a standalone software package, partially on the user's 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 user's 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).
[0200] 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, may 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.
[0201] 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.
[0202] 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 executing the above-described marketing copy generation method. This solves the technical problem that tag-driven copy generation methods cannot predict the causal effect of tag combinations on interaction metrics before deployment. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the marketing copy generation method provided in the above embodiments, and will not be elaborated upon here.
[0203] This application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the marketing copy generation method described above.
[0204] The computer program product provided in this application can solve the technical problem that tag-driven copywriting generation methods cannot predict the causal effect of tag combinations on interaction metrics before campaign deployment. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the marketing copywriting generation method provided in the above embodiments, and will not be repeated here.
[0205] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent scope of this application.
[0206] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0207] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0208] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for generating marketing copy, characterized in that, The marketing copy generation method includes: Obtain the original marketing copy, structured tags, and environmental variable information to be optimized; The original marketing copy, the structured tags, and the environmental variable information are input into the trained causal reasoning generation model; In response to a user’s virtual intervention instruction on at least one target intervention tag in the structured tags, the causal reasoning generation model performs counterfactual reasoning to generate an optimized marketing copy corresponding to the virtual intervention instruction and calculates the predicted interaction volume corresponding to the optimized marketing copy. The virtual intervention instruction is used to indicate that the state of the target intervention tag be modified to a set value. Output the optimized marketing copy and the predicted interaction volume; The step of inputting the original marketing copy, the structured tags, and the environmental variable information into the trained causal reasoning generation model includes: The original marketing copy was segmented to obtain a sequence of word identifiers; Encode the word identifier sequence to obtain the text semantic embedding corresponding to the original marketing copy; The structured tags are one-hot encoded to generate tag vectors; The environmental variable information is encoded to generate an environmental encoding vector; The text semantic embedding, the label vector, and the environment encoding vector are concatenated to generate a joint input representation; The joint input representation is fed into the trained causal reasoning generation model; The steps of responding to a user's virtual intervention instruction on at least one target intervention tag in the structured tags, performing counterfactual reasoning through the causal reasoning generation model to generate optimized marketing copy corresponding to the virtual intervention instruction, and calculating the predicted interaction volume corresponding to the optimized marketing copy include: Obtain a joint input representation generated based on the original marketing copy, the structured tags, and the environmental variable information; The joint input representation is subjected to feature compression processing to generate initial latent variables; Based on the initial latent variables, and combined with the label state changes corresponding to the virtual intervention instructions, counterfactual latent variables are generated; The counterfactual latent variables are decoded to generate the optimized marketing copy corresponding to the virtual intervention instruction, and the predicted interaction volume corresponding to the optimized marketing copy is calculated.
2. The marketing copy generation method as described in claim 1, characterized in that, The step of generating counterfactual latent variables based on the initial latent variables and the label state changes corresponding to the virtual intervention instructions includes: Based on the virtual intervention instructions, determine the target intervention label to be intervened and the post-intervention status of the target intervention label; Based on the pre-defined causal dependencies between the structured tags, the causal impact path of the intervention of the target intervention tag on the initial latent variable is calculated. Based on the causal influence path, determine the sub-vectors corresponding to the target intervention label and other structured labels affected by the target intervention label in the initial latent variables; The inferred states of the post-intervention state and the affected labels are converted into corresponding label embedding vectors, and the label embedding vectors are written into the sub-vectors to obtain the counterfactual latent variables.
3. The marketing copy generation method as described in claim 1, characterized in that, The step of decoding the counterfactual latent variable to generate the optimized marketing copy corresponding to the virtual intervention instruction includes: Obtain the semantic embedding of the text generated based on the original marketing copy encoding; The counterfactual latent variable is decoded using the causal reasoning generation model to generate a new text semantic embedding corresponding to the virtual intervention instruction; According to the preset weight coefficients, the text semantic embedding and the new text semantic embedding are weighted and fused to obtain the faithful text semantic embedding; The fidelity text semantic embedding is subjected to autoregressive decoding to generate candidate text sequences; Calculate the semantic similarity between each candidate text sequence and the original marketing copy, and adjust the score of the autoregressive decoding path based on the semantic similarity. Based on the score of the constrained and adjusted autoregressive decoding path, the optimized marketing copy is determined using a bundle search strategy.
4. The marketing copy generation method as described in claim 1, characterized in that, The steps for calculating the predicted interaction volume corresponding to the optimized marketing copy include: The counterfactual latent variables are sampled multiple times to generate multiple sets of different counterfactual latent variable samples; Based on each set of counterfactual latent variable samples, corresponding interaction volume prediction values are generated through regression prediction processing to obtain multiple interaction volume prediction samples. Calculate the average value of the multiple interaction volume prediction samples, and use the average value as the predicted interaction volume corresponding to the optimized marketing copy.
5. The marketing copy generation method as described in claim 4, characterized in that, After the step of calculating the average value of the multiple interaction volume prediction samples and using the average value as the predicted interaction volume corresponding to the optimized marketing copy, the marketing copy generation method further includes: Based on the initial latent variables, obtain the baseline interaction volume prediction value corresponding to the original marketing copy when no virtual intervention is performed; Based on the predicted interaction volume and the baseline predicted interaction volume, calculate the average causal effect of the target intervention label corresponding to the virtual intervention instruction; The average causal effect is converted into a tag value score corresponding to the target intervention tag, and the average causal effect, the tag value score, the optimized marketing copy, and the predicted interaction volume are output together.
6. The marketing copy generation method as described in claim 1, characterized in that, Before the step of inputting the original marketing copy, the structured tags, and the environmental variable information into the trained causal reasoning generation model, the marketing copy generation method further includes: Obtain a training dataset, which includes multiple historical marketing samples. Each historical marketing sample includes historical marketing copy, corresponding historical structured tags, historical environmental variable information, and historical user interaction volume tags. The historical marketing copy, historical structured tags, and historical environmental variable information in each of the historical marketing samples are encoded to generate historical text semantic embedding, historical tag vector, and historical environment encoding vector; The semantic embeddings of each historical text, the corresponding historical tag vectors, and the environment encoding vectors are concatenated to obtain the training input representations corresponding to each historical marketing sample. Each of the training input representations and the corresponding historical user interaction volume labels are input into the causal inference generation model. A joint loss function is constructed using the interaction volume prediction error loss and the causal loss. The model parameters are iteratively updated through the backpropagation algorithm. When the value of the joint loss function converges to a preset threshold, or the number of iterations reaches a preset upper limit, the trained causal reasoning generation model is obtained.
7. A marketing copy generation device, characterized in that, The marketing copy generation device includes: 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 marketing copy generation method as described in any one of claims 1 to 6.
8. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the marketing copy generation method as described in any one of claims 1 to 6.