Question and answer method and system based on large model causal diagram discovery and causal diagram enhanced reasoning

By using BFS-driven hierarchical expansion and real-time loop detection, combined with a large language model to construct a causal graph, the problems of high complexity in causal graph construction and lack of causal logic in answer generation are solved, realizing an efficient and interpretable question-answering system suitable for the medical and financial fields.

CN121860059APending Publication Date: 2026-04-14GUANGDONG UNIV OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-15
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing technologies in causal graph construction and question-answering systems suffer from high computational complexity, high resource consumption, and insufficient interpretability due to the lack of explicit causal logic in answer generation, making them difficult to apply in highly rigorous scenarios.

Method used

A hierarchical expansion strategy driven by breadth-first search (BFS) is used to construct a causal graph. Real-time loop detection is combined with a large language model (LLM) for causal path retrieval and answer generation, ensuring that the answer follows causal logic.

Benefits of technology

It significantly reduces the computational complexity of causal graph construction, improves the accuracy and interpretability of answers, enhances user trust, and is suitable for question-answering systems in fields such as healthcare and finance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121860059A_ABST
    Figure CN121860059A_ABST
Patent Text Reader

Abstract

The invention discloses a question and answer method and system based on large model causal graph discovery and causal graph enhanced reasoning, and belongs to the technical field of natural language processing and artificial intelligence. The method comprises the following steps: firstly, carrying out hierarchical expansion from an initial root node by adopting a breadth-first search strategy, and efficiently constructing a reliable causal graph conforming to directed acyclic graph constraints with linear complexity in combination with real-time loop detection; in the question and answer stage, key entities in user questions are analyzed, and causal paths connecting the key entities are retrieved in a causal graph; and taking the retrieved structured causal path as a constraint condition to be injected into a decoding process of a large-scale language model, and generating a natural language answer which is strict in logic and can trace reasoning steps. According to the method, the resource consumption of large-scale causal discovery is remarkably reduced, the accuracy and interpretability of the answers of the questions and answers are effectively improved, and technical support is provided for medical treatment, finance and other scenes needing high-reliability reasoning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of natural language processing and artificial intelligence, and in particular to a question-answering method and system based on large-model causal graph discovery and causal graph-enhanced reasoning. Background Technology

[0002] In recent years, artificial intelligence technology has made groundbreaking progress, especially with the rise of large-scale language models, which has brought revolutionary changes to natural language processing, knowledge reasoning, and interactive question answering tasks. Large models, such as GPT-4 and DeepSeek-v3, have demonstrated powerful semantic understanding and generation capabilities through massive text pre-training, enabling them to extract complex relationships from unstructured text and generate anthropomorphic responses. However, their limitations are gradually becoming apparent in scenarios involving complex causal reasoning and multi-hop logical chain interpretation. Traditional question answering models often rely on the implicit knowledge associations of large-scale language models, lacking explicit modeling of causal relationships. This easily leads to fragmented answers, logical contradictions, or factual errors, severely restricting their reliable application in highly rigorous scenarios such as healthcare and finance.

[0003] While causal graphs serve as ideal structured knowledge representation tools, clearly depicting causal relationships between variables, their construction has long relied on time-consuming and labor-intensive expert manual annotation or statistical causal discovery algorithms (such as PC algorithms and NOTEARS). Traditional algorithms suffer from significant problems such as high data requirements, high computational complexity, difficulty in directly extracting knowledge from natural language, and challenges in dynamic updates. Therefore, combining the powerful semantic reasoning capabilities of large-scale language models with the structured and interpretable advantages of causal graphs to build efficient and reliable question-answering systems has become a key challenge in promoting the practical application of cognitive intelligence.

[0004] Currently, technical solutions attempting to combine large-scale language models for causal discovery and question answering face significant bottlenecks. Firstly, in terms of causal graph construction, existing methods mostly employ a pairwise causal query pattern based on large-scale language models, requiring independent interaction with each pair of variables in the variable set to determine their causal relationship. This approach results in query complexity as high as [insert value here]. In large-scale, high-dimensional causal networks (such as biomedical graphs and supply chain analysis), computational efficiency is low, resulting in high resource consumption and API call costs, making it difficult to apply in practice. Secondly, causal edges freely generated by large language models may violate the basic constraints of directed acyclic graphs, forming loops. Existing methods lack real-time dynamic loop detection mechanisms during the construction process and usually rely on post-construction corrections, which further increases the computational burden and affects the reliability of the graph.

[0005] Furthermore, in the question-answering reasoning stage, existing question-answering systems based on large language models primarily rely on implicit knowledge within the model to generate answers, failing to incorporate structured causal relationships. This generation method, lacking explicit causal chain constraints, makes the model prone to defects when faced with multi-step causal reasoning, generating answers that violate causal logic, ultimately leading to insufficient interpretability and reduced user trust. Therefore, the industry urgently needs a new method that can significantly reduce computational complexity, ensure the correctness of causal graphs, and explicitly integrate causal logic into the answer generation process. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a question-answering method and system based on large-model causal graph discovery and causal graph-enhanced reasoning.

[0007] To achieve the above-mentioned objectives, the technical solution adopted by the present invention is as follows:

[0008] A question-answering method based on large-model causal graph discovery and causal graph-enhanced reasoning includes the following steps:

[0009] Step 1: Constructing an efficient causal graph based on Breadth-First Search (BFS), specifically including:

[0010] Initialization and root node identification: receiving includes A set of variables Its natural language description, through large language model LLM, identifies independent variables without parent nodes as root nodes, and verifies the validity of root nodes;

[0011] Hierarchical expansion and cause-effect graph construction: Add the root node to the BFS queue, iteratively process the nodes in the queue, use LLM to predict the direct child variables of the current node, and verify the correlation between the child variables and the current node;

[0012] Real-time loop detection and edge addition: For each candidate sub-variable, check whether adding an edge will cause a loop in the causal graph. Only add an edge if there is no loop and add the sub-variable to a queue until the queue is empty, thus constructing a complete acyclic causal graph. ;

[0013] Step 2: Question-answering reasoning and path retrieval based on causal graphs, specifically including:

[0014] Problem Analysis and Named Entity Recognition: Perform named entity recognition on user-input questions to extract key entities and implicit relationships;

[0015] Causal subgraph retrieval and causal path identification: in causal graphs Retrieve local subgraphs related to key entities and identify causal paths from cause entities to result entities;

[0016] Step 3: Generate an interpretable answer by integrating causal paths, specifically including:

[0017] Context building: Converting causal relationships in local subgraphs into natural language descriptions as contextual information;

[0018] Constraint-based answer generation: Input user questions, contextual information, and causal paths into the LLM to generate a final interpretable answer.

[0019] Furthermore, the initialization and root node identification in step 1 specifically include:

[0020] Variable definition: Receives a set of variables and its description text ,in For variables Description;

[0021] Root node discovery: Design hints Guided LLM to identify candidate sets of independent variables The set of parsed variables is obtained by parsing the LLM response text;

[0022] Root node verification: for candidate set Each variable in the set is logically verified to ensure that no other variable points to that variable, thus obtaining a valid set of independent variables. .

[0023] Furthermore, the hierarchical expansion and causal graph construction in step 1 specifically include:

[0024] Initialize the BFS queue: This involves merging the verified set of independent variables. Add to queue And mark it as the set of visited nodes. ;

[0025] Iterative expansion: when the queue If not empty, retrieve the current node. Using LLM hints predict The direct child variables are used to generate a set of candidate child variables. ;

[0026] Validation and filtering: Calculate the correlation measure between the current node and the candidate sub-variables. ,like Greater than the preset threshold If so, then the sub-variable is retained.

[0027] Furthermore, the real-time loop detection and edge addition in step 1 specifically include:

[0028] Loop detection: For each candidate child node Examine the cause-effect graph Does it exist from To the current node If a path exists, the edge should not be added.

[0029] Add edges safely: Add edges only if there are no loops. , Add to edge set In, and will Add to queue The premise is Not in the visited set or queue;

[0030] Loop termination: Repeat iterations until the queue is reached. If empty, output the cause-effect graph of the directed acyclic graph (DAG) structure. .

[0031] Furthermore, the problem parsing and named entity recognition in step 2 specifically include:

[0032] Entity extraction: using a named entity recognition model User issues Process and identify the relevant entity set. ;

[0033] Key Entity Filtering and Implicit Relationship Extraction: Using LLM to Analyze the Problem Given a set of entities E, output the key entities. and implicit relationships .

[0034] Furthermore, the causal subgraph retrieval and causal path identification in step 2 specifically include:

[0035] Subgraph retrieval: Retrieves all entities in the causal graph G that are related to the key entity. The related nodes and edges form a local subgraph. ,in Includes from Departure or arrival Nodes on all paths;

[0036] Causal path identification: in subgraph Search for one or more causal paths from the cause entity to the result entity. .

[0037] Furthermore, the context construction in step 3 specifically includes:

[0038] Local subgraphs The causal relationships in the text are concatenated into a natural language description, in the form of "The following causal relationships are known: lead to ",in and yes The nodes in.

[0039] Furthermore, the generation of the binding answer in step 3 specifically includes:

[0040] The design generates prompts to address user questions. Contextual information and causal path Input LLM, and the LLM_generate function will generate the answer. This ensures that the answer follows the causal chain logic.

[0041] Furthermore, the method is applied to question-answering systems in the medical and financial fields to improve the accuracy and interpretability of answers.

[0042] This invention also discloses a question-answering system based on large-model causal graph discovery and causal graph-enhanced reasoning, configured to perform the above-described question-answering method, including:

[0043] A causal graph construction module is used to interact with large language models (LLMs) based on a breadth-first search (BFS) strategy to construct and maintain an acyclic causal graph with linear complexity. This module includes:

[0044] The initialization unit is used to receive a set of variables and their natural language descriptions, and to identify and verify root variables without parent nodes through LLM;

[0045] The hierarchical extension unit is used to manage the BFS queue, iteratively removes nodes from the queue, and calls LLM to predict the direct children of the node.

[0046] The loop detection and graph update unit is used to detect whether a loop will be formed in real time when adding each candidate edge, ensuring that the causal graph conforms to the DAG constraint and updating the graph structure;

[0047] A question-answering reasoning engine module is used to process user queries and perform structured reasoning using the causal graph; this module includes:

[0048] The question parsing unit is used to perform named entity recognition on user-input questions and extract key entities and implicit relationships;

[0049] The path retrieval unit is used to retrieve local subgraphs related to key entities in the causal graph and locate causal paths from causal entities to result entities.

[0050] An interpretable answer generation module is used to integrate causal path information to generate the final answer; this module includes:

[0051] Context building units are used to convert retrieved local causal subgraphs into contexts described in natural language.

[0052] The constraint generation unit is used to integrate user questions, natural language context, and causal paths into structured prompts, guiding LLM to generate interpretable answers that follow causal logic.

[0053] The causal graph storage module is used to persistently store the causal graph structure generated by the causal graph construction module, including nodes, edges and their relationships, and to provide a query interface for the question answering reasoning engine module.

[0054] The Large Language Model Interface Module serves as a communication bridge between the system and one or more large language models, uniformly managing calls to the LLM, prompting engineering, and response parsing.

[0055] Compared with the prior art, the advantages of the present invention are as follows:

[0056] 1. This invention fundamentally changes the paradigm of traditional causal graph construction by employing a hierarchical expansion strategy driven by breadth-first search (BFS), reducing the query complexity of large language models from that of traditional pairwise query methods. Optimized to This fundamental improvement allows the system to reduce computational tasks that would normally take hours or even longer to minutes when processing large-scale, high-dimensional causal networks (such as biomedical graphs and supply chain relationship graphs), significantly improving efficiency. This not only drastically reduces the consumption of computing resources but also directly lowers the economic costs associated with frequently calling large language model APIs, removing efficiency and cost barriers to the large-scale practical application of the technology. Furthermore, the hierarchical expansion method simulates the human cognitive logic from root cause to derived result, effectively reducing the attentional distraction that large language models might experience when processing long, complex, and disordered relationships, thereby indirectly improving the accuracy of causal relationship predictions.

[0057] 2. This invention effectively solves the fragmentation and logical contradictions commonly found in traditional large-scale language models when generating answers by deeply integrating a constructed causal graph as a reliable source of structured knowledge into the question-and-answer generation process. When answering complex questions involving multi-step reasoning, the system does not allow large language models to operate freely. Instead, it first performs precise path retrieval within the causal graph to pinpoint the complete causal chain from cause to effect. This mechanism forces the generated answer to strictly adhere to verified causal logic, ensuring the scientific validity and consistency of the statements within the answer. For example, in medical diagnosis scenarios, the system avoids making leaps or erroneous inferences such as "a certain symptom directly causes another unrelated symptom," instead providing a rigorous, step-by-step explanation consistent with pathophysiological principles, significantly improving the reliability of the answer.

[0058] 3. A core benefit of this invention lies in its significantly enhanced interpretability of the question-answering system, thereby building user trust in AI decision-making. The final answer generated by the system is not an isolated conclusion, but rather includes a clear and visualized causal chain derivation process. When a user asks a question like "Why does A lead to B?", the system not only provides the ultimate cause of B, but also gradually demonstrates how A influences B through intermediate variables C and D. This output method makes the logic of answer generation transparent, like an expert showing a user their detailed reasoning notes, allowing the user to easily understand and verify the rationality of the answer. This deep interpretability is crucial for fields requiring high responsibility and rigor, such as medical consultation, financial risk control, and policy analysis, and is a key step in promoting AI technology as a truly trustworthy decision support tool. Attached Figure Description

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

[0060] Figure 1 This is the flow of a question-answering method based on large-model causal graph discovery and causal graph-enhanced reasoning in an embodiment of the present invention. Detailed Implementation

[0061] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0062] like Figure 1 As shown, an embodiment of the present invention provides a question-answering method based on large-model causal graph discovery and causal graph-enhanced reasoning, comprising:

[0063] Step 1: Constructing an efficient causal graph based on breadth-first search (BFS)

[0064] The first step of this invention employs a hierarchical expansion strategy driven by breadth-first search (BFS) and combines it with a real-time loop detection mechanism. This allows the invention to achieve linear complexity. Efficiently construct a reliable, loop-free causal graph from data. This process simulates the human cognitive logic from "cause" to "effect," first identifying independent "root cause" variables, and then exploring their direct and indirect effects layer by layer downwards.

[0065] 1. Initialization and Root Node Identification

[0066] 1.1 Variable Definition: Receives a set containing n variables. And its corresponding natural language description. The input data can be represented as:

[0067] (1)

[0068] in For variables The descriptive text.

[0069] 1.2 Root Node Discovery: Design Hints This guides the LLM to identify independent variables without parent nodes, and obtains the set of parsed variables by parsing the LLM's response text R. Generate a set of candidate independent variables C:

[0070] (2)

[0071] 1.3 Root Node Validation: Perform logical validation on each variable in the candidate set C to obtain the final set of independent variables. :

[0072] (3)

[0073] in, These are candidate variables.

[0074] 2. Hierarchical Expansion and Cause-Effect Graph Construction

[0075] 2.1 Initialize the queue: Add the verified set of independent variables to the breadth-first search (BFS) queue Q and mark it as the set of visited nodes. :

[0076] (4)

[0077] 2.2 Iterative Expansion: While queue Q is not empty, perform the following operations in a loop:

[0078] Retrieve the current node: Retrieve a node from the head of queue Q. And add it to the visited set:

[0079] (5)

[0080] (6)

[0081] Generating child node candidates: Constructing LLM hints Requires prediction The sub-variables directly affected by the LLM are then parsed to obtain the set of parsed variables. Generate a set of candidate sub-variables :

[0082] (7)

[0083] Validation and filtering: Each candidate sub-variable Verify its relationship with Is the correlation significant?

[0084] (8)

[0085] in It is a correlation measure. It is a preset threshold.

[0086] 3. Real-time loop detection and edge addition

[0087] 3.1 Loop Detection: For each verified candidate child node... Check the current cause-effect graph Is there a path from arrive The path. The function is defined as follows:

[0088] (9)

[0089] (10)

[0090] 3.2 Safe Edge Addition: Edges are added only if no loops exist. Add to edge set In, and will Add to queue Q:

[0091] (11)

[0092] (12)

[0093] 3.3 Loop Termination: Repeat steps 2.2 to 3.2 until the BFS queue is reached. Empty ( At this point, a complete acyclic causal graph is formed. Build complete.

[0094] Step 2: Question-answering reasoning and path retrieval based on causal graphs

[0095] Once a user submits a question, this step utilizes the causal graph constructed in the previous step to transform the abstract natural language question into a structured graph query task. By accurately identifying the core entities in the question and retrieving the causal paths connecting these entities in the causal graph, a solid logical framework is provided for generating an interpretable answer.

[0096] 4. Problem Analysis and Named Entity Recognition

[0097] 4.1 Entity Extraction: User Input Issues Afterwards, the system... Perform Named Entity Recognition (NER) operations to identify relevant entities. Let the entity recognition model be... Then we have:

[0098] (13)

[0099] in, This indicates the entities identified based on the question. To identify the number of entities.

[0100] 4.2 Key Entity Screening and Implicit Relationship Extraction: Key Entities Extracted Using LLM and implicit relationships :

[0101] (14)

[0102] 5. Causal subgraph retrieval and causal path identification

[0103] 5.1 Subgraph Retrieval: In the complete causal graph Search for all results related to The nodes and edges related to the entities in the graph form a local subgraph that is highly relevant to the problem. . Includes all from Departure or arrival Nodes on the path:

[0104] (15)

[0105] 5.2 Causal Path Identification: In the subgraph Search for one or more causal paths from the entity representing the "cause" to the entity representing the "effect":

[0106] (16)

[0107] Step 3: Generating an interpretable answer by integrating causal paths

[0108] 6. Context Construction: Subgraph The causal relationships in the text are converted into natural language descriptions to form contextual information. :

[0109] (17)

[0110] 7. Constraint-based answer generation: Design the final generated hints to address the original question. Contextual information and causal path Inputting LLM together generates the final interpretable answer. :

[0111] (18).

[0112] To better illustrate the present invention, an example of a question-and-answer scenario in the field of medical and health care will be used below.

[0113] Scenario: A user asks a question to the Q&A system: "Why does high blood pressure increase the risk of stroke?"

[0114] Step 1: Cause-effect graph construction

[0115] 1. Initialization: The system receives a set of medical variables and their descriptions, such as "hypertension," "hyperlipidemia," "atherosclerosis," "thrombosis," and "stroke." LLM identifies "hypertension" and "hyperlipidemia" as common initial risk factors (root node) based on initialization prompts.

[0116] 2. Hierarchical expansion:

[0117] Queue Q = [hypertension, hyperlipidemia].

[0118] When asked about hypertension, the LLM was prompted, "What does hypertension directly lead to?" The LLM replied, "Atherosclerosis."

[0119] When asked about "high cholesterol," the LLM was prompted with the question, "What does high cholesterol directly lead to?" The LLM replied, "Atherosclerosis."

[0120] At this point, "atherosclerosis" is added to queue Q. Q = [atherosclerosis].

[0121] When asked about "atherosclerosis," the LLM was prompted with the question, "What does atherosclerosis directly lead to?" The LLM replied, "Thrombosis."

[0122] "Thrombosis" is added to queue Q. Q = [Thrombosis].

[0123] When asked about thrombosis, the LLM was asked, "What does thrombosis directly lead to?" The LLM replied, "Stroke."

[0124] 3. Loop Detection and Graph Construction: During the above process, the system performs loop detection every time an edge is added (e.g., "hypertension → atherosclerosis"). For example, if LLM incorrectly proposes "stroke → hypertension", the system will detect that a path from "hypertension" to "stroke" already exists in the graph, and therefore refuse to add this edge that would form a loop.

[0125] 4. Final causal graph (partial): After iteration, the system constructed a causal graph containing the path "hypertension → atherosclerosis → thrombosis → stroke".

[0126] Step 2: Question-Answering Reasoning and Path Retrieval

[0127] 5. Question Analysis and Named Entity Recognition: The system receives the user question "Why does high blood pressure increase the risk of stroke?", The entity {hypertension, stroke, risk} is parsed out, and LLM filters out the key entity and relation {cause: hypertension, result: stroke}.

[0128] 6. Subgraph Construction and Path Retrieval: The system retrieves the path from "hypertension" to "stroke" within the constructed causal graph. It successfully identified the critical path P: Hypertension → Atherosclerosis → Thrombosis → Stroke.

[0129] Step 3: Generating Explainable Answers

[0130] 7. Context Construction and Constraint Generation: The system converts the path P into a natural language description and constructs the final prompt: "Based on the following causal chain: 'High blood pressure leads to atherosclerosis, atherosclerosis leads to thrombosis, and thrombosis leads to stroke,' please answer the user's question in detail: 'Why does high blood pressure increase the risk of stroke?'"

[0131] 8. Output the final answer: After receiving this highly structured instruction, LLM generates the following interpretable answer:

[0132] "The reason why high blood pressure increases the risk of stroke follows a clear pathophysiological process:"

[0133] High blood pressure leads to atherosclerosis: Long-term high blood pressure continuously impacts the inner walls of blood vessels, causing damage to the vascular endothelium and creating conditions for the deposition of substances such as fat and cholesterol, thereby accelerating the formation and development of atherosclerosis.

[0134] Atherosclerosis leads to thrombosis: Hardened plaques have a rough, uneven surface and are prone to rupture. Once ruptured, they activate the body's clotting system, forming a thrombus at the plaque site.

[0135] Blood clots can cause strokes: If a blood clot breaks off and travels through the bloodstream to a blood vessel in the brain, it can block a key artery that supplies blood to the brain, leading to ischemia and hypoxia in the brain tissue, and thus causing a stroke.

[0136] Therefore, high blood pressure significantly increases the risk of stroke by triggering a series of chain reactions.

[0137] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0138] In another embodiment, a question-answering system based on large-model causal graph discovery and causal graph-enhanced reasoning is provided. This system corresponds one-to-one with the question-answering methods based on large-model causal graph discovery and causal graph-enhanced reasoning in the above embodiments. It includes:

[0139] A causal graph construction module is used to interact with large language models (LLMs) based on a breadth-first search (BFS) strategy to construct and maintain an acyclic causal graph with linear complexity. This module includes:

[0140] The initialization unit is used to receive a set of variables and their natural language descriptions, and to identify and verify root variables without parent nodes through LLM;

[0141] The hierarchical extension unit is used to manage the BFS queue, iteratively removes nodes from the queue, and calls LLM to predict the direct children of the node.

[0142] The loop detection and graph update unit is used to detect whether a loop will be formed in real time when adding each candidate edge, ensuring that the causal graph conforms to the DAG constraint and updating the graph structure;

[0143] A question-answering reasoning engine module is used to process user queries and perform structured reasoning using the causal graph; this module includes:

[0144] The question parsing unit is used to perform named entity recognition on user-input questions and extract key entities and implicit relationships;

[0145] The path retrieval unit is used to retrieve local subgraphs related to key entities in the causal graph and locate causal paths from causal entities to result entities.

[0146] An interpretable answer generation module is used to integrate causal path information to generate the final answer; this module includes:

[0147] Context building units are used to convert retrieved local causal subgraphs into contexts described in natural language.

[0148] The constraint generation unit is used to integrate user questions, natural language context, and causal paths into structured prompts, guiding LLM to generate interpretable answers that follow causal logic.

[0149] The causal graph storage module is used to persistently store the causal graph structure generated by the causal graph construction module, including nodes, edges and their relationships, and to provide a query interface for the question answering reasoning engine module.

[0150] The Large Language Model Interface Module serves as a communication bridge between the system and one or more large language models, uniformly managing calls to the LLM, prompting engineering, and response parsing.

[0151] For specific limitations regarding the question-answering system based on large-model causal graph discovery and causal graph-enhanced reasoning, please refer to the limitations of the question-answering method based on large-model causal graph discovery and causal graph-enhanced reasoning mentioned above, which will not be repeated here. Each module in the above system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0152] In another embodiment of the present invention, a terminal device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve corresponding method flows or corresponding functions. The processor described in this embodiment can be used for the operation of a question-answering method based on large-model causal graph discovery and causal graph enhanced reasoning.

[0153] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory). This computer-readable storage medium is a memory device in a terminal device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and extended storage media supported by the terminal device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device.

[0154] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the question-answering method based on large model causal graph discovery and causal graph enhanced reasoning in the above embodiments; one or more instructions in the computer-readable storage medium are loaded and executed by a processor.

[0155] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0156] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0157] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A question-answering method based on large-scale causal graph discovery and causal graph-enhanced reasoning, characterized in that, Includes the following steps: Step 1: Constructing an efficient causal graph based on Breadth-First Search (BFS), specifically including: Initialization and root node identification: receiving includes A set of variables Its natural language description, through large language model LLM, identifies independent variables without parent nodes as root nodes, and verifies the validity of root nodes; Hierarchical expansion and cause-effect graph construction: Add the root node to the BFS queue, iteratively process the nodes in the queue, use LLM to predict the direct child variables of the current node, and verify the correlation between the child variables and the current node; Real-time loop detection and edge addition: For each candidate sub-variable, check whether adding an edge will cause a loop in the causal graph. Only add an edge if there is no loop and add the sub-variable to a queue until the queue is empty, thus constructing a complete acyclic causal graph. ; Step 2: Question-answering reasoning and path retrieval based on causal graphs, specifically including: Problem Analysis and Named Entity Recognition: Perform named entity recognition on user-input questions to extract key entities and implicit relationships; Causal subgraph retrieval and causal path identification: in causal graphs Retrieve local subgraphs related to key entities and identify causal paths from cause entities to result entities; Step 3: Generate an interpretable answer by integrating causal paths, specifically including: Context building: Converting causal relationships in local subgraphs into natural language descriptions as contextual information; Constraint-based answer generation: Input user questions, contextual information, and causal paths into the LLM to generate a final interpretable answer.

2. The question-and-answer method according to claim 1, characterized in that, The initialization and root node identification in step 1 specifically include: Variable definition: Receives a set of variables and its description text ,in For variables Description; Root node discovery: Design hints Guided LLM to identify candidate sets of independent variables The set of parsed variables is obtained by parsing the LLM response text; Root node verification: for candidate set Each variable in the set is logically verified to ensure that no other variable points to that variable, thus obtaining a valid set of independent variables. .

3. The question-and-answer method according to claim 1, characterized in that, The hierarchical expansion and cause-effect graph construction in step 1 specifically include: Initialize the BFS queue: This involves merging the verified set of independent variables. Add to queue And mark it as the set of visited nodes. ; Iterative expansion: when the queue If not empty, retrieve the current node. Using LLM hints predict The direct child variables are used to generate a set of candidate child variables. ; Validation and filtering: Calculate the correlation measure between the current node and the candidate sub-variables. ,like Greater than the preset threshold If so, then the sub-variable is retained.

4. The question-and-answer method according to claim 1, characterized in that, The real-time loop detection and edge addition in step 1 specifically include: Loop detection: For each candidate child node Examine the cause-effect graph Does it exist from To the current node If a path exists, the edge should not be added. Add edges safely: Add edges only if there are no loops. , Add to edge set In, and will Add to queue The premise is Not in the visited set or queue; Loop termination: Repeat iterations until the queue is reached. If empty, output the cause-effect graph of the directed acyclic graph (DAG) structure. .

5. The question-and-answer method according to claim 1, characterized in that, The problem parsing and named entity recognition in step 2 specifically include: Entity extraction: using a named entity recognition model User issues Process and identify the relevant entity set. ; Key Entity Filtering and Implicit Relationship Extraction: Using LLM to Analyze the Problem and entity set Output key entities and implicit relationships .

6. The question-and-answer method according to claim 1, characterized in that, The causal subgraph retrieval and causal path identification in step 2 specifically include: Subgraph retrieval: Retrieves all entities in the causal graph G that are related to the key entity. The related nodes and edges form a local subgraph. ,in Includes from Departure or arrival Nodes on all paths; Causal path identification: in subgraph Search for one or more causal paths from the cause entity to the result entity. .

7. The question-and-answer method according to claim 1, characterized in that, The context construction in step 3 specifically includes: Local subgraphs The causal relationships in the text are concatenated into a natural language description, in the form of "The following causal relationships are known: lead to ",in and yes The nodes in.

8. The question-and-answer method according to claim 1, characterized in that, The generation of the binding answer in step 3 specifically includes: The design generates prompts to address user questions. Contextual information and causal path Input LLM, and the LLM_generate function will generate the answer. This ensures that the answer follows the causal chain logic.

9. The method according to claim 1, characterized in that, The method is applied to question-answering systems in the medical and financial fields to improve the accuracy and interpretability of answers.

10. A question-answering system based on large-model causal graph discovery and causal graph-enhanced reasoning, characterized in that, Configured to perform the question-answering method according to any one of claims 1 to 9, comprising: A causal graph construction module is used to interact with large language models (LLMs) based on a breadth-first search (BFS) strategy to construct and maintain an acyclic causal graph with linear complexity. This module includes: The initialization unit is used to receive a set of variables and their natural language descriptions, and to identify and verify root variables without parent nodes through LLM; The hierarchical extension unit is used to manage the BFS queue, iteratively removes nodes from the queue, and calls LLM to predict the direct children of the node; The loop detection and graph update unit is used to detect whether a loop will be formed in real time when adding each candidate edge, ensuring that the causal graph conforms to the DAG constraint and updating the graph structure; A question-answering reasoning engine module is used to process user queries and perform structured reasoning using the causal graph; this module includes: The question parsing unit is used to perform named entity recognition on user-input questions and extract key entities and implicit relationships; The path retrieval unit is used to retrieve local subgraphs related to key entities in the causal graph and locate causal paths from causal entities to result entities. An interpretable answer generation module is used to integrate causal path information to generate the final answer; this module includes: Context building units are used to convert retrieved local causal subgraphs into contexts described in natural language. The constraint generation unit is used to integrate user questions, natural language context, and causal paths into structured prompts, guiding LLM to generate interpretable answers that follow causal logic; The causal graph storage module is used to persistently store the causal graph structure generated by the causal graph construction module, including nodes, edges and their relationships, and to provide a query interface for the question answering reasoning engine module. The Large Language Model Interface Module serves as a communication bridge between the system and one or more large language models, uniformly managing calls to the LLM, prompting engineering, and response parsing.

Citation Information

Cited By

  • Large-scale language model decision-making method fusing causal reasoning and uncertainty quantification

    CN122021946A