Interactive practice method and system based on counterfactual reasoning, electronic device and storage medium

CN122242726APending Publication Date: 2026-06-19SHANGHAI HAOYI INFORMATION SCI & TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI HAOYI INFORMATION SCI & TECH CO LTD
Filing Date
2026-03-10
Publication Date
2026-06-19

Smart Images

  • Figure CN122242726A_ABST
    Figure CN122242726A_ABST
Patent Text Reader

Abstract

This application discloses an interactive training method, system, electronic device, and storage medium based on counterfactual inference. The method includes: extracting candidate nodes from historical interaction data; calculating the average treatment effect of the candidate nodes as their causal effect using a propensity score matching model; and identifying candidate nodes with causal effects greater than a preset causal threshold as decision nodes; constructing a decision network containing decision nodes and causal effects based on the decision nodes; during training, acquiring the user's current decision path and performing real-time counterfactual inference to calculate the path causal effect of the current path, while simultaneously searching the decision network to determine the optimal decision path with the largest path causal effect; and finally, generating quantitative comparative feedback information based on the path causal effects of the current path and the optimal path. This application, by introducing counterfactual inference, provides scientific, timely, and quantifiable training guidance, improving the training effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to an interactive training method, system, electronic device, and storage medium based on counterfactual deduction. Background Technology

[0002] Interactive intelligent training systems have become important training tools in vocational training that requires interactive skills, such as sales and customer service. Existing technologies mainly fall into two categories: one is systems based on preset rules and scripts, whose interaction paths are fixed and difficult to cope with the complexity and variability of real-world scenarios; the other is end-to-end systems based on deep learning, which can learn from massive amounts of dialogue data and generate responses or provide scores, offering greater flexibility.

[0003] However, the aforementioned existing technologies still have inherent flaws. Whether rule-based or deep learning-based, their feedback mechanisms mostly focus on the "correlation" between user behavior and the final result, failing to effectively distinguish "causality." For example, the system cannot accurately determine whether a successful interaction is directly caused by the trainee's specific key behavior or influenced by confounding variables such as the customer's own purchasing intentions or the product's inherent advantages. This leads to training suggestions provided by the system potentially lacking scientific basis and even being misleading. Furthermore, existing coaching systems typically provide evaluations or scores after a user completes a full interaction, a "discriminatory" post-event review. Users cannot obtain real-time, quantitative comparative analysis such as "What if a different approach had been used?" The feedback is not intuitive enough, and the immediate guidance effect is limited. Simultaneously, many systems' knowledge models tend to become static once trained. When market environments, customer preferences, or effective communication techniques change, the models cannot automatically adapt, and their effectiveness diminishes over time. Summary of the Invention

[0004] The main purpose of this application is to provide an interactive training method, system, electronic device and storage medium based on counterfactual inference, which aims to solve the problems that existing intelligent training systems generally cannot accurately distinguish the real causal relationship between user behavior and training results, resulting in a lack of scientific feedback suggestions; at the same time, the feedback is usually lagging and non-quantitative, lacking real-time and comparable guidance, and the model is fixed and cannot be updated adaptively.

[0005] To achieve the above objectives, this application provides an interactive coaching method based on counterfactual inference, comprising: extracting candidate nodes from historical interaction data; calculating the average treatment effect of the candidate nodes as the causal effect of the candidate nodes using a propensity score matching model; and identifying candidate nodes whose causal effect is greater than a preset causal threshold as decision nodes; constructing a decision network containing the decision nodes and their causal effects based on the decision nodes; acquiring the user's interaction operation sequence up to the current moment during the interactive coaching process and identifying the interaction operation sequence as the current decision path; performing real-time counterfactual inference to determine the path causal effect of the current decision path, and determining the optimal decision path by searching for the decision path with the maximum path causal effect in the decision network; and generating comparative feedback information based on the path causal effect of the current decision path and the maximum path causal effect.

[0006] Optionally, constructing the decision network specifically includes: constructing a probabilistic decision state network, and determining the connection relationships between the decision nodes and the transition probabilities between the decision nodes based on the historical interaction data.

[0007] Optionally, the execution of real-time counterfactual inference specifically includes: calculating the sum of the causal effects of each decision node on the current decision path to determine the path causal effect of the current decision path; and determining the optimal decision path by searching for the decision path with the maximum path causal effect in the decision network, and determining the path causal effect corresponding to the optimal decision path; and / or, the generation of comparative feedback information includes: generating the comparative feedback information when the difference between the maximum path causal effect and the path causal effect of the current decision path exceeds a preset feedback threshold, the comparative feedback information including the difference and a description of the optimal decision path; and / or, the generation of comparative feedback information further includes: obtaining the current dialogue context; and invoking a large language model service to combine the optimal decision path with the current dialogue context to generate a specific demonstration script.

[0008] Optionally, the method further includes: dynamically updating the decision network based on newly acquired interaction data, wherein the dynamic update includes updating the causal effects of existing decision nodes and / or adding new decision nodes to the decision network.

[0009] This application also provides an interactive coaching system based on counterfactual inference, comprising: a mining module, used to extract candidate nodes from historical interaction data, calculate the average processing effect of the candidate nodes as the causal effect of the candidate nodes through a propensity score matching model, and determine the candidate nodes whose causal effect is greater than a preset causal threshold as decision nodes; a network construction module, used to construct a decision network containing the decision nodes and their causal effects based on the decision nodes; an inference module, used to obtain the user's interaction operation sequence up to the current moment as the current decision path during the interactive coaching process, and perform real-time counterfactual inference to determine the path causal effect of the current decision path, and to determine the optimal decision path by searching for the decision path with the maximum path causal effect in the decision network; and a feedback module, used to generate comparative feedback information based on the path causal effect of the current decision path and the maximum path causal effect.

[0010] Optionally, the network construction module is further configured to: construct a probabilistic decision state network, and determine the connection relationships between the decision nodes and the transition probabilities between the decision nodes based on the historical interaction data.

[0011] Optionally, the inference module is further configured to: calculate the sum of the causal effects of each decision node on the current decision path to determine the path causal effect of the current decision path; and determine the optimal decision path by searching for the decision path with the maximum path causal effect in the decision network, and determine the path causal effect corresponding to the optimal decision path; and / or, the feedback module is further configured to: generate the comparison feedback information when the difference between the maximum path causal effect and the path causal effect of the current decision path exceeds a preset feedback threshold, the comparison feedback information including the difference and a description of the optimal decision path; and / or, the feedback module is further configured to: obtain the current dialogue context; and call the large language model service to combine the optimal decision path with the current dialogue context to generate a specific demonstration script.

[0012] Optionally, the system further includes a dynamic update module, used to dynamically update the decision network based on newly acquired interaction data, wherein the dynamic update includes updating the causal effects of existing decision nodes and / or adding new decision nodes to the decision network.

[0013] This application also provides an electronic device, including: a processor; and a memory storing a computer program; wherein, when the computer program is executed by the processor, it implements any of the interactive coaching methods based on counterfactual reasoning as described above.

[0014] This application also provides a computer-readable storage medium, wherein when the computer program is executed, it implements any of the interactive coaching methods based on counterfactual deduction as described above.

[0015] Compared with the prior art, this application has the following beneficial effects:

[0016] 1. Effectively improves scientific rigor and accuracy: This application introduces a propensity score matching model to mine decision nodes that have a real causal impact on business indicators, and quantifies the causal impact to obtain the causal effect of the decision node. This reduces the negative impact of correlation and causality confusion caused by confounding variables in existing methods, and effectively improves the scientific rigor and accuracy of subsequent analysis and feedback suggestions.

[0017] 2. Significantly enhance immediacy and guidance: This application performs counterfactual reasoning in real time during the interaction process, quantifies and compares the difference between the path causal effect of the user's current decision path and the path causal effect of the optimal decision path, thereby providing users with immediate, intuitive, and quantifiable "What-if" feedback, transforming the post-event review of existing methods into "immediate guidance", significantly improving training efficiency and user acceptance;

[0018] 3. It achieves the structuring and interpretability of knowledge: This application makes implicit interactive knowledge explicit and structured by constructing a decision network, making effective decision-making patterns clear and interpretable, which is convenient for users to understand, reuse and transfer to different business scenarios;

[0019] 4. Possessing adaptive and evolutionary capabilities: By introducing an optional continuous dynamic update mechanism, this application enables the system to automatically learn based on new interactive data, update the causal effects of decision nodes, and discover new effective decision nodes. This allows the system to adapt to changes in the market environment and communication strategies, ensuring the long-term effectiveness of the system. Attached Figure Description

[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating the interactive coaching method based on counterfactual reasoning according to this application.

[0022] Figure 2 This is a schematic diagram of the structure of an interactive coaching system based on counterfactual reasoning according to an embodiment of this application.

[0023] Figure 3 This is a schematic diagram of the decision network structure according to an embodiment of this application.

[0024] Figure 4 This is an interactive timing diagram of the real-time counterfactual reasoning process according to an embodiment of this application.

[0025] Figure 5 This is a schematic diagram illustrating the working principle of the propensity score matching model according to an embodiment of this application.

[0026] Explanation of reference numerals in the attached figures:

[0027] 210: Data Access Layer; 220: Computation Engine Layer; 221: Mining Module; 222: Network Construction Module; 223: Inference Module; 224: Feedback Module; 225: Dynamic Update Module; 230: Interactive Terminal Layer; 301: First Decision Node; 302: Second Decision Node; 303: Third Decision Node; 401: User; 402: Tutoring System; 501: Original Sample; 502: Treatment Group; 503: Control Group; 504: Propensity Score Matching Model; 505: Matched Balanced Sample; 506: Matched Treatment Group; 507: Matched Control Group; 508: Calculate Average Treatment Effect. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0030] Before providing a further detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.

[0031] (1) Decision node: refers to a key behavior, event, or dialogue state node in the interaction process that has a significant causal impact on the final business indicators (such as conversion rate, customer satisfaction, etc.). In this application, it specifically refers to a candidate node that is defined as a decision node when the causal effect of the candidate node is greater than a preset causal threshold, calculated by a propensity score matching model. For example, in a sales dialogue, "proactively inquiring about the budget", "citing successful cases", and "handling price objections" can all be candidate nodes.

[0032] (2) Causal effect: This refers to the quantitative value used to characterize the causal impact of a decision node on preset business indicators. This quantitative value (causal effect) is calculated through a propensity score matching model, aiming to eliminate the interference of various confounding variables (such as salesperson experience, customer's inherent purchasing intention, etc.) and reflect the net impact of the decision node's behavior itself on the final result. Generally, a positive value indicates a positive impact, and a negative value indicates a negative impact.

[0033] (3) Decision network: refers to a structured model used to describe the relationship between decision nodes. In a specific embodiment of this application, it can be a probabilistic decision state network, which takes decision nodes as state nodes and not only associates the causal effect of each decision node with the decision node, but also includes the connection relationship between decision nodes and the transition probability between decision nodes based on the statistics of historical interaction data.

[0034] (4) Path causal effect: refers to the quantitative value of the cumulative causal impact of a decision path (i.e., an ordered sequence containing at least one decision node) on the final business indicator. In a simple implementation, it can be calculated as the sum of the causal effects of all decision nodes on the decision path, thereby quantifying the causal impact of the entire interaction strategy.

[0035] (5) Counterfactual reasoning: refers to a reasoning process used to explore what different results might occur if an action different from the facts (i.e., "counterfactual") were taken under given conditions. In this application, it specifically refers to calculating the path causality effect of the user's current decision path in real time during the interaction process, and comparing it with the theoretically existing optimal decision path with the greatest path causality effect, thereby answering the key question, "What would have been different if another approach had been taken?"

[0036] (6) Propensity Score Matching (PSM): This is a statistical method widely used in observational studies and belongs to the category of causal inference models. It calculates a "propensity score" (i.e., the probability of receiving a certain intervention or treatment) for each research subject, and then finds at least one subject with a similar propensity score in the control group for each subject in the treatment group. This makes the two groups balanced on various observable confounding variables, simulating the effect of a randomized controlled experiment, and thus more accurately estimating the true causal effect of the intervention.

[0037] The interactive training method, system, electronic device, and storage medium based on counterfactual deduction provided in this application will be described in detail below with reference to the accompanying drawings. It should be noted that although the following description uses different emphases in the implementation methods, the technical features in these implementation methods can be combined as needed to form more implementation methods that can be understood by those skilled in the art.

[0038] Reference Figure 1 This diagram illustrates a flowchart of an interactive coaching method based on counterfactual reasoning provided in this application. This method aims to address the problems of unscientific, untimely, and unintuitive feedback in existing coaching systems. The entire process can be divided into two stages: offline construction and online application. The offline stage mainly includes step S101, "mining decision nodes," and step S102, "constructing a decision network." The online application stage, i.e., during the interactive coaching process, mainly includes step S103, "obtaining the current decision path," step S104, "performing real-time counterfactual reasoning," and step S105, "generating comparative feedback information." Furthermore, the interactive coaching method based on counterfactual reasoning of this application may also include the optional step S106, "dynamically updating the decision network."

[0039] The interactive coaching method based on counterfactual deduction proposed in this application (hereinafter referred to as the "method") mainly includes:

[0040] Step S101: Mining Decision Nodes; Extracting candidate nodes from historical interaction data, and using a propensity score matching model to calculate the average treatment effect of the candidate nodes as their causal effect, and identifying candidate nodes whose causal effect is greater than a preset causal threshold as decision nodes; By performing structured analysis on historical interaction data, identifying key moments in the dialogue process where state transitions significantly diverge, and determining them as decision nodes, this solves the problems of blurred focus and low computational efficiency caused by uniform analysis of long interaction sequences. By focusing on the decision nodes that affect the probability distribution of the final result, a set of key states is provided for building a more accurate decision model, effectively improving the accuracy of the analysis; Using the average treatment effect (ATE) calculated by the propensity score matching model as the causal effect, by matching the treatment group samples with control group samples with similar background characteristics, an approximate randomized controlled trial is simulated in the observational data, thereby obtaining a more unbiased and robust estimate of the average treatment effect. At the same time, it also fundamentally ensures that the selection of decision nodes is based on the causal relationship between the behavioral pattern represented by the decision node and the business results, rather than statistical correlation, effectively filtering out false behavioral patterns caused by confounding variables. By using a preset causal threshold for screening, it is ensured that all the decision nodes discovered have statistically and practically significant positive effects, thereby improving the overall purity and effectiveness of the further constructed decision network.

[0041] Step S102: Construct a decision network; Based on the decision nodes, construct a decision network that includes the decision nodes and their causal effects; The decision network forms a structured decision process model from discrete decision nodes through connection relationships, and embeds the causal effects of each decision node as a core attribute into the decision network. On the one hand, this realizes the visualization and structured storage of the interaction process and decision results; on the other hand, it provides an objective and credible weight basis for subsequent counterfactual inference through quantified causal effects.

[0042] Step S103: Obtain the current decision path; During the interactive coaching process, obtain the user's interaction operation sequence up to the current moment, and determine the interaction operation sequence as the current decision path; By parsing the interaction operations in real time and mapping them to the decision path in the decision network, the specific state node and historical path of the user in the decision network are dynamically located, providing more accurate initial conditions and environmental context for personalized counterfactual inference, and realizing online serialization and state tracking of user behavior;

[0043] Step S104: Perform real-time counterfactual inference; perform real-time counterfactual inference to determine the path causal effect of the current decision path, and determine the optimal decision path by searching for the decision path with the largest path causal effect in the decision network; based on the path causal effect obtained by quantitative calculation of the causal impact on the entire decision path, quantitative analysis of the user's real-time performance is realized. At the same time, based on the quantitative results, the optimal decision path can be mined from the decision network, which solves the problem that the existing coaching system lacks quantitative comparison of unselected strategies, and realizes strategy recommendation based on the optimal decision path;

[0044] Step S105: Generate comparative feedback information; Based on the path causal effect of the current decision path and the maximum path causal effect, generate comparative feedback information; By quantifying the difference between the causal influence of the current decision path and the causal influence of the optimal decision path, generate feedback information that is clearly targeted and has quantitative basis, which significantly enhances the operability, comprehensibility and persuasiveness of the feedback information, thereby improving the effect of training intervention.

[0045] Based on steps S101 to S105 above, the interactive training method based on counterfactual inference of this application constructs an interactive training method based on data-driven and causal reasoning. By deconstructing historical interaction data, establishing a decision network based on causal effects, and performing counterfactual inference in real-time interaction, it realizes an active interactive training method based on causal effect decision network and dynamic decision path optimization.

[0046] Furthermore, in an optional embodiment of this application, the interactive coaching method based on counterfactual inference further includes step S106, "dynamically updating the decision network," which specifically involves: dynamically updating the decision network based on newly acquired interactive data. This dynamic update includes updating the causal effects of existing decision nodes and / or adding new decision nodes to the decision network. Based on this, the automatic evolution and continuous learning of the decision network are achieved. On the one hand, "updating the causal effects of existing decision nodes" allows for tracking the dynamic changes in the effectiveness of decision nodes, thereby adjusting the weights of decision nodes in a timely manner. This ensures that the causal effects of the decision nodes are relatively accurate, preventing the degradation of the decision network due to the solidification of decision nodes and causal effects. This provides users with a more accurate optimal decision path during counterfactual inference, thus achieving the automatic evolution of the decision network. On the other hand, "adding new decision nodes" enables the decision network to continuously discover new successful decision nodes from newly acquired interactive data and add them to the decision network, achieving continuous learning of the decision network. Therefore, the decision network can maintain its effectiveness and practicality over a long period.

[0047] In the following feasible embodiments, any one of them may be executed, any few of them may be executed, or all of them may be executed simultaneously:

[0048] (1) The construction of the decision network in step S102 specifically includes: constructing a probabilistic decision state network, and determining the connection relationship between the decision nodes and the transition probability between the decision nodes based on the historical interaction data; increasing the connection relationship between the decision nodes, upgrading the discrete decision nodes into a simulable decision process, so that the probabilistic decision state network becomes a dynamic, computable, and inference model that can characterize the logic and consequences of state transition; increasing the transition probability between decision nodes quantifies the likelihood of state transition, so that the probabilistic decision state network can characterize the likelihood of transitioning to each subsequent state after taking different actions in a given state; this greatly enhances the ability to characterize randomness and uncertainty in the interaction process, making the inference based on the probabilistic decision state network closer to the probabilistic nature of the real world, and improving the authenticity of the counterfactual inference results;

[0049] (2) In step S104, the execution of real-time counterfactual inference specifically includes: calculating the sum of the causal effects of each decision node on the current decision path to determine the path causal effect of the current decision path; and determining the optimal decision path by searching for the path with the largest path causal effect in the decision network, and determining the path causal effect corresponding to the optimal decision path; clarifying the benefits of the overall causal impact of the entire decision path, thereby intuitively evaluating the current decision path, and selecting the optimal decision path from the decision network based on the global optimization strategy recommendation mechanism, ensuring the determinism of the calculation process and the reproducibility of the results;

[0050] (3) In step S105, generating comparative feedback information includes: generating comparative feedback information when the difference between the maximum path causal effect and the path causal effect of the current decision path exceeds a preset feedback threshold. The comparative feedback information includes the difference and a description of the optimal decision path. By setting a preset feedback threshold, quantitative management of intervention conditions is achieved, avoiding user interference from the optimal decision path whose difference does not exceed the preset feedback threshold, thus preventing feedback overload and optimizing the human-computer interaction experience. At the same time, the comparative feedback information, which includes the difference and a description of the optimal decision path, ensures that the feedback information has both the accuracy of quantitative assessment and the clarity of qualitative guidance, enabling trainees to clearly understand the benefits of improvement and the specific methods that can be implemented.

[0051] (4) In step S105, generating comparative feedback information further includes: obtaining the current dialogue context; and calling the large language model service to combine the optimal decision path with the current dialogue context to generate a specific demonstration speech; this further enhances the contextual adaptability and operability of the comparative feedback information. At the same time, by calling the large language model service, the abstract and structured optimal path strategy is adapted in real time and generated into example sentences that conform to the current specific dialogue context and have a natural language style, making it easier for students to understand, reducing the difficulty of learning transfer, and effectively improving the implementation effect and training efficiency of the coaching.

[0052] To implement the above method, this application also provides an interactive training system based on counterfactual reasoning (hereinafter referred to as the "System"), used to implement the various implementation methods and embodiments of the method described above. (Refer to...) Figure 2 The system of this application mainly includes a computing engine layer 220, which receives data collected and output by the data access layer 210 as its input and outputs the processed data to the interactive terminal layer 230. The data access layer 210 is responsible for acquiring historical and real-time interactive data from various sources (such as customer relationship management systems, call recordings, online chat logs, etc.). The interactive terminal layer 230 can be the interface for users (trainees) to interact with the system, such as a chat window, a simulated call application, or a virtual reality (VR) interactive environment. The computing engine layer 220 of this system includes a mining module 221, used for executing... Figure 1 The system comprises the following steps: S101 "mining decision nodes"; network construction module 222, used to execute step S102 "building a decision network"; inference module 223, used to execute step S103 "obtaining the current decision path" and step S104 "performing real-time counterfactual inference" in real-time interaction; feedback module 224, used to execute step S105 "generating comparative feedback information"; and an optional dynamic update module 225, used to execute step S106 "dynamically updating the decision network". The data access layer 210 provides data input to the mining module 221 and the dynamic update module 225. The output results of the mining module 221 and the dynamic update module 225 are used by the network construction module 222 to build or update the decision network. The inference module 223 and the feedback module 224, based on this decision network, exchange data in real-time with the interactive terminal layer 230, completing the closed loop of training and feedback.

[0053] To illustrate the working process of this application more specifically, the following example uses a scenario where a new salesperson, Xiao Wang, uses the interactive coaching system based on counterfactual inference to conduct a product sales dialogue. In this scenario, a decision network containing key sales behaviors (i.e., decision nodes) and their causal effects and transition probabilities has been pre-constructed by the mining module 221 and the network construction module 222. Figure 3 As shown, the probabilistic decision state network contains multiple decision nodes, such as the first decision node 301, the second decision node 302, and the third decision node 303. Each decision node is associated with a quantified causal effect. Two decision nodes are connected by an edge with a transition probability, which represents the possibility of transitioning from one state to another.

[0054] like Figure 4 As shown, during the coaching session, Xiao Wang (corresponding to user 401) engages in dialogue with a simulated customer through the interactive terminal layer 230. When the simulated customer states, "Your software costs 50,000 yuan per year, which is too expensive!", the inference module 223 of the coaching system 402 (i.e., the system of this application) uses natural language understanding technology to identify the current dialogue state in real time and maps it to a decision node in the decision network, for example... Figure 3 The "First Decision Node 301" represents the critical scenario of "handling price objections." At this point, the system records that Xiao Wang has entered the First Decision Node 301.

[0055] Xiao Wang then responded, "Yes, but our functions are more comprehensive." The inference module 223 analyzes this response and determines that the action leads the dialogue to another node in the decision network, such as "third decision node 303," which represents "ineffective communication." The causal effect of third decision node 303 may be a negative value (e.g., -0.05). The system then determines Xiao Wang's current decision path as "301->303" and calculates the path causal effect of this current decision path as -0.05.

[0056] The key is that while calculating the causal effect of the current path, the inference module 223 performs real-time counterfactual inference. Specifically, starting from the current "first decision node 301", the system quickly searches for all possible subsequent decision paths in the decision network. For example, the system discovers another decision path, starting from the first decision node 301, leading to the "second decision node 302", which represents "completing functional confirmation and reshaping value". The causal effect of the second decision node 302 is positive, for example, +0.15. By traversing or using an optimization algorithm (such as the A* algorithm, i.e., the A-star algorithm), the system searches the decision network and finds that this decision path to the second decision node 302 is the decision path with the largest path causal effect among all decision paths starting from the first decision node 301. Therefore, the system determines the path "301->302" as the optimal decision path in the current situation, with a path causal effect of +0.15.

[0057] Next, the system enters the feedback generation stage. Feedback module 224 compares the path causality effect of the optimal decision path (+0.15) with the path causality effect of the current decision path (-0.05), calculating a difference of 0.20. The system internally presets a feedback threshold, for example, 0.1. Since the calculated difference of 0.20 exceeds this preset feedback threshold, the system determines that immediate feedback needs to be provided to the user. The timing of this interaction process is shown in the attached figure. Figure 4 As shown, after receiving a user's operation, the system internally performs a deduction and generates comparative feedback information when the condition is met (the difference in the path causal effect is greater than the preset feedback threshold). This comparative feedback information is presented to Xiao Wang through the interactive terminal layer 230, which may be a pop-up window, a highlighted prompt, or a voice broadcast. The content may be, for example, "Identified room for improvement! The expected order contribution of the current choice differs from that of the optimal choice by 20%. Optimal strategy suggestion: Acknowledge the price perception and immediately reshape the product value."

[0058] In this way, user Xiao Wang can immediately and clearly see the quantitative gap between his current choice and the optimal choice in terms of expected results, and clarify the specific direction for improvement (acknowledging the price first, then reshaping the value), instead of receiving a vague score only after the entire conversation ends. This quantitative comparative feedback based on counterfactual reasoning transforms the existing technology's "post-event review" into efficient "on-site learning" and "instant correction," greatly improving the training effect.

[0059] In the above embodiments, the mining of decision nodes and the calculation of their causal effects are the foundation for obtaining reliable comparative feedback information. To avoid these two elements misjudging "correlation" as "causation," the mining module 221 employs a propensity score matching (PSM) model.

[0060] Reference Figure 5 This process aims to calculate the causal effect of a candidate node (such as "referencing a success story"). First, the data mining module 221 obtains a large amount of historical interaction data from the data access layer 210, forming the initial sample 501. For the candidate node "referencing a success story," the system divides all historical interaction sessions into two groups: a "processing group 502" that executed the decision node and a "control group 503" that did not. However, these two groups of samples may have inherent differences in many aspects, i.e., confounding variables exist. For example, experienced salespeople are more likely to refute success stories, and their closing rate is inherently higher. Without control, the effect of the behavior of "referencing a success story" itself may be overestimated.

[0061] To address this issue, a propensity score matching model 504 is introduced. This model first calculates a propensity score for each interaction in the original sample 501 based on a series of observable covariates (e.g., salesperson's grade, seniority, customer source, industry, budget range, and current stage of the conversation). This propensity score represents the probability of the candidate behavior "citing a success story" occurring in that session. Then, the propensity score matching model 504 performs a matching operation: for each session in the treatment group 502, it finds at least one session in the control group 503 that has the closest propensity score for pairing. Through this matching, a balanced sample 505 is ultimately formed, containing the matched treatment group 506 and the matched control group 507. Theoretically, in this balanced sample, the two groups become very similar in all distributions of the included covariates except for the candidate node of "citing a success story," effectively controlling for the interference of these confounding variables.

[0062] Finally, the mining module 221 compares the average difference between the matched treatment group 506 and the matched control group 507 in the final business indicators (such as the conversion rate) on the matched equilibrium sample 505. The quantified value of this average difference is the average treatment effect (ATE) 508 of this behavior. For example, the calculated ATE is +0.08. The mining module 221 will use this ATE value as the causal effect of the candidate node "referencing successful cases". If the value is greater than the preset causal threshold (e.g., 0.05), the candidate node is officially confirmed as a decision node, and its information (node ​​identifier, causal effect +0.08, etc.) will be sent to the network construction module 222 for building or updating the decision network. Through a rigorous propensity score matching model, it is ensured that the suggestions provided by the entire system are based on real causal relationships rather than spurious correlations, thus improving the scientificity and reliability of the comparative feedback information.

[0063] In a preferred embodiment, the feedback module 224 can incorporate Large Language Model (LLM) technology in the process of generating comparative feedback information to transform abstract strategy guidance into concrete and vivid demonstration scripts.

[0064] Following the scenario of the first embodiment, when the system calculates that the difference in causal effect between the current path and the optimal path is 0.20, exceeding the preset feedback threshold and deciding to generate comparative feedback information, the feedback module 224 does not simply display strategic text such as "Optimal path: Acknowledge price -> Reshape value" to the user. Instead, it first executes an intelligent processing flow. First, the feedback module 224 dynamically constructs a structured prompt. This prompt is designed to leverage the capabilities of a large language model. For example, the prompt may include the following parts:

[0065] 1. Current dialogue context: The customer's original words: "Your software costs 50,000 yuan a year, which is too expensive!"

[0066] 2. Current User Action: The user's response: "Yes, but our features are more comprehensive."

[0067] 3. Optimal Strategy: The optimal decision node sequence deduced by the system: "Price objection -> Price acceptance -> Value reshaping".

[0068] 4. Role & Task Instruction: "You are a senior sales consultant with ten years of experience. Based on the above information, please generate a response that can both soothe the customer's sensitivity to price and skillfully shift the focus of the conversation to the core value of the product. The tone should be professional, confident, and empathetic."

[0069] Furthermore, the process of constructing this prompt can be further refined. For example, based on the natural language understanding module's judgment of the customer's emotions (such as recognizing "anger" or "hesitation" in the customer's tone), the task instructions can be dynamically adjusted, requiring the large language model to generate different styles of dialogue. If the customer shows anger, the instruction could be "Generate a message that first expresses understanding and apologizes, then..."; if the customer shows hesitation, the instruction could be "Generate a message that guides the customer's thinking through questions, then...".

[0070] After the prompt is constructed, the feedback module 224 calls an external or built-in large language model service through an Application Programming Interface (API). Upon receiving this structured prompt, the large language model generates a sample dialogue that fits the scenario and flows fluently. For example, the feedback module 224 might generate: "Mr. Wang, I completely understand that you feel the annual fee of 50,000 yuan sounds high. If we only look at the price, there are indeed cheaper options on the market. However, this solution aims to illustrate the value behind the investment. For example, part of the cost of the solution can be used to ensure a high data online rate (e.g., 99.99%) and 24 / 7 technical support, which effectively avoids the risk of business interruption due to system problems. For a business of your size, isn't this long-term stability guarantee a more important consideration?"

[0071] Finally, the feedback module 224 presents this message generated by the large language model, along with the previously calculated quantitative difference ("expected order contribution increase of 20%), to the user through the interactive terminal layer 230. This approach transforms the abstract strategic suggestion ("reshaping value") into concrete language that users can immediately imitate and learn, greatly reducing the user's cognitive burden and learning threshold, achieving concrete teaching effects, and improving the efficiency of user skill mastery and the training experience.

[0072] Furthermore, any effective interaction strategy may change with shifts in market conditions, customer preferences, or product strategies. To ensure the coaching system can adapt to these changes and maintain the long-term effectiveness of its guidance, this application also provides a dynamic update mechanism. In a preferred embodiment, such as... Figure 2 The dynamically updated module 225 shown periodically maintains and evolves the decision network, a process corresponding to... Figure 1 The optional step in the process dynamically updates the decision network S106.

[0073] This dynamic update process typically runs in batch mode during periods of low system load (e.g., at night). Its core tasks are twofold: updating existing decision nodes and identifying new decision nodes. First, the dynamic update module 225 uses newly acquired interaction data from the data access layer 210 within a sliding time window (e.g., the most recent month) to recalculate and calibrate the causal effects of all existing decision nodes and the transition probabilities between them in the decision network. For example, the system might find that as a competitor lowers its price, the causal effect of the decision node "cite Case A" decreases from +0.1 to +0.02; while simultaneously, the causal effect of the decision node "emphasize service advantages" increases. The system automatically adjusts these causal effects in the decision network to ensure they reflect the latest market dynamics.

[0074] Furthermore, the dynamic update module 225 is also responsible for identifying new decision nodes not yet included in the decision network. This can be achieved by first filtering out interaction cases deemed "successful" (e.g., closing a deal), but whose complete decision path, calculated using the existing decision network, has a total causal effect far below a preset success threshold. These anomalous interaction samples, where "theory and reality don't match," indicate that the success was driven by at least one new strategy or behavioral combination not yet included in the decision network. The dynamic update module 225 performs focused "anomalous attribution" analysis on these anomalous samples. For example, clustering algorithms can be used to group these anomalous samples based on their textual features or behavioral sequences. Then, for each group, the propensity score matching model described in the preferred embodiment is run again to attempt to identify new behavioral nodes with high causal effects. For example, the system might discover a new "bundled sales" sales pitch combination with an ATE value of +0.2 from a set of anomalous samples.

[0075] Once a new behavioral node is discovered, the dynamic update module 225 adds this behavioral node and its information (node ​​identifier, causal effect, etc.) to the decision network maintained by the network construction module 222, making it a new decision node. It then calculates the transition probability between this new decision node and other decision nodes based on the data. Through this continuous "updating" and "mining," the decision network of the system in this application is ensured to self-improve and iterate, automatically eliminating outdated strategies and automatically discovering and determining new effective strategies based on actual interaction data. This makes the system described in this application a dynamic system with adaptive and evolutionary capabilities.

[0076] Embodiments of this application also provide an electronic device, which may be a server, a personal computer (PC), a tablet computer, a smartphone, etc. The electronic device includes at least one processor and a memory communicatively connected to the processor. The memory stores a computer program that, when executed by the processor, can implement any of the aforementioned interactive training methods based on counterfactual deduction. For example, the processor can execute instructions to invoke the functions of the mining module 221, the network construction module 222, the deduction module 223, the feedback module 224, and the dynamic update module 225, process data from the data access layer 210, and present the results on the interactive terminal layer 230. The processor may be a central processing unit (CPU), a graphics processing unit (GPU), or an application-specific integrated circuit (ASIC), etc., and the memory may be random access memory (RAM), read-only memory (ROM), a solid-state drive (SSD), or a hard disk drive (HDD), etc.

[0077] Embodiments of this application also provide a computer-readable storage medium on which a computer program is stored. The computer-readable storage medium may be non-volatile, such as a compact disc (CD), a digital versatile disc (DVD), a USB flash drive, a portable hard drive, a solid-state drive (SSD), or a read-only memory (ROM). When the computer program stored thereon is executed by a processor, it can implement any of the aforementioned interactive training methods based on counterfactual reasoning.

[0078] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. An interactive coaching method based on counterfactual reasoning, characterized in that, include: Candidate nodes are extracted from historical interaction data. The average treatment effect of the candidate node is calculated using a propensity score matching model as the causal effect of the candidate node. Candidate nodes with causal effects greater than a preset causal threshold are identified as decision nodes. Based on the decision nodes, a decision network is constructed that includes the decision nodes and their causal effects; During interactive coaching, the user's interaction sequence up to the current moment is obtained, and the interaction sequence is determined as the current decision path; Perform real-time counterfactual reasoning to determine the path causality of the current decision path, and determine the optimal decision path by searching for the decision path with the maximum path causality in the decision network; Based on the path causality effect of the current decision path and the maximum path causality effect, comparative feedback information is generated.

2. The method according to claim 1, characterized in that, The construction of the decision network specifically includes: constructing a probabilistic decision state network, and determining the connection relationships between the decision nodes and the transition probabilities between the decision nodes based on the historical interaction data.

3. The method according to claim 1, characterized in that, The execution of real-time counterfactual inference specifically includes: calculating the sum of the causal effects of each decision node on the current decision path to determine the path causal effect of the current decision path; and determining the optimal decision path by searching for the decision path with the maximum path causal effect in the decision network, and determining the path causal effect corresponding to the optimal decision path; and / or, The generation of comparative feedback information includes: generating the comparative feedback information when the difference between the maximum path causality effect and the path causality effect of the current decision path exceeds a preset feedback threshold; the comparative feedback information includes the difference and a description of the optimal decision path; and / or, The generation of comparative feedback information also includes: obtaining the current dialogue context; and calling the large language model service to combine the optimal decision path with the current dialogue context to generate a specific demonstration script.

4. The method according to any one of claims 1 to 3, characterized in that, Also includes: Based on the newly acquired interaction data, the decision network is dynamically updated. The dynamic update includes updating the causal effects of existing decision nodes and / or adding new decision nodes to the decision network.

5. An interactive coaching system based on counterfactual reasoning, characterized in that, include: The mining module is used to extract candidate nodes from historical interaction data. Through a propensity score matching model, the average treatment effect of the candidate node is calculated as the causal effect of the candidate node, and the candidate node with the causal effect greater than the preset causal threshold is determined as the decision node. A network construction module is used to construct a decision network based on the decision nodes, including the decision nodes and the causal effects of the decision nodes; The deduction module is used to obtain the user's interactive operation sequence up to the current moment as the current decision path during interactive coaching, and to perform real-time counterfactual deduction to determine the path causal effect of the current decision path, and to determine the optimal decision path by searching for the decision path with the maximum path causal effect in the decision network. The feedback module is used to generate comparative feedback information based on the path causality effect of the current decision path and the maximum path causality effect.

6. The system according to claim 5, characterized in that, The network construction module is also used to: construct a probabilistic decision state network, and determine the connection relationship between the decision nodes and the transition probability between the decision nodes based on the historical interaction data.

7. The system according to claim 5, characterized in that, The inference module is further configured to: calculate the sum of the causal effects of each decision node on the current decision path to determine the path causal effect of the current decision path; and determine the optimal decision path by searching for the decision path with the maximum path causal effect in the decision network, and determine the path causal effect corresponding to the optimal decision path; and / or, The feedback module is further configured to: generate the comparison feedback information when the difference between the maximum path causality effect and the path causality effect of the current decision path exceeds a preset feedback threshold; the comparison feedback information includes the difference and a description of the optimal decision path; and / or, The feedback module is also used to: obtain the current dialogue context; and call the large language model service to combine the optimal decision path with the current dialogue context to generate a specific demonstration script.

8. The system according to any one of claims 5 to 7, characterized in that, Also includes: The dynamic update module is used to dynamically update the decision network based on newly acquired interaction data. The dynamic update includes updating the causal effects of existing decision nodes and / or adding new decision nodes to the decision network.

9. An electronic device, characterized in that, include: processor; And a memory, wherein a computer program is stored in the memory; wherein, when the computer program is executed by the processor, it implements the interactive training method based on counterfactual deduction as described in any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the interactive training method based on counterfactual deduction as described in any one of claims 1 to 4.