Task variable causal graph construction method and device, equipment and medium

By combining the large language model and Monte Carlo tree search method, using prior knowledge and data independence tests, the causal graph of task variables is constructed, which solves the problem of the accuracy of the existing causal graph and the poor effect of downstream tasks, and significantly improves the causal graph quality and application effect.

CN118964636APending Publication Date: 2024-11-15HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411146591.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing causal graph establishment method relies on data-driven, resulting in low accuracy of causal graphs and poor results in downstream tasks. Especially the method based on independence test has the problem that the conditional independence test results do not conform to the actual relationship. The methods of large language models lack data utilization and output uncertainty.

Method used

The task variable causal graph construction method is used, combined with the large language model and Monte Carlo tree search method, and the best causal graph is determined through prior knowledge and data independence tests, improving the accuracy of the causal graph and the effect of downstream tasks.

Benefits of technology

Through Monte Carlo tree search, the causal graph construction process is optimized, and the knowledge of the large language model and data analysis feedback are used to significantly improve the quality of the causal graph and the effect of downstream tasks, and solve the problem of the accuracy and poor results of the causal graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964636A_ABST
    Figure CN118964636A_ABST
Patent Text Reader

Abstract

The invention discloses a task variable causal graph construction method and device, equipment and a medium, and relates to the field of causal discovery, and the method comprises the steps: obtaining a variable set and application task information corresponding to a target application task; the variable set comprises a plurality of variables; the application task information comprises target application task background information and variable information; determining prior knowledge according to the variable set corresponding to the target application task and the application task information by utilizing a large language model; utilizing a Monte Carlo tree search method to determine an optimal causal graph according to priori knowledge and data independence test; nodes in the optimal causal graph are in one-to-one correspondence with variables in the variable set, and edges in the optimal causal graph represent a causal relationship between the variables corresponding to the two connected nodes; the optimal cause-and-effect graph is used for root cause analysis of the downstream task. The accuracy of the cause-and-effect graph and the effect of the downstream task are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of causal discovery, and in particular to a method, device, equipment and medium for constructing a task variable causal graph. Background Art

[0002] When establishing a causal graph between variables, most of the existing causal discovery methods are data-driven, and the causal relationship between variables is inferred from the data through data analysis and mathematical models. Commonly used methods include methods based on independence tests and methods based on large language models. However, methods based on independence tests, such as the PC algorithm, determine whether there is a causal relationship between variables by testing the conditional independence between variables, and then analyze the causal graph structure to determine the direction of the causal relationship between variables. The problem is that the results of the conditional independence test may not be consistent with the relationship between the actual variables, and not all causal relationship directions can be determined. The method based on the large language model uses the knowledge of the large language model to let the large language model determine the causal relationship between variables. The problem is that the large language model only uses the knowledge input during training, not the data, and the output of the large language model is uncertain and may not give the correct answer.

[0003] Therefore, existing causal graph establishment methods face the following two challenges: 1. The causal graph obtained by using only knowledge or only mathematical analysis methods is not accurate enough; 2. The obtained causal graph is not effective when used in downstream tasks (such as root cause analysis). Summary of the invention

[0004] The purpose of this application is to provide a method, device, equipment and medium for constructing a task variable causal graph, which can improve the accuracy of the causal graph and the effect of downstream tasks.

[0005] To achieve the above objectives, this application provides the following solutions:

[0006] In a first aspect, the present application provides a method for constructing a task variable causal graph, comprising:

[0007] Obtaining a variable set and application task information corresponding to a target application task; the variable set includes a number of variables; the application task information includes target application task background information and variable information;

[0008] Using a large language model, determine prior knowledge based on the variable set corresponding to the target application task and the application task information; prior knowledge includes the causal relationship between two variables in the variable set;

[0009] The Monte Carlo tree search method is used to determine the optimal causal graph based on prior knowledge and data independence test; the nodes in the optimal causal graph correspond one-to-one to the variables in the variable set, and the edges in the optimal causal graph represent the causal relationship between the variables corresponding to the two connected nodes; the optimal causal graph is used for root cause analysis of downstream tasks.

[0010] In a second aspect, the present application provides a task variable causal graph construction device, comprising:

[0011] The information acquisition module is used to: acquire a variable set and application task information corresponding to a target application task; the variable set includes a number of variables; the application task information includes target application task background information and variable information;

[0012] The prior knowledge determination module is used to: determine the prior knowledge based on the variable set and application task information corresponding to the target application task using the large language model; the prior knowledge includes the causal relationship between two variables in the variable set;

[0013] The optimal causal graph determination module is used to: use the Monte Carlo tree search method to determine the optimal causal graph based on prior knowledge and data independence test; the nodes in the optimal causal graph correspond one-to-one to the variables in the variable set, and the edges in the optimal causal graph represent the causal relationship between the variables corresponding to the two connected nodes; the optimal causal graph is used for root cause analysis of downstream tasks.

[0014] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned task variable causal graph construction method.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned task variable causal graph construction method.

[0016] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0017] The present application provides a method, apparatus, device and medium for constructing a task variable causal graph, which searches the causal graph through a Monte Carlo tree, utilizes the knowledge of a large language model, and performs pruning and optimization based on the graph structure and data-based variable independence test to accelerate the search process, uses data analysis to feed back search results, improves the quality of the causal graph, and thus improves the effect of downstream tasks, solving the problem that the existing causal discovery method relies on data-driven, resulting in low accuracy of the causal graph and poor effect of downstream tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 This is an application environment diagram of a method for constructing a task variable causal graph in one embodiment of the present application;

[0020] Figure 2 A flowchart of a method for constructing a task variable causal graph provided in one embodiment of the present application;

[0021] Figure 3 A schematic diagram of the principle of constructing prior knowledge provided in an embodiment of the present application;

[0022] Figure 4 A schematic diagram of a Monte Carlo tree search method flow chart provided in another embodiment of the present application;

[0023] Figure 5 A schematic diagram of functional modules of a task variable causal graph construction device provided in one embodiment of the present application;

[0024] Figure 6 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0026] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0027] The task variable causal graph construction method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, integrated on the server 104, or placed on the cloud or other servers. The terminal 102 can send the variable set and application task information corresponding to the target application task to the server 104. After the server 104 receives the variable set and application task information corresponding to the target application task, for the variable set and application task information corresponding to the target application task, the server 104 uses a large language model to determine the prior knowledge based on the variable set and application task information corresponding to the target application task, and uses the Monte Carlo tree search method to determine the optimal causal graph based on the prior knowledge and data independence test. The server 104 can feedback the obtained optimal causal graph for the target application task to the terminal 102. In addition, in some embodiments, the task variable causal graph construction method can also be implemented independently by the server 104 or the terminal 102. For example, the terminal 102 can directly construct the causal graph for the variable set and application task information corresponding to the target application task, or the server 104 can obtain the variable set and application task information corresponding to the target application task from the data storage system, and construct the causal graph for the variable set and application task information corresponding to the target application task.

[0028] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, and tablet computers. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.

[0029] In an exemplary embodiment, Figure 2 As shown, a method for constructing a task variable causal graph is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or can be executed by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 The server 104 in the example is used as an example to illustrate, including the following steps 201 to 203. Among them:

[0030] Step 201: Obtain a variable set and application task information corresponding to a target application task; the variable set includes a number of variables; the application task information includes target application task background information and variable information.

[0031] Step 202: using a large language model, determine prior knowledge based on a variable set corresponding to a target application task and application task information; the prior knowledge includes the causal relationship between any two variables in the variable set.

[0032] Step 203: Using the Monte Carlo tree search method, determine the best causal graph based on prior knowledge and data independence test; the nodes in the best causal graph correspond one-to-one to the variables in the variable set, and the edges in the best causal graph represent the causal relationship between the variables corresponding to the two connected nodes; the best causal graph is used for root cause analysis of downstream tasks.

[0033] Implement the above steps 201 to 203, infer the causal relationship between variables and construct a causal graph given some variables and observed variable data. Through Monte Carlo tree search of the causal graph, the knowledge of the large language model and the variable independence test based on the graph structure and data are used to perform pruning and optimization to accelerate the search process, and the search results are fed back using data analysis to improve the quality of the causal graph, thereby improving the effect of downstream tasks, solving the problem that the existing causal discovery method relies on data-driven, the accuracy of the causal graph obtained is not high, and the effect of downstream tasks is poor.

[0034] In another exemplary embodiment of the present application, Figure 3 As shown, the above step 202 is replaced by the following steps 301 to 304:

[0035] Step 301: Analyze the current variable according to the variable set corresponding to the target application task and the application task information through the large language model to obtain the answer variable set corresponding to the current variable; the current variable is any variable in the variable set; the answer variable in the answer variable set is the variable in the variable set that affects the current variable;

[0036] Step 302: construct an edge set corresponding to the current variable according to the answer variable set corresponding to the current variable;

[0037] Step 303: Determine whether each edge in the edge set satisfies the directed acyclic graph constraint. If so, add the edge satisfying the directed acyclic graph constraint to the causal graph; if not, delete the edge not satisfying the directed acyclic graph constraint.

[0038] Step 304: Repeat steps 301 to 303 until all variables in the variable set corresponding to the target application task are accessed to obtain prior knowledge.

[0039] Among them, the large language model can be the ChatGPT model, the Tongyi Qianwen model, or the Wenxin Yiyan model, etc.

[0040] Specifically: given n variables, a causal graph is constructed using a large language model to represent the causal relationship between the variables. The causal graph needs to conform to the constraints of a directed acyclic graph. The specific process of constructing prior knowledge is as follows:

[0041] Let N represent the set of all variables, V represent the set of nodes (variables) already in the causal graph, E represent the set of edges in the causal graph, and the causal graph G = (V, E). The steps are as follows:

[0042] 1) Select an initial variable from N and add it to V. Generally, the target variable that the downstream task is concerned about is selected.

[0043] 2) Select a variable x from V that has not been visited. If all variables in V have been visited, but Then select variable x from NV.

[0044] 3) Provide the large language model with background knowledge, variable information, currently known causal relationships, and other information, so that the large language model can determine which variables will directly affect the current variable x. Based on the variable Y = {y1, y2, ...} answered by the large language model, the edge Enew = {y1->x, y2->x, ...} is obtained.

[0045] 4) Check whether the edges in Enew will violate the directed acyclic graph constraints after being added to the causal graph G. If so, delete the corresponding edges from Enew. The directed acyclic graph constraint means that the causal graph must conform to the definition of a directed acyclic graph and there cannot be loops in the graph.

[0046] 5) Add the edges in Enew to the causal graph G, and add corresponding variables and edges in V and E.

[0047] 6) Repeat 2)-5) until all variables have been visited and the final causal graph G is obtained, that is, the prior knowledge is obtained.

[0048] Add the target variable to the set to be visited, remove a variable from the set to be visited, ask the large language model which variables affect the current variable, and convert the answer of the large language model to the corresponding edge of the current variable. If the corresponding edge of the current variable does not form a loop after being added to the graph, then add the corresponding edge of the current variable to the graph and add the newly connected variable to the set to be visited.

[0049] Background knowledge refers to the background knowledge related to the application tasks of the microservice architecture. For example, for a microservice system, the background knowledge includes the known information of the system architecture as well as the common sense and research results in the field.

[0050] Variable information refers to the supplementary description of the variable. If there is only the variable name, the large language model may not be able to understand its meaning.

[0051] The known causal information refers to the edges that have been obtained before. Since the method is executed in a loop, the causal information (edges in the graph) obtained in the previous steps needs to be sent to the large language model.

[0052] The following target application tasks are used as examples to illustrate the above content. The specific application task information is as follows:

[0053] Background: The expression levels of different proteins and phospholipids in human cells were measured by flow cytometry and mass spectrometry. It includes 11 phosphorylated proteins and phospholipids measured simultaneously from thousands of single primary immune system cells, and general and specific molecular interventions were performed to understand the biological functions of the relevant proteins and phospholipids. Among them, Akt is a key signaling protein that is usually involved in cell survival and metabolic pathways. The goal of the task is to determine the relevant variables that affect Akt activation, as well as the causal relationship between them.

[0054] Variable set: including 11 variables including Plcg, PIP2, PIP3, PKC, PKA, Raf, Mek, Erk, Akt, Jnk, P38, etc.

[0055] Variable information: The variable information of the above 11 phosphorylated proteins and phospholipids is described as follows:

[0056] Plcg (Phospholipase C gamma): enzyme involved in signal transduction, catalyzing the production of second messengers.

[0057] PIP2 (Phosphatidylinositol4,5-bisphosphate): membrane phospholipid, involved in signal transduction pathways.

[0058] PIP3 (Phosphatidylinositol (3,4,5)-trisphosphate): Phospholipid, converted from PIP2, involved in cell growth and survival signals.

[0059] PKC (Protein Kinase C): Protein kinase, regulates multiple cell functions.

[0060] PKA (Protein Kinase A): protein kinase, regulates sugar metabolism and cell cycle.

[0061] Raf: A protein kinase that is linked in tandem to the MAPK signaling pathway and is involved in cell proliferation.

[0062] Mek: a kinase in the MAPK signaling pathway that activates Erk.

[0063] Erk (Extracellular signal-regulatedkinase): protein kinase, involved in cell division and growth.

[0064] Akt: Protein kinase, also known as PKB, regulates cell survival and metabolism.

[0065] Jnk (c-JunN-terminalkinase): protein kinase, involved in stress response and cell apoptosis.

[0066] P38: a protein kinase, a MAPK, involved in cellular stress response.

[0067] It should be noted that the best causal graph can be used for downstream tasks. After determining the best causal graph and prediction model, fit the model with data. The completed model can perform many tasks. In the above task scenario, the goal is to build the best causal graph between 11 variables. The downstream task refers to using the best causal graph to find the cause of abnormal events. For example, when it is detected that Akt in a patient is abnormal and inactivated, then according to the causal graph, it can be found which variables cause the inactivation of Akt.

[0068] In another exemplary embodiment of the present application, Figure 4 As shown, a causal graph construction framework is provided, which includes a search branch pruning and optimization module based on large model knowledge and causal graph structure verification, a node expansion condition judgment module and a Monte Carlo tree search module

[0069] The above step 203 may include the following steps 401 to 408. Among them:

[0070] Step 401: Initialize the root node.

[0071] Step 402: Select an access node based on the root node.

[0072] Step 403: Determine whether the access node needs to be expanded, if so, execute step 404, if not, execute step 406.

[0073] Step 404: Prune and optimize all extended actions corresponding to the current node according to prior knowledge and data independence test to obtain candidate actions.

[0074] Step 405: Select an extended action according to the priority order of the actions in the candidate actions, create a new node for the current node, use the new node as the access node, and execute step 406.

[0075] Step 406: Calculate the causal graph score of the access node, and evaluate the causal graph corresponding to the access node according to the causal graph score to obtain an evaluation score.

[0076] Step 407: Back-propagate the causal graph scores of the visited nodes.

[0077] Step 408: Determine whether the search stop condition is met. If so, stop the search and output the optimal cause-effect diagram; if not, return to step 402.

[0078] Initialize the root node. Use an empty graph (or other methods, causal graphs known from expert knowledge) as the root node (initial state). Specifically: If you want to init If the search is based on the causal graph constructed by expert knowledge, the root node is initialized using the existing causal graph, otherwise an empty graph is used. Initialize the root node. A node (state) in the Monte Carlo tree search method represents a causal graph. The root node can use an empty causal graph, or other (traditional) methods or a causal graph known by expert knowledge, that is, the initial causal graph formed by the prior knowledge obtained in step 202. Define a node (state) as follows:

[0079] node i =state i = {G i , parent i , numVisits i , children i , Reward i ,patience i ,

[0080] totalReward i , bestDescReward i}. Gi is the causal graph corresponding to the current node i, parent i Is the parent node, numVisits i is the number of visits to the current node i, children i is the number of child nodes, Reward i is the causal graph score of the current node i, patience i is the count of nodes visited but the causal graph score did not improve, totalReward i is the sum of the causal graph scores of each visit to the descendant node (including itself), bestDescReward i It is the highest causal graph score of descendant nodes (including itself).

[0081] Therefore, the root node after initialization is:

[0083] The specific process of selecting the access node in step 402 is: based on the root node initialized in step 401, select the access node; calculate the UCT value of the node, and select the node with the largest UCT value as the access node.

[0084] The UCT value reflects the priority of the node in the search and balances the exploration and utilization in the search. The calculation formula of the UCT value is as follows:

[0085]

[0086] Among them, BestChildReward i It is the highest causal graph score of descendant nodes (including itself), emphasizing the priority search for the current best node; is the average causal graph score of the visits to the current node and its descendant nodes, emphasizing the priority search for the node with the best average descendant answer; N C is the total number of visits to the parent node, N i is the number of visits to the current node, This item emphasizes the priority search of nodes that have been searched less times before; a, b, and c are constant parameters used to adjust the importance of each item in the priority level and can be set as needed. In this application, a=0.9, b=0.1, and c=0.05 are taken.

[0087] The node expansion condition judgment module judges whether the node selected in step 402 needs to be expanded. If it needs to be expanded, continue to step 404. If it does not need to be expanded, directly access the node selected in step 402 and execute step 406.

[0088] Determine whether the access node selected in step 402 needs to be expanded. If there is a descendant node whose causal graph score is greater than the causal graph score of the current node (bestDescReward>reward), and the number of child nodes of the current node is greater than the set node value (|children|>Num), then directly access the node selected in step 402 and execute step 406. Otherwise, the node needs to be expanded and continue to execute step 404. Num can be 5.

[0089] The search branch pruning and optimization module based on the large model knowledge and causal graph structure prunes and optimizes all possible expansion actions of the current node. The obtained candidate actions are used to expand the node in step 405. The specific process is as follows:

[0090] 1) First, traverse all possible actions and select the actions that will not violate the directed acyclic graph constraints after the change of the causal graph as candidate actions. For each action corresponding to the edge X->Y, according to the d-separation rule in the causal graph, select the conditional variable set (node ​​set) that can block the path between X and Y except the directly connected edge. Use the conditional variable set as the condition and use the observed data of the variables to calculate the independence test of X and Y to obtain the p value.

[0091] 2) Then, according to the p-value of the conditional independence test and the results of the causal discovery of the large language model (prior knowledge), the candidate actions are pruned and optimized, which can be divided into four cases: (1) Direct exclusion: For very low p-values ​​(less than 0.01) or low p-values ​​(less than 0.25) and no corresponding causal relationship in the large language model results, they are directly excluded; (2) Preferred actions: For those with high p-values ​​(greater than 0.05) and corresponding causal relationships in the large language model results, they are preferred and added to the preferred action set; (3) Secondary actions: For those with high p-values ​​(greater than 0.05) or corresponding causal relationships in the large language model results, they are second-prioritized and added to the secondary action set; (4) General actions: The remaining actions are added to the general action set. The p-value threshold can be set as needed.

[0092] The action (change from one state to another) in the Monte Carlo tree search method is a modification of an edge in the causal graph, including: adding edges, deleting edges, and reversing edges. Define an action: action = {ops, vari, varj}. Among them, ops is one of the three operations of adding, deleting, and reversing, and vari and varj are the two variables corresponding to the edge to be modified.

[0093] Expanding a node: From the candidate actions of step 404 , select an action in order of priority to create a new child node for the current node, and use the created new node as the access node of step 406 .

[0094] Select all actions that do not violate the directed acyclic graph constraint. The causal graph of the node selected in step 402 is used as the current causal graph. Traverse all possible operations of adding, deleting and reversing the edges of the current causal graph as possible actions. Test whether the causal graph will have a cycle after executing these actions. If not, the priority acyclic graph constraint is not violated. The actions that do not violate the priority acyclic graph constraint are used as candidate actions for step 404.

[0095] Expand the child nodes of the node selected in step 402 based on the candidate action set selected in step 404. Select an action in the order of the preferred action set, the secondary action set, and the general action set. old Execute the modification of the opposite edge of the selected action to obtain the new causal graph G new , with Gnew A new node is created as a sub-node of the node selected in step 402. The newly created node is used as the access node and step 408 is executed.

[0096] Visit the node and calculate the causal graph score. If step 403 determines that the node does not need to be expanded, then visit the node selected in step 402; if step 403 determines that the node needs to be expanded, then visit the new node expanded in step 402. Use the causal graph evaluation module to calculate the causal graph score of the visited node. The causal graph score uses observation data to evaluate the quality of the causal graph and uses data feedback to search quality. The calculation formula for the causal graph score is as follows:

[0097] Rewardi=Evaluate(G i )-a×NHD(G i , G empty ).

[0098] Among them, G i Represents the causal graph of the node; Evaluate is the evaluation function of the causal graph; NHD(G i , G empty ) represents the normalized Hamming distance between the causal graph and the empty graph; a is a parameter that can be set as needed and can be set to 0.2. i , G empty ) represents the normalized Hamming distance between the causal graph and the empty graph. That is, the number of edges in Gi divided by the number of all possible edges.

[0099] Evaluate is an evaluation function for the causal graph. There are many options. The effect of the causal graph for downstream tasks can be used to evaluate the quality of the causal graph. This application chooses to use the F1 score of the root cause analysis task as the evaluation function. Use the outlier root cause analysis method based on causal structure to perform root cause analysis, obtain the contribution of each variable to the abnormality of the target variable, take the variable with the highest anomaly score as the root cause of the prediction, and then compare it with the true label of the root cause anomaly of the abnormal data set to calculate the root cause analysis F1 score. The specific calculation process is as follows:

[0100] Suppose there are variables X1, X2, …, Xn, among which there is the target variable Xtarget of interest; there is a normal data set, a set of observation samples of the variables under normal circumstances; there is an abnormal data set, a set of abnormal data observation samples of the variables and the root cause labels. Use the root cause analysis method to calculate the contribution of each variable in each set of abnormal data to the abnormality of the target variable Xtarget, that is, the anomaly score: AX1, AX2, …, AXn. Take the maximum value max(AXi), Xi is the root cause of the prediction. If Xi is the same as the root cause label, the prediction is correct. Finally, for all prediction results, use the MacroF1 score of the multi-classification problem to calculate the predicted F1 score. For each variable Xi:

[0101]

[0102]

[0103] The final F1 score is: MacroF1 = AVG(F1(1), F1(2), ..., F1(n)).

[0104] NHD(G i , G empty ) is calculated as follows:

[0105]

[0106] Among them, N nodes is the number of variables, e is the edge, and E is the set of all edges.

[0107] The specific process of step 407 is: visit the node, calculate the causal graph score, and then back-propagate to all ancestor nodes (including itself). ance The number of visits increases by 1 (numVisits ance +=1, totalReward increases the causal graph score of the visited node (totalRewardance+=Rewardi). If the visited node rewad is greater than the causal graph score of the ancestor node (Rewardi>Reward ance ), then bestDescReward ance =reward i and patience ance =0; otherwise, patience increases by 1 (patience ance +=1).

[0108] Search stop condition judgment module. Set the upper limit of the number of searches and the upper limit of the search time, and stop the search when the upper limit is reached. At the same time, set the early stop condition. If the score of the causal graph does not improve after n consecutive searches, stop early. Determine whether to stop. If not, repeat steps 402-407 to search.

[0109] Select the best causal graph. After the search stops, all causal graphs found during the search are sorted by Reward, and the causal graph with the highest causal graph score is selected as the result output. The first few causal graphs with the highest causal graph scores can also be output as candidate causal graphs for user reference and selection.

[0110] The present application also provides an application scenario, which applies the above-mentioned task variable causal graph construction method. Specifically: the task variable causal graph construction method provided in this embodiment can be applied in the causal graph construction scenario. The causal graph construction scenario includes an information collection link and a causal graph construction link; the variable set and application task information corresponding to the target application task enter the causal graph construction link from the information collection link to obtain the corresponding optimal causal graph. The task variable causal graph construction method provided in this embodiment belongs to the causal graph construction link. Specifically, in the process of causal graph construction link for the variable set and application task information corresponding to the target application task, a large language model can be used to determine prior knowledge based on the variable set and application task information corresponding to the target application task, and the Monte Carlo tree search method can be used to determine the optimal causal graph based on prior knowledge and data independence test.

[0111] Based on the same inventive concept, the embodiment of the present application also provides a task variable causal graph construction device for implementing the task variable causal graph construction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more task variable causal graph construction device embodiments provided below can refer to the limitations of the task variable causal graph construction method above, and will not be repeated here.

[0112] In an exemplary embodiment, Figure 5 As shown, a task variable causal graph construction device is provided, comprising:

[0113] The information acquisition module T1 is used to: acquire a variable set and application task information corresponding to a target application task; the variable set includes a number of variables; and the application task information includes target application task background information and variable information.

[0114] The prior knowledge determination module T2 is used to: use a large language model to determine prior knowledge according to the variable set corresponding to the target application task and the application task information; the prior knowledge includes the causal relationship between any two variables in the variable set.

[0115] The optimal causal graph determination module T3 is used to: use the Monte Carlo tree search method to determine the optimal causal graph based on prior knowledge and data independence test; the nodes in the optimal causal graph correspond one-to-one to the variables in the variable set, and the edges in the optimal causal graph represent the causal relationship between the variables corresponding to the two connected nodes; the optimal causal graph is used for the root cause analysis of downstream tasks.

[0116] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store causal graph construction data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a task variable causal graph construction method is implemented.

[0117] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0118] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0119] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0120] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0121] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0122] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0123] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0124] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for constructing a task variable causal graph, characterized in that: The task variable causal graph construction method includes: Obtaining a variable set and application task information corresponding to a target application task; the variable set includes a number of variables; the application task information includes target application task background information and variable information; Using a large language model, determine prior knowledge based on the variable set corresponding to the target application task and the application task information; prior knowledge includes the causal relationship between two variables in the variable set; The Monte Carlo tree search method is used to determine the optimal causal graph based on prior knowledge and data independence test; the nodes in the optimal causal graph correspond one-to-one to the variables in the variable set, and the edges in the optimal causal graph represent the causal relationship between the variables corresponding to the two connected nodes; the optimal causal graph is used for root cause analysis of downstream tasks.

2. The method for constructing a task variable causal graph according to claim 1, characterized in that: Using the large language model, we determine the prior knowledge based on the variable set and application task information corresponding to the target application task, including: Step 301: Analyze the current variable according to the variable set corresponding to the target application task and the application task information through the large language model to obtain the answer variable set corresponding to the current variable; the current variable is any variable in the variable set; the answer variable in the answer variable set is the variable in the variable set that affects the current variable; Step 302: construct an edge set corresponding to the current variable according to the answer variable set corresponding to the current variable; Step 303: Determine whether each edge in the edge set satisfies the directed acyclic graph constraint. If so, add the edge satisfying the directed acyclic graph constraint to the causal graph; if not, delete the edge not satisfying the directed acyclic graph constraint. Step 304: Repeat steps 301 to 303 until all variables in the variable set corresponding to the target application task are accessed to obtain prior knowledge.

3. The method for constructing a task variable causal graph according to claim 1, characterized in that: The Monte Carlo tree search method is used to determine the best causal diagram based on prior knowledge and data independence tests, including: Step 401: Initialize the root node; Step 402: Select an access node based on the root node; Step 403: Determine whether the access node needs to be expanded, if yes, execute step 404, if no, execute step 406; Step 404: Prune and optimize all extended actions corresponding to the current node according to prior knowledge and data independence test to obtain candidate actions; Step 405: Select an extended action according to the priority order of the actions in the candidate actions, create a new node for the current node, use the new node as the access node, and execute step 406; Step 406: Calculate the causal graph score of the access node, and evaluate the causal graph corresponding to the access node according to the causal graph score to obtain an evaluation score; Step 407: back-propagating the causal graph score of the access node; Step 408: Determine whether the search stop condition is met. If so, stop the search and output the optimal cause-effect diagram; if not, return to step 402.

4. A task variable causal graph construction device, characterized in that: The task variable causal graph construction device comprises: The information acquisition module is used to: acquire a variable set and application task information corresponding to a target application task; the variable set includes a number of variables; the application task information includes target application task background information and variable information; The prior knowledge determination module is used to: determine the prior knowledge based on the variable set and application task information corresponding to the target application task using the large language model; the prior knowledge includes the causal relationship between two variables in the variable set; The optimal causal graph determination module is used to: use the Monte Carlo tree search method to determine the optimal causal graph based on prior knowledge and data independence test; the nodes in the optimal causal graph correspond one-to-one to the variables in the variable set, and the edges in the optimal causal graph represent the causal relationship between the variables corresponding to the two connected nodes; the optimal causal graph is used for root cause analysis of downstream tasks.

5. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the task variable causal graph construction method according to any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the task variable causal graph construction method described in any one of claims 1 to 3.