Causal structure constraint and inference method and system based on large language model
By adopting causal structure constraints and inference methods based on large language models in the causal inference task, the problems of low efficiency and limited accuracy of causal inference in the existing technology are solved, and efficient and accurate causal inference on large-scale data sets are achieved.
Patent Information
- Application Number
- CN202411774650.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-11
AI Technical Summary
The prior art has problems of high computational cost, inefficiency and limited accuracy in causal inference tasks of large-scale data sets, especially in areas where professional knowledge is scarce.
The causal structure constraints and inference methods based on large language models are adopted, and the efficiency and accuracy of causal structures are improved through variable understanding, causal inference, error correction and causal structure learning stages, combined with natural language processing and data-driven causal structure learning algorithms.
It realizes efficient and accurate causal inference without relying on expert input, especially in the analysis of large-scale data sets, which improves the understanding and interpretation of causal relationships and enhances the credibility of model output.
Smart Images

Figure CN119808937A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and system for causal structure constraint and inference based on a large language model. Background Art
[0002] In the field of data analysis and machine learning, causal inference is a key task that aims to reveal the causal relationship between variables. Traditional methods, such as statistical-based methods and structural equation models, identify causal relationships between variables by analyzing observational data. However, these methods face multiple challenges when dealing with large-scale data sets: traditional causal inference methods are computationally expensive when performed on large-scale data sets, resulting in a time-consuming and resource-intensive analysis process. This efficiency problem becomes more significant as the amount of data increases; causal inference methods that rely solely on observational data may not accurately reveal the causal relationship between variables. The complexity and limitations of real-world data, such as sample selection bias and omitted variable bias, further limit the accuracy of these methods; existing methods often require expert input to set model parameters or perform hypothesis testing, which may be difficult to achieve in many fields, especially those where expertise is scarce.
[0003] Given these limitations, existing technologies have obvious shortcomings in causal inference tasks for large-scale datasets. Especially with the rapid development of data science today, there is an increasing demand for technologies that can perform causal inference efficiently and accurately. Summary of the invention
[0004] To address the deficiencies of the prior art, the present invention proposes an innovative technical solution, which integrates the natural language processing capabilities of large language models (LLMs) and data-driven causal structure learning algorithms, thereby improving the efficiency and accuracy of causal inference tasks. In particular, in the analysis of large-scale data sets, by utilizing the powerful capabilities of LLMs, the present invention can more deeply understand and interpret the data, thereby more accurately inferring the causal relationship between variables without relying on expert input.
[0005] To achieve the above objectives, the technical solutions adopted by the present invention include:
[0006] A method for causal structure constraint and inference based on a large language model, characterized by comprising:
[0007] S1, variable understanding stage, by inputting variable understanding text and variable understanding prompt words into LLMs to output understanding variable text;
[0008] Specifically, each variable x i Through a set of descriptive text (T i =t i1 ,ti2 ,...,t in ), where n is the number of descriptions. These descriptions may include the variable’s name, symbol, attributes, possible values, and meaning in a specific field. In order to facilitate LLMs’ understanding of relevant variables, a set of variable understanding prompts P is designed. 1 , these prompt words are used to guide the attention of LLMs and extract key information. 1 Possibly: (1) You are an expert in your field; (2) You are investigating the causal relationship between the following variables in your field: including the functional description of the variables, the possible values and ranges of the variables, the role of the variables in a specific field or context, and the relationship between the variables.
[0009] The specific implementation process is to enter the variable understanding text T in LLMs i And variable understanding prompt word P 1 , LLMs outputs the understanding variable text E(T i ,P 1 ).
[0010] S2, causal inference stage, based on the understanding variable text input into LLMs and combined with causal inference prompt words to output a directed graph network set A1;
[0011] Specifically, the variable understanding text E(T i ,P 1 ) as the input part of the causal inference stage, that is, E(T i ,P 1 ) is input into LLMs, and the output is a directed graph network set A1 that represents the direct causal relationship between each variable.
[0012] In order to facilitate LLMs to identify causal relationships between variables, a set of causal inference prompt words P is designed. 2 :(1) Based on the meaning of the variables you provided, analyze the direct causal relationship between them;(2) Please give the results in the form of a directed graph network in the format of x i →x j , that is, x i is x j (3) Ensure that each edge represents a direct causal relationship between two variables. The causal structure of this scheme only requires the directness of the causal relationship, because all indirect causal relationships can be inferred from the direct causal relationship.
[0013] S3, error correction stage, inputting the initial directed graph network set A1 and the error correction prompt words into LLMs to output a corrected directed graph network set A;
[0014] Specifically, the error correction stage is designed to improve the accuracy of causal statements. In this stage, LLMs are required to revisit and correct the causal statements they generate. This step is crucial because even the most advanced LLMs may produce incorrect causal inferences due to comprehension bias or incomplete data.
[0015] In order to promote LLMs to perform effective self-checking and correction, a set of error correction prompt words P is designed. 3 These prompts are used to guide LLMs to re-evaluate the accuracy of causal statements. Prompts may include: (1) evaluating the rationale for the directed graph causal relationship between variables based on the input causal relationship graph; (2) providing domain knowledge to verify its consistency with the existing causal statement; (3) asking the model for its confidence level in the causal statement and requiring supporting evidence; (4) re-providing a revised causal relationship graph between variables after evaluation.
[0016] S4, causal structure learning stage, using the directed graph network set A as the ancestor constraint, and incorporating the ancestor constraint A into the score-based causal structure learning algorithm to obtain the optimal causal structure.
[0017] Specifically, causal structure learning combines causal statements generated by large language models (LLMs) with data-driven algorithms to learn more accurate causal structures. This step is crucial for extracting deep causal relationships from data.
[0018] Here we define a causal structure in the Bayesian causal network: ancestral constraint That is, there must be a directed path from variable x to variable y.
[0019] This application uses the directed graph network set A finally output by LLMs as the ancestor constraint for causal structure learning, that is, the direct causal relationship x inferred by LLMs i →x j Here it is represented as This indicates that there is a dependent variable x in the causal structure. i to variable x j In addition, the framework for causal structure learning is CaMML (Causal Discovery via MML), which is a machine learning program for causal inference. It learns causal Bayesian networks through data and can also implement ancestral constraints. Let σ(G; D) be a scoring function, which evaluates the consistency of the causal structure G with the observed data D. CaMML can find the best causal structure G for the observed data D by using ancestral constraints and scoring functions. * .
[0020] The directed graph network set A1 may not be completely accurate because its effectiveness relies on the performance of LLMs in understanding causal mechanisms. Therefore, we find a balance between exploiting LLM-driven prior constraints and ensuring a certain error tolerance. This application can choose two methods to incorporate ancestry constraints into score-based causal structure learning algorithms, namely hard constraint-based methods and soft constraint-based methods.
[0021] Furthermore, the causal structure learning stage adopts the CaMML framework to learn the causal structure, and assumes σ(G; D) as a scoring function to evaluate the consistency between the causal structure G and the observed data D.
[0022] Furthermore, the score-based causal structure learning algorithm includes a hard constraint-based method and a soft constraint-based method.
[0023] Furthermore, the hard constraint-based method includes:
[0024] Define the search space G A , the search space G A A directed acyclic graph (DAG) G containing only those nodes satisfying the ancestry constraint A;
[0025] Use CaMML's heuristic search or optimization algorithm to determine G A The best G in the causal structure G is selected to obtain the maximum score σ(G; D) as the optimal causal structure G * .
[0026] Specifically, the scoring function is to define a scoring function to evaluate the consistency of each possible DAG model (causal structure) with the observed data D. CaMML uses the data encoding length as the scoring criterion, that is, the shortest information length required to encode the data and model.
[0027] Heuristic search methods can include greedy search, simulated annealing, genetic algorithms, etc. to reduce the search space and improve search efficiency.
[0028] Integration of ancestry constraints: The set of directed graph networks A obtained from LLMs is integrated into the search process as ancestry constraints. The search algorithm will only consider those DAG models that satisfy these constraints. For each candidate DAG model, its score is calculated using the CaMML framework. This involves calculating the complexity of the model and the encoding length of the data.
[0029] Apply an optimization algorithm to iterate the search process and gradually find the DAG model with the highest score. This may include local search, gradient descent, or other numerical optimization techniques.
[0030] Furthermore, the soft constraint-based method includes:
[0031] Define the weighted scoring function σ ′ (G; D, A) = σ(G; D) + λ·δ(G, A), where δ(G, A) represents the degree to which G violates the ancestor constraint A, and λ is a weight parameter;
[0032] Use CaMML's heuristic search or optimization algorithm to determine G A The optimal G in the equation is selected to maximize the weighted score σ ′ G of (G; D, A) as the optimal causal structure G * .
[0033] Specifically, the soft constraint method takes a more flexible attitude towards ancestry constraints during the search process, allowing a certain degree of violation to find a causal structure that is more consistent with the data. This method is suitable when there is insufficient confidence in the output of LLMs or the amount of data is large.
[0034] The algorithm steps are as follows:
[0035] 1) Define a weighted scoring function σ ′ (G; D, A) = σ(G; D) + λ·δ(G, A), where δ(G, A) measures the extent to which G violates the ancestral constraint A, and λ is a 0 to 1 weight parameter, the smaller the value, the weaker the constraint;
[0036] 2) Use heuristic search or optimization algorithms (such as simulated annealing) to search for the optimal G, that is, the optimal DAG model;
[0037] 3) Choose to maximize the weighted score σ ′ (G; D, A) G is the optimal causal structure G learned * .
[0038] Furthermore, the error correction stage also includes verifying whether the causal statements in the directed graph network set A1 conform to the knowledge logic of the professional field, and deleting the causal statements if they do not conform.
[0039] The present invention also provides a causal structure constraint and inference system based on a large language model, characterized by comprising:
[0040] A variable understanding module is used to output an understanding variable text by inputting a variable understanding text and a variable understanding prompt word to LLMs;
[0041] A causal inference module, for outputting a directed graph network set A1 based on the understanding variable text input to the LLMs and combining the causal inference prompt words;
[0042] An error correction module, used for inputting the initial directed graph network set A1 and the error correction prompt words into LLMs to output a corrected directed graph network set A;
[0043] The causal structure learning module is used to use the directed graph network set A as an ancestor constraint and incorporate the ancestor constraint A into the score-based causal structure learning algorithm to obtain the optimal causal structure.
[0044] The above system can realize all the functions of the method claims.
[0045] The present invention also provides a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
[0046] The present invention also provides an electronic device, characterized in that it includes a processor and a memory;
[0047] The memory is used to store computer programs;
[0048] The processor is configured to execute the method according to any one of claims 1 to 6 by calling a stored computer program.
[0049] The present invention also relates to a computer program product, comprising a computer program and / or instructions, characterized in that the computer program and / or instructions implement the steps of the above method when executed by a processor.
[0050] The beneficial effects of the present invention are as follows: the present scheme obtains the optimal causal structure by combining the hard constraint method and the soft constraint method, and selects appropriate weight parameters according to the confidence level of the causal statements output by LLMs and the data characteristics, so that the constraint method can find a balance between utilizing prior constraints and maintaining data consistency.
[0051] At the same time, the verification process in the error correction phase ensures that the causal statements generated by LLMs are consistent with the knowledge logic of the professional field, enhances the credibility of the model output, and ensures the accuracy and professionalism of these solutions. The combination of these two links enables this solution to provide more accurate and reliable causal relationship inference when processing complex data sets. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a flowchart of the method for causal structure constraint and inference based on a large language model of the present invention.
[0053] Figure 2 It is a schematic diagram of the system structure of the causal structure constraint and inference based on the large language model of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0055] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0056] The first aspect of the present invention relates to a causal structure constraint and inference method based on a large language model. Figure 1 The method shown comprises:
[0057] S1, variable understanding stage, by inputting variable understanding text and variable understanding prompt words into LLMs to output understanding variable text;
[0058] S2, causal inference stage, based on the understanding variable text input into LLMs and combined with causal inference prompt words to output a directed graph network set A1;
[0059] S3, error correction stage, inputting the initial directed graph network set A1 and the error correction prompt words into LLMs to output a corrected directed graph network set A;
[0060] S4, causal structure learning stage, using the directed graph network set A as the ancestor constraint, and incorporating the ancestor constraint A into the score-based causal structure learning algorithm to obtain the optimal causal structure.
[0061] Specifically, it can be applied in the medical field: The background of this embodiment is set in a typical medical research scenario, with the aim of better understanding the development process of the disease and the effects of different treatments. This embodiment involves a medical data set containing records of 1,000 patients, each of which includes the patient's symptoms (such as fever, cough), treatment results (such as antibiotic treatment), and recovery status (such as complete recovery, partial recovery). Through the analysis of these data by LLMs, researchers hope to reveal the potential causal relationship between symptoms, treatment, and recovery, thereby optimizing treatment plans and increasing the probability of recovery of patients.
[0062] In the text understanding stage, the pre-trained LLM is used to input the descriptive text of symptoms, treatments, and recovery conditions in the dataset, and combined with the variable understanding prompts, the variable understanding text of each variable is generated. For example, for the symptom "fever", LLMs not only recognize it as a medical term, but also understand the different degrees of severity it may represent in different situations. By inputting descriptive text and corresponding prompts, LLMs can generate an in-depth understanding of each variable, so that the semantic information of each variable is accurately captured and represented, providing the necessary background information and context for subsequent causal inference analysis. At the same time, through the automated variable understanding process, the time and errors of manual interpretation of medical records are reduced.
[0063] In the causal inference stage, LLM evaluates the causal relationship between symptoms and diseases through designed prompts. The input is the understanding description of the symptom variable in the text understanding stage, and the output is the causal relationship graph of each variable. Taking "fever" and "pneumonia" as examples, LLMs infer that fever is likely to be a symptom of pneumonia by analyzing the relevant information in the patient's record. This inference is achieved by constructing a directed graph network, in which each node represents a variable and the existence of an edge indicates a causal relationship. Through the advanced text processing capabilities of LLMs, we can more accurately infer the causal relationship between symptoms and diseases. The causal relationship graph generated by LLMs provides the basis for the error correction stage, making it easier to identify and correct possible inference errors. At the same time, the automated causal inference process reduces the need for manual analysis and improves the efficiency and accuracy of data analysis.
[0064] In the error correction stage, LLM uses internal consistency checks and comparisons with the medical domain knowledge base to correct causal statements. For example, if LLM mistakenly identifies "cough" as the cause of pneumonia, the error correction mechanism will find that the statement of "cough" as the cause of pneumonia is inconsistent with medical knowledge by comparing the domain knowledge base, and will identify this error and revoke its causal statement. This step outputs the corrected directed graph network set A between variables, preparing for the ancestral constraint input in the causal structure learning algorithm in the next step. Through internal consistency checks and cross-validation of the domain knowledge base, incorrect causal inferences are reduced. By autonomously identifying and correcting errors, reliance on manual review is reduced. The corrected causal graph is more in line with professional cognition in the medical field and improves the credibility of the research results.
[0065] In the causal structure learning phase, data-driven algorithms such as CaMML are used to learn the causal structure of the entire medical data set in combination with ancestral constraints generated by LLM. The input is the patient's observation data records and ancestral constraints, and the output is a directed acyclic graph (DAG). A directed acyclic graph (DAG) is a graph structure consisting of nodes (or vertices) and directed edges, where the edges are directional, that is, they point from the starting point to the end point. Each edge in the graph represents a statistically significant causal relationship. By combining the advanced text processing capabilities of LLMs and the statistical methods of the CaMML algorithm, the accuracy of causal inference is improved. The output DAG provides a clear causal relationship diagram, allowing researchers to intuitively understand the causal relationship between variables. Integrating ancestral constraints into the CaMML algorithm improves search efficiency and reduces invalid causal path exploration. At the same time, by revealing the causal structure in patient records, it provides a scientific basis for clinical treatment and health decision-making.
[0066] Another aspect of the present invention also relates to a causal structure constraint and inference system based on a large language model, the structure of which is as follows: Figure 2 As shown, including:
[0067] A variable understanding module is used to output an understanding variable text by inputting a variable understanding text and a variable understanding prompt word to LLMs;
[0068] A causal inference module, for outputting a directed graph network set A1 based on the understanding variable text input to the LLMs and combining the causal inference prompt words;
[0069] An error correction module, used for inputting the initial directed graph network set A1 and the error correction prompt words into LLMs to output a corrected directed graph network set A;
[0070] The causal structure learning module is used to use the directed graph network set A as an ancestor constraint and incorporate the ancestor constraint A into the score-based causal structure learning algorithm to obtain the optimal causal structure.
[0071] By using this system, the above-mentioned operation processing method can be executed and the corresponding technical effects can be achieved.
[0072] An embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps in the method in the above embodiment, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps in the method in the above embodiment are implemented.
[0073] An embodiment of the present invention also provides an electronic device for executing the above method. As an implementation device of the method, the electronic device has at least a processor and a memory, and in particular, the memory stores data and related computer programs required for executing the method, such as storage, etc., and the processor calls the data and programs in the memory to execute all the steps of the implementation method and obtains the corresponding technical effect.
[0074] Preferably, the electronic device may include a bus architecture, the bus may include any number of interconnected buses and bridges, and the bus will include various circuits linked together by one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are all well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter may be the same component, i.e., a transceiver, providing a unit for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while the memory may be used to store data used by the processor when performing operations.
[0075] In addition, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or controller, operation control) used may include a microprocessor or other processor device and / or a logic device, which receives input and controls the operation of various components of the electronic device; the memory may be one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices, which may store the above-mentioned related data information, and may also store a program for executing related information, and the processor may execute the program stored in the memory to realize information storage or processing, etc.; the input unit is used to provide input to the processor, for example, it may be a key or a touch input device; the power supply is used to provide power to the electronic device; the display is used to display display objects such as images and text, for example, it may be an LCD display. The communication module is a transmitter / receiver that sends and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal. Based on different communication technologies, multiple communication modules may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module (transmitter / receiver) is also coupled to a speaker and a microphone via an audio processor to provide an audio output via the speaker and receive an audio input from the microphone, thereby realizing a common telecommunication function. The audio processor may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor is also coupled to a central processor, so that recording can be performed on the machine through the microphone, and the sound stored on the machine can be played through the speaker.
[0076] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0077] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.
[0078] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in a box or multiple boxes. Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0080] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for causal structure constraint and inference based on a large language model, characterized in that: include: S1, variable understanding stage, by inputting variable understanding text and variable understanding prompt words into LLMs to output understanding variable text; S2, causal inference stage, based on the understanding variable text input into LLMs and combined with causal inference prompt words to output a directed graph network set A1; S3, error correction stage, inputting the initial directed graph network set A1 and the error correction prompt words into LLMs to output a corrected directed graph network set A; S4, causal structure learning stage, using the directed graph network set A as the ancestor constraint, and incorporating the ancestor constraint A into the score-based causal structure learning algorithm to obtain the optimal causal structure.
2. The method according to claim 1, characterized in that The causal structure learning stage adopts the CaMML framework to learn the causal structure, and sets σ(G; D) as the scoring function to evaluate the consistency between the causal structure G and the observed data D.
3. The method according to claim 2, characterized in that The score-based causal structure learning algorithm includes a hard constraint-based method and a soft constraint-based method.
4. The method according to claim 3, characterized in that The hard constraint-based method includes: Define the search space G A , the search space G A A directed acyclic graph (DAG) G containing only those nodes satisfying the ancestry constraint A; Use CaMML's heuristic search or optimization algorithm to determine G A The best G in the causal structure G is selected to obtain the maximum score σ(G; D) as the optimal causal structure G * .
5. The method according to claim 3, characterized in that: The soft constraint-based method includes: Define the weighted scoring function σ ′ (G; D, A) = σ(G; D) + λ·δ(G, A), where δ(G, A) represents the degree to which G violates the ancestor constraint A, and λ is a weight parameter; Use CaMML's heuristic search or optimization algorithm to determine G A The best G in the equation is chosen to maximize the weighted score σ ′ G of (G; D, A) as the optimal causal structure G * .
6. The method according to any one of claims 1 to 5, characterized in that: The error correction stage also includes verifying whether the causal statements in the directed graph network set A1 conform to the knowledge logic of the professional field, and deleting the causal statements if they do not conform.
7. A system for causal structure constraints and inference based on a large language model, characterized in that: include: A variable understanding module is used to output an understanding variable text by inputting a variable understanding text and a variable understanding prompt word to LLMs; A causal inference module, for outputting a directed graph network set A1 based on the understanding variable text input to the LLMs and combining the causal inference prompt words; An error correction module, used for inputting the initial directed graph network set A1 and the error correction prompt words into LLMs to output a corrected directed graph network set A; The causal structure learning module is used to use the directed graph network set A as an ancestor constraint and incorporate the ancestor constraint A into the score-based causal structure learning algorithm to obtain the optimal causal structure.
8. A computer-readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 6 by calling a stored computer program.
10. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Large language model iterative optimization training method and system based on metamorphic test
CN122047517A
A large language model iteration optimization training method and system based on decay test
CN122047517B