Automatic causal structure generation method based on semantic representation and logical reasoning of large language model
By leveraging the semantic representation and logical reasoning of a large language model, causal structures are automatically constructed from unstructured text, solving the problems of lack of causal structure and reliance on statistical correlation in causal reasoning, and achieving automated generation and highly accurate interpretation of causal graphs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU TUANHAOMAO TECHNOLOGY CO LTD
- Filing Date
- 2026-01-22
- Publication Date
- 2026-05-08
AI Technical Summary
Existing large language models lack explicit representations of causal structures and support for causal reasoning, making it difficult to apply traditional causal reasoning methods in unstructured natural language scenarios. Furthermore, their reliance on statistical correlation leads to spurious correlations and poor generalization.
By using semantic representation and logical reasoning based on a large language model, causal variables are automatically extracted from unstructured natural language text, a directed acyclic causal graph is constructed, and counterfactual intervention and do operators are used to detect causal relationships and determine directions, generating logically consistent causal explanations.
It enables the automated generation of causal structures, reduces the manual cost of causal modeling, improves the accuracy and interpretability of causal graphs, avoids spurious causal relationships, and enhances adaptability in different application environments.
Smart Images

Figure CN121998089A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence and causal reasoning technology, and in particular to a method for automatically generating causal structures based on semantic representation and logical reasoning of large language models. Background Technology
[0002] Current large language models, such as the GPT series, Gemini, and BERT, while capable of powerful contextual understanding, reasoning, and language generation, primarily rely on statistical reasoning and contextual association in their reasoning processes, and are largely trained on large amounts of text data. They infer answers to questions by analyzing patterns in the context.
[0003] However, this approach is highly susceptible to data factors, suffers from an overemphasis on spurious correlations, and exhibits relatively poor generalization prediction performance on unknown data. This is because large language models lack a clear causal structure. They do not explicitly express the relationships between variables as causal chains, nor do they have built-in support for causal reasoning (such as intervention and counterfactual reasoning). They can only generate answers based on patterns and probabilities learned during training.
[0004] Causal inference systems place greater emphasis on explicitly modeling the causal relationships between variables within a system. They can infer causal chains between variables and explicitly represent these relationships through structures such as causal graphs. Their aim is to enable models to understand causal mechanisms, not just correlations.
[0005] The core advantages of causal reasoning systems:
[0006] Inferring causal mechanisms does not rely on statistical correlation;
[0007] It allows for intervention and counterfactual reasoning, thereby simulating different decision outcomes;
[0008] Constructing causal graphs makes the reasoning process more interpretable.
[0009] However, existing causal structure learning methods (such as PC algorithms, LiNGAM, NOTEARS, etc.) mainly rely on structured numerical data, requiring manual definition of node variables and independence testing. In unstructured natural language scenarios, however, causal variables exist implicitly as semantic units, lacking explicit numerical structure, making it difficult to directly apply traditional causal inference methods. Summary of the Invention
[0010] The purpose of this application is to provide an automatic causal structure generation method based on semantic representation and logical reasoning of a large language model, so as to solve one or more technical problems existing in the prior art, or at least provide a beneficial option or create conditions.
[0011] To achieve the above-mentioned objectives, this application employs the following technical solution:
[0012] This application provides a method for automatically generating causal structures based on semantic representation and logical reasoning of large language models, including:
[0013] Get the input text;
[0014] The large language model is used to semantically encode and cluster the acquired input text to establish a set of candidate causal variables;
[0015] Causal relationship detection is performed on the established set of candidate causal variables;
[0016] Perform causal direction determination and generate a directed acyclic causal graph that satisfies logical consistency;
[0017] Based on the generated directed acyclic causal graph, a large language model is used to generate natural language interpretations and perform closed-loop verification of logical consistency.
[0018] Furthermore, a large language model is used to semantically encode and cluster the acquired input text to establish a set of candidate causal variables, including:
[0019] The input text is semantically encoded using a large language model to obtain word-level or sub-word-level vector representations, sentence vectors, and corresponding attention weight matrices, which are used to characterize the semantic relationships and contextual dependency structures between semantic units in the text.
[0020] Clustering of semantic unit embedding vectors in text automatically summarizes potential candidate causal variables from the semantic representation space;
[0021] The causal semantic validity of candidate causal variables is initially screened and enhanced, and a set of candidate causal variables is established.
[0022] Furthermore, the semantic unit embeddings in the text are clustered to automatically summarize potential candidate causal variables from the semantic representation space, including:
[0023] Clustering semantic unit embeddings in the text forms semantically independent semantic clusters, representing a set of potential candidate causal variables;
[0024] Each semantic cluster is mapped to a candidate causal variable representation in logical predicate form, as shown in the following expression:
[0025]
[0026] in, These represent the event type, attribute, and time characteristics obtained by statistically summarizing the semantic units co-occurring in this semantic cluster, respectively. Event is represented in the form of a logical predicate.
[0027] By using semantic similarity measurement and word sense disambiguation rules, candidate causal variables are normalized to merge semantically equivalent variable expressions and eliminate redundant variables caused by synonymy or ambiguity.
[0028] Furthermore, the algorithm for clustering semantic unit embeddings in text includes at least one of the following:
[0029] The HDBSCAN algorithm and k-means algorithm are based on density extension.
[0030] Furthermore, the causal semantic validity of candidate causal variables is initially screened and enhanced, including:
[0031] Based on the set of causal marker words in natural language, the corresponding causal context region is located in the attention weight matrix;
[0032] Calculate the causal triggering function for the semantic unit located within the causal context region. The expression is as follows:
[0033]
[0034] in, A causal semantic strength function maps semantic units to non-negative real numbers, characterizing the degree to which the semantic unit assumes a causal role in natural language. Let be the set of nonnegative real numbers. The set segmented by event phrases;
[0035] Preserving its semantic units satisfies Candidate causal variables or their components that exceed a preset threshold.
[0036] Furthermore, based on counterfactual intervention and the do operator, causal relationship detection is performed on the established set of candidate causal variables, including:
[0037] The established set of candidate causal variables is represented as follows:
[0038]
[0039] in These are the valid causal variables after passing the consistency screening.
[0040] Construct a structural causal model, mapping candidate causal variables to nodes in the structural causal model, and build a parameterized structural equation for each node variable:
[0041]
[0042] in, Indicates generated variables causal function, express The set of parent variables, Let j represent the j-th causal variable. Represents independent exogenous noise terms;
[0043] Then, a structural cause-effect graph is generated from all the structural equations:
[0044]
[0045] Where V is the set of variable nodes and E is the set of edges, conforming to:
[0046]
[0047] G is a directed acyclic graph (DAG);
[0048] Intervention simulation based on the do operator, for any candidate causal edge Constructing counterfactual intervention operations:
[0049]
[0050] in, Replace the structural equation with the constant values after counterfactual intervention. ;
[0051] Perform Pearl's three-step counterfactual logic calculation, executing the following steps in sequence:
[0052] Causal inference: Inferring potential noise variables;
[0053] Intervention: Implementing intervention ;
[0054] Prediction: Calculating the distribution of variables after intervention ;
[0055] To determine the existence of causal influence, the change in the distribution of the target variable before and after the intervention must satisfy... hour, To determine the preset threshold To establish a valid causal relationship, output as a set of undirected candidate causal edges.
[0056] Furthermore, constructing counterfactual intervention operations also includes:
[0057] In the semantic representation space, the embedding vector is perturbed to form continuous do-intervention samples, which are used to help estimate the changes in the distribution of the target variable before and after the intervention.
[0058] Furthermore, causal direction determination is performed to generate a directed acyclic causal graph that satisfies logical consistency, including:
[0059] For each undirected candidate causal edge Construct counterfactual interventions respectively:
[0060]
[0061] in, Let i be the constant value after counterfactual intervention. To observe the constant values of the target variable j after counterfactual intervention;
[0062] Each counterfactual three-step reasoning step was performed to compare the asymmetry of the intervention's impact in order to determine the causal direction.
[0063] Perform the following conditional independence test on the determined direction to verify that the direction satisfies the d-separation constraint:
[0064]
[0065] in, The set of candidate condition variables does not include ;
[0066] The above constraints are added as soft constraints to the objective function of causal graph structure optimization to generate a directed acyclic causal graph that satisfies logical consistency.
[0067] Furthermore, determining the direction of causality also includes:
[0068] The continuous counterfactual intervention results based on embedding perturbations serve as supplementary evidence for determining the causal direction.
[0069] Furthermore, based on the generated directed acyclic causal graph, a large language model is used to generate natural language interpretations and perform logical consistency closed-loop verification, including:
[0070] Based on the final generated directed acyclic causal graph and structural causal model, counterfactual path analysis is performed on the target variable Y of user interest and its upstream causal path. By implementing counterfactual intervention, the changes before and after the intervention are calculated. A large language model is then used to generate natural language causal explanation text that satisfies logical path constraints.
[0071]
[0072] The directed acyclic causal graph and structural equation constraints are transformed into a set of first-order logic and satisfiability constraints Φ. The propositional logic satisfiability problem SAT or the satisfiability module theory problem SMT solver is used to verify whether there is a contradiction in Φ.
[0073] If a conflict is detected, backtrack to locate the conflicting edge or equation, return to the causal direction determination, and perform optimization and reconstruction:
[0074] .
[0075] The beneficial effects of this application are as follows:
[0076] It enables the automated generation of causal structures from natural language, automatically extracts and constructs a set of causal variables from unstructured natural language text, avoids the shortcomings of existing causal modeling processes that require manual definition of variables and reliance on domain experts for modeling, and significantly reduces the manual cost and professional threshold of causal structure construction.
[0077] By introducing counterfactual intervention and do-calculus, the causal legitimacy of candidate causal relationships can be verified, effectively avoiding the problem of false causal relationships caused by relying solely on statistical correlation or co-occurrence frequency in existing technologies;
[0078] It enables automatic determination of causal direction, avoiding the problem of relying on human experience or simple assumptions in the construction of existing causal graphs, and improves the accuracy and stability of causal graph structure;
[0079] By introducing a logical constraint optimization mechanism, the generation of self-contradictory or unsatisfiable causal graphs is avoided, thus improving the reliability of the structural results.
[0080] Construct a causal explanation and logical closed-loop verification mechanism to improve the interpretability and credibility of the results;
[0081] It supports both discrete intervention methods based on text counterfactual substitution and continuous intervention methods based on embedding perturbation, which can meet the requirements of strict causal logic verification and adapt to continuous optimization scenarios in large-scale semantic spaces, thus enhancing the engineering adaptability of this application in different application environments. Attached Figure Description
[0082] Figure 1 This is a schematic flowchart of the method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model, according to an embodiment of this application.
[0083] Figure 2 This is a flowchart illustrating the specific implementation of the causal structure automatic generation method based on semantic representation and logical reasoning of a large language model, according to an embodiment of this application. Detailed Implementation
[0084] The present application will be further described below with reference to specific embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present application, and should not be used to limit the scope of protection of the present application.
[0085] This embodiment utilizes the causal theory of logic combined with the ability to generate large language models to construct a system that includes a complete process of executable variable extraction, intervention simulation, causal direction determination, causal graph optimization, and counterfactual interpretation.
[0086] The causal theories of logic used include:
[0087] Structural Causal Model (SCM)
[0088] do operator (do-calculus)
[0089] Counterfactual logic
[0090] d-separation
[0091] Formal predicate logic.
[0092] This embodiment is set against the backdrop of a general "classification model development task" and is not dependent on any specific industry. It is used to demonstrate how this application can automatically construct causal structures from training data, model behavior, and prediction results to explain and control the performance of the classification model.
[0093] like Figures 1-2 This application provides a method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model, comprising the following steps:
[0094] S100, Get the input text.
[0095] The input here can be any type of data, including:
[0096] Text (natural language statements, label descriptions, etc.)
[0097] Image processing (tasks such as image classification and object recognition)
[0098] Tabular data (common in data mining)
[0099] For images, encoding can be performed using Vision Transformer (ViT) or CLIP; for text, LLM encoding is used. These multimodal data are first uniformly mapped into the semantic space of a large language model to obtain embedding vector representations.
[0100] S200 utilizes a large language model to semantically encode and cluster the acquired input text, establishing a set of candidate causal variables.
[0101] The input text is semantically encoded using a large language model to obtain word-level or sub-word-level vector representations, sentence vectors, and corresponding attention weight matrices, which are used to characterize the semantic relationships and contextual dependency structures between semantic units in the text.
[0102] First, clustering is performed, and then a function is introduced to determine whether a cluster can be used as a causal variable to filter out non-causal semantic clusters, retaining only the clustering results that can be used as causal nodes.
[0103] Clustering algorithms can be selected from density-based clustering (such as HDBSCAN, Hierarchical Density-Based Spatial Clustering of Applications with Noise), prototype-based clustering (k-means), or a combination of both, to summarize and merge expressions with similar semantics and continuous semantic changes.
[0104] The specific steps are as follows:
[0105] Given a set of texts:
[0106]
[0107] For a given text This can be decomposed into the smallest causal analyte unit (CCU), such as through event phrase-level segmentation (predicate + argument). Define the segmented set:
[0108]
[0109] Among them, each It is a candidate semantic unit, such as: temperature drop, abnormal equipment vibration, price increase, etc.
[0110] Semantic clustering is defined as Large model vector representation corresponding to each semantic unit .
[0111] Next, we will perform stability checks on filter S201 and causality strength checks on filter S202 in sequence:
[0112] S201, Stability Assessment:
[0113] Introduce multiple rounds of perturbation to the vector representation in clustering and repeatedly perform the clustering operation, specifically including but not limited to:
[0114] Add random noise to the vector representation;
[0115] Equivalent rewriting, contextual perturbation, or random coding changes are performed on the original semantic units;
[0116] Vector representations are repeatedly generated and clustering is performed under different perturbation conditions.
[0117] Let the clustering result after the t-th round of perturbation be... Calculate the consistency index among multiple rounds of clustering results, and generate a clustering stability score based on this index:
[0118]
[0119] When the stability score is lower than the preset threshold If the semantic clustering is unstable in the representation space, it is determined that the causal variable admission condition is not met.
[0120] S202, Causality Strength Determination:
[0121] Define causal trigger function for each semantic unit This is a non-negative real number function used to measure the strength of a semantic unit's causal expression features in a natural language corpus. In this implementation, the causal trigger function is defined as:
[0122]
[0123] Each of these items provides causal evidence from three complementary dimensions: statistical co-occurrence, syntactic structure, and counterfactual substitutability. These are hyperparameters or learnable parameters used to balance the importance of the three types of evidence.
[0124] PMI ( (,cause) represents the causal co-occurrence strength, which belongs to statistical evidence and represents a semantic unit. The intensity of interaction information with causal conjunctions or causal structure tags.
[0125]
[0126] Wherein, P( ,cause) is The probability of a causal marker occurring simultaneously; cause represents a set of causal trigger markers (e.g., because, leading to, thus, etc.).
[0127] CF( The scoring of causal syntactic roles is a type of structural evidence, representing semantic units. The stability of the causal role in the syntax tree.
[0128]
[0129] Causal arguments can be constituted by one of the following characteristics:
[0130] Does it frequently occupy the X position in the "because X, therefore Y" context?
[0131] Whether it is governed by a causal verb as the object of a verb (causing, leading to, causing);
[0132] Is it the subject / object of a causal clause?
[0133] DoSub( Counterfactual substitution represents evidence of intervention and indicates assessment. Does it support do-type counterfactual substitution? Example implementation:
[0134] Constructing a template sentence: If we take If we set it to X, will it result in Y?
[0135] replace Different possible values, such as presence / absence
[0136] Use a large model to determine whether the semantics are still coherent:
[0137]
[0138] Next, the system aggregates the causal trigger values of each semantic unit in the cluster to obtain a cluster-level causal semantic consistency score:
[0139]
[0140] When the score is lower than the preset threshold When this happens, the cluster is deemed to have failed to reflect stable causal semantic features.
[0141] Finally, filtering S201 and filtering S202 are combined to determine whether to promote the semantic cluster to a causal variable node. When the joint discriminant function outputs a positive result, the semantic cluster is determined to be a causal variable node and passed to the subsequent causal graph construction or causal inference module; otherwise, the semantic cluster is excluded or retained only as a descriptive semantic object. In this embodiment, the joint discriminant function is defined as follows:
[0142]
[0143] in, and The preset threshold;
[0144] S300, based on counterfactual intervention and the do operator, performs causal relationship detection on the established set of candidate causal variables, including:
[0145] S301, Variable Generation:
[0146] Based on the previous output: (cold wave is coming, temperature is dropping, school opening is postponed), the following variables are automatically generated:
[0147] V1 = Event (Cold Wave Arrives)
[0148] V2 = Event (Temperature Decrease)
[0149] V3 = Event (Postponed School Opening)
[0150] S302, Construct a structural causal model (SCM):
[0151] Establish structural equations:
[0152]
[0153]
[0154]
[0155] in, These are the independent noise terms for V1, V2, and V3, respectively. V1 represents the causal effect strength on V2, and V2 represents the causal effect strength on V3. The specific calculation can be learned or estimated through historical sample data, counterfactual intervention simulation results, or maximum likelihood estimation. This refers to an activation function, such as the sigmoid function.
[0156] S303, Intervention Simulation:
[0157] Perform an embedding perturbation on V1 to generate counterfactual text: No cold wave occurred, schools postponed the start of the semester, constructing:
[0158]
[0159] S304, the three-step counterfactual logic method:
[0160] Abduction: Inferring Noise
[0161] Intervention Action: do(V1=0)
[0162] Prediction: Calculation
[0163] S305, Existence determination:
[0164] like , If the preset threshold is used, then the undirected candidate edges are output as: {V1, V3}.
[0165] S400 performs causal direction determination and generates a directed acyclic causal graph that satisfies logical consistency, including:
[0166] S401, Input undirected candidate edges:
[0167] S402, first perform a counterfactual asymmetric determination:
[0168]
[0169] Judgment direction: ;
[0170] S403, perform d-separation verification again. ;
[0171] S404, then perform Attention-assisted validation, estimating... ;
[0172] S405, finally perform NOTEARS convergence (a causal discovery algorithm based on continuous optimization, Nonlinear Structural Equations with Alternative Regularization and Sparsity), generating the final directed acyclic causal graph DAG: .
[0173] S500, based on the generated directed acyclic causal graph, utilizes a large language model to generate natural language interpretations and performs logical consistency closed-loop verification, including:
[0174] S501, Counterfactual Interpretation Generation:
[0175] Based on the established DAG: cold wave → temperature drop → delayed school opening
[0176] Constructing counterfactual intervention: do(cold wave=0),
[0177] calculate:
[0178] The path and values are fed into a large language model to generate explanatory text: If no cold wave occurs, the temperature will not drop significantly, and the probability of postponing the start of school will decrease by 63%, indicating that the cold wave indirectly caused the school to postpone the start of school through the drop in temperature.
[0179] S502, Logical Consistency Closed-Loop Verification:
[0180] Construct logical constraints:
[0181] If the cold wave value is 0, then the temperature drop is not valid;
[0182] If the temperature does not drop, then postponing the start of school is not an option;
[0183] This forms the constraint set Φ.
[0184] SAT / SMT verification:
[0185] If Φ satisfies → output "valid";
[0186] If the path "no cold wave but school opening still postponed" is given again → SMT cannot satisfy → trigger backtracking to reconstruct DAG.
[0187] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model, characterized in that, include: Get the input text; The large language model is used to semantically encode and cluster the acquired input text to establish a set of candidate causal variables; Causal relationship detection is performed on the established set of candidate causal variables based on counterfactual intervention and the do operator; Perform causal direction determination and generate a directed acyclic causal graph that satisfies logical consistency; Based on the generated directed acyclic causal graph, a large language model is used to generate natural language interpretations and perform closed-loop verification of logical consistency.
2. The method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model according to claim 1, characterized in that, The large language model is used to semantically encode and cluster the acquired input text to establish a set of candidate causal variables, including: The input text is semantically encoded using a large language model to obtain word-level or sub-word-level vector representations, sentence vectors, and corresponding attention weight matrices, which are used to characterize the semantic relationships and contextual dependency structures between semantic units in the text. Clustering of semantic unit embedding vectors in text automatically summarizes potential candidate causal variables from the semantic representation space; The causal semantic validity of candidate causal variables is initially screened and enhanced, and a set of candidate causal variables is established.
3. The method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model according to claim 2, characterized in that, Clustering of semantic unit embeddings in the text automatically summarizes potential candidate causal variables from the semantic representation space, including: Clustering semantic unit embeddings in the text forms semantically independent semantic clusters, representing a set of potential candidate causal variables; Each semantic cluster is mapped to a candidate causal variable representation in logical predicate form, as shown in the following expression: in, These represent the event type, attribute, and time characteristics obtained by statistically summarizing the semantic units co-occurring in this semantic cluster, respectively. Event is represented in the form of a logical predicate. By using semantic similarity measurement and word sense disambiguation rules, candidate causal variables are normalized to merge semantically equivalent variable expressions and eliminate redundant variables caused by synonymy or ambiguity.
4. The method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model according to claim 3, characterized in that, An algorithm for clustering semantic unit embeddings in text includes at least one of the following: The HDBSCAN algorithm and k-means algorithm are based on density extension.
5. The method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model according to claim 2, characterized in that, Preliminary screening and enhancement of the causal semantic validity of candidate causal variables, including: Based on the set of causal marker words in natural language, the corresponding causal context region is located in the attention weight matrix; Calculate the causal triggering function for the semantic unit located within the causal context region. The expression is as follows: in, A causal semantic strength function maps semantic units to non-negative real numbers, characterizing the degree to which the semantic unit assumes a causal role in natural language. Let be the set of nonnegative real numbers. The set segmented by event phrases; Preserving its semantic units satisfies Candidate causal variables or their components that exceed a preset threshold.
6. The method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model according to any one of claims 1-5, characterized in that, Causal relationship detection is performed on the established set of candidate causal variables based on counterfactual intervention and the do operator, including: The established set of candidate causal variables is represented as follows: in These are the valid causal variables after passing the consistency screening. Construct a structural causal model, mapping candidate causal variables to nodes in the structural causal model, and build a parameterized structural equation for each node variable: in, Indicates generated variables causal function, express The set of parent variables, Let j represent the j-th causal variable. Represents independent exogenous noise terms; Then, a structural cause-effect graph is generated from all the structural equations: Where V is the set of variable nodes and E is the set of edges, conforming to: G is a directed acyclic graph (DAG); Intervention simulation based on the do operator, for any candidate causal edge Constructing counterfactual intervention operations: in, Replace the structural equation with the constant values after counterfactual intervention. ; Perform Pearl's three-step counterfactual logic calculation, executing the following steps in sequence: Causal inference: Inferring potential noise variables; Intervention: Implementing intervention ; Prediction: Calculating the distribution of variables after intervention ; To determine the existence of causal influence, the change in the distribution of the target variable before and after the intervention must satisfy... hour, To determine the preset threshold To establish a valid causal relationship, output as a set of undirected candidate causal edges.
7. The method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model according to claim 6, characterized in that, Constructing counterfactual intervention operations also includes: In the semantic representation space, the embedding vector is perturbed to form continuous do-intervention samples, which are used to help estimate the changes in the distribution of the target variable before and after the intervention.
8. The method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model according to claim 6 or 7, characterized in that, Perform causal direction determination and generate a directed acyclic causal graph that satisfies logical consistency, including: For each undirected candidate causal edge Construct counterfactual interventions respectively: in, Let i be the constant value after counterfactual intervention. To observe the constant values of the target variable j after counterfactual intervention; Each counterfactual three-step reasoning step was performed to compare the asymmetry of the intervention's impact in order to determine the causal direction. Perform the following conditional independence test on the determined direction to verify that the direction satisfies the d-separation constraint: in, The set of candidate condition variables does not include ; The above constraints are added as soft constraints to the objective function of causal graph structure optimization to generate a directed acyclic causal graph that satisfies logical consistency.
9. The method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model according to claim 8, characterized in that, Determining the direction of causality also includes: The continuous counterfactual intervention results based on embedding perturbations serve as supplementary evidence for determining the causal direction.
10. The method for automatically generating causal structures based on semantic representation and logical reasoning of a large language model according to claim 9, characterized in that, Based on the generated directed acyclic causal graph, a large language model is used to generate natural language interpretations and perform logical consistency closed-loop verification, including: Based on the final generated directed acyclic causal graph and structural causal model, counterfactual path analysis is performed on the target variable Y of user interest and its upstream causal path. By implementing counterfactual intervention, the changes before and after the intervention are calculated. A large language model is then used to generate natural language causal explanation text that satisfies logical path constraints. The directed acyclic causal graph and structural equation constraints are transformed into a set of first-order logic and satisfiability constraints Φ. The propositional logic satisfiability problem SAT or the satisfiability module theory problem SMT solver is used to verify whether there is a contradiction in Φ. If a conflict is detected, backtrack to locate the conflicting edge or equation, return to the causal direction determination, and perform optimization and reconstruction: Here, SAT is the solver for the propositional logic satisfiability problem (SAT), Φ is the constraint set, G is the final cause-effect graph, and F is the structural equation constraint set. Together, they constitute the first-order logic and satisfiability constraint set. "valid" indicates that there exists an assignment that makes all constraints true simultaneously, and "conflict" indicates that there is no such assignment and a logical contradiction occurs.
Citation Information
Cited By
Industrial operation and maintenance text-driven causal diagram construction and root cause analysis method and device
CN122221990A
Industrial equipment fault intelligent diagnosis method, device and equipment and storage medium
CN122222041A